/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./node_modules/@ampproject/remapping/dist/remapping.umd.js": /*!******************************************************************!*\ !*** ./node_modules/@ampproject/remapping/dist/remapping.umd.js ***! \******************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { (function (global, factory) { true ? module.exports = factory(__webpack_require__(/*! @jridgewell/trace-mapping */ "./node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"), __webpack_require__(/*! @jridgewell/gen-mapping */ "./node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js")) : 0; })(this, (function (traceMapping, genMapping) { 'use strict'; const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false); const EMPTY_SOURCES = []; function SegmentObject(source, line, column, name, content, ignore) { return { source, line, column, name, content, ignore }; } function Source(map, sources, source, content, ignore) { return { map, sources, source, content, ignore, }; } /** * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes * (which may themselves be SourceMapTrees). */ function MapSource(map, sources) { return Source(map, sources, '', null, false); } /** * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive * segment tracing ends at the `OriginalSource`. */ function OriginalSource(source, content, ignore) { return Source(null, EMPTY_SOURCES, source, content, ignore); } /** * traceMappings is only called on the root level SourceMapTree, and begins the process of * resolving each mapping in terms of the original source files. */ function traceMappings(tree) { // TODO: Eventually support sourceRoot, which has to be removed because the sources are already // fully resolved. We'll need to make sources relative to the sourceRoot before adding them. const gen = new genMapping.GenMapping({ file: tree.map.file }); const { sources: rootSources, map } = tree; const rootNames = map.names; const rootMappings = traceMapping.decodedMappings(map); for (let i = 0; i < rootMappings.length; i++) { const segments = rootMappings[i]; for (let j = 0; j < segments.length; j++) { const segment = segments[j]; const genCol = segment[0]; let traced = SOURCELESS_MAPPING; // 1-length segments only move the current generated column, there's no source information // to gather from it. if (segment.length !== 1) { const source = rootSources[segment[1]]; traced = originalPositionFor(source, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : ''); // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a // respective segment into an original source. if (traced == null) continue; } const { column, line, name, content, source, ignore } = traced; genMapping.maybeAddSegment(gen, i, genCol, source, line, column, name); if (source && content != null) genMapping.setSourceContent(gen, source, content); if (ignore) genMapping.setIgnore(gen, source, true); } } return gen; } /** * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own * child SourceMapTrees, until we find the original source map. */ function originalPositionFor(source, line, column, name) { if (!source.map) { return SegmentObject(source.source, line, column, name, source.content, source.ignore); } const segment = traceMapping.traceSegment(source.map, line, column); // If we couldn't find a segment, then this doesn't exist in the sourcemap. if (segment == null) return null; // 1-length segments only move the current generated column, there's no source information // to gather from it. if (segment.length === 1) return SOURCELESS_MAPPING; return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name); } function asArray(value) { if (Array.isArray(value)) return value; return [value]; } /** * Recursively builds a tree structure out of sourcemap files, with each node * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of * `OriginalSource`s and `SourceMapTree`s. * * Every sourcemap is composed of a collection of source files and mappings * into locations of those source files. When we generate a `SourceMapTree` for * the sourcemap, we attempt to load each source file's own sourcemap. If it * does not have an associated sourcemap, it is considered an original, * unmodified source file. */ function buildSourceMapTree(input, loader) { const maps = asArray(input).map((m) => new traceMapping.TraceMap(m, '')); const map = maps.pop(); for (let i = 0; i < maps.length; i++) { if (maps[i].sources.length > 1) { throw new Error(`Transformation map ${i} must have exactly one source file.\n` + 'Did you specify these with the most recent transformation maps first?'); } } let tree = build(map, loader, '', 0); for (let i = maps.length - 1; i >= 0; i--) { tree = MapSource(maps[i], [tree]); } return tree; } function build(map, loader, importer, importerDepth) { const { resolvedSources, sourcesContent, ignoreList } = map; const depth = importerDepth + 1; const children = resolvedSources.map((sourceFile, i) => { // The loading context gives the loader more information about why this file is being loaded // (eg, from which importer). It also allows the loader to override the location of the loaded // sourcemap/original source, or to override the content in the sourcesContent field if it's // an unmodified source file. const ctx = { importer, depth, source: sourceFile || '', content: undefined, ignore: undefined, }; // Use the provided loader callback to retrieve the file's sourcemap. // TODO: We should eventually support async loading of sourcemap files. const sourceMap = loader(ctx.source, ctx); const { source, content, ignore } = ctx; // If there is a sourcemap, then we need to recurse into it to load its source files. if (sourceMap) return build(new traceMapping.TraceMap(sourceMap, source), loader, source, depth); // Else, it's an unmodified source file. // The contents of this unmodified source file can be overridden via the loader context, // allowing it to be explicitly null or a string. If it remains undefined, we fall back to // the importing sourcemap's `sourcesContent` field. const sourceContent = content !== undefined ? content : sourcesContent ? sourcesContent[i] : null; const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false; return OriginalSource(source, sourceContent, ignored); }); return MapSource(map, children); } /** * A SourceMap v3 compatible sourcemap, which only includes fields that were * provided to it. */ class SourceMap { constructor(map, options) { const out = options.decodedMappings ? genMapping.toDecodedMap(map) : genMapping.toEncodedMap(map); this.version = out.version; // SourceMap spec says this should be first. this.file = out.file; this.mappings = out.mappings; this.names = out.names; this.ignoreList = out.ignoreList; this.sourceRoot = out.sourceRoot; this.sources = out.sources; if (!options.excludeContent) { this.sourcesContent = out.sourcesContent; } } toString() { return JSON.stringify(this); } } /** * Traces through all the mappings in the root sourcemap, through the sources * (and their sourcemaps), all the way back to the original source location. * * `loader` will be called every time we encounter a source file. If it returns * a sourcemap, we will recurse into that sourcemap to continue the trace. If * it returns a falsey value, that source file is treated as an original, * unmodified source file. * * Pass `excludeContent` to exclude any self-containing source file content * from the output sourcemap. * * Pass `decodedMappings` to receive a SourceMap with decoded (instead of * VLQ encoded) mappings. */ function remapping(input, loader, options) { const opts = typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false }; const tree = buildSourceMapTree(input, loader); return new SourceMap(traceMappings(tree), opts); } return remapping; })); //# sourceMappingURL=remapping.umd.js.map /***/ }), /***/ "./node_modules/@babel/code-frame/lib/index.js": /*!*****************************************************!*\ !*** ./node_modules/@babel/code-frame/lib/index.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); var picocolors = __webpack_require__(/*! picocolors */ "./node_modules/picocolors/picocolors.browser.js"); var jsTokens = __webpack_require__(/*! js-tokens */ "./node_modules/js-tokens/index.js"); var helperValidatorIdentifier = __webpack_require__(/*! @babel/helper-validator-identifier */ "./node_modules/@babel/helper-validator-identifier/lib/index.js"); function isColorSupported() { return (typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported ); } const compose = (f, g) => v => f(g(v)); function buildDefs(colors) { return { keyword: colors.cyan, capitalized: colors.yellow, jsxIdentifier: colors.yellow, punctuator: colors.yellow, number: colors.magenta, string: colors.green, regex: colors.magenta, comment: colors.gray, invalid: compose(compose(colors.white, colors.bgRed), colors.bold), gutter: colors.gray, marker: compose(colors.red, colors.bold), message: compose(colors.red, colors.bold), reset: colors.reset }; } const defsOn = buildDefs(picocolors.createColors(true)); const defsOff = buildDefs(picocolors.createColors(false)); function getDefs(enabled) { return enabled ? defsOn : defsOff; } const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]); const NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/; const BRACKET = /^[()[\]{}]$/; let tokenize; { const JSX_TAG = /^[a-z][\w-]*$/i; const getTokenType = function (token, offset, text) { if (token.type === "name") { if (helperValidatorIdentifier.isKeyword(token.value) || helperValidatorIdentifier.isStrictReservedWord(token.value, true) || sometimesKeywords.has(token.value)) { return "keyword"; } if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === " defs[type](str)).join("\n"); } else { highlighted += value; } } return highlighted; } let deprecationWarningShown = false; const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; function getMarkerLines(loc, source, opts) { const startLoc = Object.assign({ column: 0, line: -1 }, loc.start); const endLoc = Object.assign({}, startLoc, loc.end); const { linesAbove = 2, linesBelow = 3 } = opts || {}; const startLine = startLoc.line; const startColumn = startLoc.column; const endLine = endLoc.line; const endColumn = endLoc.column; let start = Math.max(startLine - (linesAbove + 1), 0); let end = Math.min(source.length, endLine + linesBelow); if (startLine === -1) { start = 0; } if (endLine === -1) { end = source.length; } const lineDiff = endLine - startLine; const markerLines = {}; if (lineDiff) { for (let i = 0; i <= lineDiff; i++) { const lineNumber = i + startLine; if (!startColumn) { markerLines[lineNumber] = true; } else if (i === 0) { const sourceLength = source[lineNumber - 1].length; markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; } else if (i === lineDiff) { markerLines[lineNumber] = [0, endColumn]; } else { const sourceLength = source[lineNumber - i].length; markerLines[lineNumber] = [0, sourceLength]; } } } else { if (startColumn === endColumn) { if (startColumn) { markerLines[startLine] = [startColumn, 0]; } else { markerLines[startLine] = true; } } else { markerLines[startLine] = [startColumn, endColumn - startColumn]; } } return { start, end, markerLines }; } function codeFrameColumns(rawLines, loc, opts = {}) { const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode; const defs = getDefs(shouldHighlight); const lines = rawLines.split(NEWLINE); const { start, end, markerLines } = getMarkerLines(loc, lines, opts); const hasColumns = loc.start && typeof loc.start.column === "number"; const numberMaxWidth = String(end).length; const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines; let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => { const number = start + 1 + index; const paddedNumber = ` ${number}`.slice(-numberMaxWidth); const gutter = ` ${paddedNumber} |`; const hasMarker = markerLines[number]; const lastMarkerLine = !markerLines[number + 1]; if (hasMarker) { let markerLine = ""; if (Array.isArray(hasMarker)) { const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); const numberOfMarkers = hasMarker[1] || 1; markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join(""); if (lastMarkerLine && opts.message) { markerLine += " " + defs.message(opts.message); } } return [defs.marker(">"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : "", markerLine].join(""); } else { return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : ""}`; } }).join("\n"); if (opts.message && !hasColumns) { frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`; } if (shouldHighlight) { return defs.reset(frame); } else { return frame; } } function index (rawLines, lineNumber, colNumber, opts = {}) { if (!deprecationWarningShown) { deprecationWarningShown = true; const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; if (process.emitWarning) { process.emitWarning(message, "DeprecationWarning"); } else { const deprecationError = new Error(message); deprecationError.name = "DeprecationWarning"; console.warn(new Error(message)); } } colNumber = Math.max(colNumber, 0); const location = { start: { column: colNumber, line: lineNumber } }; return codeFrameColumns(rawLines, location, opts); } exports.codeFrameColumns = codeFrameColumns; exports["default"] = index; exports.highlight = highlight; //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/compat-data/data/native-modules.json": /*!******************************************************************!*\ !*** ./node_modules/@babel/compat-data/data/native-modules.json ***! \******************************************************************/ /***/ ((module) => { "use strict"; module.exports = /*#__PURE__*/JSON.parse('{"es6.module":{"chrome":"61","and_chr":"61","edge":"16","firefox":"60","and_ff":"60","node":"13.2.0","opera":"48","op_mob":"45","safari":"10.1","ios":"10.3","samsung":"8.2","android":"61","electron":"2.0","ios_saf":"10.3"}}'); /***/ }), /***/ "./node_modules/@babel/compat-data/data/plugins.json": /*!***********************************************************!*\ !*** ./node_modules/@babel/compat-data/data/plugins.json ***! \***********************************************************/ /***/ ((module) => { "use strict"; module.exports = /*#__PURE__*/JSON.parse('{"transform-explicit-resource-management":{"chrome":"134","edge":"134","node":"24","electron":"35.0"},"transform-duplicate-named-capturing-groups-regex":{"chrome":"126","opera":"112","edge":"126","firefox":"129","safari":"17.4","node":"23","ios":"17.4","electron":"31.0"},"transform-regexp-modifiers":{"chrome":"125","opera":"111","edge":"125","firefox":"132","node":"23","samsung":"27","electron":"31.0"},"transform-unicode-sets-regex":{"chrome":"112","opera":"98","edge":"112","firefox":"116","safari":"17","node":"20","deno":"1.32","ios":"17","samsung":"23","opera_mobile":"75","electron":"24.0"},"bugfix/transform-v8-static-class-fields-redefine-readonly":{"chrome":"98","opera":"84","edge":"98","firefox":"75","safari":"15","node":"12","deno":"1.18","ios":"15","samsung":"11","opera_mobile":"52","electron":"17.0"},"bugfix/transform-firefox-class-in-computed-class-key":{"chrome":"74","opera":"62","edge":"79","firefox":"126","safari":"16","node":"12","deno":"1","ios":"16","samsung":"11","opera_mobile":"53","electron":"6.0"},"bugfix/transform-safari-class-field-initializer-scope":{"chrome":"74","opera":"62","edge":"79","firefox":"69","safari":"16","node":"12","deno":"1","ios":"16","samsung":"11","opera_mobile":"53","electron":"6.0"},"transform-class-static-block":{"chrome":"94","opera":"80","edge":"94","firefox":"93","safari":"16.4","node":"16.11","deno":"1.14","ios":"16.4","samsung":"17","opera_mobile":"66","electron":"15.0"},"proposal-class-static-block":{"chrome":"94","opera":"80","edge":"94","firefox":"93","safari":"16.4","node":"16.11","deno":"1.14","ios":"16.4","samsung":"17","opera_mobile":"66","electron":"15.0"},"transform-private-property-in-object":{"chrome":"91","opera":"77","edge":"91","firefox":"90","safari":"15","node":"16.9","deno":"1.9","ios":"15","samsung":"16","opera_mobile":"64","electron":"13.0"},"proposal-private-property-in-object":{"chrome":"91","opera":"77","edge":"91","firefox":"90","safari":"15","node":"16.9","deno":"1.9","ios":"15","samsung":"16","opera_mobile":"64","electron":"13.0"},"transform-class-properties":{"chrome":"74","opera":"62","edge":"79","firefox":"90","safari":"14.1","node":"12","deno":"1","ios":"14.5","samsung":"11","opera_mobile":"53","electron":"6.0"},"proposal-class-properties":{"chrome":"74","opera":"62","edge":"79","firefox":"90","safari":"14.1","node":"12","deno":"1","ios":"14.5","samsung":"11","opera_mobile":"53","electron":"6.0"},"transform-private-methods":{"chrome":"84","opera":"70","edge":"84","firefox":"90","safari":"15","node":"14.6","deno":"1","ios":"15","samsung":"14","opera_mobile":"60","electron":"10.0"},"proposal-private-methods":{"chrome":"84","opera":"70","edge":"84","firefox":"90","safari":"15","node":"14.6","deno":"1","ios":"15","samsung":"14","opera_mobile":"60","electron":"10.0"},"transform-numeric-separator":{"chrome":"75","opera":"62","edge":"79","firefox":"70","safari":"13","node":"12.5","deno":"1","ios":"13","samsung":"11","rhino":"1.7.14","opera_mobile":"54","electron":"6.0"},"proposal-numeric-separator":{"chrome":"75","opera":"62","edge":"79","firefox":"70","safari":"13","node":"12.5","deno":"1","ios":"13","samsung":"11","rhino":"1.7.14","opera_mobile":"54","electron":"6.0"},"transform-logical-assignment-operators":{"chrome":"85","opera":"71","edge":"85","firefox":"79","safari":"14","node":"15","deno":"1.2","ios":"14","samsung":"14","opera_mobile":"60","electron":"10.0"},"proposal-logical-assignment-operators":{"chrome":"85","opera":"71","edge":"85","firefox":"79","safari":"14","node":"15","deno":"1.2","ios":"14","samsung":"14","opera_mobile":"60","electron":"10.0"},"transform-nullish-coalescing-operator":{"chrome":"80","opera":"67","edge":"80","firefox":"72","safari":"13.1","node":"14","deno":"1","ios":"13.4","samsung":"13","rhino":"1.8","opera_mobile":"57","electron":"8.0"},"proposal-nullish-coalescing-operator":{"chrome":"80","opera":"67","edge":"80","firefox":"72","safari":"13.1","node":"14","deno":"1","ios":"13.4","samsung":"13","rhino":"1.8","opera_mobile":"57","electron":"8.0"},"transform-optional-chaining":{"chrome":"91","opera":"77","edge":"91","firefox":"74","safari":"13.1","node":"16.9","deno":"1.9","ios":"13.4","samsung":"16","opera_mobile":"64","electron":"13.0"},"proposal-optional-chaining":{"chrome":"91","opera":"77","edge":"91","firefox":"74","safari":"13.1","node":"16.9","deno":"1.9","ios":"13.4","samsung":"16","opera_mobile":"64","electron":"13.0"},"transform-json-strings":{"chrome":"66","opera":"53","edge":"79","firefox":"62","safari":"12","node":"10","deno":"1","ios":"12","samsung":"9","rhino":"1.7.14","opera_mobile":"47","electron":"3.0"},"proposal-json-strings":{"chrome":"66","opera":"53","edge":"79","firefox":"62","safari":"12","node":"10","deno":"1","ios":"12","samsung":"9","rhino":"1.7.14","opera_mobile":"47","electron":"3.0"},"transform-optional-catch-binding":{"chrome":"66","opera":"53","edge":"79","firefox":"58","safari":"11.1","node":"10","deno":"1","ios":"11.3","samsung":"9","opera_mobile":"47","electron":"3.0"},"proposal-optional-catch-binding":{"chrome":"66","opera":"53","edge":"79","firefox":"58","safari":"11.1","node":"10","deno":"1","ios":"11.3","samsung":"9","opera_mobile":"47","electron":"3.0"},"transform-parameters":{"chrome":"49","opera":"36","edge":"18","firefox":"52","safari":"16.3","node":"6","deno":"1","ios":"16.3","samsung":"5","opera_mobile":"36","electron":"0.37"},"transform-async-generator-functions":{"chrome":"63","opera":"50","edge":"79","firefox":"57","safari":"12","node":"10","deno":"1","ios":"12","samsung":"8","opera_mobile":"46","electron":"3.0"},"proposal-async-generator-functions":{"chrome":"63","opera":"50","edge":"79","firefox":"57","safari":"12","node":"10","deno":"1","ios":"12","samsung":"8","opera_mobile":"46","electron":"3.0"},"transform-object-rest-spread":{"chrome":"60","opera":"47","edge":"79","firefox":"55","safari":"11.1","node":"8.3","deno":"1","ios":"11.3","samsung":"8","opera_mobile":"44","electron":"2.0"},"proposal-object-rest-spread":{"chrome":"60","opera":"47","edge":"79","firefox":"55","safari":"11.1","node":"8.3","deno":"1","ios":"11.3","samsung":"8","opera_mobile":"44","electron":"2.0"},"transform-dotall-regex":{"chrome":"62","opera":"49","edge":"79","firefox":"78","safari":"11.1","node":"8.10","deno":"1","ios":"11.3","samsung":"8","rhino":"1.7.15","opera_mobile":"46","electron":"3.0"},"transform-unicode-property-regex":{"chrome":"64","opera":"51","edge":"79","firefox":"78","safari":"11.1","node":"10","deno":"1","ios":"11.3","samsung":"9","opera_mobile":"47","electron":"3.0"},"proposal-unicode-property-regex":{"chrome":"64","opera":"51","edge":"79","firefox":"78","safari":"11.1","node":"10","deno":"1","ios":"11.3","samsung":"9","opera_mobile":"47","electron":"3.0"},"transform-named-capturing-groups-regex":{"chrome":"64","opera":"51","edge":"79","firefox":"78","safari":"11.1","node":"10","deno":"1","ios":"11.3","samsung":"9","opera_mobile":"47","electron":"3.0"},"transform-async-to-generator":{"chrome":"55","opera":"42","edge":"15","firefox":"52","safari":"11","node":"7.6","deno":"1","ios":"11","samsung":"6","opera_mobile":"42","electron":"1.6"},"transform-exponentiation-operator":{"chrome":"52","opera":"39","edge":"14","firefox":"52","safari":"10.1","node":"7","deno":"1","ios":"10.3","samsung":"6","rhino":"1.7.14","opera_mobile":"41","electron":"1.3"},"transform-template-literals":{"chrome":"41","opera":"28","edge":"13","firefox":"34","safari":"13","node":"4","deno":"1","ios":"13","samsung":"3.4","opera_mobile":"28","electron":"0.21"},"transform-literals":{"chrome":"44","opera":"31","edge":"12","firefox":"53","safari":"9","node":"4","deno":"1","ios":"9","samsung":"4","rhino":"1.7.15","opera_mobile":"32","electron":"0.30"},"transform-function-name":{"chrome":"51","opera":"38","edge":"79","firefox":"53","safari":"10","node":"6.5","deno":"1","ios":"10","samsung":"5","opera_mobile":"41","electron":"1.2"},"transform-arrow-functions":{"chrome":"47","opera":"34","edge":"13","firefox":"43","safari":"10","node":"6","deno":"1","ios":"10","samsung":"5","rhino":"1.7.13","opera_mobile":"34","electron":"0.36"},"transform-block-scoped-functions":{"chrome":"41","opera":"28","edge":"12","firefox":"46","safari":"10","node":"4","deno":"1","ie":"11","ios":"10","samsung":"3.4","opera_mobile":"28","electron":"0.21"},"transform-classes":{"chrome":"46","opera":"33","edge":"13","firefox":"45","safari":"10","node":"5","deno":"1","ios":"10","samsung":"5","opera_mobile":"33","electron":"0.36"},"transform-object-super":{"chrome":"46","opera":"33","edge":"13","firefox":"45","safari":"10","node":"5","deno":"1","ios":"10","samsung":"5","opera_mobile":"33","electron":"0.36"},"transform-shorthand-properties":{"chrome":"43","opera":"30","edge":"12","firefox":"33","safari":"9","node":"4","deno":"1","ios":"9","samsung":"4","rhino":"1.7.14","opera_mobile":"30","electron":"0.27"},"transform-duplicate-keys":{"chrome":"42","opera":"29","edge":"12","firefox":"34","safari":"9","node":"4","deno":"1","ios":"9","samsung":"3.4","opera_mobile":"29","electron":"0.25"},"transform-computed-properties":{"chrome":"44","opera":"31","edge":"12","firefox":"34","safari":"7.1","node":"4","deno":"1","ios":"8","samsung":"4","rhino":"1.8","opera_mobile":"32","electron":"0.30"},"transform-for-of":{"chrome":"51","opera":"38","edge":"15","firefox":"53","safari":"10","node":"6.5","deno":"1","ios":"10","samsung":"5","opera_mobile":"41","electron":"1.2"},"transform-sticky-regex":{"chrome":"49","opera":"36","edge":"13","firefox":"3","safari":"10","node":"6","deno":"1","ios":"10","samsung":"5","rhino":"1.7.15","opera_mobile":"36","electron":"0.37"},"transform-unicode-escapes":{"chrome":"44","opera":"31","edge":"12","firefox":"53","safari":"9","node":"4","deno":"1","ios":"9","samsung":"4","rhino":"1.7.15","opera_mobile":"32","electron":"0.30"},"transform-unicode-regex":{"chrome":"50","opera":"37","edge":"13","firefox":"46","safari":"12","node":"6","deno":"1","ios":"12","samsung":"5","opera_mobile":"37","electron":"1.1"},"transform-spread":{"chrome":"46","opera":"33","edge":"13","firefox":"45","safari":"10","node":"5","deno":"1","ios":"10","samsung":"5","opera_mobile":"33","electron":"0.36"},"transform-destructuring":{"chrome":"51","opera":"38","edge":"15","firefox":"53","safari":"10","node":"6.5","deno":"1","ios":"10","samsung":"5","opera_mobile":"41","electron":"1.2"},"transform-block-scoping":{"chrome":"50","opera":"37","edge":"14","firefox":"53","safari":"11","node":"6","deno":"1","ios":"11","samsung":"5","opera_mobile":"37","electron":"1.1"},"transform-typeof-symbol":{"chrome":"48","opera":"35","edge":"12","firefox":"36","safari":"9","node":"6","deno":"1","ios":"9","samsung":"5","rhino":"1.8","opera_mobile":"35","electron":"0.37"},"transform-new-target":{"chrome":"46","opera":"33","edge":"14","firefox":"41","safari":"10","node":"5","deno":"1","ios":"10","samsung":"5","opera_mobile":"33","electron":"0.36"},"transform-regenerator":{"chrome":"50","opera":"37","edge":"13","firefox":"53","safari":"10","node":"6","deno":"1","ios":"10","samsung":"5","opera_mobile":"37","electron":"1.1"},"transform-member-expression-literals":{"chrome":"7","opera":"12","edge":"12","firefox":"2","safari":"5.1","node":"0.4","deno":"1","ie":"9","android":"4","ios":"6","phantom":"1.9","samsung":"1","rhino":"1.7.13","opera_mobile":"12","electron":"0.20"},"transform-property-literals":{"chrome":"7","opera":"12","edge":"12","firefox":"2","safari":"5.1","node":"0.4","deno":"1","ie":"9","android":"4","ios":"6","phantom":"1.9","samsung":"1","rhino":"1.7.13","opera_mobile":"12","electron":"0.20"},"transform-reserved-words":{"chrome":"13","opera":"10.50","edge":"12","firefox":"2","safari":"3.1","node":"0.6","deno":"1","ie":"9","android":"4.4","ios":"6","phantom":"1.9","samsung":"1","rhino":"1.7.13","opera_mobile":"10.1","electron":"0.20"},"transform-export-namespace-from":{"chrome":"72","deno":"1.0","edge":"79","firefox":"80","node":"13.2.0","opera":"60","opera_mobile":"51","safari":"14.1","ios":"14.5","samsung":"11.0","android":"72","electron":"5.0"},"proposal-export-namespace-from":{"chrome":"72","deno":"1.0","edge":"79","firefox":"80","node":"13.2.0","opera":"60","opera_mobile":"51","safari":"14.1","ios":"14.5","samsung":"11.0","android":"72","electron":"5.0"}}'); /***/ }), /***/ "./node_modules/@babel/compat-data/native-modules.js": /*!***********************************************************!*\ !*** ./node_modules/@babel/compat-data/native-modules.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Todo (Babel 8): remove this file, in Babel 8 users import the .json directly module.exports = __webpack_require__(/*! ./data/native-modules.json */ "./node_modules/@babel/compat-data/data/native-modules.json"); /***/ }), /***/ "./node_modules/@babel/compat-data/plugins.js": /*!****************************************************!*\ !*** ./node_modules/@babel/compat-data/plugins.js ***! \****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Todo (Babel 8): remove this file, in Babel 8 users import the .json directly module.exports = __webpack_require__(/*! ./data/plugins.json */ "./node_modules/@babel/compat-data/data/plugins.json"); /***/ }), /***/ "./node_modules/@babel/core/lib/config/caching.js": /*!********************************************************!*\ !*** ./node_modules/@babel/core/lib/config/caching.js ***! \********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.assertSimpleType = assertSimpleType; exports.makeStrongCache = makeStrongCache; exports.makeStrongCacheSync = makeStrongCacheSync; exports.makeWeakCache = makeWeakCache; exports.makeWeakCacheSync = makeWeakCacheSync; function _gensync() { const data = __webpack_require__(/*! gensync */ "./node_modules/gensync/index.js"); _gensync = function () { return data; }; return data; } var _async = __webpack_require__(/*! ../gensync-utils/async.js */ "./node_modules/@babel/core/lib/gensync-utils/async.js"); var _util = __webpack_require__(/*! ./util.js */ "./node_modules/@babel/core/lib/config/util.js"); const synchronize = gen => { return _gensync()(gen).sync; }; function* genTrue() { return true; } function makeWeakCache(handler) { return makeCachedFunction(WeakMap, handler); } function makeWeakCacheSync(handler) { return synchronize(makeWeakCache(handler)); } function makeStrongCache(handler) { return makeCachedFunction(Map, handler); } function makeStrongCacheSync(handler) { return synchronize(makeStrongCache(handler)); } function makeCachedFunction(CallCache, handler) { const callCacheSync = new CallCache(); const callCacheAsync = new CallCache(); const futureCache = new CallCache(); return function* cachedFunction(arg, data) { const asyncContext = yield* (0, _async.isAsync)(); const callCache = asyncContext ? callCacheAsync : callCacheSync; const cached = yield* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data); if (cached.valid) return cached.value; const cache = new CacheConfigurator(data); const handlerResult = handler(arg, cache); let finishLock; let value; if ((0, _util.isIterableIterator)(handlerResult)) { value = yield* (0, _async.onFirstPause)(handlerResult, () => { finishLock = setupAsyncLocks(cache, futureCache, arg); }); } else { value = handlerResult; } updateFunctionCache(callCache, cache, arg, value); if (finishLock) { futureCache.delete(arg); finishLock.release(value); } return value; }; } function* getCachedValue(cache, arg, data) { const cachedValue = cache.get(arg); if (cachedValue) { for (const { value, valid } of cachedValue) { if (yield* valid(data)) return { valid: true, value }; } } return { valid: false, value: null }; } function* getCachedValueOrWait(asyncContext, callCache, futureCache, arg, data) { const cached = yield* getCachedValue(callCache, arg, data); if (cached.valid) { return cached; } if (asyncContext) { const cached = yield* getCachedValue(futureCache, arg, data); if (cached.valid) { const value = yield* (0, _async.waitFor)(cached.value.promise); return { valid: true, value }; } } return { valid: false, value: null }; } function setupAsyncLocks(config, futureCache, arg) { const finishLock = new Lock(); updateFunctionCache(futureCache, config, arg, finishLock); return finishLock; } function updateFunctionCache(cache, config, arg, value) { if (!config.configured()) config.forever(); let cachedValue = cache.get(arg); config.deactivate(); switch (config.mode()) { case "forever": cachedValue = [{ value, valid: genTrue }]; cache.set(arg, cachedValue); break; case "invalidate": cachedValue = [{ value, valid: config.validator() }]; cache.set(arg, cachedValue); break; case "valid": if (cachedValue) { cachedValue.push({ value, valid: config.validator() }); } else { cachedValue = [{ value, valid: config.validator() }]; cache.set(arg, cachedValue); } } } class CacheConfigurator { constructor(data) { this._active = true; this._never = false; this._forever = false; this._invalidate = false; this._configured = false; this._pairs = []; this._data = void 0; this._data = data; } simple() { return makeSimpleConfigurator(this); } mode() { if (this._never) return "never"; if (this._forever) return "forever"; if (this._invalidate) return "invalidate"; return "valid"; } forever() { if (!this._active) { throw new Error("Cannot change caching after evaluation has completed."); } if (this._never) { throw new Error("Caching has already been configured with .never()"); } this._forever = true; this._configured = true; } never() { if (!this._active) { throw new Error("Cannot change caching after evaluation has completed."); } if (this._forever) { throw new Error("Caching has already been configured with .forever()"); } this._never = true; this._configured = true; } using(handler) { if (!this._active) { throw new Error("Cannot change caching after evaluation has completed."); } if (this._never || this._forever) { throw new Error("Caching has already been configured with .never or .forever()"); } this._configured = true; const key = handler(this._data); const fn = (0, _async.maybeAsync)(handler, `You appear to be using an async cache handler, but Babel has been called synchronously`); if ((0, _async.isThenable)(key)) { return key.then(key => { this._pairs.push([key, fn]); return key; }); } this._pairs.push([key, fn]); return key; } invalidate(handler) { this._invalidate = true; return this.using(handler); } validator() { const pairs = this._pairs; return function* (data) { for (const [key, fn] of pairs) { if (key !== (yield* fn(data))) return false; } return true; }; } deactivate() { this._active = false; } configured() { return this._configured; } } function makeSimpleConfigurator(cache) { function cacheFn(val) { if (typeof val === "boolean") { if (val) cache.forever();else cache.never(); return; } return cache.using(() => assertSimpleType(val())); } cacheFn.forever = () => cache.forever(); cacheFn.never = () => cache.never(); cacheFn.using = cb => cache.using(() => assertSimpleType(cb())); cacheFn.invalidate = cb => cache.invalidate(() => assertSimpleType(cb())); return cacheFn; } function assertSimpleType(value) { if ((0, _async.isThenable)(value)) { throw new Error(`You appear to be using an async cache handler, ` + `which your current version of Babel does not support. ` + `We may add support for this in the future, ` + `but if you're on the most recent version of @babel/core and still ` + `seeing this error, then you'll need to synchronously handle your caching logic.`); } if (value != null && typeof value !== "string" && typeof value !== "boolean" && typeof value !== "number") { throw new Error("Cache keys must be either string, boolean, number, null, or undefined."); } return value; } class Lock { constructor() { this.released = false; this.promise = void 0; this._resolve = void 0; this.promise = new Promise(resolve => { this._resolve = resolve; }); } release(value) { this.released = true; this._resolve(value); } } 0 && 0; //# sourceMappingURL=caching.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/config-chain.js": /*!*************************************************************!*\ !*** ./node_modules/@babel/core/lib/config/config-chain.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.buildPresetChain = buildPresetChain; exports.buildPresetChainWalker = void 0; exports.buildRootChain = buildRootChain; function _path() { const data = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js"); _path = function () { return data; }; return data; } function _debug() { const data = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js"); _debug = function () { return data; }; return data; } var _options = __webpack_require__(/*! ./validation/options.js */ "./node_modules/@babel/core/lib/config/validation/options.js"); var _patternToRegex = __webpack_require__(/*! ./pattern-to-regex.js */ "./node_modules/@babel/core/lib/config/pattern-to-regex.js"); var _printer = __webpack_require__(/*! ./printer.js */ "./node_modules/@babel/core/lib/config/printer.js"); var _rewriteStackTrace = __webpack_require__(/*! ../errors/rewrite-stack-trace.js */ "./node_modules/@babel/core/lib/errors/rewrite-stack-trace.js"); var _configError = __webpack_require__(/*! ../errors/config-error.js */ "./node_modules/@babel/core/lib/errors/config-error.js"); var _index = __webpack_require__(/*! ./files/index.js */ "./node_modules/@babel/core/lib/config/files/index-browser.js"); var _caching = __webpack_require__(/*! ./caching.js */ "./node_modules/@babel/core/lib/config/caching.js"); var _configDescriptors = __webpack_require__(/*! ./config-descriptors.js */ "./node_modules/@babel/core/lib/config/config-descriptors.js"); const debug = _debug()("babel:config:config-chain"); function* buildPresetChain(arg, context) { const chain = yield* buildPresetChainWalker(arg, context); if (!chain) return null; return { plugins: dedupDescriptors(chain.plugins), presets: dedupDescriptors(chain.presets), options: chain.options.map(o => normalizeOptions(o)), files: new Set() }; } const buildPresetChainWalker = exports.buildPresetChainWalker = makeChainWalker({ root: preset => loadPresetDescriptors(preset), env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName), overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index), overridesEnv: (preset, index, envName) => loadPresetOverridesEnvDescriptors(preset)(index)(envName), createLogger: () => () => {} }); const loadPresetDescriptors = (0, _caching.makeWeakCacheSync)(preset => buildRootDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors)); const loadPresetEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, envName))); const loadPresetOverridesDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index))); const loadPresetOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(preset => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index, envName)))); function* buildRootChain(opts, context) { let configReport, babelRcReport; const programmaticLogger = new _printer.ConfigPrinter(); const programmaticChain = yield* loadProgrammaticChain({ options: opts, dirname: context.cwd }, context, undefined, programmaticLogger); if (!programmaticChain) return null; const programmaticReport = yield* programmaticLogger.output(); let configFile; if (typeof opts.configFile === "string") { configFile = yield* (0, _index.loadConfig)(opts.configFile, context.cwd, context.envName, context.caller); } else if (opts.configFile !== false) { configFile = yield* (0, _index.findRootConfig)(context.root, context.envName, context.caller); } let { babelrc, babelrcRoots } = opts; let babelrcRootsDirectory = context.cwd; const configFileChain = emptyChain(); const configFileLogger = new _printer.ConfigPrinter(); if (configFile) { const validatedFile = validateConfigFile(configFile); const result = yield* loadFileChain(validatedFile, context, undefined, configFileLogger); if (!result) return null; configReport = yield* configFileLogger.output(); if (babelrc === undefined) { babelrc = validatedFile.options.babelrc; } if (babelrcRoots === undefined) { babelrcRootsDirectory = validatedFile.dirname; babelrcRoots = validatedFile.options.babelrcRoots; } mergeChain(configFileChain, result); } let ignoreFile, babelrcFile; let isIgnored = false; const fileChain = emptyChain(); if ((babelrc === true || babelrc === undefined) && typeof context.filename === "string") { const pkgData = yield* (0, _index.findPackageData)(context.filename); if (pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)) { ({ ignore: ignoreFile, config: babelrcFile } = yield* (0, _index.findRelativeConfig)(pkgData, context.envName, context.caller)); if (ignoreFile) { fileChain.files.add(ignoreFile.filepath); } if (ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)) { isIgnored = true; } if (babelrcFile && !isIgnored) { const validatedFile = validateBabelrcFile(babelrcFile); const babelrcLogger = new _printer.ConfigPrinter(); const result = yield* loadFileChain(validatedFile, context, undefined, babelrcLogger); if (!result) { isIgnored = true; } else { babelRcReport = yield* babelrcLogger.output(); mergeChain(fileChain, result); } } if (babelrcFile && isIgnored) { fileChain.files.add(babelrcFile.filepath); } } } if (context.showConfig) { console.log(`Babel configs on "${context.filename}" (ascending priority):\n` + [configReport, babelRcReport, programmaticReport].filter(x => !!x).join("\n\n") + "\n-----End Babel configs-----"); } const chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain); return { plugins: isIgnored ? [] : dedupDescriptors(chain.plugins), presets: isIgnored ? [] : dedupDescriptors(chain.presets), options: isIgnored ? [] : chain.options.map(o => normalizeOptions(o)), fileHandling: isIgnored ? "ignored" : "transpile", ignore: ignoreFile || undefined, babelrc: babelrcFile || undefined, config: configFile || undefined, files: chain.files }; } function babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory) { if (typeof babelrcRoots === "boolean") return babelrcRoots; const absoluteRoot = context.root; if (babelrcRoots === undefined) { return pkgData.directories.includes(absoluteRoot); } let babelrcPatterns = babelrcRoots; if (!Array.isArray(babelrcPatterns)) { babelrcPatterns = [babelrcPatterns]; } babelrcPatterns = babelrcPatterns.map(pat => { return typeof pat === "string" ? _path().resolve(babelrcRootsDirectory, pat) : pat; }); if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) { return pkgData.directories.includes(absoluteRoot); } return babelrcPatterns.some(pat => { if (typeof pat === "string") { pat = (0, _patternToRegex.default)(pat, babelrcRootsDirectory); } return pkgData.directories.some(directory => { return matchPattern(pat, babelrcRootsDirectory, directory, context); }); }); } const validateConfigFile = (0, _caching.makeWeakCacheSync)(file => ({ filepath: file.filepath, dirname: file.dirname, options: (0, _options.validate)("configfile", file.options, file.filepath) })); const validateBabelrcFile = (0, _caching.makeWeakCacheSync)(file => ({ filepath: file.filepath, dirname: file.dirname, options: (0, _options.validate)("babelrcfile", file.options, file.filepath) })); const validateExtendFile = (0, _caching.makeWeakCacheSync)(file => ({ filepath: file.filepath, dirname: file.dirname, options: (0, _options.validate)("extendsfile", file.options, file.filepath) })); const loadProgrammaticChain = makeChainWalker({ root: input => buildRootDescriptors(input, "base", _configDescriptors.createCachedDescriptors), env: (input, envName) => buildEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, envName), overrides: (input, index) => buildOverrideDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index), overridesEnv: (input, index, envName) => buildOverrideEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index, envName), createLogger: (input, context, baseLogger) => buildProgrammaticLogger(input, context, baseLogger) }); const loadFileChainWalker = makeChainWalker({ root: file => loadFileDescriptors(file), env: (file, envName) => loadFileEnvDescriptors(file)(envName), overrides: (file, index) => loadFileOverridesDescriptors(file)(index), overridesEnv: (file, index, envName) => loadFileOverridesEnvDescriptors(file)(index)(envName), createLogger: (file, context, baseLogger) => buildFileLogger(file.filepath, context, baseLogger) }); function* loadFileChain(input, context, files, baseLogger) { const chain = yield* loadFileChainWalker(input, context, files, baseLogger); chain == null || chain.files.add(input.filepath); return chain; } const loadFileDescriptors = (0, _caching.makeWeakCacheSync)(file => buildRootDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors)); const loadFileEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(envName => buildEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, envName))); const loadFileOverridesDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => buildOverrideDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index))); const loadFileOverridesEnvDescriptors = (0, _caching.makeWeakCacheSync)(file => (0, _caching.makeStrongCacheSync)(index => (0, _caching.makeStrongCacheSync)(envName => buildOverrideEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index, envName)))); function buildFileLogger(filepath, context, baseLogger) { if (!baseLogger) { return () => {}; } return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Config, { filepath }); } function buildRootDescriptors({ dirname, options }, alias, descriptors) { return descriptors(dirname, options, alias); } function buildProgrammaticLogger(_, context, baseLogger) { var _context$caller; if (!baseLogger) { return () => {}; } return baseLogger.configure(context.showConfig, _printer.ChainFormatter.Programmatic, { callerName: (_context$caller = context.caller) == null ? void 0 : _context$caller.name }); } function buildEnvDescriptors({ dirname, options }, alias, descriptors, envName) { var _options$env; const opts = (_options$env = options.env) == null ? void 0 : _options$env[envName]; return opts ? descriptors(dirname, opts, `${alias}.env["${envName}"]`) : null; } function buildOverrideDescriptors({ dirname, options }, alias, descriptors, index) { var _options$overrides; const opts = (_options$overrides = options.overrides) == null ? void 0 : _options$overrides[index]; if (!opts) throw new Error("Assertion failure - missing override"); return descriptors(dirname, opts, `${alias}.overrides[${index}]`); } function buildOverrideEnvDescriptors({ dirname, options }, alias, descriptors, index, envName) { var _options$overrides2, _override$env; const override = (_options$overrides2 = options.overrides) == null ? void 0 : _options$overrides2[index]; if (!override) throw new Error("Assertion failure - missing override"); const opts = (_override$env = override.env) == null ? void 0 : _override$env[envName]; return opts ? descriptors(dirname, opts, `${alias}.overrides[${index}].env["${envName}"]`) : null; } function makeChainWalker({ root, env, overrides, overridesEnv, createLogger }) { return function* chainWalker(input, context, files = new Set(), baseLogger) { const { dirname } = input; const flattenedConfigs = []; const rootOpts = root(input); if (configIsApplicable(rootOpts, dirname, context, input.filepath)) { flattenedConfigs.push({ config: rootOpts, envName: undefined, index: undefined }); const envOpts = env(input, context.envName); if (envOpts && configIsApplicable(envOpts, dirname, context, input.filepath)) { flattenedConfigs.push({ config: envOpts, envName: context.envName, index: undefined }); } (rootOpts.options.overrides || []).forEach((_, index) => { const overrideOps = overrides(input, index); if (configIsApplicable(overrideOps, dirname, context, input.filepath)) { flattenedConfigs.push({ config: overrideOps, index, envName: undefined }); const overrideEnvOpts = overridesEnv(input, index, context.envName); if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context, input.filepath)) { flattenedConfigs.push({ config: overrideEnvOpts, index, envName: context.envName }); } } }); } if (flattenedConfigs.some(({ config: { options: { ignore, only } } }) => shouldIgnore(context, ignore, only, dirname))) { return null; } const chain = emptyChain(); const logger = createLogger(input, context, baseLogger); for (const { config, index, envName } of flattenedConfigs) { if (!(yield* mergeExtendsChain(chain, config.options, dirname, context, files, baseLogger))) { return null; } logger(config, index, envName); yield* mergeChainOpts(chain, config); } return chain; }; } function* mergeExtendsChain(chain, opts, dirname, context, files, baseLogger) { if (opts.extends === undefined) return true; const file = yield* (0, _index.loadConfig)(opts.extends, dirname, context.envName, context.caller); if (files.has(file)) { throw new Error(`Configuration cycle detected loading ${file.filepath}.\n` + `File already loaded following the config chain:\n` + Array.from(files, file => ` - ${file.filepath}`).join("\n")); } files.add(file); const fileChain = yield* loadFileChain(validateExtendFile(file), context, files, baseLogger); files.delete(file); if (!fileChain) return false; mergeChain(chain, fileChain); return true; } function mergeChain(target, source) { target.options.push(...source.options); target.plugins.push(...source.plugins); target.presets.push(...source.presets); for (const file of source.files) { target.files.add(file); } return target; } function* mergeChainOpts(target, { options, plugins, presets }) { target.options.push(options); target.plugins.push(...(yield* plugins())); target.presets.push(...(yield* presets())); return target; } function emptyChain() { return { options: [], presets: [], plugins: [], files: new Set() }; } function normalizeOptions(opts) { const options = Object.assign({}, opts); delete options.extends; delete options.env; delete options.overrides; delete options.plugins; delete options.presets; delete options.passPerPreset; delete options.ignore; delete options.only; delete options.test; delete options.include; delete options.exclude; if (hasOwnProperty.call(options, "sourceMap")) { options.sourceMaps = options.sourceMap; delete options.sourceMap; } return options; } function dedupDescriptors(items) { const map = new Map(); const descriptors = []; for (const item of items) { if (typeof item.value === "function") { const fnKey = item.value; let nameMap = map.get(fnKey); if (!nameMap) { nameMap = new Map(); map.set(fnKey, nameMap); } let desc = nameMap.get(item.name); if (!desc) { desc = { value: item }; descriptors.push(desc); if (!item.ownPass) nameMap.set(item.name, desc); } else { desc.value = item; } } else { descriptors.push({ value: item }); } } return descriptors.reduce((acc, desc) => { acc.push(desc.value); return acc; }, []); } function configIsApplicable({ options }, dirname, context, configName) { return (options.test === undefined || configFieldIsApplicable(context, options.test, dirname, configName)) && (options.include === undefined || configFieldIsApplicable(context, options.include, dirname, configName)) && (options.exclude === undefined || !configFieldIsApplicable(context, options.exclude, dirname, configName)); } function configFieldIsApplicable(context, test, dirname, configName) { const patterns = Array.isArray(test) ? test : [test]; return matchesPatterns(context, patterns, dirname, configName); } function ignoreListReplacer(_key, value) { if (value instanceof RegExp) { return String(value); } return value; } function shouldIgnore(context, ignore, only, dirname) { if (ignore && matchesPatterns(context, ignore, dirname)) { var _context$filename; const message = `No config is applied to "${(_context$filename = context.filename) != null ? _context$filename : "(unknown)"}" because it matches one of \`ignore: ${JSON.stringify(ignore, ignoreListReplacer)}\` from "${dirname}"`; debug(message); if (context.showConfig) { console.log(message); } return true; } if (only && !matchesPatterns(context, only, dirname)) { var _context$filename2; const message = `No config is applied to "${(_context$filename2 = context.filename) != null ? _context$filename2 : "(unknown)"}" because it fails to match one of \`only: ${JSON.stringify(only, ignoreListReplacer)}\` from "${dirname}"`; debug(message); if (context.showConfig) { console.log(message); } return true; } return false; } function matchesPatterns(context, patterns, dirname, configName) { return patterns.some(pattern => matchPattern(pattern, dirname, context.filename, context, configName)); } function matchPattern(pattern, dirname, pathToTest, context, configName) { if (typeof pattern === "function") { return !!(0, _rewriteStackTrace.endHiddenCallStack)(pattern)(pathToTest, { dirname, envName: context.envName, caller: context.caller }); } if (typeof pathToTest !== "string") { throw new _configError.default(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`, configName); } if (typeof pattern === "string") { pattern = (0, _patternToRegex.default)(pattern, dirname); } return pattern.test(pathToTest); } 0 && 0; //# sourceMappingURL=config-chain.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/config-descriptors.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/core/lib/config/config-descriptors.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createCachedDescriptors = createCachedDescriptors; exports.createDescriptor = createDescriptor; exports.createUncachedDescriptors = createUncachedDescriptors; function _gensync() { const data = __webpack_require__(/*! gensync */ "./node_modules/gensync/index.js"); _gensync = function () { return data; }; return data; } var _functional = __webpack_require__(/*! ../gensync-utils/functional.js */ "./node_modules/@babel/core/lib/gensync-utils/functional.js"); var _index = __webpack_require__(/*! ./files/index.js */ "./node_modules/@babel/core/lib/config/files/index-browser.js"); var _item = __webpack_require__(/*! ./item.js */ "./node_modules/@babel/core/lib/config/item.js"); var _caching = __webpack_require__(/*! ./caching.js */ "./node_modules/@babel/core/lib/config/caching.js"); var _resolveTargets = __webpack_require__(/*! ./resolve-targets.js */ "./node_modules/@babel/core/lib/config/resolve-targets-browser.js"); function isEqualDescriptor(a, b) { var _a$file, _b$file, _a$file2, _b$file2; return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && ((_a$file = a.file) == null ? void 0 : _a$file.request) === ((_b$file = b.file) == null ? void 0 : _b$file.request) && ((_a$file2 = a.file) == null ? void 0 : _a$file2.resolved) === ((_b$file2 = b.file) == null ? void 0 : _b$file2.resolved); } function* handlerOf(value) { return value; } function optionsWithResolvedBrowserslistConfigFile(options, dirname) { if (typeof options.browserslistConfigFile === "string") { options.browserslistConfigFile = (0, _resolveTargets.resolveBrowserslistConfigFile)(options.browserslistConfigFile, dirname); } return options; } function createCachedDescriptors(dirname, options, alias) { const { plugins, presets, passPerPreset } = options; return { options: optionsWithResolvedBrowserslistConfigFile(options, dirname), plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => handlerOf([]), presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => handlerOf([]) }; } function createUncachedDescriptors(dirname, options, alias) { return { options: optionsWithResolvedBrowserslistConfigFile(options, dirname), plugins: (0, _functional.once)(() => createPluginDescriptors(options.plugins || [], dirname, alias)), presets: (0, _functional.once)(() => createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset)) }; } const PRESET_DESCRIPTOR_CACHE = new WeakMap(); const createCachedPresetDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => { const dirname = cache.using(dir => dir); return (0, _caching.makeStrongCacheSync)(alias => (0, _caching.makeStrongCache)(function* (passPerPreset) { const descriptors = yield* createPresetDescriptors(items, dirname, alias, passPerPreset); return descriptors.map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc)); })); }); const PLUGIN_DESCRIPTOR_CACHE = new WeakMap(); const createCachedPluginDescriptors = (0, _caching.makeWeakCacheSync)((items, cache) => { const dirname = cache.using(dir => dir); return (0, _caching.makeStrongCache)(function* (alias) { const descriptors = yield* createPluginDescriptors(items, dirname, alias); return descriptors.map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc)); }); }); const DEFAULT_OPTIONS = {}; function loadCachedDescriptor(cache, desc) { const { value, options = DEFAULT_OPTIONS } = desc; if (options === false) return desc; let cacheByOptions = cache.get(value); if (!cacheByOptions) { cacheByOptions = new WeakMap(); cache.set(value, cacheByOptions); } let possibilities = cacheByOptions.get(options); if (!possibilities) { possibilities = []; cacheByOptions.set(options, possibilities); } if (!possibilities.includes(desc)) { const matches = possibilities.filter(possibility => isEqualDescriptor(possibility, desc)); if (matches.length > 0) { return matches[0]; } possibilities.push(desc); } return desc; } function* createPresetDescriptors(items, dirname, alias, passPerPreset) { return yield* createDescriptors("preset", items, dirname, alias, passPerPreset); } function* createPluginDescriptors(items, dirname, alias) { return yield* createDescriptors("plugin", items, dirname, alias); } function* createDescriptors(type, items, dirname, alias, ownPass) { const descriptors = yield* _gensync().all(items.map((item, index) => createDescriptor(item, dirname, { type, alias: `${alias}$${index}`, ownPass: !!ownPass }))); assertNoDuplicates(descriptors); return descriptors; } function* createDescriptor(pair, dirname, { type, alias, ownPass }) { const desc = (0, _item.getItemDescriptor)(pair); if (desc) { return desc; } let name; let options; let value = pair; if (Array.isArray(value)) { if (value.length === 3) { [value, options, name] = value; } else { [value, options] = value; } } let file = undefined; let filepath = null; if (typeof value === "string") { if (typeof type !== "string") { throw new Error("To resolve a string-based item, the type of item must be given"); } const resolver = type === "plugin" ? _index.loadPlugin : _index.loadPreset; const request = value; ({ filepath, value } = yield* resolver(value, dirname)); file = { request, resolved: filepath }; } if (!value) { throw new Error(`Unexpected falsy value: ${String(value)}`); } if (typeof value === "object" && value.__esModule) { if (value.default) { value = value.default; } else { throw new Error("Must export a default export when using ES6 modules."); } } if (typeof value !== "object" && typeof value !== "function") { throw new Error(`Unsupported format: ${typeof value}. Expected an object or a function.`); } if (filepath !== null && typeof value === "object" && value) { throw new Error(`Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`); } return { name, alias: filepath || alias, value, options, dirname, ownPass, file }; } function assertNoDuplicates(items) { const map = new Map(); for (const item of items) { if (typeof item.value !== "function") continue; let nameMap = map.get(item.value); if (!nameMap) { nameMap = new Set(); map.set(item.value, nameMap); } if (nameMap.has(item.name)) { const conflicts = items.filter(i => i.value === item.value); throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, ` plugins: [`, ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`, ``, `Duplicates detected are:`, `${JSON.stringify(conflicts, null, 2)}`].join("\n")); } nameMap.add(item.name); } } 0 && 0; //# sourceMappingURL=config-descriptors.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/files/index-browser.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/core/lib/config/files/index-browser.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ROOT_CONFIG_FILENAMES = void 0; exports.findConfigUpwards = findConfigUpwards; exports.findPackageData = findPackageData; exports.findRelativeConfig = findRelativeConfig; exports.findRootConfig = findRootConfig; exports.loadConfig = loadConfig; exports.loadPlugin = loadPlugin; exports.loadPreset = loadPreset; exports.resolvePlugin = resolvePlugin; exports.resolvePreset = resolvePreset; exports.resolveShowConfigPath = resolveShowConfigPath; function findConfigUpwards(rootDir) { return null; } function* findPackageData(filepath) { return { filepath, directories: [], pkg: null, isPackage: false }; } function* findRelativeConfig(pkgData, envName, caller) { return { config: null, ignore: null }; } function* findRootConfig(dirname, envName, caller) { return null; } function* loadConfig(name, dirname, envName, caller) { throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`); } function* resolveShowConfigPath(dirname) { return null; } const ROOT_CONFIG_FILENAMES = exports.ROOT_CONFIG_FILENAMES = []; function resolvePlugin(name, dirname) { return null; } function resolvePreset(name, dirname) { return null; } function loadPlugin(name, dirname) { throw new Error(`Cannot load plugin ${name} relative to ${dirname} in a browser`); } function loadPreset(name, dirname) { throw new Error(`Cannot load preset ${name} relative to ${dirname} in a browser`); } 0 && 0; //# sourceMappingURL=index-browser.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/full.js": /*!*****************************************************!*\ !*** ./node_modules/@babel/core/lib/config/full.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; function _gensync() { const data = __webpack_require__(/*! gensync */ "./node_modules/gensync/index.js"); _gensync = function () { return data; }; return data; } var _async = __webpack_require__(/*! ../gensync-utils/async.js */ "./node_modules/@babel/core/lib/gensync-utils/async.js"); var _util = __webpack_require__(/*! ./util.js */ "./node_modules/@babel/core/lib/config/util.js"); var context = __webpack_require__(/*! ../index.js */ "./node_modules/@babel/core/lib/index.js"); var _plugin = __webpack_require__(/*! ./plugin.js */ "./node_modules/@babel/core/lib/config/plugin.js"); var _item = __webpack_require__(/*! ./item.js */ "./node_modules/@babel/core/lib/config/item.js"); var _configChain = __webpack_require__(/*! ./config-chain.js */ "./node_modules/@babel/core/lib/config/config-chain.js"); var _deepArray = __webpack_require__(/*! ./helpers/deep-array.js */ "./node_modules/@babel/core/lib/config/helpers/deep-array.js"); function _traverse() { const data = __webpack_require__(/*! @babel/traverse */ "./node_modules/@babel/traverse/lib/index.js"); _traverse = function () { return data; }; return data; } var _caching = __webpack_require__(/*! ./caching.js */ "./node_modules/@babel/core/lib/config/caching.js"); var _options = __webpack_require__(/*! ./validation/options.js */ "./node_modules/@babel/core/lib/config/validation/options.js"); var _plugins = __webpack_require__(/*! ./validation/plugins.js */ "./node_modules/@babel/core/lib/config/validation/plugins.js"); var _configApi = __webpack_require__(/*! ./helpers/config-api.js */ "./node_modules/@babel/core/lib/config/helpers/config-api.js"); var _partial = __webpack_require__(/*! ./partial.js */ "./node_modules/@babel/core/lib/config/partial.js"); var _configError = __webpack_require__(/*! ../errors/config-error.js */ "./node_modules/@babel/core/lib/errors/config-error.js"); var _default = exports["default"] = _gensync()(function* loadFullConfig(inputOpts) { var _opts$assumptions; const result = yield* (0, _partial.default)(inputOpts); if (!result) { return null; } const { options, context, fileHandling } = result; if (fileHandling === "ignored") { return null; } const optionDefaults = {}; const { plugins, presets } = options; if (!plugins || !presets) { throw new Error("Assertion failure - plugins and presets exist"); } const presetContext = Object.assign({}, context, { targets: options.targets }); const toDescriptor = item => { const desc = (0, _item.getItemDescriptor)(item); if (!desc) { throw new Error("Assertion failure - must be config item"); } return desc; }; const presetsDescriptors = presets.map(toDescriptor); const initialPluginsDescriptors = plugins.map(toDescriptor); const pluginDescriptorsByPass = [[]]; const passes = []; const externalDependencies = []; const ignored = yield* enhanceError(context, function* recursePresetDescriptors(rawPresets, pluginDescriptorsPass) { const presets = []; for (let i = 0; i < rawPresets.length; i++) { const descriptor = rawPresets[i]; if (descriptor.options !== false) { try { var preset = yield* loadPresetDescriptor(descriptor, presetContext); } catch (e) { if (e.code === "BABEL_UNKNOWN_OPTION") { (0, _options.checkNoUnwrappedItemOptionPairs)(rawPresets, i, "preset", e); } throw e; } externalDependencies.push(preset.externalDependencies); if (descriptor.ownPass) { presets.push({ preset: preset.chain, pass: [] }); } else { presets.unshift({ preset: preset.chain, pass: pluginDescriptorsPass }); } } } if (presets.length > 0) { pluginDescriptorsByPass.splice(1, 0, ...presets.map(o => o.pass).filter(p => p !== pluginDescriptorsPass)); for (const { preset, pass } of presets) { if (!preset) return true; pass.push(...preset.plugins); const ignored = yield* recursePresetDescriptors(preset.presets, pass); if (ignored) return true; preset.options.forEach(opts => { (0, _util.mergeOptions)(optionDefaults, opts); }); } } })(presetsDescriptors, pluginDescriptorsByPass[0]); if (ignored) return null; const opts = optionDefaults; (0, _util.mergeOptions)(opts, options); const pluginContext = Object.assign({}, presetContext, { assumptions: (_opts$assumptions = opts.assumptions) != null ? _opts$assumptions : {} }); yield* enhanceError(context, function* loadPluginDescriptors() { pluginDescriptorsByPass[0].unshift(...initialPluginsDescriptors); for (const descs of pluginDescriptorsByPass) { const pass = []; passes.push(pass); for (let i = 0; i < descs.length; i++) { const descriptor = descs[i]; if (descriptor.options !== false) { try { var plugin = yield* loadPluginDescriptor(descriptor, pluginContext); } catch (e) { if (e.code === "BABEL_UNKNOWN_PLUGIN_PROPERTY") { (0, _options.checkNoUnwrappedItemOptionPairs)(descs, i, "plugin", e); } throw e; } pass.push(plugin); externalDependencies.push(plugin.externalDependencies); } } } })(); opts.plugins = passes[0]; opts.presets = passes.slice(1).filter(plugins => plugins.length > 0).map(plugins => ({ plugins })); opts.passPerPreset = opts.presets.length > 0; return { options: opts, passes: passes, externalDependencies: (0, _deepArray.finalize)(externalDependencies) }; }); function enhanceError(context, fn) { return function* (arg1, arg2) { try { return yield* fn(arg1, arg2); } catch (e) { if (!/^\[BABEL\]/.test(e.message)) { var _context$filename; e.message = `[BABEL] ${(_context$filename = context.filename) != null ? _context$filename : "unknown file"}: ${e.message}`; } throw e; } }; } const makeDescriptorLoader = apiFactory => (0, _caching.makeWeakCache)(function* ({ value, options, dirname, alias }, cache) { if (options === false) throw new Error("Assertion failure"); options = options || {}; const externalDependencies = []; let item = value; if (typeof value === "function") { const factory = (0, _async.maybeAsync)(value, `You appear to be using an async plugin/preset, but Babel has been called synchronously`); const api = Object.assign({}, context, apiFactory(cache, externalDependencies)); try { item = yield* factory(api, options, dirname); } catch (e) { if (alias) { e.message += ` (While processing: ${JSON.stringify(alias)})`; } throw e; } } if (!item || typeof item !== "object") { throw new Error("Plugin/Preset did not return an object."); } if ((0, _async.isThenable)(item)) { yield* []; throw new Error(`You appear to be using a promise as a plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version. ` + `As an alternative, you can prefix the promise with "await". ` + `(While processing: ${JSON.stringify(alias)})`); } if (externalDependencies.length > 0 && (!cache.configured() || cache.mode() === "forever")) { let error = `A plugin/preset has external untracked dependencies ` + `(${externalDependencies[0]}), but the cache `; if (!cache.configured()) { error += `has not been configured to be invalidated when the external dependencies change. `; } else { error += ` has been configured to never be invalidated. `; } error += `Plugins/presets should configure their cache to be invalidated when the external ` + `dependencies change, for example using \`api.cache.invalidate(() => ` + `statSync(filepath).mtimeMs)\` or \`api.cache.never()\`\n` + `(While processing: ${JSON.stringify(alias)})`; throw new Error(error); } return { value: item, options, dirname, alias, externalDependencies: (0, _deepArray.finalize)(externalDependencies) }; }); const pluginDescriptorLoader = makeDescriptorLoader(_configApi.makePluginAPI); const presetDescriptorLoader = makeDescriptorLoader(_configApi.makePresetAPI); const instantiatePlugin = (0, _caching.makeWeakCache)(function* ({ value, options, dirname, alias, externalDependencies }, cache) { const pluginObj = (0, _plugins.validatePluginObject)(value); const plugin = Object.assign({}, pluginObj); if (plugin.visitor) { plugin.visitor = _traverse().default.explode(Object.assign({}, plugin.visitor)); } if (plugin.inherits) { const inheritsDescriptor = { name: undefined, alias: `${alias}$inherits`, value: plugin.inherits, options, dirname }; const inherits = yield* (0, _async.forwardAsync)(loadPluginDescriptor, run => { return cache.invalidate(data => run(inheritsDescriptor, data)); }); plugin.pre = chainMaybeAsync(inherits.pre, plugin.pre); plugin.post = chainMaybeAsync(inherits.post, plugin.post); plugin.manipulateOptions = chainMaybeAsync(inherits.manipulateOptions, plugin.manipulateOptions); plugin.visitor = _traverse().default.visitors.merge([inherits.visitor || {}, plugin.visitor || {}]); if (inherits.externalDependencies.length > 0) { if (externalDependencies.length === 0) { externalDependencies = inherits.externalDependencies; } else { externalDependencies = (0, _deepArray.finalize)([externalDependencies, inherits.externalDependencies]); } } } return new _plugin.default(plugin, options, alias, externalDependencies); }); function* loadPluginDescriptor(descriptor, context) { if (descriptor.value instanceof _plugin.default) { if (descriptor.options) { throw new Error("Passed options to an existing Plugin instance will not work."); } return descriptor.value; } return yield* instantiatePlugin(yield* pluginDescriptorLoader(descriptor, context), context); } const needsFilename = val => val && typeof val !== "function"; const validateIfOptionNeedsFilename = (options, descriptor) => { if (needsFilename(options.test) || needsFilename(options.include) || needsFilename(options.exclude)) { const formattedPresetName = descriptor.name ? `"${descriptor.name}"` : "/* your preset */"; throw new _configError.default([`Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`, `\`\`\``, `babel.transformSync(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`, `\`\`\``, `See https://babeljs.io/docs/en/options#filename for more information.`].join("\n")); } }; const validatePreset = (preset, context, descriptor) => { if (!context.filename) { var _options$overrides; const { options } = preset; validateIfOptionNeedsFilename(options, descriptor); (_options$overrides = options.overrides) == null || _options$overrides.forEach(overrideOptions => validateIfOptionNeedsFilename(overrideOptions, descriptor)); } }; const instantiatePreset = (0, _caching.makeWeakCacheSync)(({ value, dirname, alias, externalDependencies }) => { return { options: (0, _options.validate)("preset", value), alias, dirname, externalDependencies }; }); function* loadPresetDescriptor(descriptor, context) { const preset = instantiatePreset(yield* presetDescriptorLoader(descriptor, context)); validatePreset(preset, context, descriptor); return { chain: yield* (0, _configChain.buildPresetChain)(preset, context), externalDependencies: preset.externalDependencies }; } function chainMaybeAsync(a, b) { if (!a) return b; if (!b) return a; return function (...args) { const res = a.apply(this, args); if (res && typeof res.then === "function") { return res.then(() => b.apply(this, args)); } return b.apply(this, args); }; } 0 && 0; //# sourceMappingURL=full.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/helpers/config-api.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/core/lib/config/helpers/config-api.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.makeConfigAPI = makeConfigAPI; exports.makePluginAPI = makePluginAPI; exports.makePresetAPI = makePresetAPI; function _semver() { const data = __webpack_require__(/*! semver */ "./node_modules/semver/semver.js"); _semver = function () { return data; }; return data; } var _index = __webpack_require__(/*! ../../index.js */ "./node_modules/@babel/core/lib/index.js"); var _caching = __webpack_require__(/*! ../caching.js */ "./node_modules/@babel/core/lib/config/caching.js"); function makeConfigAPI(cache) { const env = value => cache.using(data => { if (value === undefined) return data.envName; if (typeof value === "function") { return (0, _caching.assertSimpleType)(value(data.envName)); } return (Array.isArray(value) ? value : [value]).some(entry => { if (typeof entry !== "string") { throw new Error("Unexpected non-string value"); } return entry === data.envName; }); }); const caller = cb => cache.using(data => (0, _caching.assertSimpleType)(cb(data.caller))); return { version: _index.version, cache: cache.simple(), env, async: () => false, caller, assertVersion }; } function makePresetAPI(cache, externalDependencies) { const targets = () => JSON.parse(cache.using(data => JSON.stringify(data.targets))); const addExternalDependency = ref => { externalDependencies.push(ref); }; return Object.assign({}, makeConfigAPI(cache), { targets, addExternalDependency }); } function makePluginAPI(cache, externalDependencies) { const assumption = name => cache.using(data => data.assumptions[name]); return Object.assign({}, makePresetAPI(cache, externalDependencies), { assumption }); } function assertVersion(range) { if (typeof range === "number") { if (!Number.isInteger(range)) { throw new Error("Expected string or integer value."); } range = `^${range}.0.0-0`; } if (typeof range !== "string") { throw new Error("Expected string or integer value."); } if (range === "*" || _semver().satisfies(_index.version, range)) return; const limit = Error.stackTraceLimit; if (typeof limit === "number" && limit < 25) { Error.stackTraceLimit = 25; } const err = new Error(`Requires Babel "${range}", but was loaded with "${_index.version}". ` + `If you are sure you have a compatible version of @babel/core, ` + `it is likely that something in your build process is loading the ` + `wrong version. Inspect the stack trace of this error to look for ` + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + `to see what is calling Babel.`); if (typeof limit === "number") { Error.stackTraceLimit = limit; } throw Object.assign(err, { code: "BABEL_VERSION_UNSUPPORTED", version: _index.version, range }); } 0 && 0; //# sourceMappingURL=config-api.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/helpers/deep-array.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/core/lib/config/helpers/deep-array.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.finalize = finalize; exports.flattenToSet = flattenToSet; function finalize(deepArr) { return Object.freeze(deepArr); } function flattenToSet(arr) { const result = new Set(); const stack = [arr]; while (stack.length > 0) { for (const el of stack.pop()) { if (Array.isArray(el)) stack.push(el);else result.add(el); } } return result; } 0 && 0; //# sourceMappingURL=deep-array.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/helpers/environment.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/core/lib/config/helpers/environment.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getEnv = getEnv; function getEnv(defaultValue = "development") { return process.env.BABEL_ENV || "development" || 0; } 0 && 0; //# sourceMappingURL=environment.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/index.js": /*!******************************************************!*\ !*** ./node_modules/@babel/core/lib/config/index.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createConfigItem = createConfigItem; exports.createConfigItemAsync = createConfigItemAsync; exports.createConfigItemSync = createConfigItemSync; Object.defineProperty(exports, "default", ({ enumerable: true, get: function () { return _full.default; } })); exports.loadOptions = loadOptions; exports.loadOptionsAsync = loadOptionsAsync; exports.loadOptionsSync = loadOptionsSync; exports.loadPartialConfig = loadPartialConfig; exports.loadPartialConfigAsync = loadPartialConfigAsync; exports.loadPartialConfigSync = loadPartialConfigSync; function _gensync() { const data = __webpack_require__(/*! gensync */ "./node_modules/gensync/index.js"); _gensync = function () { return data; }; return data; } var _full = __webpack_require__(/*! ./full.js */ "./node_modules/@babel/core/lib/config/full.js"); var _partial = __webpack_require__(/*! ./partial.js */ "./node_modules/@babel/core/lib/config/partial.js"); var _item = __webpack_require__(/*! ./item.js */ "./node_modules/@babel/core/lib/config/item.js"); var _rewriteStackTrace = __webpack_require__(/*! ../errors/rewrite-stack-trace.js */ "./node_modules/@babel/core/lib/errors/rewrite-stack-trace.js"); const loadPartialConfigRunner = _gensync()(_partial.loadPartialConfig); function loadPartialConfigAsync(...args) { return (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.async)(...args); } function loadPartialConfigSync(...args) { return (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.sync)(...args); } function loadPartialConfig(opts, callback) { if (callback !== undefined) { (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.errback)(opts, callback); } else if (typeof opts === "function") { (0, _rewriteStackTrace.beginHiddenCallStack)(loadPartialConfigRunner.errback)(undefined, opts); } else { { return loadPartialConfigSync(opts); } } } function* loadOptionsImpl(opts) { var _config$options; const config = yield* (0, _full.default)(opts); return (_config$options = config == null ? void 0 : config.options) != null ? _config$options : null; } const loadOptionsRunner = _gensync()(loadOptionsImpl); function loadOptionsAsync(...args) { return (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.async)(...args); } function loadOptionsSync(...args) { return (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.sync)(...args); } function loadOptions(opts, callback) { if (callback !== undefined) { (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.errback)(opts, callback); } else if (typeof opts === "function") { (0, _rewriteStackTrace.beginHiddenCallStack)(loadOptionsRunner.errback)(undefined, opts); } else { { return loadOptionsSync(opts); } } } const createConfigItemRunner = _gensync()(_item.createConfigItem); function createConfigItemAsync(...args) { return (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.async)(...args); } function createConfigItemSync(...args) { return (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.sync)(...args); } function createConfigItem(target, options, callback) { if (callback !== undefined) { (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.errback)(target, options, callback); } else if (typeof options === "function") { (0, _rewriteStackTrace.beginHiddenCallStack)(createConfigItemRunner.errback)(target, undefined, callback); } else { { return createConfigItemSync(target, options); } } } 0 && 0; //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/item.js": /*!*****************************************************!*\ !*** ./node_modules/@babel/core/lib/config/item.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createConfigItem = createConfigItem; exports.createItemFromDescriptor = createItemFromDescriptor; exports.getItemDescriptor = getItemDescriptor; function _path() { const data = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js"); _path = function () { return data; }; return data; } var _configDescriptors = __webpack_require__(/*! ./config-descriptors.js */ "./node_modules/@babel/core/lib/config/config-descriptors.js"); function createItemFromDescriptor(desc) { return new ConfigItem(desc); } function* createConfigItem(value, { dirname = ".", type } = {}) { const descriptor = yield* (0, _configDescriptors.createDescriptor)(value, _path().resolve(dirname), { type, alias: "programmatic item" }); return createItemFromDescriptor(descriptor); } const CONFIG_ITEM_BRAND = Symbol.for("@babel/core@7 - ConfigItem"); function getItemDescriptor(item) { if (item != null && item[CONFIG_ITEM_BRAND]) { return item._descriptor; } return undefined; } class ConfigItem { constructor(descriptor) { this._descriptor = void 0; this[CONFIG_ITEM_BRAND] = true; this.value = void 0; this.options = void 0; this.dirname = void 0; this.name = void 0; this.file = void 0; this._descriptor = descriptor; Object.defineProperty(this, "_descriptor", { enumerable: false }); Object.defineProperty(this, CONFIG_ITEM_BRAND, { enumerable: false }); this.value = this._descriptor.value; this.options = this._descriptor.options; this.dirname = this._descriptor.dirname; this.name = this._descriptor.name; this.file = this._descriptor.file ? { request: this._descriptor.file.request, resolved: this._descriptor.file.resolved } : undefined; Object.freeze(this); } } Object.freeze(ConfigItem.prototype); 0 && 0; //# sourceMappingURL=item.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/partial.js": /*!********************************************************!*\ !*** ./node_modules/@babel/core/lib/config/partial.js ***! \********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = loadPrivatePartialConfig; exports.loadPartialConfig = loadPartialConfig; function _path() { const data = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js"); _path = function () { return data; }; return data; } var _plugin = __webpack_require__(/*! ./plugin.js */ "./node_modules/@babel/core/lib/config/plugin.js"); var _util = __webpack_require__(/*! ./util.js */ "./node_modules/@babel/core/lib/config/util.js"); var _item = __webpack_require__(/*! ./item.js */ "./node_modules/@babel/core/lib/config/item.js"); var _configChain = __webpack_require__(/*! ./config-chain.js */ "./node_modules/@babel/core/lib/config/config-chain.js"); var _environment = __webpack_require__(/*! ./helpers/environment.js */ "./node_modules/@babel/core/lib/config/helpers/environment.js"); var _options = __webpack_require__(/*! ./validation/options.js */ "./node_modules/@babel/core/lib/config/validation/options.js"); var _index = __webpack_require__(/*! ./files/index.js */ "./node_modules/@babel/core/lib/config/files/index-browser.js"); var _resolveTargets = __webpack_require__(/*! ./resolve-targets.js */ "./node_modules/@babel/core/lib/config/resolve-targets-browser.js"); const _excluded = ["showIgnoredFiles"]; function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function resolveRootMode(rootDir, rootMode) { switch (rootMode) { case "root": return rootDir; case "upward-optional": { const upwardRootDir = (0, _index.findConfigUpwards)(rootDir); return upwardRootDir === null ? rootDir : upwardRootDir; } case "upward": { const upwardRootDir = (0, _index.findConfigUpwards)(rootDir); if (upwardRootDir !== null) return upwardRootDir; throw Object.assign(new Error(`Babel was run with rootMode:"upward" but a root could not ` + `be found when searching upward from "${rootDir}".\n` + `One of the following config files must be in the directory tree: ` + `"${_index.ROOT_CONFIG_FILENAMES.join(", ")}".`), { code: "BABEL_ROOT_NOT_FOUND", dirname: rootDir }); } default: throw new Error(`Assertion failure - unknown rootMode value.`); } } function* loadPrivatePartialConfig(inputOpts) { if (inputOpts != null && (typeof inputOpts !== "object" || Array.isArray(inputOpts))) { throw new Error("Babel options must be an object, null, or undefined"); } const args = inputOpts ? (0, _options.validate)("arguments", inputOpts) : {}; const { envName = (0, _environment.getEnv)(), cwd = ".", root: rootDir = ".", rootMode = "root", caller, cloneInputAst = true } = args; const absoluteCwd = _path().resolve(cwd); const absoluteRootDir = resolveRootMode(_path().resolve(absoluteCwd, rootDir), rootMode); const filename = typeof args.filename === "string" ? _path().resolve(cwd, args.filename) : undefined; const showConfigPath = yield* (0, _index.resolveShowConfigPath)(absoluteCwd); const context = { filename, cwd: absoluteCwd, root: absoluteRootDir, envName, caller, showConfig: showConfigPath === filename }; const configChain = yield* (0, _configChain.buildRootChain)(args, context); if (!configChain) return null; const merged = { assumptions: {} }; configChain.options.forEach(opts => { (0, _util.mergeOptions)(merged, opts); }); const options = Object.assign({}, merged, { targets: (0, _resolveTargets.resolveTargets)(merged, absoluteRootDir), cloneInputAst, babelrc: false, configFile: false, browserslistConfigFile: false, passPerPreset: false, envName: context.envName, cwd: context.cwd, root: context.root, rootMode: "root", filename: typeof context.filename === "string" ? context.filename : undefined, plugins: configChain.plugins.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor)), presets: configChain.presets.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor)) }); return { options, context, fileHandling: configChain.fileHandling, ignore: configChain.ignore, babelrc: configChain.babelrc, config: configChain.config, files: configChain.files }; } function* loadPartialConfig(opts) { let showIgnoredFiles = false; if (typeof opts === "object" && opts !== null && !Array.isArray(opts)) { var _opts = opts; ({ showIgnoredFiles } = _opts); opts = _objectWithoutPropertiesLoose(_opts, _excluded); _opts; } const result = yield* loadPrivatePartialConfig(opts); if (!result) return null; const { options, babelrc, ignore, config, fileHandling, files } = result; if (fileHandling === "ignored" && !showIgnoredFiles) { return null; } (options.plugins || []).forEach(item => { if (item.value instanceof _plugin.default) { throw new Error("Passing cached plugin instances is not supported in " + "babel.loadPartialConfig()"); } }); return new PartialConfig(options, babelrc ? babelrc.filepath : undefined, ignore ? ignore.filepath : undefined, config ? config.filepath : undefined, fileHandling, files); } class PartialConfig { constructor(options, babelrc, ignore, config, fileHandling, files) { this.options = void 0; this.babelrc = void 0; this.babelignore = void 0; this.config = void 0; this.fileHandling = void 0; this.files = void 0; this.options = options; this.babelignore = ignore; this.babelrc = babelrc; this.config = config; this.fileHandling = fileHandling; this.files = files; Object.freeze(this); } hasFilesystemConfig() { return this.babelrc !== undefined || this.config !== undefined; } } Object.freeze(PartialConfig.prototype); 0 && 0; //# sourceMappingURL=partial.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/pattern-to-regex.js": /*!*****************************************************************!*\ !*** ./node_modules/@babel/core/lib/config/pattern-to-regex.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = pathToPattern; function _path() { const data = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js"); _path = function () { return data; }; return data; } const sep = `\\${_path().sep}`; const endSep = `(?:${sep}|$)`; const substitution = `[^${sep}]+`; const starPat = `(?:${substitution}${sep})`; const starPatLast = `(?:${substitution}${endSep})`; const starStarPat = `${starPat}*?`; const starStarPatLast = `${starPat}*?${starPatLast}?`; function escapeRegExp(string) { return string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&"); } function pathToPattern(pattern, dirname) { const parts = _path().resolve(dirname, pattern).split(_path().sep); return new RegExp(["^", ...parts.map((part, i) => { const last = i === parts.length - 1; if (part === "**") return last ? starStarPatLast : starStarPat; if (part === "*") return last ? starPatLast : starPat; if (part.indexOf("*.") === 0) { return substitution + escapeRegExp(part.slice(1)) + (last ? endSep : sep); } return escapeRegExp(part) + (last ? endSep : sep); })].join("")); } 0 && 0; //# sourceMappingURL=pattern-to-regex.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/plugin.js": /*!*******************************************************!*\ !*** ./node_modules/@babel/core/lib/config/plugin.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _deepArray = __webpack_require__(/*! ./helpers/deep-array.js */ "./node_modules/@babel/core/lib/config/helpers/deep-array.js"); class Plugin { constructor(plugin, options, key, externalDependencies = (0, _deepArray.finalize)([])) { this.key = void 0; this.manipulateOptions = void 0; this.post = void 0; this.pre = void 0; this.visitor = void 0; this.parserOverride = void 0; this.generatorOverride = void 0; this.options = void 0; this.externalDependencies = void 0; this.key = plugin.name || key; this.manipulateOptions = plugin.manipulateOptions; this.post = plugin.post; this.pre = plugin.pre; this.visitor = plugin.visitor || {}; this.parserOverride = plugin.parserOverride; this.generatorOverride = plugin.generatorOverride; this.options = options; this.externalDependencies = externalDependencies; } } exports["default"] = Plugin; 0 && 0; //# sourceMappingURL=plugin.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/printer.js": /*!********************************************************!*\ !*** ./node_modules/@babel/core/lib/config/printer.js ***! \********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ConfigPrinter = exports.ChainFormatter = void 0; function _gensync() { const data = __webpack_require__(/*! gensync */ "./node_modules/gensync/index.js"); _gensync = function () { return data; }; return data; } const ChainFormatter = exports.ChainFormatter = { Programmatic: 0, Config: 1 }; const Formatter = { title(type, callerName, filepath) { let title = ""; if (type === ChainFormatter.Programmatic) { title = "programmatic options"; if (callerName) { title += " from " + callerName; } } else { title = "config " + filepath; } return title; }, loc(index, envName) { let loc = ""; if (index != null) { loc += `.overrides[${index}]`; } if (envName != null) { loc += `.env["${envName}"]`; } return loc; }, *optionsAndDescriptors(opt) { const content = Object.assign({}, opt.options); delete content.overrides; delete content.env; const pluginDescriptors = [...(yield* opt.plugins())]; if (pluginDescriptors.length) { content.plugins = pluginDescriptors.map(d => descriptorToConfig(d)); } const presetDescriptors = [...(yield* opt.presets())]; if (presetDescriptors.length) { content.presets = [...presetDescriptors].map(d => descriptorToConfig(d)); } return JSON.stringify(content, undefined, 2); } }; function descriptorToConfig(d) { var _d$file; let name = (_d$file = d.file) == null ? void 0 : _d$file.request; if (name == null) { if (typeof d.value === "object") { name = d.value; } else if (typeof d.value === "function") { name = `[Function: ${d.value.toString().slice(0, 50)} ... ]`; } } if (name == null) { name = "[Unknown]"; } if (d.options === undefined) { return name; } else if (d.name == null) { return [name, d.options]; } else { return [name, d.options, d.name]; } } class ConfigPrinter { constructor() { this._stack = []; } configure(enabled, type, { callerName, filepath }) { if (!enabled) return () => {}; return (content, index, envName) => { this._stack.push({ type, callerName, filepath, content, index, envName }); }; } static *format(config) { let title = Formatter.title(config.type, config.callerName, config.filepath); const loc = Formatter.loc(config.index, config.envName); if (loc) title += ` ${loc}`; const content = yield* Formatter.optionsAndDescriptors(config.content); return `${title}\n${content}`; } *output() { if (this._stack.length === 0) return ""; const configs = yield* _gensync().all(this._stack.map(s => ConfigPrinter.format(s))); return configs.join("\n\n"); } } exports.ConfigPrinter = ConfigPrinter; 0 && 0; //# sourceMappingURL=printer.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/resolve-targets-browser.js": /*!************************************************************************!*\ !*** ./node_modules/@babel/core/lib/config/resolve-targets-browser.js ***! \************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resolveBrowserslistConfigFile = resolveBrowserslistConfigFile; exports.resolveTargets = resolveTargets; function _helperCompilationTargets() { const data = __webpack_require__(/*! @babel/helper-compilation-targets */ "./node_modules/@babel/helper-compilation-targets/lib/index.js"); _helperCompilationTargets = function () { return data; }; return data; } function resolveBrowserslistConfigFile(browserslistConfigFile, configFilePath) { return undefined; } function resolveTargets(options, root) { const optTargets = options.targets; let targets; if (typeof optTargets === "string" || Array.isArray(optTargets)) { targets = { browsers: optTargets }; } else if (optTargets) { if ("esmodules" in optTargets) { targets = Object.assign({}, optTargets, { esmodules: "intersect" }); } else { targets = optTargets; } } return (0, _helperCompilationTargets().default)(targets, { ignoreBrowserslistConfig: true, browserslistEnv: options.browserslistEnv }); } 0 && 0; //# sourceMappingURL=resolve-targets-browser.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/util.js": /*!*****************************************************!*\ !*** ./node_modules/@babel/core/lib/config/util.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isIterableIterator = isIterableIterator; exports.mergeOptions = mergeOptions; function mergeOptions(target, source) { for (const k of Object.keys(source)) { if ((k === "parserOpts" || k === "generatorOpts" || k === "assumptions") && source[k]) { const parserOpts = source[k]; const targetObj = target[k] || (target[k] = {}); mergeDefaultFields(targetObj, parserOpts); } else { const val = source[k]; if (val !== undefined) target[k] = val; } } } function mergeDefaultFields(target, source) { for (const k of Object.keys(source)) { const val = source[k]; if (val !== undefined) target[k] = val; } } function isIterableIterator(value) { return !!value && typeof value.next === "function" && typeof value[Symbol.iterator] === "function"; } 0 && 0; //# sourceMappingURL=util.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/validation/option-assertions.js": /*!*****************************************************************************!*\ !*** ./node_modules/@babel/core/lib/config/validation/option-assertions.js ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.access = access; exports.assertArray = assertArray; exports.assertAssumptions = assertAssumptions; exports.assertBabelrcSearch = assertBabelrcSearch; exports.assertBoolean = assertBoolean; exports.assertCallerMetadata = assertCallerMetadata; exports.assertCompact = assertCompact; exports.assertConfigApplicableTest = assertConfigApplicableTest; exports.assertConfigFileSearch = assertConfigFileSearch; exports.assertFunction = assertFunction; exports.assertIgnoreList = assertIgnoreList; exports.assertInputSourceMap = assertInputSourceMap; exports.assertObject = assertObject; exports.assertPluginList = assertPluginList; exports.assertRootMode = assertRootMode; exports.assertSourceMaps = assertSourceMaps; exports.assertSourceType = assertSourceType; exports.assertString = assertString; exports.assertTargets = assertTargets; exports.msg = msg; function _helperCompilationTargets() { const data = __webpack_require__(/*! @babel/helper-compilation-targets */ "./node_modules/@babel/helper-compilation-targets/lib/index.js"); _helperCompilationTargets = function () { return data; }; return data; } var _options = __webpack_require__(/*! ./options.js */ "./node_modules/@babel/core/lib/config/validation/options.js"); function msg(loc) { switch (loc.type) { case "root": return ``; case "env": return `${msg(loc.parent)}.env["${loc.name}"]`; case "overrides": return `${msg(loc.parent)}.overrides[${loc.index}]`; case "option": return `${msg(loc.parent)}.${loc.name}`; case "access": return `${msg(loc.parent)}[${JSON.stringify(loc.name)}]`; default: throw new Error(`Assertion failure: Unknown type ${loc.type}`); } } function access(loc, name) { return { type: "access", name, parent: loc }; } function assertRootMode(loc, value) { if (value !== undefined && value !== "root" && value !== "upward" && value !== "upward-optional") { throw new Error(`${msg(loc)} must be a "root", "upward", "upward-optional" or undefined`); } return value; } function assertSourceMaps(loc, value) { if (value !== undefined && typeof value !== "boolean" && value !== "inline" && value !== "both") { throw new Error(`${msg(loc)} must be a boolean, "inline", "both", or undefined`); } return value; } function assertCompact(loc, value) { if (value !== undefined && typeof value !== "boolean" && value !== "auto") { throw new Error(`${msg(loc)} must be a boolean, "auto", or undefined`); } return value; } function assertSourceType(loc, value) { if (value !== undefined && value !== "module" && value !== "commonjs" && value !== "script" && value !== "unambiguous") { throw new Error(`${msg(loc)} must be "module", "commonjs", "script", "unambiguous", or undefined`); } return value; } function assertCallerMetadata(loc, value) { const obj = assertObject(loc, value); if (obj) { if (typeof obj.name !== "string") { throw new Error(`${msg(loc)} set but does not contain "name" property string`); } for (const prop of Object.keys(obj)) { const propLoc = access(loc, prop); const value = obj[prop]; if (value != null && typeof value !== "boolean" && typeof value !== "string" && typeof value !== "number") { throw new Error(`${msg(propLoc)} must be null, undefined, a boolean, a string, or a number.`); } } } return value; } function assertInputSourceMap(loc, value) { if (value !== undefined && typeof value !== "boolean" && (typeof value !== "object" || !value)) { throw new Error(`${msg(loc)} must be a boolean, object, or undefined`); } return value; } function assertString(loc, value) { if (value !== undefined && typeof value !== "string") { throw new Error(`${msg(loc)} must be a string, or undefined`); } return value; } function assertFunction(loc, value) { if (value !== undefined && typeof value !== "function") { throw new Error(`${msg(loc)} must be a function, or undefined`); } return value; } function assertBoolean(loc, value) { if (value !== undefined && typeof value !== "boolean") { throw new Error(`${msg(loc)} must be a boolean, or undefined`); } return value; } function assertObject(loc, value) { if (value !== undefined && (typeof value !== "object" || Array.isArray(value) || !value)) { throw new Error(`${msg(loc)} must be an object, or undefined`); } return value; } function assertArray(loc, value) { if (value != null && !Array.isArray(value)) { throw new Error(`${msg(loc)} must be an array, or undefined`); } return value; } function assertIgnoreList(loc, value) { const arr = assertArray(loc, value); arr == null || arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item)); return arr; } function assertIgnoreItem(loc, value) { if (typeof value !== "string" && typeof value !== "function" && !(value instanceof RegExp)) { throw new Error(`${msg(loc)} must be an array of string/Function/RegExp values, or undefined`); } return value; } function assertConfigApplicableTest(loc, value) { if (value === undefined) { return value; } if (Array.isArray(value)) { value.forEach((item, i) => { if (!checkValidTest(item)) { throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`); } }); } else if (!checkValidTest(value)) { throw new Error(`${msg(loc)} must be a string/Function/RegExp, or an array of those`); } return value; } function checkValidTest(value) { return typeof value === "string" || typeof value === "function" || value instanceof RegExp; } function assertConfigFileSearch(loc, value) { if (value !== undefined && typeof value !== "boolean" && typeof value !== "string") { throw new Error(`${msg(loc)} must be a undefined, a boolean, a string, ` + `got ${JSON.stringify(value)}`); } return value; } function assertBabelrcSearch(loc, value) { if (value === undefined || typeof value === "boolean") { return value; } if (Array.isArray(value)) { value.forEach((item, i) => { if (!checkValidTest(item)) { throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`); } }); } else if (!checkValidTest(value)) { throw new Error(`${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp ` + `or an array of those, got ${JSON.stringify(value)}`); } return value; } function assertPluginList(loc, value) { const arr = assertArray(loc, value); if (arr) { arr.forEach((item, i) => assertPluginItem(access(loc, i), item)); } return arr; } function assertPluginItem(loc, value) { if (Array.isArray(value)) { if (value.length === 0) { throw new Error(`${msg(loc)} must include an object`); } if (value.length > 3) { throw new Error(`${msg(loc)} may only be a two-tuple or three-tuple`); } assertPluginTarget(access(loc, 0), value[0]); if (value.length > 1) { const opts = value[1]; if (opts !== undefined && opts !== false && (typeof opts !== "object" || Array.isArray(opts) || opts === null)) { throw new Error(`${msg(access(loc, 1))} must be an object, false, or undefined`); } } if (value.length === 3) { const name = value[2]; if (name !== undefined && typeof name !== "string") { throw new Error(`${msg(access(loc, 2))} must be a string, or undefined`); } } } else { assertPluginTarget(loc, value); } return value; } function assertPluginTarget(loc, value) { if ((typeof value !== "object" || !value) && typeof value !== "string" && typeof value !== "function") { throw new Error(`${msg(loc)} must be a string, object, function`); } return value; } function assertTargets(loc, value) { if ((0, _helperCompilationTargets().isBrowsersQueryValid)(value)) return value; if (typeof value !== "object" || !value || Array.isArray(value)) { throw new Error(`${msg(loc)} must be a string, an array of strings or an object`); } const browsersLoc = access(loc, "browsers"); const esmodulesLoc = access(loc, "esmodules"); assertBrowsersList(browsersLoc, value.browsers); assertBoolean(esmodulesLoc, value.esmodules); for (const key of Object.keys(value)) { const val = value[key]; const subLoc = access(loc, key); if (key === "esmodules") assertBoolean(subLoc, val);else if (key === "browsers") assertBrowsersList(subLoc, val);else if (!hasOwnProperty.call(_helperCompilationTargets().TargetNames, key)) { const validTargets = Object.keys(_helperCompilationTargets().TargetNames).join(", "); throw new Error(`${msg(subLoc)} is not a valid target. Supported targets are ${validTargets}`); } else assertBrowserVersion(subLoc, val); } return value; } function assertBrowsersList(loc, value) { if (value !== undefined && !(0, _helperCompilationTargets().isBrowsersQueryValid)(value)) { throw new Error(`${msg(loc)} must be undefined, a string or an array of strings`); } } function assertBrowserVersion(loc, value) { if (typeof value === "number" && Math.round(value) === value) return; if (typeof value === "string") return; throw new Error(`${msg(loc)} must be a string or an integer number`); } function assertAssumptions(loc, value) { if (value === undefined) return; if (typeof value !== "object" || value === null) { throw new Error(`${msg(loc)} must be an object or undefined.`); } let root = loc; do { root = root.parent; } while (root.type !== "root"); const inPreset = root.source === "preset"; for (const name of Object.keys(value)) { const subLoc = access(loc, name); if (!_options.assumptionsNames.has(name)) { throw new Error(`${msg(subLoc)} is not a supported assumption.`); } if (typeof value[name] !== "boolean") { throw new Error(`${msg(subLoc)} must be a boolean.`); } if (inPreset && value[name] === false) { throw new Error(`${msg(subLoc)} cannot be set to 'false' inside presets.`); } } return value; } 0 && 0; //# sourceMappingURL=option-assertions.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/validation/options.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/core/lib/config/validation/options.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.assumptionsNames = void 0; exports.checkNoUnwrappedItemOptionPairs = checkNoUnwrappedItemOptionPairs; exports.validate = validate; var _removed = __webpack_require__(/*! ./removed.js */ "./node_modules/@babel/core/lib/config/validation/removed.js"); var _optionAssertions = __webpack_require__(/*! ./option-assertions.js */ "./node_modules/@babel/core/lib/config/validation/option-assertions.js"); var _configError = __webpack_require__(/*! ../../errors/config-error.js */ "./node_modules/@babel/core/lib/errors/config-error.js"); const ROOT_VALIDATORS = { cwd: _optionAssertions.assertString, root: _optionAssertions.assertString, rootMode: _optionAssertions.assertRootMode, configFile: _optionAssertions.assertConfigFileSearch, caller: _optionAssertions.assertCallerMetadata, filename: _optionAssertions.assertString, filenameRelative: _optionAssertions.assertString, code: _optionAssertions.assertBoolean, ast: _optionAssertions.assertBoolean, cloneInputAst: _optionAssertions.assertBoolean, envName: _optionAssertions.assertString }; const BABELRC_VALIDATORS = { babelrc: _optionAssertions.assertBoolean, babelrcRoots: _optionAssertions.assertBabelrcSearch }; const NONPRESET_VALIDATORS = { extends: _optionAssertions.assertString, ignore: _optionAssertions.assertIgnoreList, only: _optionAssertions.assertIgnoreList, targets: _optionAssertions.assertTargets, browserslistConfigFile: _optionAssertions.assertConfigFileSearch, browserslistEnv: _optionAssertions.assertString }; const COMMON_VALIDATORS = { inputSourceMap: _optionAssertions.assertInputSourceMap, presets: _optionAssertions.assertPluginList, plugins: _optionAssertions.assertPluginList, passPerPreset: _optionAssertions.assertBoolean, assumptions: _optionAssertions.assertAssumptions, env: assertEnvSet, overrides: assertOverridesList, test: _optionAssertions.assertConfigApplicableTest, include: _optionAssertions.assertConfigApplicableTest, exclude: _optionAssertions.assertConfigApplicableTest, retainLines: _optionAssertions.assertBoolean, comments: _optionAssertions.assertBoolean, shouldPrintComment: _optionAssertions.assertFunction, compact: _optionAssertions.assertCompact, minified: _optionAssertions.assertBoolean, auxiliaryCommentBefore: _optionAssertions.assertString, auxiliaryCommentAfter: _optionAssertions.assertString, sourceType: _optionAssertions.assertSourceType, wrapPluginVisitorMethod: _optionAssertions.assertFunction, highlightCode: _optionAssertions.assertBoolean, sourceMaps: _optionAssertions.assertSourceMaps, sourceMap: _optionAssertions.assertSourceMaps, sourceFileName: _optionAssertions.assertString, sourceRoot: _optionAssertions.assertString, parserOpts: _optionAssertions.assertObject, generatorOpts: _optionAssertions.assertObject }; { Object.assign(COMMON_VALIDATORS, { getModuleId: _optionAssertions.assertFunction, moduleRoot: _optionAssertions.assertString, moduleIds: _optionAssertions.assertBoolean, moduleId: _optionAssertions.assertString }); } const knownAssumptions = ["arrayLikeIsIterable", "constantReexports", "constantSuper", "enumerableModuleMeta", "ignoreFunctionLength", "ignoreToPrimitiveHint", "iterableIsArray", "mutableTemplateObject", "noClassCalls", "noDocumentAll", "noIncompleteNsImportDetection", "noNewArrows", "noUninitializedPrivateFieldAccess", "objectRestNoSymbols", "privateFieldsAsSymbols", "privateFieldsAsProperties", "pureGetters", "setClassMethods", "setComputedProperties", "setPublicClassFields", "setSpreadProperties", "skipForOfIteratorClosing", "superIsCallableConstructor"]; const assumptionsNames = exports.assumptionsNames = new Set(knownAssumptions); function getSource(loc) { return loc.type === "root" ? loc.source : getSource(loc.parent); } function validate(type, opts, filename) { try { return validateNested({ type: "root", source: type }, opts); } catch (error) { const configError = new _configError.default(error.message, filename); if (error.code) configError.code = error.code; throw configError; } } function validateNested(loc, opts) { const type = getSource(loc); assertNoDuplicateSourcemap(opts); Object.keys(opts).forEach(key => { const optLoc = { type: "option", name: key, parent: loc }; if (type === "preset" && NONPRESET_VALIDATORS[key]) { throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in preset options`); } if (type !== "arguments" && ROOT_VALIDATORS[key]) { throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options`); } if (type !== "arguments" && type !== "configfile" && BABELRC_VALIDATORS[key]) { if (type === "babelrcfile" || type === "extendsfile") { throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in .babelrc or "extends"ed files, only in root programmatic options, ` + `or babel.config.js/config file options`); } throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options, or babel.config.js/config file options`); } const validator = COMMON_VALIDATORS[key] || NONPRESET_VALIDATORS[key] || BABELRC_VALIDATORS[key] || ROOT_VALIDATORS[key] || throwUnknownError; validator(optLoc, opts[key]); }); return opts; } function throwUnknownError(loc) { const key = loc.name; if (_removed.default[key]) { const { message, version = 5 } = _removed.default[key]; throw new Error(`Using removed Babel ${version} option: ${(0, _optionAssertions.msg)(loc)} - ${message}`); } else { const unknownOptErr = new Error(`Unknown option: ${(0, _optionAssertions.msg)(loc)}. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.`); unknownOptErr.code = "BABEL_UNKNOWN_OPTION"; throw unknownOptErr; } } function assertNoDuplicateSourcemap(opts) { if (hasOwnProperty.call(opts, "sourceMap") && hasOwnProperty.call(opts, "sourceMaps")) { throw new Error(".sourceMap is an alias for .sourceMaps, cannot use both"); } } function assertEnvSet(loc, value) { if (loc.parent.type === "env") { throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside of another .env block`); } const parent = loc.parent; const obj = (0, _optionAssertions.assertObject)(loc, value); if (obj) { for (const envName of Object.keys(obj)) { const env = (0, _optionAssertions.assertObject)((0, _optionAssertions.access)(loc, envName), obj[envName]); if (!env) continue; const envLoc = { type: "env", name: envName, parent }; validateNested(envLoc, env); } } return obj; } function assertOverridesList(loc, value) { if (loc.parent.type === "env") { throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .env block`); } if (loc.parent.type === "overrides") { throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .overrides block`); } const parent = loc.parent; const arr = (0, _optionAssertions.assertArray)(loc, value); if (arr) { for (const [index, item] of arr.entries()) { const objLoc = (0, _optionAssertions.access)(loc, index); const env = (0, _optionAssertions.assertObject)(objLoc, item); if (!env) throw new Error(`${(0, _optionAssertions.msg)(objLoc)} must be an object`); const overridesLoc = { type: "overrides", index, parent }; validateNested(overridesLoc, env); } } return arr; } function checkNoUnwrappedItemOptionPairs(items, index, type, e) { if (index === 0) return; const lastItem = items[index - 1]; const thisItem = items[index]; if (lastItem.file && lastItem.options === undefined && typeof thisItem.value === "object") { e.message += `\n- Maybe you meant to use\n` + `"${type}s": [\n ["${lastItem.file.request}", ${JSON.stringify(thisItem.value, undefined, 2)}]\n]\n` + `To be a valid ${type}, its name and options should be wrapped in a pair of brackets`; } } 0 && 0; //# sourceMappingURL=options.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/validation/plugins.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/core/lib/config/validation/plugins.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validatePluginObject = validatePluginObject; var _optionAssertions = __webpack_require__(/*! ./option-assertions.js */ "./node_modules/@babel/core/lib/config/validation/option-assertions.js"); const VALIDATORS = { name: _optionAssertions.assertString, manipulateOptions: _optionAssertions.assertFunction, pre: _optionAssertions.assertFunction, post: _optionAssertions.assertFunction, inherits: _optionAssertions.assertFunction, visitor: assertVisitorMap, parserOverride: _optionAssertions.assertFunction, generatorOverride: _optionAssertions.assertFunction }; function assertVisitorMap(loc, value) { const obj = (0, _optionAssertions.assertObject)(loc, value); if (obj) { Object.keys(obj).forEach(prop => { if (prop !== "_exploded" && prop !== "_verified") { assertVisitorHandler(prop, obj[prop]); } }); if (obj.enter || obj.exit) { throw new Error(`${(0, _optionAssertions.msg)(loc)} cannot contain catch-all "enter" or "exit" handlers. Please target individual nodes.`); } } return obj; } function assertVisitorHandler(key, value) { if (value && typeof value === "object") { Object.keys(value).forEach(handler => { if (handler !== "enter" && handler !== "exit") { throw new Error(`.visitor["${key}"] may only have .enter and/or .exit handlers.`); } }); } else if (typeof value !== "function") { throw new Error(`.visitor["${key}"] must be a function`); } } function validatePluginObject(obj) { const rootPath = { type: "root", source: "plugin" }; Object.keys(obj).forEach(key => { const validator = VALIDATORS[key]; if (validator) { const optLoc = { type: "option", name: key, parent: rootPath }; validator(optLoc, obj[key]); } else { const invalidPluginPropertyError = new Error(`.${key} is not a valid Plugin property`); invalidPluginPropertyError.code = "BABEL_UNKNOWN_PLUGIN_PROPERTY"; throw invalidPluginPropertyError; } }); return obj; } 0 && 0; //# sourceMappingURL=plugins.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/config/validation/removed.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/core/lib/config/validation/removed.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _default = exports["default"] = { auxiliaryComment: { message: "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`" }, blacklist: { message: "Put the specific transforms you want in the `plugins` option" }, breakConfig: { message: "This is not a necessary option in Babel 6" }, experimental: { message: "Put the specific transforms you want in the `plugins` option" }, externalHelpers: { message: "Use the `external-helpers` plugin instead. " + "Check out http://babeljs.io/docs/plugins/external-helpers/" }, extra: { message: "" }, jsxPragma: { message: "use the `pragma` option in the `react-jsx` plugin. " + "Check out http://babeljs.io/docs/plugins/transform-react-jsx/" }, loose: { message: "Specify the `loose` option for the relevant plugin you are using " + "or use a preset that sets the option." }, metadataUsedHelpers: { message: "Not required anymore as this is enabled by default" }, modules: { message: "Use the corresponding module transform plugin in the `plugins` option. " + "Check out http://babeljs.io/docs/plugins/#modules" }, nonStandard: { message: "Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. " + "Also check out the react preset http://babeljs.io/docs/plugins/preset-react/" }, optional: { message: "Put the specific transforms you want in the `plugins` option" }, sourceMapName: { message: "The `sourceMapName` option has been removed because it makes more sense for the " + "tooling that calls Babel to assign `map.file` themselves." }, stage: { message: "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets" }, whitelist: { message: "Put the specific transforms you want in the `plugins` option" }, resolveModuleSource: { version: 6, message: "Use `babel-plugin-module-resolver@3`'s 'resolvePath' options" }, metadata: { version: 6, message: "Generated plugin metadata is always included in the output result" }, sourceMapTarget: { version: 6, message: "The `sourceMapTarget` option has been removed because it makes more sense for the tooling " + "that calls Babel to assign `map.file` themselves." } }; 0 && 0; //# sourceMappingURL=removed.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/errors/config-error.js": /*!*************************************************************!*\ !*** ./node_modules/@babel/core/lib/errors/config-error.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _rewriteStackTrace = __webpack_require__(/*! ./rewrite-stack-trace.js */ "./node_modules/@babel/core/lib/errors/rewrite-stack-trace.js"); class ConfigError extends Error { constructor(message, filename) { super(message); (0, _rewriteStackTrace.expectedError)(this); if (filename) (0, _rewriteStackTrace.injectVirtualStackFrame)(this, filename); } } exports["default"] = ConfigError; 0 && 0; //# sourceMappingURL=config-error.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/errors/rewrite-stack-trace.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/core/lib/errors/rewrite-stack-trace.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.beginHiddenCallStack = beginHiddenCallStack; exports.endHiddenCallStack = endHiddenCallStack; exports.expectedError = expectedError; exports.injectVirtualStackFrame = injectVirtualStackFrame; var _Object$getOwnPropert; const ErrorToString = Function.call.bind(Error.prototype.toString); const SUPPORTED = !!Error.captureStackTrace && ((_Object$getOwnPropert = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit")) == null ? void 0 : _Object$getOwnPropert.writable) === true; const START_HIDING = "startHiding - secret - don't use this - v1"; const STOP_HIDING = "stopHiding - secret - don't use this - v1"; const expectedErrors = new WeakSet(); const virtualFrames = new WeakMap(); function CallSite(filename) { return Object.create({ isNative: () => false, isConstructor: () => false, isToplevel: () => true, getFileName: () => filename, getLineNumber: () => undefined, getColumnNumber: () => undefined, getFunctionName: () => undefined, getMethodName: () => undefined, getTypeName: () => undefined, toString: () => filename }); } function injectVirtualStackFrame(error, filename) { if (!SUPPORTED) return; let frames = virtualFrames.get(error); if (!frames) virtualFrames.set(error, frames = []); frames.push(CallSite(filename)); return error; } function expectedError(error) { if (!SUPPORTED) return; expectedErrors.add(error); return error; } function beginHiddenCallStack(fn) { if (!SUPPORTED) return fn; return Object.defineProperty(function (...args) { setupPrepareStackTrace(); return fn(...args); }, "name", { value: STOP_HIDING }); } function endHiddenCallStack(fn) { if (!SUPPORTED) return fn; return Object.defineProperty(function (...args) { return fn(...args); }, "name", { value: START_HIDING }); } function setupPrepareStackTrace() { setupPrepareStackTrace = () => {}; const { prepareStackTrace = defaultPrepareStackTrace } = Error; const MIN_STACK_TRACE_LIMIT = 50; Error.stackTraceLimit && (Error.stackTraceLimit = Math.max(Error.stackTraceLimit, MIN_STACK_TRACE_LIMIT)); Error.prepareStackTrace = function stackTraceRewriter(err, trace) { let newTrace = []; const isExpected = expectedErrors.has(err); let status = isExpected ? "hiding" : "unknown"; for (let i = 0; i < trace.length; i++) { const name = trace[i].getFunctionName(); if (name === START_HIDING) { status = "hiding"; } else if (name === STOP_HIDING) { if (status === "hiding") { status = "showing"; if (virtualFrames.has(err)) { newTrace.unshift(...virtualFrames.get(err)); } } else if (status === "unknown") { newTrace = trace; break; } } else if (status !== "hiding") { newTrace.push(trace[i]); } } return prepareStackTrace(err, newTrace); }; } function defaultPrepareStackTrace(err, trace) { if (trace.length === 0) return ErrorToString(err); return `${ErrorToString(err)}\n at ${trace.join("\n at ")}`; } 0 && 0; //# sourceMappingURL=rewrite-stack-trace.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/gensync-utils/async.js": /*!*************************************************************!*\ !*** ./node_modules/@babel/core/lib/gensync-utils/async.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.forwardAsync = forwardAsync; exports.isAsync = void 0; exports.isThenable = isThenable; exports.maybeAsync = maybeAsync; exports.waitFor = exports.onFirstPause = void 0; function _gensync() { const data = __webpack_require__(/*! gensync */ "./node_modules/gensync/index.js"); _gensync = function () { return data; }; return data; } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } const runGenerator = _gensync()(function* (item) { return yield* item; }); const isAsync = exports.isAsync = _gensync()({ sync: () => false, errback: cb => cb(null, true) }); function maybeAsync(fn, message) { return _gensync()({ sync(...args) { const result = fn.apply(this, args); if (isThenable(result)) throw new Error(message); return result; }, async(...args) { return Promise.resolve(fn.apply(this, args)); } }); } const withKind = _gensync()({ sync: cb => cb("sync"), async: function () { var _ref = _asyncToGenerator(function* (cb) { return cb("async"); }); return function async(_x) { return _ref.apply(this, arguments); }; }() }); function forwardAsync(action, cb) { const g = _gensync()(action); return withKind(kind => { const adapted = g[kind]; return cb(adapted); }); } const onFirstPause = exports.onFirstPause = _gensync()({ name: "onFirstPause", arity: 2, sync: function (item) { return runGenerator.sync(item); }, errback: function (item, firstPause, cb) { let completed = false; runGenerator.errback(item, (err, value) => { completed = true; cb(err, value); }); if (!completed) { firstPause(); } } }); const waitFor = exports.waitFor = _gensync()({ sync: x => x, async: function () { var _ref2 = _asyncToGenerator(function* (x) { return x; }); return function async(_x2) { return _ref2.apply(this, arguments); }; }() }); function isThenable(val) { return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function"; } 0 && 0; //# sourceMappingURL=async.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/gensync-utils/functional.js": /*!******************************************************************!*\ !*** ./node_modules/@babel/core/lib/gensync-utils/functional.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.once = once; var _async = __webpack_require__(/*! ./async.js */ "./node_modules/@babel/core/lib/gensync-utils/async.js"); function once(fn) { let result; let resultP; let promiseReferenced = false; return function* () { if (!result) { if (resultP) { promiseReferenced = true; return yield* (0, _async.waitFor)(resultP); } if (!(yield* (0, _async.isAsync)())) { try { result = { ok: true, value: yield* fn() }; } catch (error) { result = { ok: false, value: error }; } } else { let resolve, reject; resultP = new Promise((res, rej) => { resolve = res; reject = rej; }); try { result = { ok: true, value: yield* fn() }; resultP = null; if (promiseReferenced) resolve(result.value); } catch (error) { result = { ok: false, value: error }; resultP = null; if (promiseReferenced) reject(error); } } } if (result.ok) return result.value;else throw result.value; }; } 0 && 0; //# sourceMappingURL=functional.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/index.js": /*!***********************************************!*\ !*** ./node_modules/@babel/core/lib/index.js ***! \***********************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DEFAULT_EXTENSIONS = void 0; Object.defineProperty(exports, "File", ({ enumerable: true, get: function () { return _file.default; } })); Object.defineProperty(exports, "buildExternalHelpers", ({ enumerable: true, get: function () { return _buildExternalHelpers.default; } })); Object.defineProperty(exports, "createConfigItem", ({ enumerable: true, get: function () { return _index2.createConfigItem; } })); Object.defineProperty(exports, "createConfigItemAsync", ({ enumerable: true, get: function () { return _index2.createConfigItemAsync; } })); Object.defineProperty(exports, "createConfigItemSync", ({ enumerable: true, get: function () { return _index2.createConfigItemSync; } })); Object.defineProperty(exports, "getEnv", ({ enumerable: true, get: function () { return _environment.getEnv; } })); Object.defineProperty(exports, "loadOptions", ({ enumerable: true, get: function () { return _index2.loadOptions; } })); Object.defineProperty(exports, "loadOptionsAsync", ({ enumerable: true, get: function () { return _index2.loadOptionsAsync; } })); Object.defineProperty(exports, "loadOptionsSync", ({ enumerable: true, get: function () { return _index2.loadOptionsSync; } })); Object.defineProperty(exports, "loadPartialConfig", ({ enumerable: true, get: function () { return _index2.loadPartialConfig; } })); Object.defineProperty(exports, "loadPartialConfigAsync", ({ enumerable: true, get: function () { return _index2.loadPartialConfigAsync; } })); Object.defineProperty(exports, "loadPartialConfigSync", ({ enumerable: true, get: function () { return _index2.loadPartialConfigSync; } })); Object.defineProperty(exports, "parse", ({ enumerable: true, get: function () { return _parse.parse; } })); Object.defineProperty(exports, "parseAsync", ({ enumerable: true, get: function () { return _parse.parseAsync; } })); Object.defineProperty(exports, "parseSync", ({ enumerable: true, get: function () { return _parse.parseSync; } })); exports.resolvePreset = exports.resolvePlugin = void 0; Object.defineProperty((0, exports), "template", { enumerable: true, get: function () { return _template().default; } }); Object.defineProperty((0, exports), "tokTypes", { enumerable: true, get: function () { return _parser().tokTypes; } }); Object.defineProperty(exports, "transform", ({ enumerable: true, get: function () { return _transform.transform; } })); Object.defineProperty(exports, "transformAsync", ({ enumerable: true, get: function () { return _transform.transformAsync; } })); Object.defineProperty(exports, "transformFile", ({ enumerable: true, get: function () { return _transformFile.transformFile; } })); Object.defineProperty(exports, "transformFileAsync", ({ enumerable: true, get: function () { return _transformFile.transformFileAsync; } })); Object.defineProperty(exports, "transformFileSync", ({ enumerable: true, get: function () { return _transformFile.transformFileSync; } })); Object.defineProperty(exports, "transformFromAst", ({ enumerable: true, get: function () { return _transformAst.transformFromAst; } })); Object.defineProperty(exports, "transformFromAstAsync", ({ enumerable: true, get: function () { return _transformAst.transformFromAstAsync; } })); Object.defineProperty(exports, "transformFromAstSync", ({ enumerable: true, get: function () { return _transformAst.transformFromAstSync; } })); Object.defineProperty(exports, "transformSync", ({ enumerable: true, get: function () { return _transform.transformSync; } })); Object.defineProperty((0, exports), "traverse", { enumerable: true, get: function () { return _traverse().default; } }); exports.version = exports.types = void 0; var _file = __webpack_require__(/*! ./transformation/file/file.js */ "./node_modules/@babel/core/lib/transformation/file/file.js"); var _buildExternalHelpers = __webpack_require__(/*! ./tools/build-external-helpers.js */ "./node_modules/@babel/core/lib/tools/build-external-helpers.js"); var resolvers = __webpack_require__(/*! ./config/files/index.js */ "./node_modules/@babel/core/lib/config/files/index-browser.js"); var _environment = __webpack_require__(/*! ./config/helpers/environment.js */ "./node_modules/@babel/core/lib/config/helpers/environment.js"); function _types() { const data = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); _types = function () { return data; }; return data; } Object.defineProperty((0, exports), "types", { enumerable: true, get: function () { return _types(); } }); function _parser() { const data = __webpack_require__(/*! @babel/parser */ "./node_modules/@babel/parser/lib/index.js"); _parser = function () { return data; }; return data; } function _traverse() { const data = __webpack_require__(/*! @babel/traverse */ "./node_modules/@babel/traverse/lib/index.js"); _traverse = function () { return data; }; return data; } function _template() { const data = __webpack_require__(/*! @babel/template */ "./node_modules/@babel/template/lib/index.js"); _template = function () { return data; }; return data; } var _index2 = __webpack_require__(/*! ./config/index.js */ "./node_modules/@babel/core/lib/config/index.js"); var _transform = __webpack_require__(/*! ./transform.js */ "./node_modules/@babel/core/lib/transform.js"); var _transformFile = __webpack_require__(/*! ./transform-file.js */ "./node_modules/@babel/core/lib/transform-file-browser.js"); var _transformAst = __webpack_require__(/*! ./transform-ast.js */ "./node_modules/@babel/core/lib/transform-ast.js"); var _parse = __webpack_require__(/*! ./parse.js */ "./node_modules/@babel/core/lib/parse.js"); ; const version = exports.version = "7.28.3"; const resolvePlugin = (name, dirname) => resolvers.resolvePlugin(name, dirname, false).filepath; exports.resolvePlugin = resolvePlugin; const resolvePreset = (name, dirname) => resolvers.resolvePreset(name, dirname, false).filepath; exports.resolvePreset = resolvePreset; const DEFAULT_EXTENSIONS = exports.DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs", ".cjs"]); { exports.OptionManager = class OptionManager { init(opts) { return (0, _index2.loadOptionsSync)(opts); } }; exports.Plugin = function Plugin(alias) { throw new Error(`The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`); }; } 0 && (0); //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/parse.js": /*!***********************************************!*\ !*** ./node_modules/@babel/core/lib/parse.js ***! \***********************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.parse = void 0; exports.parseAsync = parseAsync; exports.parseSync = parseSync; function _gensync() { const data = __webpack_require__(/*! gensync */ "./node_modules/gensync/index.js"); _gensync = function () { return data; }; return data; } var _index = __webpack_require__(/*! ./config/index.js */ "./node_modules/@babel/core/lib/config/index.js"); var _index2 = __webpack_require__(/*! ./parser/index.js */ "./node_modules/@babel/core/lib/parser/index.js"); var _normalizeOpts = __webpack_require__(/*! ./transformation/normalize-opts.js */ "./node_modules/@babel/core/lib/transformation/normalize-opts.js"); var _rewriteStackTrace = __webpack_require__(/*! ./errors/rewrite-stack-trace.js */ "./node_modules/@babel/core/lib/errors/rewrite-stack-trace.js"); const parseRunner = _gensync()(function* parse(code, opts) { const config = yield* (0, _index.default)(opts); if (config === null) { return null; } return yield* (0, _index2.default)(config.passes, (0, _normalizeOpts.default)(config), code); }); const parse = exports.parse = function parse(code, opts, callback) { if (typeof opts === "function") { callback = opts; opts = undefined; } if (callback === undefined) { { return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.sync)(code, opts); } } (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.errback)(code, opts, callback); }; function parseSync(...args) { return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.sync)(...args); } function parseAsync(...args) { return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.async)(...args); } 0 && 0; //# sourceMappingURL=parse.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/parser/index.js": /*!******************************************************!*\ !*** ./node_modules/@babel/core/lib/parser/index.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = parser; function _parser() { const data = __webpack_require__(/*! @babel/parser */ "./node_modules/@babel/parser/lib/index.js"); _parser = function () { return data; }; return data; } function _codeFrame() { const data = __webpack_require__(/*! @babel/code-frame */ "./node_modules/@babel/code-frame/lib/index.js"); _codeFrame = function () { return data; }; return data; } var _missingPluginHelper = __webpack_require__(/*! ./util/missing-plugin-helper.js */ "./node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js"); function* parser(pluginPasses, { parserOpts, highlightCode = true, filename = "unknown" }, code) { try { const results = []; for (const plugins of pluginPasses) { for (const plugin of plugins) { const { parserOverride } = plugin; if (parserOverride) { const ast = parserOverride(code, parserOpts, _parser().parse); if (ast !== undefined) results.push(ast); } } } if (results.length === 0) { return (0, _parser().parse)(code, parserOpts); } else if (results.length === 1) { yield* []; if (typeof results[0].then === "function") { throw new Error(`You appear to be using an async parser plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`); } return results[0]; } throw new Error("More than one plugin attempted to override parsing."); } catch (err) { if (err.code === "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED") { err.message += "\nConsider renaming the file to '.mjs', or setting sourceType:module " + "or sourceType:unambiguous in your Babel config for this file."; } const { loc, missingPlugin } = err; if (loc) { const codeFrame = (0, _codeFrame().codeFrameColumns)(code, { start: { line: loc.line, column: loc.column + 1 } }, { highlightCode }); if (missingPlugin) { err.message = `${filename}: ` + (0, _missingPluginHelper.default)(missingPlugin[0], loc, codeFrame, filename); } else { err.message = `${filename}: ${err.message}\n\n` + codeFrame; } err.code = "BABEL_PARSE_ERROR"; } throw err; } } 0 && 0; //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js": /*!***************************************************************************!*\ !*** ./node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js ***! \***************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = generateMissingPluginMessage; const pluginNameMap = { asyncDoExpressions: { syntax: { name: "@babel/plugin-syntax-async-do-expressions", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-do-expressions" } }, decimal: { syntax: { name: "@babel/plugin-syntax-decimal", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decimal" } }, decorators: { syntax: { name: "@babel/plugin-syntax-decorators", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decorators" }, transform: { name: "@babel/plugin-proposal-decorators", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-decorators" } }, doExpressions: { syntax: { name: "@babel/plugin-syntax-do-expressions", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-do-expressions" }, transform: { name: "@babel/plugin-proposal-do-expressions", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-do-expressions" } }, exportDefaultFrom: { syntax: { name: "@babel/plugin-syntax-export-default-from", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-default-from" }, transform: { name: "@babel/plugin-proposal-export-default-from", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-export-default-from" } }, flow: { syntax: { name: "@babel/plugin-syntax-flow", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-flow" }, transform: { name: "@babel/preset-flow", url: "https://github.com/babel/babel/tree/main/packages/babel-preset-flow" } }, functionBind: { syntax: { name: "@babel/plugin-syntax-function-bind", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-bind" }, transform: { name: "@babel/plugin-proposal-function-bind", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-bind" } }, functionSent: { syntax: { name: "@babel/plugin-syntax-function-sent", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-sent" }, transform: { name: "@babel/plugin-proposal-function-sent", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-sent" } }, jsx: { syntax: { name: "@babel/plugin-syntax-jsx", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-jsx" }, transform: { name: "@babel/preset-react", url: "https://github.com/babel/babel/tree/main/packages/babel-preset-react" } }, pipelineOperator: { syntax: { name: "@babel/plugin-syntax-pipeline-operator", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-pipeline-operator" }, transform: { name: "@babel/plugin-proposal-pipeline-operator", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-pipeline-operator" } }, recordAndTuple: { syntax: { name: "@babel/plugin-syntax-record-and-tuple", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-record-and-tuple" } }, throwExpressions: { syntax: { name: "@babel/plugin-syntax-throw-expressions", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-throw-expressions" }, transform: { name: "@babel/plugin-proposal-throw-expressions", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-throw-expressions" } }, typescript: { syntax: { name: "@babel/plugin-syntax-typescript", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-typescript" }, transform: { name: "@babel/preset-typescript", url: "https://github.com/babel/babel/tree/main/packages/babel-preset-typescript" } } }; { Object.assign(pluginNameMap, { asyncGenerators: { syntax: { name: "@babel/plugin-syntax-async-generators", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-generators" }, transform: { name: "@babel/plugin-transform-async-generator-functions", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-async-generator-functions" } }, classProperties: { syntax: { name: "@babel/plugin-syntax-class-properties", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties" }, transform: { name: "@babel/plugin-transform-class-properties", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties" } }, classPrivateProperties: { syntax: { name: "@babel/plugin-syntax-class-properties", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties" }, transform: { name: "@babel/plugin-transform-class-properties", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties" } }, classPrivateMethods: { syntax: { name: "@babel/plugin-syntax-class-properties", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties" }, transform: { name: "@babel/plugin-transform-private-methods", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-methods" } }, classStaticBlock: { syntax: { name: "@babel/plugin-syntax-class-static-block", url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-class-static-block" }, transform: { name: "@babel/plugin-transform-class-static-block", url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-class-static-block" } }, dynamicImport: { syntax: { name: "@babel/plugin-syntax-dynamic-import", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-dynamic-import" } }, exportNamespaceFrom: { syntax: { name: "@babel/plugin-syntax-export-namespace-from", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-namespace-from" }, transform: { name: "@babel/plugin-transform-export-namespace-from", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-export-namespace-from" } }, importAssertions: { syntax: { name: "@babel/plugin-syntax-import-assertions", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-assertions" } }, importAttributes: { syntax: { name: "@babel/plugin-syntax-import-attributes", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-attributes" } }, importMeta: { syntax: { name: "@babel/plugin-syntax-import-meta", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-meta" } }, logicalAssignment: { syntax: { name: "@babel/plugin-syntax-logical-assignment-operators", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-logical-assignment-operators" }, transform: { name: "@babel/plugin-transform-logical-assignment-operators", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-logical-assignment-operators" } }, moduleStringNames: { syntax: { name: "@babel/plugin-syntax-module-string-names", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-module-string-names" } }, numericSeparator: { syntax: { name: "@babel/plugin-syntax-numeric-separator", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-numeric-separator" }, transform: { name: "@babel/plugin-transform-numeric-separator", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-numeric-separator" } }, nullishCoalescingOperator: { syntax: { name: "@babel/plugin-syntax-nullish-coalescing-operator", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-nullish-coalescing-operator" }, transform: { name: "@babel/plugin-transform-nullish-coalescing-operator", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-nullish-coalescing-opearator" } }, objectRestSpread: { syntax: { name: "@babel/plugin-syntax-object-rest-spread", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-object-rest-spread" }, transform: { name: "@babel/plugin-transform-object-rest-spread", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-object-rest-spread" } }, optionalCatchBinding: { syntax: { name: "@babel/plugin-syntax-optional-catch-binding", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-catch-binding" }, transform: { name: "@babel/plugin-transform-optional-catch-binding", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-catch-binding" } }, optionalChaining: { syntax: { name: "@babel/plugin-syntax-optional-chaining", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-chaining" }, transform: { name: "@babel/plugin-transform-optional-chaining", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-chaining" } }, privateIn: { syntax: { name: "@babel/plugin-syntax-private-property-in-object", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-private-property-in-object" }, transform: { name: "@babel/plugin-transform-private-property-in-object", url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-property-in-object" } }, regexpUnicodeSets: { syntax: { name: "@babel/plugin-syntax-unicode-sets-regex", url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-syntax-unicode-sets-regex/README.md" }, transform: { name: "@babel/plugin-transform-unicode-sets-regex", url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-proposalunicode-sets-regex/README.md" } } }); } const getNameURLCombination = ({ name, url }) => `${name} (${url})`; function generateMissingPluginMessage(missingPluginName, loc, codeFrame, filename) { let helpMessage = `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` + `(${loc.line}:${loc.column + 1}):\n\n` + codeFrame; const pluginInfo = pluginNameMap[missingPluginName]; if (pluginInfo) { const { syntax: syntaxPlugin, transform: transformPlugin } = pluginInfo; if (syntaxPlugin) { const syntaxPluginInfo = getNameURLCombination(syntaxPlugin); if (transformPlugin) { const transformPluginInfo = getNameURLCombination(transformPlugin); const sectionType = transformPlugin.name.startsWith("@babel/plugin") ? "plugins" : "presets"; helpMessage += `\n\nAdd ${transformPluginInfo} to the '${sectionType}' section of your Babel config to enable transformation. If you want to leave it as-is, add ${syntaxPluginInfo} to the 'plugins' section to enable parsing.`; } else { helpMessage += `\n\nAdd ${syntaxPluginInfo} to the 'plugins' section of your Babel config ` + `to enable parsing.`; } } } const msgFilename = filename === "unknown" ? "" : filename; helpMessage += ` If you already added the plugin for this syntax to your config, it's possible that your config \ isn't being loaded. You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded \ configuration: \tnpx cross-env BABEL_SHOW_CONFIG_FOR=${msgFilename} See https://babeljs.io/docs/configuration#print-effective-configs for more info. `; return helpMessage; } 0 && 0; //# sourceMappingURL=missing-plugin-helper.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/tools/build-external-helpers.js": /*!**********************************************************************!*\ !*** ./node_modules/@babel/core/lib/tools/build-external-helpers.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = _default; function helpers() { const data = __webpack_require__(/*! @babel/helpers */ "./node_modules/@babel/helpers/lib/index.js"); helpers = function () { return data; }; return data; } function _generator() { const data = __webpack_require__(/*! @babel/generator */ "./node_modules/@babel/generator/lib/index.js"); _generator = function () { return data; }; return data; } function _template() { const data = __webpack_require__(/*! @babel/template */ "./node_modules/@babel/template/lib/index.js"); _template = function () { return data; }; return data; } function _t() { const data = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); _t = function () { return data; }; return data; } const { arrayExpression, assignmentExpression, binaryExpression, blockStatement, callExpression, cloneNode, conditionalExpression, exportNamedDeclaration, exportSpecifier, expressionStatement, functionExpression, identifier, memberExpression, objectExpression, program, stringLiteral, unaryExpression, variableDeclaration, variableDeclarator } = _t(); const buildUmdWrapper = replacements => _template().default.statement` (function (root, factory) { if (typeof define === "function" && define.amd) { define(AMD_ARGUMENTS, factory); } else if (typeof exports === "object") { factory(COMMON_ARGUMENTS); } else { factory(BROWSER_ARGUMENTS); } })(UMD_ROOT, function (FACTORY_PARAMETERS) { FACTORY_BODY }); `(replacements); function buildGlobal(allowlist) { const namespace = identifier("babelHelpers"); const body = []; const container = functionExpression(null, [identifier("global")], blockStatement(body)); const tree = program([expressionStatement(callExpression(container, [conditionalExpression(binaryExpression("===", unaryExpression("typeof", identifier("global")), stringLiteral("undefined")), identifier("self"), identifier("global"))]))]); body.push(variableDeclaration("var", [variableDeclarator(namespace, assignmentExpression("=", memberExpression(identifier("global"), namespace), objectExpression([])))])); buildHelpers(body, namespace, allowlist); return tree; } function buildModule(allowlist) { const body = []; const refs = buildHelpers(body, null, allowlist); body.unshift(exportNamedDeclaration(null, Object.keys(refs).map(name => { return exportSpecifier(cloneNode(refs[name]), identifier(name)); }))); return program(body, [], "module"); } function buildUmd(allowlist) { const namespace = identifier("babelHelpers"); const body = []; body.push(variableDeclaration("var", [variableDeclarator(namespace, identifier("global"))])); buildHelpers(body, namespace, allowlist); return program([buildUmdWrapper({ FACTORY_PARAMETERS: identifier("global"), BROWSER_ARGUMENTS: assignmentExpression("=", memberExpression(identifier("root"), namespace), objectExpression([])), COMMON_ARGUMENTS: identifier("exports"), AMD_ARGUMENTS: arrayExpression([stringLiteral("exports")]), FACTORY_BODY: body, UMD_ROOT: identifier("this") })]); } function buildVar(allowlist) { const namespace = identifier("babelHelpers"); const body = []; body.push(variableDeclaration("var", [variableDeclarator(namespace, objectExpression([]))])); const tree = program(body); buildHelpers(body, namespace, allowlist); body.push(expressionStatement(namespace)); return tree; } function buildHelpers(body, namespace, allowlist) { const getHelperReference = name => { return namespace ? memberExpression(namespace, identifier(name)) : identifier(`_${name}`); }; const refs = {}; helpers().list.forEach(function (name) { if (allowlist && !allowlist.includes(name)) return; const ref = refs[name] = getHelperReference(name); const { nodes } = helpers().get(name, getHelperReference, namespace ? null : `_${name}`, [], namespace ? (ast, exportName, mapExportBindingAssignments) => { mapExportBindingAssignments(node => assignmentExpression("=", ref, node)); ast.body.push(expressionStatement(assignmentExpression("=", ref, identifier(exportName)))); } : null); body.push(...nodes); }); return refs; } function _default(allowlist, outputType = "global") { let tree; const build = { global: buildGlobal, module: buildModule, umd: buildUmd, var: buildVar }[outputType]; if (build) { tree = build(allowlist); } else { throw new Error(`Unsupported output type ${outputType}`); } return (0, _generator().default)(tree).code; } 0 && 0; //# sourceMappingURL=build-external-helpers.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/transform-ast.js": /*!*******************************************************!*\ !*** ./node_modules/@babel/core/lib/transform-ast.js ***! \*******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.transformFromAst = void 0; exports.transformFromAstAsync = transformFromAstAsync; exports.transformFromAstSync = transformFromAstSync; function _gensync() { const data = __webpack_require__(/*! gensync */ "./node_modules/gensync/index.js"); _gensync = function () { return data; }; return data; } var _index = __webpack_require__(/*! ./config/index.js */ "./node_modules/@babel/core/lib/config/index.js"); var _index2 = __webpack_require__(/*! ./transformation/index.js */ "./node_modules/@babel/core/lib/transformation/index.js"); var _rewriteStackTrace = __webpack_require__(/*! ./errors/rewrite-stack-trace.js */ "./node_modules/@babel/core/lib/errors/rewrite-stack-trace.js"); const transformFromAstRunner = _gensync()(function* (ast, code, opts) { const config = yield* (0, _index.default)(opts); if (config === null) return null; if (!ast) throw new Error("No AST given"); return yield* (0, _index2.run)(config, code, ast); }); const transformFromAst = exports.transformFromAst = function transformFromAst(ast, code, optsOrCallback, maybeCallback) { let opts; let callback; if (typeof optsOrCallback === "function") { callback = optsOrCallback; opts = undefined; } else { opts = optsOrCallback; callback = maybeCallback; } if (callback === undefined) { { return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(ast, code, opts); } } (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.errback)(ast, code, opts, callback); }; function transformFromAstSync(...args) { return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(...args); } function transformFromAstAsync(...args) { return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.async)(...args); } 0 && 0; //# sourceMappingURL=transform-ast.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/transform-file-browser.js": /*!****************************************************************!*\ !*** ./node_modules/@babel/core/lib/transform-file-browser.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.transformFile = void 0; exports.transformFileAsync = transformFileAsync; exports.transformFileSync = transformFileSync; const transformFile = exports.transformFile = function transformFile(filename, opts, callback) { if (typeof opts === "function") { callback = opts; } callback(new Error("Transforming files is not supported in browsers"), null); }; function transformFileSync() { throw new Error("Transforming files is not supported in browsers"); } function transformFileAsync() { return Promise.reject(new Error("Transforming files is not supported in browsers")); } 0 && 0; //# sourceMappingURL=transform-file-browser.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/transform.js": /*!***************************************************!*\ !*** ./node_modules/@babel/core/lib/transform.js ***! \***************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.transform = void 0; exports.transformAsync = transformAsync; exports.transformSync = transformSync; function _gensync() { const data = __webpack_require__(/*! gensync */ "./node_modules/gensync/index.js"); _gensync = function () { return data; }; return data; } var _index = __webpack_require__(/*! ./config/index.js */ "./node_modules/@babel/core/lib/config/index.js"); var _index2 = __webpack_require__(/*! ./transformation/index.js */ "./node_modules/@babel/core/lib/transformation/index.js"); var _rewriteStackTrace = __webpack_require__(/*! ./errors/rewrite-stack-trace.js */ "./node_modules/@babel/core/lib/errors/rewrite-stack-trace.js"); const transformRunner = _gensync()(function* transform(code, opts) { const config = yield* (0, _index.default)(opts); if (config === null) return null; return yield* (0, _index2.run)(config, code); }); const transform = exports.transform = function transform(code, optsOrCallback, maybeCallback) { let opts; let callback; if (typeof optsOrCallback === "function") { callback = optsOrCallback; opts = undefined; } else { opts = optsOrCallback; callback = maybeCallback; } if (callback === undefined) { { return (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.sync)(code, opts); } } (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.errback)(code, opts, callback); }; function transformSync(...args) { return (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.sync)(...args); } function transformAsync(...args) { return (0, _rewriteStackTrace.beginHiddenCallStack)(transformRunner.async)(...args); } 0 && 0; //# sourceMappingURL=transform.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/transformation/block-hoist-plugin.js": /*!***************************************************************************!*\ !*** ./node_modules/@babel/core/lib/transformation/block-hoist-plugin.js ***! \***************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = loadBlockHoistPlugin; function _traverse() { const data = __webpack_require__(/*! @babel/traverse */ "./node_modules/@babel/traverse/lib/index.js"); _traverse = function () { return data; }; return data; } var _plugin = __webpack_require__(/*! ../config/plugin.js */ "./node_modules/@babel/core/lib/config/plugin.js"); let LOADED_PLUGIN; const blockHoistPlugin = { name: "internal.blockHoist", visitor: { Block: { exit({ node }) { node.body = performHoisting(node.body); } }, SwitchCase: { exit({ node }) { node.consequent = performHoisting(node.consequent); } } } }; function performHoisting(body) { let max = Math.pow(2, 30) - 1; let hasChange = false; for (let i = 0; i < body.length; i++) { const n = body[i]; const p = priority(n); if (p > max) { hasChange = true; break; } max = p; } if (!hasChange) return body; return stableSort(body.slice()); } function loadBlockHoistPlugin() { if (!LOADED_PLUGIN) { LOADED_PLUGIN = new _plugin.default(Object.assign({}, blockHoistPlugin, { visitor: _traverse().default.explode(blockHoistPlugin.visitor) }), {}); } return LOADED_PLUGIN; } function priority(bodyNode) { const priority = bodyNode == null ? void 0 : bodyNode._blockHoist; if (priority == null) return 1; if (priority === true) return 2; return priority; } function stableSort(body) { const buckets = Object.create(null); for (let i = 0; i < body.length; i++) { const n = body[i]; const p = priority(n); const bucket = buckets[p] || (buckets[p] = []); bucket.push(n); } const keys = Object.keys(buckets).map(k => +k).sort((a, b) => b - a); let index = 0; for (const key of keys) { const bucket = buckets[key]; for (const n of bucket) { body[index++] = n; } } return body; } 0 && 0; //# sourceMappingURL=block-hoist-plugin.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs": /*!******************************************************************************!*\ !*** ./node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs ***! \******************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { { exports.getModuleName = () => (__webpack_require__(/*! @babel/helper-module-transforms */ "./node_modules/@babel/helper-module-transforms/lib/index.js").getModuleName); } 0 && 0; //# sourceMappingURL=babel-7-helpers.cjs.map /***/ }), /***/ "./node_modules/@babel/core/lib/transformation/file/file.js": /*!******************************************************************!*\ !*** ./node_modules/@babel/core/lib/transformation/file/file.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; function helpers() { const data = __webpack_require__(/*! @babel/helpers */ "./node_modules/@babel/helpers/lib/index.js"); helpers = function () { return data; }; return data; } function _traverse() { const data = __webpack_require__(/*! @babel/traverse */ "./node_modules/@babel/traverse/lib/index.js"); _traverse = function () { return data; }; return data; } function _codeFrame() { const data = __webpack_require__(/*! @babel/code-frame */ "./node_modules/@babel/code-frame/lib/index.js"); _codeFrame = function () { return data; }; return data; } function _t() { const data = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); _t = function () { return data; }; return data; } function _semver() { const data = __webpack_require__(/*! semver */ "./node_modules/semver/semver.js"); _semver = function () { return data; }; return data; } var _babel7Helpers = __webpack_require__(/*! ./babel-7-helpers.cjs */ "./node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs"); const { cloneNode, interpreterDirective } = _t(); const errorVisitor = { enter(path, state) { const loc = path.node.loc; if (loc) { state.loc = loc; path.stop(); } } }; class File { constructor(options, { code, ast, inputMap }) { this._map = new Map(); this.opts = void 0; this.declarations = {}; this.path = void 0; this.ast = void 0; this.scope = void 0; this.metadata = {}; this.code = ""; this.inputMap = void 0; this.hub = { file: this, getCode: () => this.code, getScope: () => this.scope, addHelper: this.addHelper.bind(this), buildError: this.buildCodeFrameError.bind(this) }; this.opts = options; this.code = code; this.ast = ast; this.inputMap = inputMap; this.path = _traverse().NodePath.get({ hub: this.hub, parentPath: null, parent: this.ast, container: this.ast, key: "program" }).setContext(); this.scope = this.path.scope; } get shebang() { const { interpreter } = this.path.node; return interpreter ? interpreter.value : ""; } set shebang(value) { if (value) { this.path.get("interpreter").replaceWith(interpreterDirective(value)); } else { this.path.get("interpreter").remove(); } } set(key, val) { { if (key === "helpersNamespace") { throw new Error("Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility." + "If you are using @babel/plugin-external-helpers you will need to use a newer " + "version than the one you currently have installed. " + "If you have your own implementation, you'll want to explore using 'helperGenerator' " + "alongside 'file.availableHelper()'."); } } this._map.set(key, val); } get(key) { return this._map.get(key); } has(key) { return this._map.has(key); } availableHelper(name, versionRange) { if (helpers().isInternal(name)) return false; let minVersion; try { minVersion = helpers().minVersion(name); } catch (err) { if (err.code !== "BABEL_HELPER_UNKNOWN") throw err; return false; } if (typeof versionRange !== "string") return true; if (_semver().valid(versionRange)) versionRange = `^${versionRange}`; { return !_semver().intersects(`<${minVersion}`, versionRange) && !_semver().intersects(`>=8.0.0`, versionRange); } } addHelper(name) { if (helpers().isInternal(name)) { throw new Error("Cannot use internal helper " + name); } return this._addHelper(name); } _addHelper(name) { const declar = this.declarations[name]; if (declar) return cloneNode(declar); const generator = this.get("helperGenerator"); if (generator) { const res = generator(name); if (res) return res; } helpers().minVersion(name); const uid = this.declarations[name] = this.scope.generateUidIdentifier(name); const dependencies = {}; for (const dep of helpers().getDependencies(name)) { dependencies[dep] = this._addHelper(dep); } const { nodes, globals } = helpers().get(name, dep => dependencies[dep], uid.name, Object.keys(this.scope.getAllBindings())); globals.forEach(name => { if (this.path.scope.hasBinding(name, true)) { this.path.scope.rename(name); } }); nodes.forEach(node => { node._compact = true; }); const added = this.path.unshiftContainer("body", nodes); for (const path of added) { if (path.isVariableDeclaration()) this.scope.registerDeclaration(path); } return uid; } buildCodeFrameError(node, msg, _Error = SyntaxError) { let loc = node == null ? void 0 : node.loc; if (!loc && node) { const state = { loc: null }; (0, _traverse().default)(node, errorVisitor, this.scope, state); loc = state.loc; let txt = "This is an error on an internal node. Probably an internal error."; if (loc) txt += " Location has been estimated."; msg += ` (${txt})`; } if (loc) { const { highlightCode = true } = this.opts; msg += "\n" + (0, _codeFrame().codeFrameColumns)(this.code, { start: { line: loc.start.line, column: loc.start.column + 1 }, end: loc.end && loc.start.line === loc.end.line ? { line: loc.end.line, column: loc.end.column + 1 } : undefined }, { highlightCode }); } return new _Error(msg); } } exports["default"] = File; { File.prototype.addImport = function addImport() { throw new Error("This API has been removed. If you're looking for this " + "functionality in Babel 7, you should import the " + "'@babel/helper-module-imports' module and use the functions exposed " + " from that module, such as 'addNamed' or 'addDefault'."); }; File.prototype.addTemplateObject = function addTemplateObject() { throw new Error("This function has been moved into the template literal transform itself."); }; { File.prototype.getModuleName = function getModuleName() { return _babel7Helpers.getModuleName()(this.opts, this.opts); }; } } 0 && 0; //# sourceMappingURL=file.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/transformation/file/generate.js": /*!**********************************************************************!*\ !*** ./node_modules/@babel/core/lib/transformation/file/generate.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = generateCode; function _convertSourceMap() { const data = __webpack_require__(/*! convert-source-map */ "./node_modules/convert-source-map/index.js"); _convertSourceMap = function () { return data; }; return data; } function _generator() { const data = __webpack_require__(/*! @babel/generator */ "./node_modules/@babel/generator/lib/index.js"); _generator = function () { return data; }; return data; } var _mergeMap = __webpack_require__(/*! ./merge-map.js */ "./node_modules/@babel/core/lib/transformation/file/merge-map.js"); function generateCode(pluginPasses, file) { const { opts, ast, code, inputMap } = file; const { generatorOpts } = opts; generatorOpts.inputSourceMap = inputMap == null ? void 0 : inputMap.toObject(); const results = []; for (const plugins of pluginPasses) { for (const plugin of plugins) { const { generatorOverride } = plugin; if (generatorOverride) { const result = generatorOverride(ast, generatorOpts, code, _generator().default); if (result !== undefined) results.push(result); } } } let result; if (results.length === 0) { result = (0, _generator().default)(ast, generatorOpts, code); } else if (results.length === 1) { result = results[0]; if (typeof result.then === "function") { throw new Error(`You appear to be using an async codegen plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version.`); } } else { throw new Error("More than one plugin attempted to override codegen."); } let { code: outputCode, decodedMap: outputMap = result.map } = result; if (result.__mergedMap) { outputMap = Object.assign({}, result.map); } else { if (outputMap) { if (inputMap) { outputMap = (0, _mergeMap.default)(inputMap.toObject(), outputMap, generatorOpts.sourceFileName); } else { outputMap = result.map; } } } if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") { outputCode += "\n" + _convertSourceMap().fromObject(outputMap).toComment(); } if (opts.sourceMaps === "inline") { outputMap = null; } return { outputCode, outputMap }; } 0 && 0; //# sourceMappingURL=generate.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/transformation/file/merge-map.js": /*!***********************************************************************!*\ !*** ./node_modules/@babel/core/lib/transformation/file/merge-map.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = mergeSourceMap; function _remapping() { const data = __webpack_require__(/*! @ampproject/remapping */ "./node_modules/@ampproject/remapping/dist/remapping.umd.js"); _remapping = function () { return data; }; return data; } function mergeSourceMap(inputMap, map, sourceFileName) { const source = sourceFileName.replace(/\\/g, "/"); let found = false; const result = _remapping()(rootless(map), (s, ctx) => { if (s === source && !found) { found = true; ctx.source = ""; return rootless(inputMap); } return null; }); if (typeof inputMap.sourceRoot === "string") { result.sourceRoot = inputMap.sourceRoot; } return Object.assign({}, result); } function rootless(map) { return Object.assign({}, map, { sourceRoot: null }); } 0 && 0; //# sourceMappingURL=merge-map.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/transformation/index.js": /*!**************************************************************!*\ !*** ./node_modules/@babel/core/lib/transformation/index.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.run = run; function _traverse() { const data = __webpack_require__(/*! @babel/traverse */ "./node_modules/@babel/traverse/lib/index.js"); _traverse = function () { return data; }; return data; } var _pluginPass = __webpack_require__(/*! ./plugin-pass.js */ "./node_modules/@babel/core/lib/transformation/plugin-pass.js"); var _blockHoistPlugin = __webpack_require__(/*! ./block-hoist-plugin.js */ "./node_modules/@babel/core/lib/transformation/block-hoist-plugin.js"); var _normalizeOpts = __webpack_require__(/*! ./normalize-opts.js */ "./node_modules/@babel/core/lib/transformation/normalize-opts.js"); var _normalizeFile = __webpack_require__(/*! ./normalize-file.js */ "./node_modules/@babel/core/lib/transformation/normalize-file.js"); var _generate = __webpack_require__(/*! ./file/generate.js */ "./node_modules/@babel/core/lib/transformation/file/generate.js"); var _deepArray = __webpack_require__(/*! ../config/helpers/deep-array.js */ "./node_modules/@babel/core/lib/config/helpers/deep-array.js"); var _async = __webpack_require__(/*! ../gensync-utils/async.js */ "./node_modules/@babel/core/lib/gensync-utils/async.js"); function* run(config, code, ast) { const file = yield* (0, _normalizeFile.default)(config.passes, (0, _normalizeOpts.default)(config), code, ast); const opts = file.opts; try { yield* transformFile(file, config.passes); } catch (e) { var _opts$filename; e.message = `${(_opts$filename = opts.filename) != null ? _opts$filename : "unknown file"}: ${e.message}`; if (!e.code) { e.code = "BABEL_TRANSFORM_ERROR"; } throw e; } let outputCode, outputMap; try { if (opts.code !== false) { ({ outputCode, outputMap } = (0, _generate.default)(config.passes, file)); } } catch (e) { var _opts$filename2; e.message = `${(_opts$filename2 = opts.filename) != null ? _opts$filename2 : "unknown file"}: ${e.message}`; if (!e.code) { e.code = "BABEL_GENERATE_ERROR"; } throw e; } return { metadata: file.metadata, options: opts, ast: opts.ast === true ? file.ast : null, code: outputCode === undefined ? null : outputCode, map: outputMap === undefined ? null : outputMap, sourceType: file.ast.program.sourceType, externalDependencies: (0, _deepArray.flattenToSet)(config.externalDependencies) }; } function* transformFile(file, pluginPasses) { const async = yield* (0, _async.isAsync)(); for (const pluginPairs of pluginPasses) { const passPairs = []; const passes = []; const visitors = []; for (const plugin of pluginPairs.concat([(0, _blockHoistPlugin.default)()])) { const pass = new _pluginPass.default(file, plugin.key, plugin.options, async); passPairs.push([plugin, pass]); passes.push(pass); visitors.push(plugin.visitor); } for (const [plugin, pass] of passPairs) { if (plugin.pre) { const fn = (0, _async.maybeAsync)(plugin.pre, `You appear to be using an async plugin/preset, but Babel has been called synchronously`); yield* fn.call(pass, file); } } const visitor = _traverse().default.visitors.merge(visitors, passes, file.opts.wrapPluginVisitorMethod); { (0, _traverse().default)(file.ast, visitor, file.scope); } for (const [plugin, pass] of passPairs) { if (plugin.post) { const fn = (0, _async.maybeAsync)(plugin.post, `You appear to be using an async plugin/preset, but Babel has been called synchronously`); yield* fn.call(pass, file); } } } } 0 && 0; //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/transformation/normalize-file.js": /*!***********************************************************************!*\ !*** ./node_modules/@babel/core/lib/transformation/normalize-file.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = normalizeFile; function _fs() { const data = __webpack_require__(/*! fs */ "?748e"); _fs = function () { return data; }; return data; } function _path() { const data = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js"); _path = function () { return data; }; return data; } function _debug() { const data = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js"); _debug = function () { return data; }; return data; } function _t() { const data = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); _t = function () { return data; }; return data; } function _convertSourceMap() { const data = __webpack_require__(/*! convert-source-map */ "./node_modules/convert-source-map/index.js"); _convertSourceMap = function () { return data; }; return data; } var _file = __webpack_require__(/*! ./file/file.js */ "./node_modules/@babel/core/lib/transformation/file/file.js"); var _index = __webpack_require__(/*! ../parser/index.js */ "./node_modules/@babel/core/lib/parser/index.js"); var _cloneDeep = __webpack_require__(/*! ./util/clone-deep.js */ "./node_modules/@babel/core/lib/transformation/util/clone-deep.js"); const { file, traverseFast } = _t(); const debug = _debug()("babel:transform:file"); const INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,.*$/; const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/; function* normalizeFile(pluginPasses, options, code, ast) { code = `${code || ""}`; if (ast) { if (ast.type === "Program") { ast = file(ast, [], []); } else if (ast.type !== "File") { throw new Error("AST root must be a Program or File node"); } if (options.cloneInputAst) { ast = (0, _cloneDeep.default)(ast); } } else { ast = yield* (0, _index.default)(pluginPasses, options, code); } let inputMap = null; if (options.inputSourceMap !== false) { if (typeof options.inputSourceMap === "object") { inputMap = _convertSourceMap().fromObject(options.inputSourceMap); } if (!inputMap) { const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast); if (lastComment) { try { inputMap = _convertSourceMap().fromComment("//" + lastComment); } catch (err) { { debug("discarding unknown inline input sourcemap"); } } } } if (!inputMap) { const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast); if (typeof options.filename === "string" && lastComment) { try { const match = EXTERNAL_SOURCEMAP_REGEX.exec(lastComment); const inputMapContent = _fs().readFileSync(_path().resolve(_path().dirname(options.filename), match[1]), "utf8"); inputMap = _convertSourceMap().fromJSON(inputMapContent); } catch (err) { debug("discarding unknown file input sourcemap", err); } } else if (lastComment) { debug("discarding un-loadable file input sourcemap"); } } } return new _file.default(options, { code, ast: ast, inputMap }); } function extractCommentsFromList(regex, comments, lastComment) { if (comments) { comments = comments.filter(({ value }) => { if (regex.test(value)) { lastComment = value; return false; } return true; }); } return [comments, lastComment]; } function extractComments(regex, ast) { let lastComment = null; traverseFast(ast, node => { [node.leadingComments, lastComment] = extractCommentsFromList(regex, node.leadingComments, lastComment); [node.innerComments, lastComment] = extractCommentsFromList(regex, node.innerComments, lastComment); [node.trailingComments, lastComment] = extractCommentsFromList(regex, node.trailingComments, lastComment); }); return lastComment; } 0 && 0; //# sourceMappingURL=normalize-file.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/transformation/normalize-opts.js": /*!***********************************************************************!*\ !*** ./node_modules/@babel/core/lib/transformation/normalize-opts.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = normalizeOptions; function _path() { const data = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js"); _path = function () { return data; }; return data; } function normalizeOptions(config) { const { filename, cwd, filenameRelative = typeof filename === "string" ? _path().relative(cwd, filename) : "unknown", sourceType = "module", inputSourceMap, sourceMaps = !!inputSourceMap, sourceRoot = config.options.moduleRoot, sourceFileName = _path().basename(filenameRelative), comments = true, compact = "auto" } = config.options; const opts = config.options; const options = Object.assign({}, opts, { parserOpts: Object.assign({ sourceType: _path().extname(filenameRelative) === ".mjs" ? "module" : sourceType, sourceFileName: filename, plugins: [] }, opts.parserOpts), generatorOpts: Object.assign({ filename, auxiliaryCommentBefore: opts.auxiliaryCommentBefore, auxiliaryCommentAfter: opts.auxiliaryCommentAfter, retainLines: opts.retainLines, comments, shouldPrintComment: opts.shouldPrintComment, compact, minified: opts.minified, sourceMaps, sourceRoot, sourceFileName }, opts.generatorOpts) }); for (const plugins of config.passes) { for (const plugin of plugins) { if (plugin.manipulateOptions) { plugin.manipulateOptions(options, options.parserOpts); } } } return options; } 0 && 0; //# sourceMappingURL=normalize-opts.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/transformation/plugin-pass.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/core/lib/transformation/plugin-pass.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; class PluginPass { constructor(file, key, options, isAsync) { this._map = new Map(); this.key = void 0; this.file = void 0; this.opts = void 0; this.cwd = void 0; this.filename = void 0; this.isAsync = void 0; this.key = key; this.file = file; this.opts = options || {}; this.cwd = file.opts.cwd; this.filename = file.opts.filename; this.isAsync = isAsync; } set(key, val) { this._map.set(key, val); } get(key) { return this._map.get(key); } availableHelper(name, versionRange) { return this.file.availableHelper(name, versionRange); } addHelper(name) { return this.file.addHelper(name); } buildCodeFrameError(node, msg, _Error) { return this.file.buildCodeFrameError(node, msg, _Error); } } exports["default"] = PluginPass; { PluginPass.prototype.getModuleName = function getModuleName() { return this.file.getModuleName(); }; PluginPass.prototype.addImport = function addImport() { this.file.addImport(); }; } 0 && 0; //# sourceMappingURL=plugin-pass.js.map /***/ }), /***/ "./node_modules/@babel/core/lib/transformation/util/clone-deep.js": /*!************************************************************************!*\ !*** ./node_modules/@babel/core/lib/transformation/util/clone-deep.js ***! \************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = _default; const circleSet = new Set(); let depth = 0; function deepClone(value, cache, allowCircle) { if (value !== null) { if (allowCircle) { if (cache.has(value)) return cache.get(value); } else if (++depth > 250) { if (circleSet.has(value)) { depth = 0; circleSet.clear(); throw new Error("Babel-deepClone: Cycles are not allowed in AST"); } circleSet.add(value); } let cloned; if (Array.isArray(value)) { cloned = new Array(value.length); if (allowCircle) cache.set(value, cloned); for (let i = 0; i < value.length; i++) { cloned[i] = typeof value[i] !== "object" ? value[i] : deepClone(value[i], cache, allowCircle); } } else { cloned = {}; if (allowCircle) cache.set(value, cloned); const keys = Object.keys(value); for (let i = 0; i < keys.length; i++) { const key = keys[i]; cloned[key] = typeof value[key] !== "object" ? value[key] : deepClone(value[key], cache, allowCircle || key === "leadingComments" || key === "innerComments" || key === "trailingComments" || key === "extra"); } } if (!allowCircle) { if (depth-- > 250) circleSet.delete(value); } return cloned; } return value; } function _default(value) { if (typeof value !== "object") return value; { try { return deepClone(value, new Map(), true); } catch (_) { return structuredClone(value); } } } 0 && 0; //# sourceMappingURL=clone-deep.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/buffer.js": /*!*****************************************************!*\ !*** ./node_modules/@babel/generator/lib/buffer.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; class Buffer { constructor(map, indentChar) { this._map = null; this._buf = ""; this._str = ""; this._appendCount = 0; this._last = 0; this._queue = []; this._queueCursor = 0; this._canMarkIdName = true; this._indentChar = ""; this._fastIndentations = []; this._position = { line: 1, column: 0 }; this._sourcePosition = { identifierName: undefined, identifierNamePos: undefined, line: undefined, column: undefined, filename: undefined }; this._map = map; this._indentChar = indentChar; for (let i = 0; i < 64; i++) { this._fastIndentations.push(indentChar.repeat(i)); } this._allocQueue(); } _allocQueue() { const queue = this._queue; for (let i = 0; i < 16; i++) { queue.push({ char: 0, repeat: 1, line: undefined, column: undefined, identifierName: undefined, identifierNamePos: undefined, filename: "" }); } } _pushQueue(char, repeat, line, column, filename) { const cursor = this._queueCursor; if (cursor === this._queue.length) { this._allocQueue(); } const item = this._queue[cursor]; item.char = char; item.repeat = repeat; item.line = line; item.column = column; item.filename = filename; this._queueCursor++; } _popQueue() { if (this._queueCursor === 0) { throw new Error("Cannot pop from empty queue"); } return this._queue[--this._queueCursor]; } get() { this._flush(); const map = this._map; const result = { code: (this._buf + this._str).trimRight(), decodedMap: map == null ? void 0 : map.getDecoded(), get __mergedMap() { return this.map; }, get map() { const resultMap = map ? map.get() : null; result.map = resultMap; return resultMap; }, set map(value) { Object.defineProperty(result, "map", { value, writable: true }); }, get rawMappings() { const mappings = map == null ? void 0 : map.getRawMappings(); result.rawMappings = mappings; return mappings; }, set rawMappings(value) { Object.defineProperty(result, "rawMappings", { value, writable: true }); } }; return result; } append(str, maybeNewline) { this._flush(); this._append(str, this._sourcePosition, maybeNewline); } appendChar(char) { this._flush(); this._appendChar(char, 1, this._sourcePosition); } queue(char) { if (char === 10) { while (this._queueCursor !== 0) { const char = this._queue[this._queueCursor - 1].char; if (char !== 32 && char !== 9) { break; } this._queueCursor--; } } const sourcePosition = this._sourcePosition; this._pushQueue(char, 1, sourcePosition.line, sourcePosition.column, sourcePosition.filename); } queueIndentation(repeat) { if (repeat === 0) return; this._pushQueue(-1, repeat, undefined, undefined, undefined); } _flush() { const queueCursor = this._queueCursor; const queue = this._queue; for (let i = 0; i < queueCursor; i++) { const item = queue[i]; this._appendChar(item.char, item.repeat, item); } this._queueCursor = 0; } _appendChar(char, repeat, sourcePos) { this._last = char; if (char === -1) { const fastIndentation = this._fastIndentations[repeat]; if (fastIndentation !== undefined) { this._str += fastIndentation; } else { this._str += repeat > 1 ? this._indentChar.repeat(repeat) : this._indentChar; } } else { this._str += repeat > 1 ? String.fromCharCode(char).repeat(repeat) : String.fromCharCode(char); } if (char !== 10) { this._mark(sourcePos.line, sourcePos.column, sourcePos.identifierName, sourcePos.identifierNamePos, sourcePos.filename); this._position.column += repeat; } else { this._position.line++; this._position.column = 0; } if (this._canMarkIdName) { sourcePos.identifierName = undefined; sourcePos.identifierNamePos = undefined; } } _append(str, sourcePos, maybeNewline) { const len = str.length; const position = this._position; this._last = str.charCodeAt(len - 1); if (++this._appendCount > 4096) { +this._str; this._buf += this._str; this._str = str; this._appendCount = 0; } else { this._str += str; } if (!maybeNewline && !this._map) { position.column += len; return; } const { column, identifierName, identifierNamePos, filename } = sourcePos; let line = sourcePos.line; if ((identifierName != null || identifierNamePos != null) && this._canMarkIdName) { sourcePos.identifierName = undefined; sourcePos.identifierNamePos = undefined; } let i = str.indexOf("\n"); let last = 0; if (i !== 0) { this._mark(line, column, identifierName, identifierNamePos, filename); } while (i !== -1) { position.line++; position.column = 0; last = i + 1; if (last < len && line !== undefined) { this._mark(++line, 0, null, null, filename); } i = str.indexOf("\n", last); } position.column += len - last; } _mark(line, column, identifierName, identifierNamePos, filename) { var _this$_map; (_this$_map = this._map) == null || _this$_map.mark(this._position, line, column, identifierName, identifierNamePos, filename); } removeTrailingNewline() { const queueCursor = this._queueCursor; if (queueCursor !== 0 && this._queue[queueCursor - 1].char === 10) { this._queueCursor--; } } removeLastSemicolon() { const queueCursor = this._queueCursor; if (queueCursor !== 0 && this._queue[queueCursor - 1].char === 59) { this._queueCursor--; } } getLastChar() { const queueCursor = this._queueCursor; return queueCursor !== 0 ? this._queue[queueCursor - 1].char : this._last; } getNewlineCount() { const queueCursor = this._queueCursor; let count = 0; if (queueCursor === 0) return this._last === 10 ? 1 : 0; for (let i = queueCursor - 1; i >= 0; i--) { if (this._queue[i].char !== 10) { break; } count++; } return count === queueCursor && this._last === 10 ? count + 1 : count; } endsWithCharAndNewline() { const queue = this._queue; const queueCursor = this._queueCursor; if (queueCursor !== 0) { const lastCp = queue[queueCursor - 1].char; if (lastCp !== 10) return; if (queueCursor > 1) { return queue[queueCursor - 2].char; } else { return this._last; } } } hasContent() { return this._queueCursor !== 0 || !!this._last; } exactSource(loc, cb) { if (!this._map) { cb(); return; } this.source("start", loc); const identifierName = loc.identifierName; const sourcePos = this._sourcePosition; if (identifierName) { this._canMarkIdName = false; sourcePos.identifierName = identifierName; } cb(); if (identifierName) { this._canMarkIdName = true; sourcePos.identifierName = undefined; sourcePos.identifierNamePos = undefined; } this.source("end", loc); } source(prop, loc) { if (!this._map) return; this._normalizePosition(prop, loc, 0); } sourceWithOffset(prop, loc, columnOffset) { if (!this._map) return; this._normalizePosition(prop, loc, columnOffset); } _normalizePosition(prop, loc, columnOffset) { const pos = loc[prop]; const target = this._sourcePosition; if (pos) { target.line = pos.line; target.column = Math.max(pos.column + columnOffset, 0); target.filename = loc.filename; } } getCurrentColumn() { const queue = this._queue; const queueCursor = this._queueCursor; let lastIndex = -1; let len = 0; for (let i = 0; i < queueCursor; i++) { const item = queue[i]; if (item.char === 10) { lastIndex = len; } len += item.repeat; } return lastIndex === -1 ? this._position.column + len : len - 1 - lastIndex; } getCurrentLine() { let count = 0; const queue = this._queue; for (let i = 0; i < this._queueCursor; i++) { if (queue[i].char === 10) { count++; } } return this._position.line + count; } } exports["default"] = Buffer; //# sourceMappingURL=buffer.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/generators/base.js": /*!**************************************************************!*\ !*** ./node_modules/@babel/generator/lib/generators/base.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BlockStatement = BlockStatement; exports.Directive = Directive; exports.DirectiveLiteral = DirectiveLiteral; exports.File = File; exports.InterpreterDirective = InterpreterDirective; exports.Placeholder = Placeholder; exports.Program = Program; function File(node) { if (node.program) { this.print(node.program.interpreter); } this.print(node.program); } function Program(node) { var _node$directives; this.noIndentInnerCommentsHere(); this.printInnerComments(); const directivesLen = (_node$directives = node.directives) == null ? void 0 : _node$directives.length; if (directivesLen) { var _node$directives$trai; const newline = node.body.length ? 2 : 1; this.printSequence(node.directives, undefined, newline); if (!((_node$directives$trai = node.directives[directivesLen - 1].trailingComments) != null && _node$directives$trai.length)) { this.newline(newline); } } this.printSequence(node.body); } function BlockStatement(node) { var _node$directives2; this.tokenChar(123); const exit = this.enterDelimited(); const directivesLen = (_node$directives2 = node.directives) == null ? void 0 : _node$directives2.length; if (directivesLen) { var _node$directives$trai2; const newline = node.body.length ? 2 : 1; this.printSequence(node.directives, true, newline); if (!((_node$directives$trai2 = node.directives[directivesLen - 1].trailingComments) != null && _node$directives$trai2.length)) { this.newline(newline); } } this.printSequence(node.body, true); exit(); this.rightBrace(node); } function Directive(node) { this.print(node.value); this.semicolon(); } const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/; const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/; function DirectiveLiteral(node) { const raw = this.getPossibleRaw(node); if (!this.format.minified && raw !== undefined) { this.token(raw); return; } const { value } = node; if (!unescapedDoubleQuoteRE.test(value)) { this.token(`"${value}"`); } else if (!unescapedSingleQuoteRE.test(value)) { this.token(`'${value}'`); } else { throw new Error("Malformed AST: it is not possible to print a directive containing" + " both unescaped single and double quotes."); } } function InterpreterDirective(node) { this.token(`#!${node.value}`); this.newline(1, true); } function Placeholder(node) { this.token("%%"); this.print(node.name); this.token("%%"); if (node.expectedNode === "Statement") { this.semicolon(); } } //# sourceMappingURL=base.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/generators/classes.js": /*!*****************************************************************!*\ !*** ./node_modules/@babel/generator/lib/generators/classes.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ClassAccessorProperty = ClassAccessorProperty; exports.ClassBody = ClassBody; exports.ClassExpression = exports.ClassDeclaration = ClassDeclaration; exports.ClassMethod = ClassMethod; exports.ClassPrivateMethod = ClassPrivateMethod; exports.ClassPrivateProperty = ClassPrivateProperty; exports.ClassProperty = ClassProperty; exports.StaticBlock = StaticBlock; exports._classMethodHead = _classMethodHead; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { isExportDefaultDeclaration, isExportNamedDeclaration } = _t; function ClassDeclaration(node, parent) { const inExport = isExportDefaultDeclaration(parent) || isExportNamedDeclaration(parent); if (!inExport || !this._shouldPrintDecoratorsBeforeExport(parent)) { this.printJoin(node.decorators); } if (node.declare) { this.word("declare"); this.space(); } if (node.abstract) { this.word("abstract"); this.space(); } this.word("class"); if (node.id) { this.space(); this.print(node.id); } this.print(node.typeParameters); if (node.superClass) { this.space(); this.word("extends"); this.space(); this.print(node.superClass); this.print(node.superTypeParameters); } if (node.implements) { this.space(); this.word("implements"); this.space(); this.printList(node.implements); } this.space(); this.print(node.body); } function ClassBody(node) { this.tokenChar(123); if (node.body.length === 0) { this.tokenChar(125); } else { this.newline(); const separator = classBodyEmptySemicolonsPrinter(this, node); separator == null || separator(-1); const exit = this.enterDelimited(); this.printJoin(node.body, true, true, separator, true); exit(); if (!this.endsWith(10)) this.newline(); this.rightBrace(node); } } function classBodyEmptySemicolonsPrinter(printer, node) { if (!printer.tokenMap || node.start == null || node.end == null) { return null; } const indexes = printer.tokenMap.getIndexes(node); if (!indexes) return null; let k = 1; let occurrenceCount = 0; let nextLocIndex = 0; const advanceNextLocIndex = () => { while (nextLocIndex < node.body.length && node.body[nextLocIndex].start == null) { nextLocIndex++; } }; advanceNextLocIndex(); return i => { if (nextLocIndex <= i) { nextLocIndex = i + 1; advanceNextLocIndex(); } const end = nextLocIndex === node.body.length ? node.end : node.body[nextLocIndex].start; let tok; while (k < indexes.length && printer.tokenMap.matchesOriginal(tok = printer._tokens[indexes[k]], ";") && tok.start < end) { printer.token(";", undefined, occurrenceCount++); k++; } }; } function ClassProperty(node) { this.printJoin(node.decorators); if (!node.static && !this.format.preserveFormat) { var _node$key$loc; const endLine = (_node$key$loc = node.key.loc) == null || (_node$key$loc = _node$key$loc.end) == null ? void 0 : _node$key$loc.line; if (endLine) this.catchUp(endLine); } this.tsPrintClassMemberModifiers(node); if (node.computed) { this.tokenChar(91); this.print(node.key); this.tokenChar(93); } else { this._variance(node); this.print(node.key); } if (node.optional) { this.tokenChar(63); } if (node.definite) { this.tokenChar(33); } this.print(node.typeAnnotation); if (node.value) { this.space(); this.tokenChar(61); this.space(); this.print(node.value); } this.semicolon(); } function ClassAccessorProperty(node) { var _node$key$loc2; this.printJoin(node.decorators); const endLine = (_node$key$loc2 = node.key.loc) == null || (_node$key$loc2 = _node$key$loc2.end) == null ? void 0 : _node$key$loc2.line; if (endLine) this.catchUp(endLine); this.tsPrintClassMemberModifiers(node); this.word("accessor", true); this.space(); if (node.computed) { this.tokenChar(91); this.print(node.key); this.tokenChar(93); } else { this._variance(node); this.print(node.key); } if (node.optional) { this.tokenChar(63); } if (node.definite) { this.tokenChar(33); } this.print(node.typeAnnotation); if (node.value) { this.space(); this.tokenChar(61); this.space(); this.print(node.value); } this.semicolon(); } function ClassPrivateProperty(node) { this.printJoin(node.decorators); this.tsPrintClassMemberModifiers(node); this.print(node.key); if (node.optional) { this.tokenChar(63); } if (node.definite) { this.tokenChar(33); } this.print(node.typeAnnotation); if (node.value) { this.space(); this.tokenChar(61); this.space(); this.print(node.value); } this.semicolon(); } function ClassMethod(node) { this._classMethodHead(node); this.space(); this.print(node.body); } function ClassPrivateMethod(node) { this._classMethodHead(node); this.space(); this.print(node.body); } function _classMethodHead(node) { this.printJoin(node.decorators); if (!this.format.preserveFormat) { var _node$key$loc3; const endLine = (_node$key$loc3 = node.key.loc) == null || (_node$key$loc3 = _node$key$loc3.end) == null ? void 0 : _node$key$loc3.line; if (endLine) this.catchUp(endLine); } this.tsPrintClassMemberModifiers(node); this._methodHead(node); } function StaticBlock(node) { this.word("static"); this.space(); this.tokenChar(123); if (node.body.length === 0) { this.tokenChar(125); } else { this.newline(); this.printSequence(node.body, true); this.rightBrace(node); } } //# sourceMappingURL=classes.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/generators/deprecated.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/generator/lib/generators/deprecated.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.addDeprecatedGenerators = addDeprecatedGenerators; function addDeprecatedGenerators(PrinterClass) { { const deprecatedBabel7Generators = { Noop() {}, TSExpressionWithTypeArguments(node) { this.print(node.expression); this.print(node.typeParameters); }, DecimalLiteral(node) { const raw = this.getPossibleRaw(node); if (!this.format.minified && raw !== undefined) { this.word(raw); return; } this.word(node.value + "m"); } }; Object.assign(PrinterClass.prototype, deprecatedBabel7Generators); } } //# sourceMappingURL=deprecated.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/generators/expressions.js": /*!*********************************************************************!*\ !*** ./node_modules/@babel/generator/lib/generators/expressions.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LogicalExpression = exports.BinaryExpression = exports.AssignmentExpression = AssignmentExpression; exports.AssignmentPattern = AssignmentPattern; exports.AwaitExpression = AwaitExpression; exports.BindExpression = BindExpression; exports.CallExpression = CallExpression; exports.ConditionalExpression = ConditionalExpression; exports.Decorator = Decorator; exports.DoExpression = DoExpression; exports.EmptyStatement = EmptyStatement; exports.ExpressionStatement = ExpressionStatement; exports.Import = Import; exports.MemberExpression = MemberExpression; exports.MetaProperty = MetaProperty; exports.ModuleExpression = ModuleExpression; exports.NewExpression = NewExpression; exports.OptionalCallExpression = OptionalCallExpression; exports.OptionalMemberExpression = OptionalMemberExpression; exports.ParenthesizedExpression = ParenthesizedExpression; exports.PrivateName = PrivateName; exports.SequenceExpression = SequenceExpression; exports.Super = Super; exports.ThisExpression = ThisExpression; exports.UnaryExpression = UnaryExpression; exports.UpdateExpression = UpdateExpression; exports.V8IntrinsicIdentifier = V8IntrinsicIdentifier; exports.YieldExpression = YieldExpression; exports._shouldPrintDecoratorsBeforeExport = _shouldPrintDecoratorsBeforeExport; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _index = __webpack_require__(/*! ../node/index.js */ "./node_modules/@babel/generator/lib/node/index.js"); const { isCallExpression, isLiteral, isMemberExpression, isNewExpression, isPattern } = _t; function UnaryExpression(node) { const { operator } = node; if (operator === "void" || operator === "delete" || operator === "typeof" || operator === "throw") { this.word(operator); this.space(); } else { this.token(operator); } this.print(node.argument); } function DoExpression(node) { if (node.async) { this.word("async", true); this.space(); } this.word("do"); this.space(); this.print(node.body); } function ParenthesizedExpression(node) { this.tokenChar(40); const exit = this.enterDelimited(); this.print(node.expression); exit(); this.rightParens(node); } function UpdateExpression(node) { if (node.prefix) { this.token(node.operator); this.print(node.argument); } else { this.print(node.argument, true); this.token(node.operator); } } function ConditionalExpression(node) { this.print(node.test); this.space(); this.tokenChar(63); this.space(); this.print(node.consequent); this.space(); this.tokenChar(58); this.space(); this.print(node.alternate); } function NewExpression(node, parent) { this.word("new"); this.space(); this.print(node.callee); if (this.format.minified && node.arguments.length === 0 && !node.optional && !isCallExpression(parent, { callee: node }) && !isMemberExpression(parent) && !isNewExpression(parent)) { return; } this.print(node.typeArguments); { this.print(node.typeParameters); if (node.optional) { this.token("?."); } } if (node.arguments.length === 0 && this.tokenMap && !this.tokenMap.endMatches(node, ")")) { return; } this.tokenChar(40); const exit = this.enterDelimited(); this.printList(node.arguments, this.shouldPrintTrailingComma(")")); exit(); this.rightParens(node); } function SequenceExpression(node) { this.printList(node.expressions); } function ThisExpression() { this.word("this"); } function Super() { this.word("super"); } function _shouldPrintDecoratorsBeforeExport(node) { if (typeof this.format.decoratorsBeforeExport === "boolean") { return this.format.decoratorsBeforeExport; } return typeof node.start === "number" && node.start === node.declaration.start; } function Decorator(node) { this.tokenChar(64); this.print(node.expression); this.newline(); } function OptionalMemberExpression(node) { let { computed } = node; const { optional, property } = node; this.print(node.object); if (!computed && isMemberExpression(property)) { throw new TypeError("Got a MemberExpression for MemberExpression property"); } if (isLiteral(property) && typeof property.value === "number") { computed = true; } if (optional) { this.token("?."); } if (computed) { this.tokenChar(91); this.print(property); this.tokenChar(93); } else { if (!optional) { this.tokenChar(46); } this.print(property); } } function OptionalCallExpression(node) { this.print(node.callee); { this.print(node.typeParameters); } if (node.optional) { this.token("?."); } this.print(node.typeArguments); this.tokenChar(40); const exit = this.enterDelimited(); this.printList(node.arguments); exit(); this.rightParens(node); } function CallExpression(node) { this.print(node.callee); this.print(node.typeArguments); { this.print(node.typeParameters); } this.tokenChar(40); const exit = this.enterDelimited(); this.printList(node.arguments, this.shouldPrintTrailingComma(")")); exit(); this.rightParens(node); } function Import() { this.word("import"); } function AwaitExpression(node) { this.word("await"); this.space(); this.print(node.argument); } function YieldExpression(node) { if (node.delegate) { this.word("yield", true); this.tokenChar(42); if (node.argument) { this.space(); this.print(node.argument); } } else if (node.argument) { this.word("yield", true); this.space(); this.print(node.argument); } else { this.word("yield"); } } function EmptyStatement() { this.semicolon(true); } function ExpressionStatement(node) { this.tokenContext |= _index.TokenContext.expressionStatement; this.print(node.expression); this.semicolon(); } function AssignmentPattern(node) { this.print(node.left); if (node.left.type === "Identifier" || isPattern(node.left)) { if (node.left.optional) this.tokenChar(63); this.print(node.left.typeAnnotation); } this.space(); this.tokenChar(61); this.space(); this.print(node.right); } function AssignmentExpression(node) { this.print(node.left); this.space(); if (node.operator === "in" || node.operator === "instanceof") { this.word(node.operator); } else { this.token(node.operator); this._endsWithDiv = node.operator === "/"; } this.space(); this.print(node.right); } function BindExpression(node) { this.print(node.object); this.token("::"); this.print(node.callee); } function MemberExpression(node) { this.print(node.object); if (!node.computed && isMemberExpression(node.property)) { throw new TypeError("Got a MemberExpression for MemberExpression property"); } let computed = node.computed; if (isLiteral(node.property) && typeof node.property.value === "number") { computed = true; } if (computed) { const exit = this.enterDelimited(); this.tokenChar(91); this.print(node.property); this.tokenChar(93); exit(); } else { this.tokenChar(46); this.print(node.property); } } function MetaProperty(node) { this.print(node.meta); this.tokenChar(46); this.print(node.property); } function PrivateName(node) { this.tokenChar(35); this.print(node.id); } function V8IntrinsicIdentifier(node) { this.tokenChar(37); this.word(node.name); } function ModuleExpression(node) { this.word("module", true); this.space(); this.tokenChar(123); this.indent(); const { body } = node; if (body.body.length || body.directives.length) { this.newline(); } this.print(body); this.dedent(); this.rightBrace(node); } //# sourceMappingURL=expressions.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/generators/flow.js": /*!**************************************************************!*\ !*** ./node_modules/@babel/generator/lib/generators/flow.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AnyTypeAnnotation = AnyTypeAnnotation; exports.ArrayTypeAnnotation = ArrayTypeAnnotation; exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation; exports.BooleanTypeAnnotation = BooleanTypeAnnotation; exports.DeclareClass = DeclareClass; exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration; exports.DeclareExportDeclaration = DeclareExportDeclaration; exports.DeclareFunction = DeclareFunction; exports.DeclareInterface = DeclareInterface; exports.DeclareModule = DeclareModule; exports.DeclareModuleExports = DeclareModuleExports; exports.DeclareOpaqueType = DeclareOpaqueType; exports.DeclareTypeAlias = DeclareTypeAlias; exports.DeclareVariable = DeclareVariable; exports.DeclaredPredicate = DeclaredPredicate; exports.EmptyTypeAnnotation = EmptyTypeAnnotation; exports.EnumBooleanBody = EnumBooleanBody; exports.EnumBooleanMember = EnumBooleanMember; exports.EnumDeclaration = EnumDeclaration; exports.EnumDefaultedMember = EnumDefaultedMember; exports.EnumNumberBody = EnumNumberBody; exports.EnumNumberMember = EnumNumberMember; exports.EnumStringBody = EnumStringBody; exports.EnumStringMember = EnumStringMember; exports.EnumSymbolBody = EnumSymbolBody; exports.ExistsTypeAnnotation = ExistsTypeAnnotation; exports.FunctionTypeAnnotation = FunctionTypeAnnotation; exports.FunctionTypeParam = FunctionTypeParam; exports.IndexedAccessType = IndexedAccessType; exports.InferredPredicate = InferredPredicate; exports.InterfaceDeclaration = InterfaceDeclaration; exports.GenericTypeAnnotation = exports.ClassImplements = exports.InterfaceExtends = InterfaceExtends; exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation; exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation; exports.MixedTypeAnnotation = MixedTypeAnnotation; exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation; exports.NullableTypeAnnotation = NullableTypeAnnotation; Object.defineProperty(exports, "NumberLiteralTypeAnnotation", ({ enumerable: true, get: function () { return _types2.NumericLiteral; } })); exports.NumberTypeAnnotation = NumberTypeAnnotation; exports.ObjectTypeAnnotation = ObjectTypeAnnotation; exports.ObjectTypeCallProperty = ObjectTypeCallProperty; exports.ObjectTypeIndexer = ObjectTypeIndexer; exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot; exports.ObjectTypeProperty = ObjectTypeProperty; exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty; exports.OpaqueType = OpaqueType; exports.OptionalIndexedAccessType = OptionalIndexedAccessType; exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier; Object.defineProperty(exports, "StringLiteralTypeAnnotation", ({ enumerable: true, get: function () { return _types2.StringLiteral; } })); exports.StringTypeAnnotation = StringTypeAnnotation; exports.SymbolTypeAnnotation = SymbolTypeAnnotation; exports.ThisTypeAnnotation = ThisTypeAnnotation; exports.TupleTypeAnnotation = TupleTypeAnnotation; exports.TypeAlias = TypeAlias; exports.TypeAnnotation = TypeAnnotation; exports.TypeCastExpression = TypeCastExpression; exports.TypeParameter = TypeParameter; exports.TypeParameterDeclaration = exports.TypeParameterInstantiation = TypeParameterInstantiation; exports.TypeofTypeAnnotation = TypeofTypeAnnotation; exports.UnionTypeAnnotation = UnionTypeAnnotation; exports.Variance = Variance; exports.VoidTypeAnnotation = VoidTypeAnnotation; exports._interfaceish = _interfaceish; exports._variance = _variance; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _modules = __webpack_require__(/*! ./modules.js */ "./node_modules/@babel/generator/lib/generators/modules.js"); var _index = __webpack_require__(/*! ../node/index.js */ "./node_modules/@babel/generator/lib/node/index.js"); var _types2 = __webpack_require__(/*! ./types.js */ "./node_modules/@babel/generator/lib/generators/types.js"); const { isDeclareExportDeclaration, isStatement } = _t; function AnyTypeAnnotation() { this.word("any"); } function ArrayTypeAnnotation(node) { this.print(node.elementType, true); this.tokenChar(91); this.tokenChar(93); } function BooleanTypeAnnotation() { this.word("boolean"); } function BooleanLiteralTypeAnnotation(node) { this.word(node.value ? "true" : "false"); } function NullLiteralTypeAnnotation() { this.word("null"); } function DeclareClass(node, parent) { if (!isDeclareExportDeclaration(parent)) { this.word("declare"); this.space(); } this.word("class"); this.space(); this._interfaceish(node); } function DeclareFunction(node, parent) { if (!isDeclareExportDeclaration(parent)) { this.word("declare"); this.space(); } this.word("function"); this.space(); this.print(node.id); this.print(node.id.typeAnnotation.typeAnnotation); if (node.predicate) { this.space(); this.print(node.predicate); } this.semicolon(); } function InferredPredicate() { this.tokenChar(37); this.word("checks"); } function DeclaredPredicate(node) { this.tokenChar(37); this.word("checks"); this.tokenChar(40); this.print(node.value); this.tokenChar(41); } function DeclareInterface(node) { this.word("declare"); this.space(); this.InterfaceDeclaration(node); } function DeclareModule(node) { this.word("declare"); this.space(); this.word("module"); this.space(); this.print(node.id); this.space(); this.print(node.body); } function DeclareModuleExports(node) { this.word("declare"); this.space(); this.word("module"); this.tokenChar(46); this.word("exports"); this.print(node.typeAnnotation); } function DeclareTypeAlias(node) { this.word("declare"); this.space(); this.TypeAlias(node); } function DeclareOpaqueType(node, parent) { if (!isDeclareExportDeclaration(parent)) { this.word("declare"); this.space(); } this.OpaqueType(node); } function DeclareVariable(node, parent) { if (!isDeclareExportDeclaration(parent)) { this.word("declare"); this.space(); } this.word("var"); this.space(); this.print(node.id); this.print(node.id.typeAnnotation); this.semicolon(); } function DeclareExportDeclaration(node) { this.word("declare"); this.space(); this.word("export"); this.space(); if (node.default) { this.word("default"); this.space(); } FlowExportDeclaration.call(this, node); } function DeclareExportAllDeclaration(node) { this.word("declare"); this.space(); _modules.ExportAllDeclaration.call(this, node); } function EnumDeclaration(node) { const { id, body } = node; this.word("enum"); this.space(); this.print(id); this.print(body); } function enumExplicitType(context, name, hasExplicitType) { if (hasExplicitType) { context.space(); context.word("of"); context.space(); context.word(name); } context.space(); } function enumBody(context, node) { const { members } = node; context.token("{"); context.indent(); context.newline(); for (const member of members) { context.print(member); context.newline(); } if (node.hasUnknownMembers) { context.token("..."); context.newline(); } context.dedent(); context.token("}"); } function EnumBooleanBody(node) { const { explicitType } = node; enumExplicitType(this, "boolean", explicitType); enumBody(this, node); } function EnumNumberBody(node) { const { explicitType } = node; enumExplicitType(this, "number", explicitType); enumBody(this, node); } function EnumStringBody(node) { const { explicitType } = node; enumExplicitType(this, "string", explicitType); enumBody(this, node); } function EnumSymbolBody(node) { enumExplicitType(this, "symbol", true); enumBody(this, node); } function EnumDefaultedMember(node) { const { id } = node; this.print(id); this.tokenChar(44); } function enumInitializedMember(context, node) { context.print(node.id); context.space(); context.token("="); context.space(); context.print(node.init); context.token(","); } function EnumBooleanMember(node) { enumInitializedMember(this, node); } function EnumNumberMember(node) { enumInitializedMember(this, node); } function EnumStringMember(node) { enumInitializedMember(this, node); } function FlowExportDeclaration(node) { if (node.declaration) { const declar = node.declaration; this.print(declar); if (!isStatement(declar)) this.semicolon(); } else { this.tokenChar(123); if (node.specifiers.length) { this.space(); this.printList(node.specifiers); this.space(); } this.tokenChar(125); if (node.source) { this.space(); this.word("from"); this.space(); this.print(node.source); } this.semicolon(); } } function ExistsTypeAnnotation() { this.tokenChar(42); } function FunctionTypeAnnotation(node, parent) { this.print(node.typeParameters); this.tokenChar(40); if (node.this) { this.word("this"); this.tokenChar(58); this.space(); this.print(node.this.typeAnnotation); if (node.params.length || node.rest) { this.tokenChar(44); this.space(); } } this.printList(node.params); if (node.rest) { if (node.params.length) { this.tokenChar(44); this.space(); } this.token("..."); this.print(node.rest); } this.tokenChar(41); const type = parent == null ? void 0 : parent.type; if (type != null && (type === "ObjectTypeCallProperty" || type === "ObjectTypeInternalSlot" || type === "DeclareFunction" || type === "ObjectTypeProperty" && parent.method)) { this.tokenChar(58); } else { this.space(); this.token("=>"); } this.space(); this.print(node.returnType); } function FunctionTypeParam(node) { this.print(node.name); if (node.optional) this.tokenChar(63); if (node.name) { this.tokenChar(58); this.space(); } this.print(node.typeAnnotation); } function InterfaceExtends(node) { this.print(node.id); this.print(node.typeParameters, true); } function _interfaceish(node) { var _node$extends; this.print(node.id); this.print(node.typeParameters); if ((_node$extends = node.extends) != null && _node$extends.length) { this.space(); this.word("extends"); this.space(); this.printList(node.extends); } if (node.type === "DeclareClass") { var _node$mixins, _node$implements; if ((_node$mixins = node.mixins) != null && _node$mixins.length) { this.space(); this.word("mixins"); this.space(); this.printList(node.mixins); } if ((_node$implements = node.implements) != null && _node$implements.length) { this.space(); this.word("implements"); this.space(); this.printList(node.implements); } } this.space(); this.print(node.body); } function _variance(node) { var _node$variance; const kind = (_node$variance = node.variance) == null ? void 0 : _node$variance.kind; if (kind != null) { if (kind === "plus") { this.tokenChar(43); } else if (kind === "minus") { this.tokenChar(45); } } } function InterfaceDeclaration(node) { this.word("interface"); this.space(); this._interfaceish(node); } function andSeparator(occurrenceCount) { this.space(); this.token("&", false, occurrenceCount); this.space(); } function InterfaceTypeAnnotation(node) { var _node$extends2; this.word("interface"); if ((_node$extends2 = node.extends) != null && _node$extends2.length) { this.space(); this.word("extends"); this.space(); this.printList(node.extends); } this.space(); this.print(node.body); } function IntersectionTypeAnnotation(node) { this.printJoin(node.types, undefined, undefined, andSeparator); } function MixedTypeAnnotation() { this.word("mixed"); } function EmptyTypeAnnotation() { this.word("empty"); } function NullableTypeAnnotation(node) { this.tokenChar(63); this.print(node.typeAnnotation); } function NumberTypeAnnotation() { this.word("number"); } function StringTypeAnnotation() { this.word("string"); } function ThisTypeAnnotation() { this.word("this"); } function TupleTypeAnnotation(node) { this.tokenChar(91); this.printList(node.types); this.tokenChar(93); } function TypeofTypeAnnotation(node) { this.word("typeof"); this.space(); this.print(node.argument); } function TypeAlias(node) { this.word("type"); this.space(); this.print(node.id); this.print(node.typeParameters); this.space(); this.tokenChar(61); this.space(); this.print(node.right); this.semicolon(); } function TypeAnnotation(node, parent) { this.tokenChar(58); this.space(); if (parent.type === "ArrowFunctionExpression") { this.tokenContext |= _index.TokenContext.arrowFlowReturnType; } else if (node.optional) { this.tokenChar(63); } this.print(node.typeAnnotation); } function TypeParameterInstantiation(node) { this.tokenChar(60); this.printList(node.params); this.tokenChar(62); } function TypeParameter(node) { this._variance(node); this.word(node.name); if (node.bound) { this.print(node.bound); } if (node.default) { this.space(); this.tokenChar(61); this.space(); this.print(node.default); } } function OpaqueType(node) { this.word("opaque"); this.space(); this.word("type"); this.space(); this.print(node.id); this.print(node.typeParameters); if (node.supertype) { this.tokenChar(58); this.space(); this.print(node.supertype); } if (node.impltype) { this.space(); this.tokenChar(61); this.space(); this.print(node.impltype); } this.semicolon(); } function ObjectTypeAnnotation(node) { if (node.exact) { this.token("{|"); } else { this.tokenChar(123); } const props = [...node.properties, ...(node.callProperties || []), ...(node.indexers || []), ...(node.internalSlots || [])]; if (props.length) { this.newline(); this.space(); this.printJoin(props, true, true, undefined, undefined, function addNewlines(leading) { if (leading && !props[0]) return 1; }, () => { if (props.length !== 1 || node.inexact) { this.tokenChar(44); this.space(); } }); this.space(); } if (node.inexact) { this.indent(); this.token("..."); if (props.length) { this.newline(); } this.dedent(); } if (node.exact) { this.token("|}"); } else { this.tokenChar(125); } } function ObjectTypeInternalSlot(node) { if (node.static) { this.word("static"); this.space(); } this.tokenChar(91); this.tokenChar(91); this.print(node.id); this.tokenChar(93); this.tokenChar(93); if (node.optional) this.tokenChar(63); if (!node.method) { this.tokenChar(58); this.space(); } this.print(node.value); } function ObjectTypeCallProperty(node) { if (node.static) { this.word("static"); this.space(); } this.print(node.value); } function ObjectTypeIndexer(node) { if (node.static) { this.word("static"); this.space(); } this._variance(node); this.tokenChar(91); if (node.id) { this.print(node.id); this.tokenChar(58); this.space(); } this.print(node.key); this.tokenChar(93); this.tokenChar(58); this.space(); this.print(node.value); } function ObjectTypeProperty(node) { if (node.proto) { this.word("proto"); this.space(); } if (node.static) { this.word("static"); this.space(); } if (node.kind === "get" || node.kind === "set") { this.word(node.kind); this.space(); } this._variance(node); this.print(node.key); if (node.optional) this.tokenChar(63); if (!node.method) { this.tokenChar(58); this.space(); } this.print(node.value); } function ObjectTypeSpreadProperty(node) { this.token("..."); this.print(node.argument); } function QualifiedTypeIdentifier(node) { this.print(node.qualification); this.tokenChar(46); this.print(node.id); } function SymbolTypeAnnotation() { this.word("symbol"); } function orSeparator(occurrenceCount) { this.space(); this.token("|", false, occurrenceCount); this.space(); } function UnionTypeAnnotation(node) { this.printJoin(node.types, undefined, undefined, orSeparator); } function TypeCastExpression(node) { this.tokenChar(40); this.print(node.expression); this.print(node.typeAnnotation); this.tokenChar(41); } function Variance(node) { if (node.kind === "plus") { this.tokenChar(43); } else { this.tokenChar(45); } } function VoidTypeAnnotation() { this.word("void"); } function IndexedAccessType(node) { this.print(node.objectType, true); this.tokenChar(91); this.print(node.indexType); this.tokenChar(93); } function OptionalIndexedAccessType(node) { this.print(node.objectType); if (node.optional) { this.token("?."); } this.tokenChar(91); this.print(node.indexType); this.tokenChar(93); } //# sourceMappingURL=flow.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/generators/index.js": /*!***************************************************************!*\ !*** ./node_modules/@babel/generator/lib/generators/index.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var _templateLiterals = __webpack_require__(/*! ./template-literals.js */ "./node_modules/@babel/generator/lib/generators/template-literals.js"); Object.keys(_templateLiterals).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _templateLiterals[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _templateLiterals[key]; } }); }); var _expressions = __webpack_require__(/*! ./expressions.js */ "./node_modules/@babel/generator/lib/generators/expressions.js"); Object.keys(_expressions).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _expressions[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _expressions[key]; } }); }); var _statements = __webpack_require__(/*! ./statements.js */ "./node_modules/@babel/generator/lib/generators/statements.js"); Object.keys(_statements).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _statements[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _statements[key]; } }); }); var _classes = __webpack_require__(/*! ./classes.js */ "./node_modules/@babel/generator/lib/generators/classes.js"); Object.keys(_classes).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _classes[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _classes[key]; } }); }); var _methods = __webpack_require__(/*! ./methods.js */ "./node_modules/@babel/generator/lib/generators/methods.js"); Object.keys(_methods).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _methods[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _methods[key]; } }); }); var _modules = __webpack_require__(/*! ./modules.js */ "./node_modules/@babel/generator/lib/generators/modules.js"); Object.keys(_modules).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _modules[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _modules[key]; } }); }); var _types = __webpack_require__(/*! ./types.js */ "./node_modules/@babel/generator/lib/generators/types.js"); Object.keys(_types).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _types[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _types[key]; } }); }); var _flow = __webpack_require__(/*! ./flow.js */ "./node_modules/@babel/generator/lib/generators/flow.js"); Object.keys(_flow).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _flow[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _flow[key]; } }); }); var _base = __webpack_require__(/*! ./base.js */ "./node_modules/@babel/generator/lib/generators/base.js"); Object.keys(_base).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _base[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _base[key]; } }); }); var _jsx = __webpack_require__(/*! ./jsx.js */ "./node_modules/@babel/generator/lib/generators/jsx.js"); Object.keys(_jsx).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _jsx[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _jsx[key]; } }); }); var _typescript = __webpack_require__(/*! ./typescript.js */ "./node_modules/@babel/generator/lib/generators/typescript.js"); Object.keys(_typescript).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _typescript[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _typescript[key]; } }); }); //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/generators/jsx.js": /*!*************************************************************!*\ !*** ./node_modules/@babel/generator/lib/generators/jsx.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.JSXAttribute = JSXAttribute; exports.JSXClosingElement = JSXClosingElement; exports.JSXClosingFragment = JSXClosingFragment; exports.JSXElement = JSXElement; exports.JSXEmptyExpression = JSXEmptyExpression; exports.JSXExpressionContainer = JSXExpressionContainer; exports.JSXFragment = JSXFragment; exports.JSXIdentifier = JSXIdentifier; exports.JSXMemberExpression = JSXMemberExpression; exports.JSXNamespacedName = JSXNamespacedName; exports.JSXOpeningElement = JSXOpeningElement; exports.JSXOpeningFragment = JSXOpeningFragment; exports.JSXSpreadAttribute = JSXSpreadAttribute; exports.JSXSpreadChild = JSXSpreadChild; exports.JSXText = JSXText; function JSXAttribute(node) { this.print(node.name); if (node.value) { this.tokenChar(61); this.print(node.value); } } function JSXIdentifier(node) { this.word(node.name); } function JSXNamespacedName(node) { this.print(node.namespace); this.tokenChar(58); this.print(node.name); } function JSXMemberExpression(node) { this.print(node.object); this.tokenChar(46); this.print(node.property); } function JSXSpreadAttribute(node) { this.tokenChar(123); this.token("..."); this.print(node.argument); this.rightBrace(node); } function JSXExpressionContainer(node) { this.tokenChar(123); this.print(node.expression); this.rightBrace(node); } function JSXSpreadChild(node) { this.tokenChar(123); this.token("..."); this.print(node.expression); this.rightBrace(node); } function JSXText(node) { const raw = this.getPossibleRaw(node); if (raw !== undefined) { this.token(raw, true); } else { this.token(node.value, true); } } function JSXElement(node) { const open = node.openingElement; this.print(open); if (open.selfClosing) return; this.indent(); for (const child of node.children) { this.print(child); } this.dedent(); this.print(node.closingElement); } function spaceSeparator() { this.space(); } function JSXOpeningElement(node) { this.tokenChar(60); this.print(node.name); { if (node.typeArguments) { this.print(node.typeArguments); } this.print(node.typeParameters); } if (node.attributes.length > 0) { this.space(); this.printJoin(node.attributes, undefined, undefined, spaceSeparator); } if (node.selfClosing) { this.space(); this.tokenChar(47); } this.tokenChar(62); } function JSXClosingElement(node) { this.tokenChar(60); this.tokenChar(47); this.print(node.name); this.tokenChar(62); } function JSXEmptyExpression() { this.printInnerComments(); } function JSXFragment(node) { this.print(node.openingFragment); this.indent(); for (const child of node.children) { this.print(child); } this.dedent(); this.print(node.closingFragment); } function JSXOpeningFragment() { this.tokenChar(60); this.tokenChar(62); } function JSXClosingFragment() { this.token(" { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ArrowFunctionExpression = ArrowFunctionExpression; exports.FunctionDeclaration = exports.FunctionExpression = FunctionExpression; exports._functionHead = _functionHead; exports._methodHead = _methodHead; exports._param = _param; exports._parameters = _parameters; exports._params = _params; exports._predicate = _predicate; exports._shouldPrintArrowParamsParens = _shouldPrintArrowParamsParens; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _index = __webpack_require__(/*! ../node/index.js */ "./node_modules/@babel/generator/lib/node/index.js"); const { isIdentifier } = _t; function _params(node, idNode, parentNode) { this.print(node.typeParameters); const nameInfo = _getFuncIdName.call(this, idNode, parentNode); if (nameInfo) { this.sourceIdentifierName(nameInfo.name, nameInfo.pos); } this.tokenChar(40); this._parameters(node.params, ")"); const noLineTerminator = node.type === "ArrowFunctionExpression"; this.print(node.returnType, noLineTerminator); this._noLineTerminator = noLineTerminator; } function _parameters(parameters, endToken) { const exit = this.enterDelimited(); const trailingComma = this.shouldPrintTrailingComma(endToken); const paramLength = parameters.length; for (let i = 0; i < paramLength; i++) { this._param(parameters[i]); if (trailingComma || i < paramLength - 1) { this.token(",", null, i); this.space(); } } this.token(endToken); exit(); } function _param(parameter) { this.printJoin(parameter.decorators); this.print(parameter); if (parameter.optional) { this.tokenChar(63); } this.print(parameter.typeAnnotation); } function _methodHead(node) { const kind = node.kind; const key = node.key; if (kind === "get" || kind === "set") { this.word(kind); this.space(); } if (node.async) { this.word("async", true); this.space(); } if (kind === "method" || kind === "init") { if (node.generator) { this.tokenChar(42); } } if (node.computed) { this.tokenChar(91); this.print(key); this.tokenChar(93); } else { this.print(key); } if (node.optional) { this.tokenChar(63); } this._params(node, node.computed && node.key.type !== "StringLiteral" ? undefined : node.key, undefined); } function _predicate(node, noLineTerminatorAfter) { if (node.predicate) { if (!node.returnType) { this.tokenChar(58); } this.space(); this.print(node.predicate, noLineTerminatorAfter); } } function _functionHead(node, parent) { if (node.async) { this.word("async"); if (!this.format.preserveFormat) { this._endsWithInnerRaw = false; } this.space(); } this.word("function"); if (node.generator) { if (!this.format.preserveFormat) { this._endsWithInnerRaw = false; } this.tokenChar(42); } this.space(); if (node.id) { this.print(node.id); } this._params(node, node.id, parent); if (node.type !== "TSDeclareFunction") { this._predicate(node); } } function FunctionExpression(node, parent) { this._functionHead(node, parent); this.space(); this.print(node.body); } function ArrowFunctionExpression(node, parent) { if (node.async) { this.word("async", true); this.space(); } if (this._shouldPrintArrowParamsParens(node)) { this._params(node, undefined, parent); } else { this.print(node.params[0], true); } this._predicate(node, true); this.space(); this.printInnerComments(); this.token("=>"); this.space(); this.tokenContext |= _index.TokenContext.arrowBody; this.print(node.body); } function _shouldPrintArrowParamsParens(node) { var _firstParam$leadingCo, _firstParam$trailingC; if (node.params.length !== 1) return true; if (node.typeParameters || node.returnType || node.predicate) { return true; } const firstParam = node.params[0]; if (!isIdentifier(firstParam) || firstParam.typeAnnotation || firstParam.optional || (_firstParam$leadingCo = firstParam.leadingComments) != null && _firstParam$leadingCo.length || (_firstParam$trailingC = firstParam.trailingComments) != null && _firstParam$trailingC.length) { return true; } if (this.tokenMap) { if (node.loc == null) return true; if (this.tokenMap.findMatching(node, "(") !== null) return true; const arrowToken = this.tokenMap.findMatching(node, "=>"); if ((arrowToken == null ? void 0 : arrowToken.loc) == null) return true; return arrowToken.loc.start.line !== node.loc.start.line; } if (this.format.retainLines) return true; return false; } function _getFuncIdName(idNode, parent) { let id = idNode; if (!id && parent) { const parentType = parent.type; if (parentType === "VariableDeclarator") { id = parent.id; } else if (parentType === "AssignmentExpression" || parentType === "AssignmentPattern") { id = parent.left; } else if (parentType === "ObjectProperty" || parentType === "ClassProperty") { if (!parent.computed || parent.key.type === "StringLiteral") { id = parent.key; } } else if (parentType === "ClassPrivateProperty" || parentType === "ClassAccessorProperty") { id = parent.key; } } if (!id) return; let nameInfo; if (id.type === "Identifier") { var _id$loc, _id$loc2; nameInfo = { pos: (_id$loc = id.loc) == null ? void 0 : _id$loc.start, name: ((_id$loc2 = id.loc) == null ? void 0 : _id$loc2.identifierName) || id.name }; } else if (id.type === "PrivateName") { var _id$loc3; nameInfo = { pos: (_id$loc3 = id.loc) == null ? void 0 : _id$loc3.start, name: "#" + id.id.name }; } else if (id.type === "StringLiteral") { var _id$loc4; nameInfo = { pos: (_id$loc4 = id.loc) == null ? void 0 : _id$loc4.start, name: id.value }; } return nameInfo; } //# sourceMappingURL=methods.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/generators/modules.js": /*!*****************************************************************!*\ !*** ./node_modules/@babel/generator/lib/generators/modules.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExportAllDeclaration = ExportAllDeclaration; exports.ExportDefaultDeclaration = ExportDefaultDeclaration; exports.ExportDefaultSpecifier = ExportDefaultSpecifier; exports.ExportNamedDeclaration = ExportNamedDeclaration; exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier; exports.ExportSpecifier = ExportSpecifier; exports.ImportAttribute = ImportAttribute; exports.ImportDeclaration = ImportDeclaration; exports.ImportDefaultSpecifier = ImportDefaultSpecifier; exports.ImportExpression = ImportExpression; exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; exports.ImportSpecifier = ImportSpecifier; exports._printAttributes = _printAttributes; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _index = __webpack_require__(/*! ../node/index.js */ "./node_modules/@babel/generator/lib/node/index.js"); const { isClassDeclaration, isExportDefaultSpecifier, isExportNamespaceSpecifier, isImportDefaultSpecifier, isImportNamespaceSpecifier, isStatement } = _t; function ImportSpecifier(node) { if (node.importKind === "type" || node.importKind === "typeof") { this.word(node.importKind); this.space(); } this.print(node.imported); if (node.local && node.local.name !== node.imported.name) { this.space(); this.word("as"); this.space(); this.print(node.local); } } function ImportDefaultSpecifier(node) { this.print(node.local); } function ExportDefaultSpecifier(node) { this.print(node.exported); } function ExportSpecifier(node) { if (node.exportKind === "type") { this.word("type"); this.space(); } this.print(node.local); if (node.exported && node.local.name !== node.exported.name) { this.space(); this.word("as"); this.space(); this.print(node.exported); } } function ExportNamespaceSpecifier(node) { this.tokenChar(42); this.space(); this.word("as"); this.space(); this.print(node.exported); } let warningShown = false; function _printAttributes(node, hasPreviousBrace) { var _node$extra; const { importAttributesKeyword } = this.format; const { attributes, assertions } = node; if (attributes && !importAttributesKeyword && node.extra && (node.extra.deprecatedAssertSyntax || node.extra.deprecatedWithLegacySyntax) && !warningShown) { warningShown = true; console.warn(`\ You are using import attributes, without specifying the desired output syntax. Please specify the "importAttributesKeyword" generator option, whose value can be one of: - "with" : \`import { a } from "b" with { type: "json" };\` - "assert" : \`import { a } from "b" assert { type: "json" };\` - "with-legacy" : \`import { a } from "b" with type: "json";\` `); } const useAssertKeyword = importAttributesKeyword === "assert" || !importAttributesKeyword && assertions; this.word(useAssertKeyword ? "assert" : "with"); this.space(); if (!useAssertKeyword && (importAttributesKeyword === "with-legacy" || !importAttributesKeyword && (_node$extra = node.extra) != null && _node$extra.deprecatedWithLegacySyntax)) { this.printList(attributes || assertions); return; } const occurrenceCount = hasPreviousBrace ? 1 : 0; this.token("{", null, occurrenceCount); this.space(); this.printList(attributes || assertions, this.shouldPrintTrailingComma("}")); this.space(); this.token("}", null, occurrenceCount); } function ExportAllDeclaration(node) { var _node$attributes, _node$assertions; this.word("export"); this.space(); if (node.exportKind === "type") { this.word("type"); this.space(); } this.tokenChar(42); this.space(); this.word("from"); this.space(); if ((_node$attributes = node.attributes) != null && _node$attributes.length || (_node$assertions = node.assertions) != null && _node$assertions.length) { this.print(node.source, true); this.space(); this._printAttributes(node, false); } else { this.print(node.source); } this.semicolon(); } function maybePrintDecoratorsBeforeExport(printer, node) { if (isClassDeclaration(node.declaration) && printer._shouldPrintDecoratorsBeforeExport(node)) { printer.printJoin(node.declaration.decorators); } } function ExportNamedDeclaration(node) { maybePrintDecoratorsBeforeExport(this, node); this.word("export"); this.space(); if (node.declaration) { const declar = node.declaration; this.print(declar); if (!isStatement(declar)) this.semicolon(); } else { if (node.exportKind === "type") { this.word("type"); this.space(); } const specifiers = node.specifiers.slice(0); let hasSpecial = false; for (;;) { const first = specifiers[0]; if (isExportDefaultSpecifier(first) || isExportNamespaceSpecifier(first)) { hasSpecial = true; this.print(specifiers.shift()); if (specifiers.length) { this.tokenChar(44); this.space(); } } else { break; } } let hasBrace = false; if (specifiers.length || !specifiers.length && !hasSpecial) { hasBrace = true; this.tokenChar(123); if (specifiers.length) { this.space(); this.printList(specifiers, this.shouldPrintTrailingComma("}")); this.space(); } this.tokenChar(125); } if (node.source) { var _node$attributes2, _node$assertions2; this.space(); this.word("from"); this.space(); if ((_node$attributes2 = node.attributes) != null && _node$attributes2.length || (_node$assertions2 = node.assertions) != null && _node$assertions2.length) { this.print(node.source, true); this.space(); this._printAttributes(node, hasBrace); } else { this.print(node.source); } } this.semicolon(); } } function ExportDefaultDeclaration(node) { maybePrintDecoratorsBeforeExport(this, node); this.word("export"); this.noIndentInnerCommentsHere(); this.space(); this.word("default"); this.space(); this.tokenContext |= _index.TokenContext.exportDefault; const declar = node.declaration; this.print(declar); if (!isStatement(declar)) this.semicolon(); } function ImportDeclaration(node) { var _node$attributes3, _node$assertions3; this.word("import"); this.space(); const isTypeKind = node.importKind === "type" || node.importKind === "typeof"; if (isTypeKind) { this.noIndentInnerCommentsHere(); this.word(node.importKind); this.space(); } else if (node.module) { this.noIndentInnerCommentsHere(); this.word("module"); this.space(); } else if (node.phase) { this.noIndentInnerCommentsHere(); this.word(node.phase); this.space(); } const specifiers = node.specifiers.slice(0); const hasSpecifiers = !!specifiers.length; while (hasSpecifiers) { const first = specifiers[0]; if (isImportDefaultSpecifier(first) || isImportNamespaceSpecifier(first)) { this.print(specifiers.shift()); if (specifiers.length) { this.tokenChar(44); this.space(); } } else { break; } } let hasBrace = false; if (specifiers.length) { hasBrace = true; this.tokenChar(123); this.space(); this.printList(specifiers, this.shouldPrintTrailingComma("}")); this.space(); this.tokenChar(125); } else if (isTypeKind && !hasSpecifiers) { hasBrace = true; this.tokenChar(123); this.tokenChar(125); } if (hasSpecifiers || isTypeKind) { this.space(); this.word("from"); this.space(); } if ((_node$attributes3 = node.attributes) != null && _node$attributes3.length || (_node$assertions3 = node.assertions) != null && _node$assertions3.length) { this.print(node.source, true); this.space(); this._printAttributes(node, hasBrace); } else { this.print(node.source); } this.semicolon(); } function ImportAttribute(node) { this.print(node.key); this.tokenChar(58); this.space(); this.print(node.value); } function ImportNamespaceSpecifier(node) { this.tokenChar(42); this.space(); this.word("as"); this.space(); this.print(node.local); } function ImportExpression(node) { this.word("import"); if (node.phase) { this.tokenChar(46); this.word(node.phase); } this.tokenChar(40); const shouldPrintTrailingComma = this.shouldPrintTrailingComma(")"); this.print(node.source); if (node.options != null) { this.tokenChar(44); this.space(); this.print(node.options); } if (shouldPrintTrailingComma) { this.tokenChar(44); } this.rightParens(node); } //# sourceMappingURL=modules.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/generators/statements.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/generator/lib/generators/statements.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BreakStatement = BreakStatement; exports.CatchClause = CatchClause; exports.ContinueStatement = ContinueStatement; exports.DebuggerStatement = DebuggerStatement; exports.DoWhileStatement = DoWhileStatement; exports.ForOfStatement = exports.ForInStatement = void 0; exports.ForStatement = ForStatement; exports.IfStatement = IfStatement; exports.LabeledStatement = LabeledStatement; exports.ReturnStatement = ReturnStatement; exports.SwitchCase = SwitchCase; exports.SwitchStatement = SwitchStatement; exports.ThrowStatement = ThrowStatement; exports.TryStatement = TryStatement; exports.VariableDeclaration = VariableDeclaration; exports.VariableDeclarator = VariableDeclarator; exports.WhileStatement = WhileStatement; exports.WithStatement = WithStatement; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { isFor, isForStatement, isIfStatement, isStatement } = _t; function WithStatement(node) { this.word("with"); this.space(); this.tokenChar(40); this.print(node.object); this.tokenChar(41); this.printBlock(node); } function IfStatement(node) { this.word("if"); this.space(); this.tokenChar(40); this.print(node.test); this.tokenChar(41); this.space(); const needsBlock = node.alternate && isIfStatement(getLastStatement(node.consequent)); if (needsBlock) { this.tokenChar(123); this.newline(); this.indent(); } this.printAndIndentOnComments(node.consequent); if (needsBlock) { this.dedent(); this.newline(); this.tokenChar(125); } if (node.alternate) { if (this.endsWith(125)) this.space(); this.word("else"); this.space(); this.printAndIndentOnComments(node.alternate); } } function getLastStatement(statement) { const { body } = statement; if (isStatement(body) === false) { return statement; } return getLastStatement(body); } function ForStatement(node) { this.word("for"); this.space(); this.tokenChar(40); { const exit = this.enterForStatementInit(); this.print(node.init); exit(); } this.tokenChar(59); if (node.test) { this.space(); this.print(node.test); } this.token(";", false, 1); if (node.update) { this.space(); this.print(node.update); } this.tokenChar(41); this.printBlock(node); } function WhileStatement(node) { this.word("while"); this.space(); this.tokenChar(40); this.print(node.test); this.tokenChar(41); this.printBlock(node); } function ForXStatement(node) { this.word("for"); this.space(); const isForOf = node.type === "ForOfStatement"; if (isForOf && node.await) { this.word("await"); this.space(); } this.noIndentInnerCommentsHere(); this.tokenChar(40); { const exit = this.enterForXStatementInit(isForOf); this.print(node.left); exit == null || exit(); } this.space(); this.word(isForOf ? "of" : "in"); this.space(); this.print(node.right); this.tokenChar(41); this.printBlock(node); } const ForInStatement = exports.ForInStatement = ForXStatement; const ForOfStatement = exports.ForOfStatement = ForXStatement; function DoWhileStatement(node) { this.word("do"); this.space(); this.print(node.body); this.space(); this.word("while"); this.space(); this.tokenChar(40); this.print(node.test); this.tokenChar(41); this.semicolon(); } function printStatementAfterKeyword(printer, node) { if (node) { printer.space(); printer.printTerminatorless(node); } printer.semicolon(); } function BreakStatement(node) { this.word("break"); printStatementAfterKeyword(this, node.label); } function ContinueStatement(node) { this.word("continue"); printStatementAfterKeyword(this, node.label); } function ReturnStatement(node) { this.word("return"); printStatementAfterKeyword(this, node.argument); } function ThrowStatement(node) { this.word("throw"); printStatementAfterKeyword(this, node.argument); } function LabeledStatement(node) { this.print(node.label); this.tokenChar(58); this.space(); this.print(node.body); } function TryStatement(node) { this.word("try"); this.space(); this.print(node.block); this.space(); if (node.handlers) { this.print(node.handlers[0]); } else { this.print(node.handler); } if (node.finalizer) { this.space(); this.word("finally"); this.space(); this.print(node.finalizer); } } function CatchClause(node) { this.word("catch"); this.space(); if (node.param) { this.tokenChar(40); this.print(node.param); this.print(node.param.typeAnnotation); this.tokenChar(41); this.space(); } this.print(node.body); } function SwitchStatement(node) { this.word("switch"); this.space(); this.tokenChar(40); this.print(node.discriminant); this.tokenChar(41); this.space(); this.tokenChar(123); this.printSequence(node.cases, true, undefined, function addNewlines(leading, cas) { if (!leading && node.cases[node.cases.length - 1] === cas) return -1; }); this.rightBrace(node); } function SwitchCase(node) { if (node.test) { this.word("case"); this.space(); this.print(node.test); this.tokenChar(58); } else { this.word("default"); this.tokenChar(58); } if (node.consequent.length) { this.newline(); this.printSequence(node.consequent, true); } } function DebuggerStatement() { this.word("debugger"); this.semicolon(); } function VariableDeclaration(node, parent) { if (node.declare) { this.word("declare"); this.space(); } const { kind } = node; if (kind === "await using") { this.word("await"); this.space(); this.word("using", true); } else { this.word(kind, kind === "using"); } this.space(); let hasInits = false; if (!isFor(parent)) { for (const declar of node.declarations) { if (declar.init) { hasInits = true; } } } this.printList(node.declarations, undefined, undefined, node.declarations.length > 1, hasInits ? function (occurrenceCount) { this.token(",", false, occurrenceCount); this.newline(); } : undefined); if (isFor(parent)) { if (isForStatement(parent)) { if (parent.init === node) return; } else { if (parent.left === node) return; } } this.semicolon(); } function VariableDeclarator(node) { this.print(node.id); if (node.definite) this.tokenChar(33); this.print(node.id.typeAnnotation); if (node.init) { this.space(); this.tokenChar(61); this.space(); this.print(node.init); } } //# sourceMappingURL=statements.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/generators/template-literals.js": /*!***************************************************************************!*\ !*** ./node_modules/@babel/generator/lib/generators/template-literals.js ***! \***************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TaggedTemplateExpression = TaggedTemplateExpression; exports.TemplateElement = TemplateElement; exports.TemplateLiteral = TemplateLiteral; exports._printTemplate = _printTemplate; function TaggedTemplateExpression(node) { this.print(node.tag); { this.print(node.typeParameters); } this.print(node.quasi); } function TemplateElement() { throw new Error("TemplateElement printing is handled in TemplateLiteral"); } function _printTemplate(node, substitutions) { const quasis = node.quasis; let partRaw = "`"; for (let i = 0; i < quasis.length - 1; i++) { partRaw += quasis[i].value.raw; this.token(partRaw + "${", true); this.print(substitutions[i]); partRaw = "}"; if (this.tokenMap) { const token = this.tokenMap.findMatching(node, "}", i); if (token) this._catchUpTo(token.loc.start); } } partRaw += quasis[quasis.length - 1].value.raw; this.token(partRaw + "`", true); } function TemplateLiteral(node) { this._printTemplate(node, node.expressions); } //# sourceMappingURL=template-literals.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/generators/types.js": /*!***************************************************************!*\ !*** ./node_modules/@babel/generator/lib/generators/types.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ArgumentPlaceholder = ArgumentPlaceholder; exports.ArrayPattern = exports.ArrayExpression = ArrayExpression; exports.BigIntLiteral = BigIntLiteral; exports.BooleanLiteral = BooleanLiteral; exports.Identifier = Identifier; exports.NullLiteral = NullLiteral; exports.NumericLiteral = NumericLiteral; exports.ObjectPattern = exports.ObjectExpression = ObjectExpression; exports.ObjectMethod = ObjectMethod; exports.ObjectProperty = ObjectProperty; exports.PipelineBareFunction = PipelineBareFunction; exports.PipelinePrimaryTopicReference = PipelinePrimaryTopicReference; exports.PipelineTopicExpression = PipelineTopicExpression; exports.RecordExpression = RecordExpression; exports.RegExpLiteral = RegExpLiteral; exports.SpreadElement = exports.RestElement = RestElement; exports.StringLiteral = StringLiteral; exports.TopicReference = TopicReference; exports.TupleExpression = TupleExpression; exports.VoidPattern = VoidPattern; exports._getRawIdentifier = _getRawIdentifier; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _jsesc = __webpack_require__(/*! jsesc */ "./node_modules/jsesc/jsesc.js"); const { isAssignmentPattern, isIdentifier } = _t; let lastRawIdentNode = null; let lastRawIdentResult = ""; function _getRawIdentifier(node) { if (node === lastRawIdentNode) return lastRawIdentResult; lastRawIdentNode = node; const { name } = node; const token = this.tokenMap.find(node, tok => tok.value === name); if (token) { lastRawIdentResult = this._originalCode.slice(token.start, token.end); return lastRawIdentResult; } return lastRawIdentResult = node.name; } function Identifier(node) { var _node$loc; this.sourceIdentifierName(((_node$loc = node.loc) == null ? void 0 : _node$loc.identifierName) || node.name); this.word(this.tokenMap ? this._getRawIdentifier(node) : node.name); } function ArgumentPlaceholder() { this.tokenChar(63); } function RestElement(node) { this.token("..."); this.print(node.argument); } function ObjectExpression(node) { const props = node.properties; this.tokenChar(123); if (props.length) { const exit = this.enterDelimited(); this.space(); this.printList(props, this.shouldPrintTrailingComma("}"), true, true); this.space(); exit(); } this.sourceWithOffset("end", node.loc, -1); this.tokenChar(125); } function ObjectMethod(node) { this.printJoin(node.decorators); this._methodHead(node); this.space(); this.print(node.body); } function ObjectProperty(node) { this.printJoin(node.decorators); if (node.computed) { this.tokenChar(91); this.print(node.key); this.tokenChar(93); } else { if (isAssignmentPattern(node.value) && isIdentifier(node.key) && node.key.name === node.value.left.name) { this.print(node.value); return; } this.print(node.key); if (node.shorthand && isIdentifier(node.key) && isIdentifier(node.value) && node.key.name === node.value.name) { return; } } this.tokenChar(58); this.space(); this.print(node.value); } function ArrayExpression(node) { const elems = node.elements; const len = elems.length; this.tokenChar(91); const exit = this.enterDelimited(); for (let i = 0; i < elems.length; i++) { const elem = elems[i]; if (elem) { if (i > 0) this.space(); this.print(elem); if (i < len - 1 || this.shouldPrintTrailingComma("]")) { this.token(",", false, i); } } else { this.token(",", false, i); } } exit(); this.tokenChar(93); } function RecordExpression(node) { const props = node.properties; let startToken; let endToken; { if (this.format.recordAndTupleSyntaxType === "bar") { startToken = "{|"; endToken = "|}"; } else if (this.format.recordAndTupleSyntaxType !== "hash" && this.format.recordAndTupleSyntaxType != null) { throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`); } else { startToken = "#{"; endToken = "}"; } } this.token(startToken); if (props.length) { this.space(); this.printList(props, this.shouldPrintTrailingComma(endToken), true, true); this.space(); } this.token(endToken); } function TupleExpression(node) { const elems = node.elements; const len = elems.length; let startToken; let endToken; { if (this.format.recordAndTupleSyntaxType === "bar") { startToken = "[|"; endToken = "|]"; } else if (this.format.recordAndTupleSyntaxType === "hash") { startToken = "#["; endToken = "]"; } else { throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`); } } this.token(startToken); for (let i = 0; i < elems.length; i++) { const elem = elems[i]; if (elem) { if (i > 0) this.space(); this.print(elem); if (i < len - 1 || this.shouldPrintTrailingComma(endToken)) { this.token(",", false, i); } } } this.token(endToken); } function RegExpLiteral(node) { this.word(`/${node.pattern}/${node.flags}`); } function BooleanLiteral(node) { this.word(node.value ? "true" : "false"); } function NullLiteral() { this.word("null"); } function NumericLiteral(node) { const raw = this.getPossibleRaw(node); const opts = this.format.jsescOption; const value = node.value; const str = value + ""; if (opts.numbers) { this.number(_jsesc(value, opts), value); } else if (raw == null) { this.number(str, value); } else if (this.format.minified) { this.number(raw.length < str.length ? raw : str, value); } else { this.number(raw, value); } } function StringLiteral(node) { const raw = this.getPossibleRaw(node); if (!this.format.minified && raw !== undefined) { this.token(raw); return; } const val = _jsesc(node.value, this.format.jsescOption); this.token(val); } function BigIntLiteral(node) { const raw = this.getPossibleRaw(node); if (!this.format.minified && raw !== undefined) { this.word(raw); return; } this.word(node.value + "n"); } const validTopicTokenSet = new Set(["^^", "@@", "^", "%", "#"]); function TopicReference() { const { topicToken } = this.format; if (validTopicTokenSet.has(topicToken)) { this.token(topicToken); } else { const givenTopicTokenJSON = JSON.stringify(topicToken); const validTopics = Array.from(validTopicTokenSet, v => JSON.stringify(v)); throw new Error(`The "topicToken" generator option must be one of ` + `${validTopics.join(", ")} (${givenTopicTokenJSON} received instead).`); } } function PipelineTopicExpression(node) { this.print(node.expression); } function PipelineBareFunction(node) { this.print(node.callee); } function PipelinePrimaryTopicReference() { this.tokenChar(35); } function VoidPattern() { this.word("void"); } //# sourceMappingURL=types.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/generators/typescript.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/generator/lib/generators/typescript.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TSAnyKeyword = TSAnyKeyword; exports.TSArrayType = TSArrayType; exports.TSSatisfiesExpression = exports.TSAsExpression = TSTypeExpression; exports.TSBigIntKeyword = TSBigIntKeyword; exports.TSBooleanKeyword = TSBooleanKeyword; exports.TSCallSignatureDeclaration = TSCallSignatureDeclaration; exports.TSInterfaceHeritage = exports.TSClassImplements = TSClassImplements; exports.TSConditionalType = TSConditionalType; exports.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration; exports.TSConstructorType = TSConstructorType; exports.TSDeclareFunction = TSDeclareFunction; exports.TSDeclareMethod = TSDeclareMethod; exports.TSEnumBody = TSEnumBody; exports.TSEnumDeclaration = TSEnumDeclaration; exports.TSEnumMember = TSEnumMember; exports.TSExportAssignment = TSExportAssignment; exports.TSExternalModuleReference = TSExternalModuleReference; exports.TSFunctionType = TSFunctionType; exports.TSImportEqualsDeclaration = TSImportEqualsDeclaration; exports.TSImportType = TSImportType; exports.TSIndexSignature = TSIndexSignature; exports.TSIndexedAccessType = TSIndexedAccessType; exports.TSInferType = TSInferType; exports.TSInstantiationExpression = TSInstantiationExpression; exports.TSInterfaceBody = TSInterfaceBody; exports.TSInterfaceDeclaration = TSInterfaceDeclaration; exports.TSIntersectionType = TSIntersectionType; exports.TSIntrinsicKeyword = TSIntrinsicKeyword; exports.TSLiteralType = TSLiteralType; exports.TSMappedType = TSMappedType; exports.TSMethodSignature = TSMethodSignature; exports.TSModuleBlock = TSModuleBlock; exports.TSModuleDeclaration = TSModuleDeclaration; exports.TSNamedTupleMember = TSNamedTupleMember; exports.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration; exports.TSNeverKeyword = TSNeverKeyword; exports.TSNonNullExpression = TSNonNullExpression; exports.TSNullKeyword = TSNullKeyword; exports.TSNumberKeyword = TSNumberKeyword; exports.TSObjectKeyword = TSObjectKeyword; exports.TSOptionalType = TSOptionalType; exports.TSParameterProperty = TSParameterProperty; exports.TSParenthesizedType = TSParenthesizedType; exports.TSPropertySignature = TSPropertySignature; exports.TSQualifiedName = TSQualifiedName; exports.TSRestType = TSRestType; exports.TSStringKeyword = TSStringKeyword; exports.TSSymbolKeyword = TSSymbolKeyword; exports.TSTemplateLiteralType = TSTemplateLiteralType; exports.TSThisType = TSThisType; exports.TSTupleType = TSTupleType; exports.TSTypeAliasDeclaration = TSTypeAliasDeclaration; exports.TSTypeAnnotation = TSTypeAnnotation; exports.TSTypeAssertion = TSTypeAssertion; exports.TSTypeLiteral = TSTypeLiteral; exports.TSTypeOperator = TSTypeOperator; exports.TSTypeParameter = TSTypeParameter; exports.TSTypeParameterDeclaration = exports.TSTypeParameterInstantiation = TSTypeParameterInstantiation; exports.TSTypePredicate = TSTypePredicate; exports.TSTypeQuery = TSTypeQuery; exports.TSTypeReference = TSTypeReference; exports.TSUndefinedKeyword = TSUndefinedKeyword; exports.TSUnionType = TSUnionType; exports.TSUnknownKeyword = TSUnknownKeyword; exports.TSVoidKeyword = TSVoidKeyword; exports.tsPrintClassMemberModifiers = tsPrintClassMemberModifiers; exports.tsPrintFunctionOrConstructorType = tsPrintFunctionOrConstructorType; exports.tsPrintPropertyOrMethodName = tsPrintPropertyOrMethodName; exports.tsPrintSignatureDeclarationBase = tsPrintSignatureDeclarationBase; function TSTypeAnnotation(node, parent) { this.token((parent.type === "TSFunctionType" || parent.type === "TSConstructorType") && parent.typeAnnotation === node ? "=>" : ":"); this.space(); if (node.optional) this.tokenChar(63); this.print(node.typeAnnotation); } function TSTypeParameterInstantiation(node, parent) { this.tokenChar(60); let printTrailingSeparator = parent.type === "ArrowFunctionExpression" && node.params.length === 1; if (this.tokenMap && node.start != null && node.end != null) { printTrailingSeparator && (printTrailingSeparator = !!this.tokenMap.find(node, t => this.tokenMap.matchesOriginal(t, ","))); printTrailingSeparator || (printTrailingSeparator = this.shouldPrintTrailingComma(">")); } this.printList(node.params, printTrailingSeparator); this.tokenChar(62); } function TSTypeParameter(node) { if (node.const) { this.word("const"); this.space(); } if (node.in) { this.word("in"); this.space(); } if (node.out) { this.word("out"); this.space(); } this.word(node.name); if (node.constraint) { this.space(); this.word("extends"); this.space(); this.print(node.constraint); } if (node.default) { this.space(); this.tokenChar(61); this.space(); this.print(node.default); } } function TSParameterProperty(node) { if (node.accessibility) { this.word(node.accessibility); this.space(); } if (node.readonly) { this.word("readonly"); this.space(); } this._param(node.parameter); } function TSDeclareFunction(node, parent) { if (node.declare) { this.word("declare"); this.space(); } this._functionHead(node, parent); this.semicolon(); } function TSDeclareMethod(node) { this._classMethodHead(node); this.semicolon(); } function TSQualifiedName(node) { this.print(node.left); this.tokenChar(46); this.print(node.right); } function TSCallSignatureDeclaration(node) { this.tsPrintSignatureDeclarationBase(node); maybePrintTrailingCommaOrSemicolon(this, node); } function maybePrintTrailingCommaOrSemicolon(printer, node) { if (!printer.tokenMap || !node.start || !node.end) { printer.semicolon(); return; } if (printer.tokenMap.endMatches(node, ",")) { printer.token(","); } else if (printer.tokenMap.endMatches(node, ";")) { printer.semicolon(); } } function TSConstructSignatureDeclaration(node) { this.word("new"); this.space(); this.tsPrintSignatureDeclarationBase(node); maybePrintTrailingCommaOrSemicolon(this, node); } function TSPropertySignature(node) { const { readonly } = node; if (readonly) { this.word("readonly"); this.space(); } this.tsPrintPropertyOrMethodName(node); this.print(node.typeAnnotation); maybePrintTrailingCommaOrSemicolon(this, node); } function tsPrintPropertyOrMethodName(node) { if (node.computed) { this.tokenChar(91); } this.print(node.key); if (node.computed) { this.tokenChar(93); } if (node.optional) { this.tokenChar(63); } } function TSMethodSignature(node) { const { kind } = node; if (kind === "set" || kind === "get") { this.word(kind); this.space(); } this.tsPrintPropertyOrMethodName(node); this.tsPrintSignatureDeclarationBase(node); maybePrintTrailingCommaOrSemicolon(this, node); } function TSIndexSignature(node) { const { readonly, static: isStatic } = node; if (isStatic) { this.word("static"); this.space(); } if (readonly) { this.word("readonly"); this.space(); } this.tokenChar(91); this._parameters(node.parameters, "]"); this.print(node.typeAnnotation); maybePrintTrailingCommaOrSemicolon(this, node); } function TSAnyKeyword() { this.word("any"); } function TSBigIntKeyword() { this.word("bigint"); } function TSUnknownKeyword() { this.word("unknown"); } function TSNumberKeyword() { this.word("number"); } function TSObjectKeyword() { this.word("object"); } function TSBooleanKeyword() { this.word("boolean"); } function TSStringKeyword() { this.word("string"); } function TSSymbolKeyword() { this.word("symbol"); } function TSVoidKeyword() { this.word("void"); } function TSUndefinedKeyword() { this.word("undefined"); } function TSNullKeyword() { this.word("null"); } function TSNeverKeyword() { this.word("never"); } function TSIntrinsicKeyword() { this.word("intrinsic"); } function TSThisType() { this.word("this"); } function TSFunctionType(node) { this.tsPrintFunctionOrConstructorType(node); } function TSConstructorType(node) { if (node.abstract) { this.word("abstract"); this.space(); } this.word("new"); this.space(); this.tsPrintFunctionOrConstructorType(node); } function tsPrintFunctionOrConstructorType(node) { const { typeParameters } = node; const parameters = node.parameters; this.print(typeParameters); this.tokenChar(40); this._parameters(parameters, ")"); this.space(); const returnType = node.typeAnnotation; this.print(returnType); } function TSTypeReference(node) { const typeArguments = node.typeParameters; this.print(node.typeName, !!typeArguments); this.print(typeArguments); } function TSTypePredicate(node) { if (node.asserts) { this.word("asserts"); this.space(); } this.print(node.parameterName); if (node.typeAnnotation) { this.space(); this.word("is"); this.space(); this.print(node.typeAnnotation.typeAnnotation); } } function TSTypeQuery(node) { this.word("typeof"); this.space(); this.print(node.exprName); const typeArguments = node.typeParameters; if (typeArguments) { this.print(typeArguments); } } function TSTypeLiteral(node) { printBraced(this, node, () => this.printJoin(node.members, true, true)); } function TSArrayType(node) { this.print(node.elementType, true); this.tokenChar(91); this.tokenChar(93); } function TSTupleType(node) { this.tokenChar(91); this.printList(node.elementTypes, this.shouldPrintTrailingComma("]")); this.tokenChar(93); } function TSOptionalType(node) { this.print(node.typeAnnotation); this.tokenChar(63); } function TSRestType(node) { this.token("..."); this.print(node.typeAnnotation); } function TSNamedTupleMember(node) { this.print(node.label); if (node.optional) this.tokenChar(63); this.tokenChar(58); this.space(); this.print(node.elementType); } function TSUnionType(node) { tsPrintUnionOrIntersectionType(this, node, "|"); } function TSIntersectionType(node) { tsPrintUnionOrIntersectionType(this, node, "&"); } function tsPrintUnionOrIntersectionType(printer, node, sep) { var _printer$tokenMap; let hasLeadingToken = 0; if ((_printer$tokenMap = printer.tokenMap) != null && _printer$tokenMap.startMatches(node, sep)) { hasLeadingToken = 1; printer.token(sep); } printer.printJoin(node.types, undefined, undefined, function (i) { this.space(); this.token(sep, null, i + hasLeadingToken); this.space(); }); } function TSConditionalType(node) { this.print(node.checkType); this.space(); this.word("extends"); this.space(); this.print(node.extendsType); this.space(); this.tokenChar(63); this.space(); this.print(node.trueType); this.space(); this.tokenChar(58); this.space(); this.print(node.falseType); } function TSInferType(node) { this.word("infer"); this.print(node.typeParameter); } function TSParenthesizedType(node) { this.tokenChar(40); this.print(node.typeAnnotation); this.tokenChar(41); } function TSTypeOperator(node) { this.word(node.operator); this.space(); this.print(node.typeAnnotation); } function TSIndexedAccessType(node) { this.print(node.objectType, true); this.tokenChar(91); this.print(node.indexType); this.tokenChar(93); } function TSMappedType(node) { const { nameType, optional, readonly, typeAnnotation } = node; this.tokenChar(123); const exit = this.enterDelimited(); this.space(); if (readonly) { tokenIfPlusMinus(this, readonly); this.word("readonly"); this.space(); } this.tokenChar(91); { this.word(node.typeParameter.name); } this.space(); this.word("in"); this.space(); { this.print(node.typeParameter.constraint); } if (nameType) { this.space(); this.word("as"); this.space(); this.print(nameType); } this.tokenChar(93); if (optional) { tokenIfPlusMinus(this, optional); this.tokenChar(63); } if (typeAnnotation) { this.tokenChar(58); this.space(); this.print(typeAnnotation); } this.space(); exit(); this.tokenChar(125); } function tokenIfPlusMinus(self, tok) { if (tok !== true) { self.token(tok); } } function TSTemplateLiteralType(node) { this._printTemplate(node, node.types); } function TSLiteralType(node) { this.print(node.literal); } function TSClassImplements(node) { this.print(node.expression); this.print(node.typeArguments); } function TSInterfaceDeclaration(node) { const { declare, id, typeParameters, extends: extendz, body } = node; if (declare) { this.word("declare"); this.space(); } this.word("interface"); this.space(); this.print(id); this.print(typeParameters); if (extendz != null && extendz.length) { this.space(); this.word("extends"); this.space(); this.printList(extendz); } this.space(); this.print(body); } function TSInterfaceBody(node) { printBraced(this, node, () => this.printJoin(node.body, true, true)); } function TSTypeAliasDeclaration(node) { const { declare, id, typeParameters, typeAnnotation } = node; if (declare) { this.word("declare"); this.space(); } this.word("type"); this.space(); this.print(id); this.print(typeParameters); this.space(); this.tokenChar(61); this.space(); this.print(typeAnnotation); this.semicolon(); } function TSTypeExpression(node) { const { type, expression, typeAnnotation } = node; this.print(expression, true); this.space(); this.word(type === "TSAsExpression" ? "as" : "satisfies"); this.space(); this.print(typeAnnotation); } function TSTypeAssertion(node) { const { typeAnnotation, expression } = node; this.tokenChar(60); this.print(typeAnnotation); this.tokenChar(62); this.space(); this.print(expression); } function TSInstantiationExpression(node) { this.print(node.expression); { this.print(node.typeParameters); } } function TSEnumDeclaration(node) { const { declare, const: isConst, id } = node; if (declare) { this.word("declare"); this.space(); } if (isConst) { this.word("const"); this.space(); } this.word("enum"); this.space(); this.print(id); this.space(); { TSEnumBody.call(this, node); } } function TSEnumBody(node) { printBraced(this, node, () => { var _this$shouldPrintTrai; return this.printList(node.members, (_this$shouldPrintTrai = this.shouldPrintTrailingComma("}")) != null ? _this$shouldPrintTrai : true, true, true); }); } function TSEnumMember(node) { const { id, initializer } = node; this.print(id); if (initializer) { this.space(); this.tokenChar(61); this.space(); this.print(initializer); } } function TSModuleDeclaration(node) { const { declare, id, kind } = node; if (declare) { this.word("declare"); this.space(); } { if (!node.global) { this.word(kind != null ? kind : id.type === "Identifier" ? "namespace" : "module"); this.space(); } this.print(id); if (!node.body) { this.semicolon(); return; } let body = node.body; while (body.type === "TSModuleDeclaration") { this.tokenChar(46); this.print(body.id); body = body.body; } this.space(); this.print(body); } } function TSModuleBlock(node) { printBraced(this, node, () => this.printSequence(node.body, true)); } function TSImportType(node) { const { argument, qualifier, options } = node; this.word("import"); this.tokenChar(40); this.print(argument); if (options) { this.tokenChar(44); this.print(options); } this.tokenChar(41); if (qualifier) { this.tokenChar(46); this.print(qualifier); } const typeArguments = node.typeParameters; if (typeArguments) { this.print(typeArguments); } } function TSImportEqualsDeclaration(node) { const { id, moduleReference } = node; if (node.isExport) { this.word("export"); this.space(); } this.word("import"); this.space(); this.print(id); this.space(); this.tokenChar(61); this.space(); this.print(moduleReference); this.semicolon(); } function TSExternalModuleReference(node) { this.token("require("); this.print(node.expression); this.tokenChar(41); } function TSNonNullExpression(node) { this.print(node.expression); this.tokenChar(33); } function TSExportAssignment(node) { this.word("export"); this.space(); this.tokenChar(61); this.space(); this.print(node.expression); this.semicolon(); } function TSNamespaceExportDeclaration(node) { this.word("export"); this.space(); this.word("as"); this.space(); this.word("namespace"); this.space(); this.print(node.id); this.semicolon(); } function tsPrintSignatureDeclarationBase(node) { const { typeParameters } = node; const parameters = node.parameters; this.print(typeParameters); this.tokenChar(40); this._parameters(parameters, ")"); const returnType = node.typeAnnotation; this.print(returnType); } function tsPrintClassMemberModifiers(node) { const isPrivateField = node.type === "ClassPrivateProperty"; const isPublicField = node.type === "ClassAccessorProperty" || node.type === "ClassProperty"; printModifiersList(this, node, [isPublicField && node.declare && "declare", !isPrivateField && node.accessibility]); if (node.static) { this.word("static"); this.space(); } printModifiersList(this, node, [!isPrivateField && node.abstract && "abstract", !isPrivateField && node.override && "override", (isPublicField || isPrivateField) && node.readonly && "readonly"]); } function printBraced(printer, node, cb) { printer.token("{"); const exit = printer.enterDelimited(); cb(); exit(); printer.rightBrace(node); } function printModifiersList(printer, node, modifiers) { var _printer$tokenMap2; const modifiersSet = new Set(); for (const modifier of modifiers) { if (modifier) modifiersSet.add(modifier); } (_printer$tokenMap2 = printer.tokenMap) == null || _printer$tokenMap2.find(node, tok => { if (modifiersSet.has(tok.value)) { printer.token(tok.value); printer.space(); modifiersSet.delete(tok.value); return modifiersSet.size === 0; } }); for (const modifier of modifiersSet) { printer.word(modifier); printer.space(); } } //# sourceMappingURL=typescript.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/index.js": /*!****************************************************!*\ !*** ./node_modules/@babel/generator/lib/index.js ***! \****************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; exports.generate = generate; var _sourceMap = __webpack_require__(/*! ./source-map.js */ "./node_modules/@babel/generator/lib/source-map.js"); var _printer = __webpack_require__(/*! ./printer.js */ "./node_modules/@babel/generator/lib/printer.js"); function normalizeOptions(code, opts, ast) { if (opts.experimental_preserveFormat) { if (typeof code !== "string") { throw new Error("`experimental_preserveFormat` requires the original `code` to be passed to @babel/generator as a string"); } if (!opts.retainLines) { throw new Error("`experimental_preserveFormat` requires `retainLines` to be set to `true`"); } if (opts.compact && opts.compact !== "auto") { throw new Error("`experimental_preserveFormat` is not compatible with the `compact` option"); } if (opts.minified) { throw new Error("`experimental_preserveFormat` is not compatible with the `minified` option"); } if (opts.jsescOption) { throw new Error("`experimental_preserveFormat` is not compatible with the `jsescOption` option"); } if (!Array.isArray(ast.tokens)) { throw new Error("`experimental_preserveFormat` requires the AST to have attached the token of the input code. Make sure to enable the `tokens: true` parser option."); } } const format = { auxiliaryCommentBefore: opts.auxiliaryCommentBefore, auxiliaryCommentAfter: opts.auxiliaryCommentAfter, shouldPrintComment: opts.shouldPrintComment, preserveFormat: opts.experimental_preserveFormat, retainLines: opts.retainLines, retainFunctionParens: opts.retainFunctionParens, comments: opts.comments == null || opts.comments, compact: opts.compact, minified: opts.minified, concise: opts.concise, indent: { adjustMultilineComment: true, style: " " }, jsescOption: Object.assign({ quotes: "double", wrap: true, minimal: false }, opts.jsescOption), topicToken: opts.topicToken, importAttributesKeyword: opts.importAttributesKeyword }; { var _opts$recordAndTupleS; format.decoratorsBeforeExport = opts.decoratorsBeforeExport; format.jsescOption.json = opts.jsonCompatibleStrings; format.recordAndTupleSyntaxType = (_opts$recordAndTupleS = opts.recordAndTupleSyntaxType) != null ? _opts$recordAndTupleS : "hash"; } if (format.minified) { format.compact = true; format.shouldPrintComment = format.shouldPrintComment || (() => format.comments); } else { format.shouldPrintComment = format.shouldPrintComment || (value => format.comments || value.includes("@license") || value.includes("@preserve")); } if (format.compact === "auto") { format.compact = typeof code === "string" && code.length > 500000; if (format.compact) { console.error("[BABEL] Note: The code generator has deoptimised the styling of " + `${opts.filename} as it exceeds the max of ${"500KB"}.`); } } if (format.compact || format.preserveFormat) { format.indent.adjustMultilineComment = false; } const { auxiliaryCommentBefore, auxiliaryCommentAfter, shouldPrintComment } = format; if (auxiliaryCommentBefore && !shouldPrintComment(auxiliaryCommentBefore)) { format.auxiliaryCommentBefore = undefined; } if (auxiliaryCommentAfter && !shouldPrintComment(auxiliaryCommentAfter)) { format.auxiliaryCommentAfter = undefined; } return format; } { exports.CodeGenerator = class CodeGenerator { constructor(ast, opts = {}, code) { this._ast = void 0; this._format = void 0; this._map = void 0; this._ast = ast; this._format = normalizeOptions(code, opts, ast); this._map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null; } generate() { const printer = new _printer.default(this._format, this._map); return printer.generate(this._ast); } }; } function generate(ast, opts = {}, code) { const format = normalizeOptions(code, opts, ast); const map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null; const printer = new _printer.default(format, map, ast.tokens, typeof code === "string" ? code : null); return printer.generate(ast); } var _default = exports["default"] = generate; //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/node/index.js": /*!*********************************************************!*\ !*** ./node_modules/@babel/generator/lib/node/index.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TokenContext = void 0; exports.isLastChild = isLastChild; exports.needsParens = needsParens; exports.needsWhitespace = needsWhitespace; exports.needsWhitespaceAfter = needsWhitespaceAfter; exports.needsWhitespaceBefore = needsWhitespaceBefore; var whitespace = __webpack_require__(/*! ./whitespace.js */ "./node_modules/@babel/generator/lib/node/whitespace.js"); var parens = __webpack_require__(/*! ./parentheses.js */ "./node_modules/@babel/generator/lib/node/parentheses.js"); var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { FLIPPED_ALIAS_KEYS, VISITOR_KEYS, isCallExpression, isDecorator, isExpressionStatement, isMemberExpression, isNewExpression, isParenthesizedExpression } = _t; const TokenContext = exports.TokenContext = { normal: 0, expressionStatement: 1, arrowBody: 2, exportDefault: 4, arrowFlowReturnType: 8, forInitHead: 16, forInHead: 32, forOfHead: 64, forInOrInitHeadAccumulate: 128, forInOrInitHeadAccumulatePassThroughMask: 128 }; function expandAliases(obj) { const map = new Map(); function add(type, func) { const fn = map.get(type); map.set(type, fn ? function (node, parent, stack, getRawIdentifier) { var _fn; return (_fn = fn(node, parent, stack, getRawIdentifier)) != null ? _fn : func(node, parent, stack, getRawIdentifier); } : func); } for (const type of Object.keys(obj)) { const aliases = FLIPPED_ALIAS_KEYS[type]; if (aliases) { for (const alias of aliases) { add(alias, obj[type]); } } else { add(type, obj[type]); } } return map; } const expandedParens = expandAliases(parens); const expandedWhitespaceNodes = expandAliases(whitespace.nodes); function isOrHasCallExpression(node) { if (isCallExpression(node)) { return true; } return isMemberExpression(node) && isOrHasCallExpression(node.object); } function needsWhitespace(node, parent, type) { var _expandedWhitespaceNo; if (!node) return false; if (isExpressionStatement(node)) { node = node.expression; } const flag = (_expandedWhitespaceNo = expandedWhitespaceNodes.get(node.type)) == null ? void 0 : _expandedWhitespaceNo(node, parent); if (typeof flag === "number") { return (flag & type) !== 0; } return false; } function needsWhitespaceBefore(node, parent) { return needsWhitespace(node, parent, 1); } function needsWhitespaceAfter(node, parent) { return needsWhitespace(node, parent, 2); } function needsParens(node, parent, tokenContext, getRawIdentifier) { var _expandedParens$get; if (!parent) return false; if (isNewExpression(parent) && parent.callee === node) { if (isOrHasCallExpression(node)) return true; } if (isDecorator(parent)) { return !isDecoratorMemberExpression(node) && !(isCallExpression(node) && isDecoratorMemberExpression(node.callee)) && !isParenthesizedExpression(node); } return (_expandedParens$get = expandedParens.get(node.type)) == null ? void 0 : _expandedParens$get(node, parent, tokenContext, getRawIdentifier); } function isDecoratorMemberExpression(node) { switch (node.type) { case "Identifier": return true; case "MemberExpression": return !node.computed && node.property.type === "Identifier" && isDecoratorMemberExpression(node.object); default: return false; } } function isLastChild(parent, child) { const visitorKeys = VISITOR_KEYS[parent.type]; for (let i = visitorKeys.length - 1; i >= 0; i--) { const val = parent[visitorKeys[i]]; if (val === child) { return true; } else if (Array.isArray(val)) { let j = val.length - 1; while (j >= 0 && val[j] === null) j--; return j >= 0 && val[j] === child; } else if (val) { return false; } } return false; } //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/node/parentheses.js": /*!***************************************************************!*\ !*** ./node_modules/@babel/generator/lib/node/parentheses.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.AssignmentExpression = AssignmentExpression; exports.Binary = Binary; exports.BinaryExpression = BinaryExpression; exports.ClassExpression = ClassExpression; exports.ArrowFunctionExpression = exports.ConditionalExpression = ConditionalExpression; exports.DoExpression = DoExpression; exports.FunctionExpression = FunctionExpression; exports.FunctionTypeAnnotation = FunctionTypeAnnotation; exports.Identifier = Identifier; exports.LogicalExpression = LogicalExpression; exports.NullableTypeAnnotation = NullableTypeAnnotation; exports.ObjectExpression = ObjectExpression; exports.OptionalIndexedAccessType = OptionalIndexedAccessType; exports.OptionalCallExpression = exports.OptionalMemberExpression = OptionalMemberExpression; exports.SequenceExpression = SequenceExpression; exports.TSSatisfiesExpression = exports.TSAsExpression = TSAsExpression; exports.TSConditionalType = TSConditionalType; exports.TSConstructorType = exports.TSFunctionType = TSFunctionType; exports.TSInferType = TSInferType; exports.TSInstantiationExpression = TSInstantiationExpression; exports.TSIntersectionType = TSIntersectionType; exports.UnaryLike = exports.TSTypeAssertion = UnaryLike; exports.TSTypeOperator = TSTypeOperator; exports.TSUnionType = TSUnionType; exports.IntersectionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation; exports.UpdateExpression = UpdateExpression; exports.AwaitExpression = exports.YieldExpression = YieldExpression; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _index = __webpack_require__(/*! ./index.js */ "./node_modules/@babel/generator/lib/node/index.js"); const { isArrayTypeAnnotation, isBinaryExpression, isCallExpression, isForOfStatement, isIndexedAccessType, isMemberExpression, isObjectPattern, isOptionalMemberExpression, isYieldExpression, isStatement } = _t; const PRECEDENCE = new Map([["||", 0], ["??", 0], ["|>", 0], ["&&", 1], ["|", 2], ["^", 3], ["&", 4], ["==", 5], ["===", 5], ["!=", 5], ["!==", 5], ["<", 6], [">", 6], ["<=", 6], [">=", 6], ["in", 6], ["instanceof", 6], [">>", 7], ["<<", 7], [">>>", 7], ["+", 8], ["-", 8], ["*", 9], ["/", 9], ["%", 9], ["**", 10]]); function getBinaryPrecedence(node, nodeType) { if (nodeType === "BinaryExpression" || nodeType === "LogicalExpression") { return PRECEDENCE.get(node.operator); } if (nodeType === "TSAsExpression" || nodeType === "TSSatisfiesExpression") { return PRECEDENCE.get("in"); } } function isTSTypeExpression(nodeType) { return nodeType === "TSAsExpression" || nodeType === "TSSatisfiesExpression" || nodeType === "TSTypeAssertion"; } const isClassExtendsClause = (node, parent) => { const parentType = parent.type; return (parentType === "ClassDeclaration" || parentType === "ClassExpression") && parent.superClass === node; }; const hasPostfixPart = (node, parent) => { const parentType = parent.type; return (parentType === "MemberExpression" || parentType === "OptionalMemberExpression") && parent.object === node || (parentType === "CallExpression" || parentType === "OptionalCallExpression" || parentType === "NewExpression") && parent.callee === node || parentType === "TaggedTemplateExpression" && parent.tag === node || parentType === "TSNonNullExpression"; }; function NullableTypeAnnotation(node, parent) { return isArrayTypeAnnotation(parent); } function FunctionTypeAnnotation(node, parent, tokenContext) { const parentType = parent.type; return (parentType === "UnionTypeAnnotation" || parentType === "IntersectionTypeAnnotation" || parentType === "ArrayTypeAnnotation" || Boolean(tokenContext & _index.TokenContext.arrowFlowReturnType) ); } function UpdateExpression(node, parent) { return hasPostfixPart(node, parent) || isClassExtendsClause(node, parent); } function needsParenBeforeExpressionBrace(tokenContext) { return Boolean(tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.arrowBody)); } function ObjectExpression(node, parent, tokenContext) { return needsParenBeforeExpressionBrace(tokenContext); } function DoExpression(node, parent, tokenContext) { return !node.async && Boolean(tokenContext & _index.TokenContext.expressionStatement); } function Binary(node, parent) { const parentType = parent.type; if (node.type === "BinaryExpression" && node.operator === "**" && parentType === "BinaryExpression" && parent.operator === "**") { return parent.left === node; } if (isClassExtendsClause(node, parent)) { return true; } if (hasPostfixPart(node, parent) || parentType === "UnaryExpression" || parentType === "SpreadElement" || parentType === "AwaitExpression") { return true; } const parentPos = getBinaryPrecedence(parent, parentType); if (parentPos != null) { const nodePos = getBinaryPrecedence(node, node.type); if (parentPos === nodePos && parentType === "BinaryExpression" && parent.right === node || parentPos > nodePos) { return true; } } return undefined; } function UnionTypeAnnotation(node, parent) { const parentType = parent.type; return parentType === "ArrayTypeAnnotation" || parentType === "NullableTypeAnnotation" || parentType === "IntersectionTypeAnnotation" || parentType === "UnionTypeAnnotation"; } function OptionalIndexedAccessType(node, parent) { return isIndexedAccessType(parent) && parent.objectType === node; } function TSAsExpression(node, parent) { if ((parent.type === "AssignmentExpression" || parent.type === "AssignmentPattern") && parent.left === node) { return true; } if (parent.type === "BinaryExpression" && (parent.operator === "|" || parent.operator === "&") && node === parent.left) { return true; } return Binary(node, parent); } function TSConditionalType(node, parent) { const parentType = parent.type; if (parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType" || parentType === "TSTypeOperator" || parentType === "TSTypeParameter") { return true; } if ((parentType === "TSIntersectionType" || parentType === "TSUnionType") && parent.types[0] === node) { return true; } if (parentType === "TSConditionalType" && (parent.checkType === node || parent.extendsType === node)) { return true; } return false; } function TSUnionType(node, parent) { const parentType = parent.type; return parentType === "TSIntersectionType" || parentType === "TSTypeOperator" || parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType"; } function TSIntersectionType(node, parent) { const parentType = parent.type; return parentType === "TSTypeOperator" || parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType"; } function TSInferType(node, parent) { const parentType = parent.type; if (parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType") { return true; } if (node.typeParameter.constraint) { if ((parentType === "TSIntersectionType" || parentType === "TSUnionType") && parent.types[0] === node) { return true; } } return false; } function TSTypeOperator(node, parent) { const parentType = parent.type; return parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSOptionalType"; } function TSInstantiationExpression(node, parent) { const parentType = parent.type; return (parentType === "CallExpression" || parentType === "OptionalCallExpression" || parentType === "NewExpression" || parentType === "TSInstantiationExpression") && !!parent.typeParameters; } function TSFunctionType(node, parent) { const parentType = parent.type; return parentType === "TSIntersectionType" || parentType === "TSUnionType" || parentType === "TSTypeOperator" || parentType === "TSOptionalType" || parentType === "TSArrayType" || parentType === "TSIndexedAccessType" && parent.objectType === node || parentType === "TSConditionalType" && (parent.checkType === node || parent.extendsType === node); } function BinaryExpression(node, parent, tokenContext) { return node.operator === "in" && Boolean(tokenContext & _index.TokenContext.forInOrInitHeadAccumulate); } function SequenceExpression(node, parent) { const parentType = parent.type; if (parentType === "SequenceExpression" || parentType === "ParenthesizedExpression" || parentType === "MemberExpression" && parent.property === node || parentType === "OptionalMemberExpression" && parent.property === node || parentType === "TemplateLiteral") { return false; } if (parentType === "ClassDeclaration") { return true; } if (parentType === "ForOfStatement") { return parent.right === node; } if (parentType === "ExportDefaultDeclaration") { return true; } return !isStatement(parent); } function YieldExpression(node, parent) { const parentType = parent.type; return parentType === "BinaryExpression" || parentType === "LogicalExpression" || parentType === "UnaryExpression" || parentType === "SpreadElement" || hasPostfixPart(node, parent) || parentType === "AwaitExpression" && isYieldExpression(node) || parentType === "ConditionalExpression" && node === parent.test || isClassExtendsClause(node, parent) || isTSTypeExpression(parentType); } function ClassExpression(node, parent, tokenContext) { return Boolean(tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.exportDefault)); } function UnaryLike(node, parent) { return hasPostfixPart(node, parent) || isBinaryExpression(parent) && parent.operator === "**" && parent.left === node || isClassExtendsClause(node, parent); } function FunctionExpression(node, parent, tokenContext) { return Boolean(tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.exportDefault)); } function ConditionalExpression(node, parent) { const parentType = parent.type; if (parentType === "UnaryExpression" || parentType === "SpreadElement" || parentType === "BinaryExpression" || parentType === "LogicalExpression" || parentType === "ConditionalExpression" && parent.test === node || parentType === "AwaitExpression" || isTSTypeExpression(parentType)) { return true; } return UnaryLike(node, parent); } function OptionalMemberExpression(node, parent) { return isCallExpression(parent) && parent.callee === node || isMemberExpression(parent) && parent.object === node; } function AssignmentExpression(node, parent, tokenContext) { if (needsParenBeforeExpressionBrace(tokenContext) && isObjectPattern(node.left)) { return true; } else { return ConditionalExpression(node, parent); } } function LogicalExpression(node, parent) { const parentType = parent.type; if (isTSTypeExpression(parentType)) return true; if (parentType !== "LogicalExpression") return false; switch (node.operator) { case "||": return parent.operator === "??" || parent.operator === "&&"; case "&&": return parent.operator === "??"; case "??": return parent.operator !== "??"; } } function Identifier(node, parent, tokenContext, getRawIdentifier) { var _node$extra; const parentType = parent.type; if ((_node$extra = node.extra) != null && _node$extra.parenthesized && parentType === "AssignmentExpression" && parent.left === node) { const rightType = parent.right.type; if ((rightType === "FunctionExpression" || rightType === "ClassExpression") && parent.right.id == null) { return true; } } if (getRawIdentifier && getRawIdentifier(node) !== node.name) { return false; } if (node.name === "let") { const isFollowedByBracket = isMemberExpression(parent, { object: node, computed: true }) || isOptionalMemberExpression(parent, { object: node, computed: true, optional: false }); if (isFollowedByBracket && tokenContext & (_index.TokenContext.expressionStatement | _index.TokenContext.forInitHead | _index.TokenContext.forInHead)) { return true; } return Boolean(tokenContext & _index.TokenContext.forOfHead); } return node.name === "async" && isForOfStatement(parent, { left: node, await: false }); } //# sourceMappingURL=parentheses.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/node/whitespace.js": /*!**************************************************************!*\ !*** ./node_modules/@babel/generator/lib/node/whitespace.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.nodes = void 0; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { FLIPPED_ALIAS_KEYS, isArrayExpression, isAssignmentExpression, isBinary, isBlockStatement, isCallExpression, isFunction, isIdentifier, isLiteral, isMemberExpression, isObjectExpression, isOptionalCallExpression, isOptionalMemberExpression, isStringLiteral } = _t; function crawlInternal(node, state) { if (!node) return state; if (isMemberExpression(node) || isOptionalMemberExpression(node)) { crawlInternal(node.object, state); if (node.computed) crawlInternal(node.property, state); } else if (isBinary(node) || isAssignmentExpression(node)) { crawlInternal(node.left, state); crawlInternal(node.right, state); } else if (isCallExpression(node) || isOptionalCallExpression(node)) { state.hasCall = true; crawlInternal(node.callee, state); } else if (isFunction(node)) { state.hasFunction = true; } else if (isIdentifier(node)) { state.hasHelper = state.hasHelper || node.callee && isHelper(node.callee); } return state; } function crawl(node) { return crawlInternal(node, { hasCall: false, hasFunction: false, hasHelper: false }); } function isHelper(node) { if (!node) return false; if (isMemberExpression(node)) { return isHelper(node.object) || isHelper(node.property); } else if (isIdentifier(node)) { return node.name === "require" || node.name.charCodeAt(0) === 95; } else if (isCallExpression(node)) { return isHelper(node.callee); } else if (isBinary(node) || isAssignmentExpression(node)) { return isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right); } else { return false; } } function isType(node) { return isLiteral(node) || isObjectExpression(node) || isArrayExpression(node) || isIdentifier(node) || isMemberExpression(node); } const nodes = exports.nodes = { AssignmentExpression(node) { const state = crawl(node.right); if (state.hasCall && state.hasHelper || state.hasFunction) { return state.hasFunction ? 1 | 2 : 2; } }, SwitchCase(node, parent) { return (!!node.consequent.length || parent.cases[0] === node ? 1 : 0) | (!node.consequent.length && parent.cases[parent.cases.length - 1] === node ? 2 : 0); }, LogicalExpression(node) { if (isFunction(node.left) || isFunction(node.right)) { return 2; } }, Literal(node) { if (isStringLiteral(node) && node.value === "use strict") { return 2; } }, CallExpression(node) { if (isFunction(node.callee) || isHelper(node)) { return 1 | 2; } }, OptionalCallExpression(node) { if (isFunction(node.callee)) { return 1 | 2; } }, VariableDeclaration(node) { for (let i = 0; i < node.declarations.length; i++) { const declar = node.declarations[i]; let enabled = isHelper(declar.id) && !isType(declar.init); if (!enabled && declar.init) { const state = crawl(declar.init); enabled = isHelper(declar.init) && state.hasCall || state.hasFunction; } if (enabled) { return 1 | 2; } } }, IfStatement(node) { if (isBlockStatement(node.consequent)) { return 1 | 2; } } }; nodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function (node, parent) { if (parent.properties[0] === node) { return 1; } }; nodes.ObjectTypeCallProperty = function (node, parent) { var _parent$properties; if (parent.callProperties[0] === node && !((_parent$properties = parent.properties) != null && _parent$properties.length)) { return 1; } }; nodes.ObjectTypeIndexer = function (node, parent) { var _parent$properties2, _parent$callPropertie; if (parent.indexers[0] === node && !((_parent$properties2 = parent.properties) != null && _parent$properties2.length) && !((_parent$callPropertie = parent.callProperties) != null && _parent$callPropertie.length)) { return 1; } }; nodes.ObjectTypeInternalSlot = function (node, parent) { var _parent$properties3, _parent$callPropertie2, _parent$indexers; if (parent.internalSlots[0] === node && !((_parent$properties3 = parent.properties) != null && _parent$properties3.length) && !((_parent$callPropertie2 = parent.callProperties) != null && _parent$callPropertie2.length) && !((_parent$indexers = parent.indexers) != null && _parent$indexers.length)) { return 1; } }; [["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function ([type, amounts]) { [type].concat(FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) { const ret = amounts ? 1 | 2 : 0; nodes[type] = () => ret; }); }); //# sourceMappingURL=whitespace.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/printer.js": /*!******************************************************!*\ !*** ./node_modules/@babel/generator/lib/printer.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _buffer = __webpack_require__(/*! ./buffer.js */ "./node_modules/@babel/generator/lib/buffer.js"); var _index = __webpack_require__(/*! ./node/index.js */ "./node_modules/@babel/generator/lib/node/index.js"); var n = _index; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _tokenMap = __webpack_require__(/*! ./token-map.js */ "./node_modules/@babel/generator/lib/token-map.js"); var generatorFunctions = __webpack_require__(/*! ./generators/index.js */ "./node_modules/@babel/generator/lib/generators/index.js"); var _deprecated = __webpack_require__(/*! ./generators/deprecated.js */ "./node_modules/@babel/generator/lib/generators/deprecated.js"); const { isExpression, isFunction, isStatement, isClassBody, isTSInterfaceBody, isTSEnumMember } = _t; const SCIENTIFIC_NOTATION = /e/i; const ZERO_DECIMAL_INTEGER = /\.0+$/; const HAS_NEWLINE = /[\n\r\u2028\u2029]/; const HAS_NEWLINE_OR_BlOCK_COMMENT_END = /[\n\r\u2028\u2029]|\*\//; function commentIsNewline(c) { return c.type === "CommentLine" || HAS_NEWLINE.test(c.value); } const { needsParens } = n; class Printer { constructor(format, map, tokens, originalCode) { this.tokenContext = _index.TokenContext.normal; this._tokens = null; this._originalCode = null; this._currentNode = null; this._indent = 0; this._indentRepeat = 0; this._insideAux = false; this._noLineTerminator = false; this._noLineTerminatorAfterNode = null; this._printAuxAfterOnNextUserNode = false; this._printedComments = new Set(); this._endsWithInteger = false; this._endsWithWord = false; this._endsWithDiv = false; this._lastCommentLine = 0; this._endsWithInnerRaw = false; this._indentInnerComments = true; this.tokenMap = null; this._boundGetRawIdentifier = this._getRawIdentifier.bind(this); this._printSemicolonBeforeNextNode = -1; this._printSemicolonBeforeNextToken = -1; this.format = format; this._tokens = tokens; this._originalCode = originalCode; this._indentRepeat = format.indent.style.length; this._inputMap = map == null ? void 0 : map._inputMap; this._buf = new _buffer.default(map, format.indent.style[0]); } enterForStatementInit() { this.tokenContext |= _index.TokenContext.forInitHead | _index.TokenContext.forInOrInitHeadAccumulate; return () => this.tokenContext = _index.TokenContext.normal; } enterForXStatementInit(isForOf) { if (isForOf) { this.tokenContext |= _index.TokenContext.forOfHead; return null; } else { this.tokenContext |= _index.TokenContext.forInHead | _index.TokenContext.forInOrInitHeadAccumulate; return () => this.tokenContext = _index.TokenContext.normal; } } enterDelimited() { const oldTokenContext = this.tokenContext; const oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode; if (!(oldTokenContext & _index.TokenContext.forInOrInitHeadAccumulate) && oldNoLineTerminatorAfterNode === null) { return () => {}; } this._noLineTerminatorAfterNode = null; this.tokenContext = _index.TokenContext.normal; return () => { this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode; this.tokenContext = oldTokenContext; }; } generate(ast) { if (this.format.preserveFormat) { this.tokenMap = new _tokenMap.TokenMap(ast, this._tokens, this._originalCode); } this.print(ast); this._maybeAddAuxComment(); return this._buf.get(); } indent() { const { format } = this; if (format.preserveFormat || format.compact || format.concise) { return; } this._indent++; } dedent() { const { format } = this; if (format.preserveFormat || format.compact || format.concise) { return; } this._indent--; } semicolon(force = false) { this._maybeAddAuxComment(); if (force) { this._appendChar(59); this._noLineTerminator = false; return; } if (this.tokenMap) { const node = this._currentNode; if (node.start != null && node.end != null) { if (!this.tokenMap.endMatches(node, ";")) { this._printSemicolonBeforeNextNode = this._buf.getCurrentLine(); return; } const indexes = this.tokenMap.getIndexes(this._currentNode); this._catchUpTo(this._tokens[indexes[indexes.length - 1]].loc.start); } } this._queue(59); this._noLineTerminator = false; } rightBrace(node) { if (this.format.minified) { this._buf.removeLastSemicolon(); } this.sourceWithOffset("end", node.loc, -1); this.tokenChar(125); } rightParens(node) { this.sourceWithOffset("end", node.loc, -1); this.tokenChar(41); } space(force = false) { const { format } = this; if (format.compact || format.preserveFormat) return; if (force) { this._space(); } else if (this._buf.hasContent()) { const lastCp = this.getLastChar(); if (lastCp !== 32 && lastCp !== 10) { this._space(); } } } word(str, noLineTerminatorAfter = false) { this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask; this._maybePrintInnerComments(str); this._maybeAddAuxComment(); if (this.tokenMap) this._catchUpToCurrentToken(str); if (this._endsWithWord || this._endsWithDiv && str.charCodeAt(0) === 47) { this._space(); } this._append(str, false); this._endsWithWord = true; this._noLineTerminator = noLineTerminatorAfter; } number(str, number) { function isNonDecimalLiteral(str) { if (str.length > 2 && str.charCodeAt(0) === 48) { const secondChar = str.charCodeAt(1); return secondChar === 98 || secondChar === 111 || secondChar === 120; } return false; } this.word(str); this._endsWithInteger = Number.isInteger(number) && !isNonDecimalLiteral(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str.charCodeAt(str.length - 1) !== 46; } token(str, maybeNewline = false, occurrenceCount = 0) { this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask; this._maybePrintInnerComments(str, occurrenceCount); this._maybeAddAuxComment(); if (this.tokenMap) this._catchUpToCurrentToken(str, occurrenceCount); const lastChar = this.getLastChar(); const strFirst = str.charCodeAt(0); if (lastChar === 33 && (str === "--" || strFirst === 61) || strFirst === 43 && lastChar === 43 || strFirst === 45 && lastChar === 45 || strFirst === 46 && this._endsWithInteger) { this._space(); } this._append(str, maybeNewline); this._noLineTerminator = false; } tokenChar(char) { this.tokenContext &= _index.TokenContext.forInOrInitHeadAccumulatePassThroughMask; const str = String.fromCharCode(char); this._maybePrintInnerComments(str); this._maybeAddAuxComment(); if (this.tokenMap) this._catchUpToCurrentToken(str); const lastChar = this.getLastChar(); if (char === 43 && lastChar === 43 || char === 45 && lastChar === 45 || char === 46 && this._endsWithInteger) { this._space(); } this._appendChar(char); this._noLineTerminator = false; } newline(i = 1, force) { if (i <= 0) return; if (!force) { if (this.format.retainLines || this.format.compact) return; if (this.format.concise) { this.space(); return; } } if (i > 2) i = 2; i -= this._buf.getNewlineCount(); for (let j = 0; j < i; j++) { this._newline(); } return; } endsWith(char) { return this.getLastChar() === char; } getLastChar() { return this._buf.getLastChar(); } endsWithCharAndNewline() { return this._buf.endsWithCharAndNewline(); } removeTrailingNewline() { this._buf.removeTrailingNewline(); } exactSource(loc, cb) { if (!loc) { cb(); return; } this._catchUp("start", loc); this._buf.exactSource(loc, cb); } source(prop, loc) { if (!loc) return; this._catchUp(prop, loc); this._buf.source(prop, loc); } sourceWithOffset(prop, loc, columnOffset) { if (!loc || this.format.preserveFormat) return; this._catchUp(prop, loc); this._buf.sourceWithOffset(prop, loc, columnOffset); } sourceIdentifierName(identifierName, pos) { if (!this._buf._canMarkIdName) return; const sourcePosition = this._buf._sourcePosition; sourcePosition.identifierNamePos = pos; sourcePosition.identifierName = identifierName; } _space() { this._queue(32); } _newline() { this._queue(10); } _catchUpToCurrentToken(str, occurrenceCount = 0) { const token = this.tokenMap.findMatching(this._currentNode, str, occurrenceCount); if (token) this._catchUpTo(token.loc.start); if (this._printSemicolonBeforeNextToken !== -1 && this._printSemicolonBeforeNextToken === this._buf.getCurrentLine()) { this._buf.appendChar(59); this._endsWithWord = false; this._endsWithInteger = false; this._endsWithDiv = false; } this._printSemicolonBeforeNextToken = -1; this._printSemicolonBeforeNextNode = -1; } _append(str, maybeNewline) { this._maybeIndent(str.charCodeAt(0)); this._buf.append(str, maybeNewline); this._endsWithWord = false; this._endsWithInteger = false; this._endsWithDiv = false; } _appendChar(char) { this._maybeIndent(char); this._buf.appendChar(char); this._endsWithWord = false; this._endsWithInteger = false; this._endsWithDiv = false; } _queue(char) { this._maybeIndent(char); this._buf.queue(char); this._endsWithWord = false; this._endsWithInteger = false; } _maybeIndent(firstChar) { if (this._indent && firstChar !== 10 && this.endsWith(10)) { this._buf.queueIndentation(this._getIndent()); } } _shouldIndent(firstChar) { if (this._indent && firstChar !== 10 && this.endsWith(10)) { return true; } } catchUp(line) { if (!this.format.retainLines) return; const count = line - this._buf.getCurrentLine(); for (let i = 0; i < count; i++) { this._newline(); } } _catchUp(prop, loc) { const { format } = this; if (!format.preserveFormat) { if (format.retainLines && loc != null && loc[prop]) { this.catchUp(loc[prop].line); } return; } const pos = loc == null ? void 0 : loc[prop]; if (pos != null) this._catchUpTo(pos); } _catchUpTo({ line, column, index }) { const count = line - this._buf.getCurrentLine(); if (count > 0 && this._noLineTerminator) { return; } for (let i = 0; i < count; i++) { this._newline(); } const spacesCount = count > 0 ? column : column - this._buf.getCurrentColumn(); if (spacesCount > 0) { const spaces = this._originalCode ? this._originalCode.slice(index - spacesCount, index).replace(/[^\t\x0B\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]/gu, " ") : " ".repeat(spacesCount); this._append(spaces, false); } } _getIndent() { return this._indentRepeat * this._indent; } printTerminatorless(node) { this._noLineTerminator = true; this.print(node); } print(node, noLineTerminatorAfter, trailingCommentsLineOffset) { var _node$extra, _node$leadingComments, _node$leadingComments2; if (!node) return; this._endsWithInnerRaw = false; const nodeType = node.type; const format = this.format; const oldConcise = format.concise; if (node._compact) { format.concise = true; } const printMethod = this[nodeType]; if (printMethod === undefined) { throw new ReferenceError(`unknown node of type ${JSON.stringify(nodeType)} with constructor ${JSON.stringify(node.constructor.name)}`); } const parent = this._currentNode; this._currentNode = node; if (this.tokenMap) { this._printSemicolonBeforeNextToken = this._printSemicolonBeforeNextNode; } const oldInAux = this._insideAux; this._insideAux = node.loc == null; this._maybeAddAuxComment(this._insideAux && !oldInAux); const parenthesized = (_node$extra = node.extra) == null ? void 0 : _node$extra.parenthesized; let shouldPrintParens = parenthesized && format.preserveFormat || parenthesized && format.retainFunctionParens && nodeType === "FunctionExpression" || needsParens(node, parent, this.tokenContext, format.preserveFormat ? this._boundGetRawIdentifier : undefined); if (!shouldPrintParens && parenthesized && (_node$leadingComments = node.leadingComments) != null && _node$leadingComments.length && node.leadingComments[0].type === "CommentBlock") { const parentType = parent == null ? void 0 : parent.type; switch (parentType) { case "ExpressionStatement": case "VariableDeclarator": case "AssignmentExpression": case "ReturnStatement": break; case "CallExpression": case "OptionalCallExpression": case "NewExpression": if (parent.callee !== node) break; default: shouldPrintParens = true; } } let indentParenthesized = false; if (!shouldPrintParens && this._noLineTerminator && ((_node$leadingComments2 = node.leadingComments) != null && _node$leadingComments2.some(commentIsNewline) || this.format.retainLines && node.loc && node.loc.start.line > this._buf.getCurrentLine())) { shouldPrintParens = true; indentParenthesized = true; } let oldNoLineTerminatorAfterNode; let oldTokenContext; if (!shouldPrintParens) { noLineTerminatorAfter || (noLineTerminatorAfter = parent && this._noLineTerminatorAfterNode === parent && n.isLastChild(parent, node)); if (noLineTerminatorAfter) { var _node$trailingComment; if ((_node$trailingComment = node.trailingComments) != null && _node$trailingComment.some(commentIsNewline)) { if (isExpression(node)) shouldPrintParens = true; } else { oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode; this._noLineTerminatorAfterNode = node; } } } if (shouldPrintParens) { this.tokenChar(40); if (indentParenthesized) this.indent(); this._endsWithInnerRaw = false; if (this.tokenContext & _index.TokenContext.forInOrInitHeadAccumulate) { oldTokenContext = this.tokenContext; this.tokenContext = _index.TokenContext.normal; } oldNoLineTerminatorAfterNode = this._noLineTerminatorAfterNode; this._noLineTerminatorAfterNode = null; } this._lastCommentLine = 0; this._printLeadingComments(node, parent); const loc = nodeType === "Program" || nodeType === "File" ? null : node.loc; this.exactSource(loc, printMethod.bind(this, node, parent)); if (shouldPrintParens) { this._printTrailingComments(node, parent); if (indentParenthesized) { this.dedent(); this.newline(); } this.tokenChar(41); this._noLineTerminator = noLineTerminatorAfter; if (oldTokenContext) this.tokenContext = oldTokenContext; } else if (noLineTerminatorAfter && !this._noLineTerminator) { this._noLineTerminator = true; this._printTrailingComments(node, parent); } else { this._printTrailingComments(node, parent, trailingCommentsLineOffset); } this._currentNode = parent; format.concise = oldConcise; this._insideAux = oldInAux; if (oldNoLineTerminatorAfterNode !== undefined) { this._noLineTerminatorAfterNode = oldNoLineTerminatorAfterNode; } this._endsWithInnerRaw = false; } _maybeAddAuxComment(enteredPositionlessNode) { if (enteredPositionlessNode) this._printAuxBeforeComment(); if (!this._insideAux) this._printAuxAfterComment(); } _printAuxBeforeComment() { if (this._printAuxAfterOnNextUserNode) return; this._printAuxAfterOnNextUserNode = true; const comment = this.format.auxiliaryCommentBefore; if (comment) { this._printComment({ type: "CommentBlock", value: comment }, 0); } } _printAuxAfterComment() { if (!this._printAuxAfterOnNextUserNode) return; this._printAuxAfterOnNextUserNode = false; const comment = this.format.auxiliaryCommentAfter; if (comment) { this._printComment({ type: "CommentBlock", value: comment }, 0); } } getPossibleRaw(node) { const extra = node.extra; if ((extra == null ? void 0 : extra.raw) != null && extra.rawValue != null && node.value === extra.rawValue) { return extra.raw; } } printJoin(nodes, statement, indent, separator, printTrailingSeparator, addNewlines, iterator, trailingCommentsLineOffset) { if (!(nodes != null && nodes.length)) return; if (indent == null && this.format.retainLines) { var _nodes$0$loc; const startLine = (_nodes$0$loc = nodes[0].loc) == null ? void 0 : _nodes$0$loc.start.line; if (startLine != null && startLine !== this._buf.getCurrentLine()) { indent = true; } } if (indent) this.indent(); const newlineOpts = { addNewlines: addNewlines, nextNodeStartLine: 0 }; const boundSeparator = separator == null ? void 0 : separator.bind(this); const len = nodes.length; for (let i = 0; i < len; i++) { const node = nodes[i]; if (!node) continue; if (statement) this._printNewline(i === 0, newlineOpts); this.print(node, undefined, trailingCommentsLineOffset || 0); iterator == null || iterator(node, i); if (boundSeparator != null) { if (i < len - 1) boundSeparator(i, false);else if (printTrailingSeparator) boundSeparator(i, true); } if (statement) { var _node$trailingComment2; if (!((_node$trailingComment2 = node.trailingComments) != null && _node$trailingComment2.length)) { this._lastCommentLine = 0; } if (i + 1 === len) { this.newline(1); } else { var _nextNode$loc; const nextNode = nodes[i + 1]; newlineOpts.nextNodeStartLine = ((_nextNode$loc = nextNode.loc) == null ? void 0 : _nextNode$loc.start.line) || 0; this._printNewline(true, newlineOpts); } } } if (indent) this.dedent(); } printAndIndentOnComments(node) { const indent = node.leadingComments && node.leadingComments.length > 0; if (indent) this.indent(); this.print(node); if (indent) this.dedent(); } printBlock(parent) { const node = parent.body; if (node.type !== "EmptyStatement") { this.space(); } this.print(node); } _printTrailingComments(node, parent, lineOffset) { const { innerComments, trailingComments } = node; if (innerComments != null && innerComments.length) { this._printComments(2, innerComments, node, parent, lineOffset); } if (trailingComments != null && trailingComments.length) { this._printComments(2, trailingComments, node, parent, lineOffset); } } _printLeadingComments(node, parent) { const comments = node.leadingComments; if (!(comments != null && comments.length)) return; this._printComments(0, comments, node, parent); } _maybePrintInnerComments(nextTokenStr, nextTokenOccurrenceCount) { if (this._endsWithInnerRaw) { var _this$tokenMap; this.printInnerComments((_this$tokenMap = this.tokenMap) == null ? void 0 : _this$tokenMap.findMatching(this._currentNode, nextTokenStr, nextTokenOccurrenceCount)); } this._endsWithInnerRaw = true; this._indentInnerComments = true; } printInnerComments(nextToken) { const node = this._currentNode; const comments = node.innerComments; if (!(comments != null && comments.length)) return; const hasSpace = this.endsWith(32); const indent = this._indentInnerComments; const printedCommentsCount = this._printedComments.size; if (indent) this.indent(); this._printComments(1, comments, node, undefined, undefined, nextToken); if (hasSpace && printedCommentsCount !== this._printedComments.size) { this.space(); } if (indent) this.dedent(); } noIndentInnerCommentsHere() { this._indentInnerComments = false; } printSequence(nodes, indent, trailingCommentsLineOffset, addNewlines) { this.printJoin(nodes, true, indent != null ? indent : false, undefined, undefined, addNewlines, undefined, trailingCommentsLineOffset); } printList(items, printTrailingSeparator, statement, indent, separator, iterator) { this.printJoin(items, statement, indent, separator != null ? separator : commaSeparator, printTrailingSeparator, undefined, iterator); } shouldPrintTrailingComma(listEnd) { if (!this.tokenMap) return null; const listEndIndex = this.tokenMap.findLastIndex(this._currentNode, token => this.tokenMap.matchesOriginal(token, listEnd)); if (listEndIndex <= 0) return null; return this.tokenMap.matchesOriginal(this._tokens[listEndIndex - 1], ","); } _printNewline(newLine, opts) { const format = this.format; if (format.retainLines || format.compact) return; if (format.concise) { this.space(); return; } if (!newLine) { return; } const startLine = opts.nextNodeStartLine; const lastCommentLine = this._lastCommentLine; if (startLine > 0 && lastCommentLine > 0) { const offset = startLine - lastCommentLine; if (offset >= 0) { this.newline(offset || 1); return; } } if (this._buf.hasContent()) { this.newline(1); } } _shouldPrintComment(comment, nextToken) { if (comment.ignore) return 0; if (this._printedComments.has(comment)) return 0; if (this._noLineTerminator && HAS_NEWLINE_OR_BlOCK_COMMENT_END.test(comment.value)) { return 2; } if (nextToken && this.tokenMap) { const commentTok = this.tokenMap.find(this._currentNode, token => token.value === comment.value); if (commentTok && commentTok.start > nextToken.start) { return 2; } } this._printedComments.add(comment); if (!this.format.shouldPrintComment(comment.value)) { return 0; } return 1; } _printComment(comment, skipNewLines) { const noLineTerminator = this._noLineTerminator; const isBlockComment = comment.type === "CommentBlock"; const printNewLines = isBlockComment && skipNewLines !== 1 && !this._noLineTerminator; if (printNewLines && this._buf.hasContent() && skipNewLines !== 2) { this.newline(1); } const lastCharCode = this.getLastChar(); if (lastCharCode !== 91 && lastCharCode !== 123 && lastCharCode !== 40) { this.space(); } let val; if (isBlockComment) { val = `/*${comment.value}*/`; if (this.format.indent.adjustMultilineComment) { var _comment$loc; const offset = (_comment$loc = comment.loc) == null ? void 0 : _comment$loc.start.column; if (offset) { const newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g"); val = val.replace(newlineRegex, "\n"); } if (this.format.concise) { val = val.replace(/\n(?!$)/g, `\n`); } else { let indentSize = this.format.retainLines ? 0 : this._buf.getCurrentColumn(); if (this._shouldIndent(47) || this.format.retainLines) { indentSize += this._getIndent(); } val = val.replace(/\n(?!$)/g, `\n${" ".repeat(indentSize)}`); } } } else if (!noLineTerminator) { val = `//${comment.value}`; } else { val = `/*${comment.value}*/`; } if (this._endsWithDiv) this._space(); if (this.tokenMap) { const { _printSemicolonBeforeNextToken, _printSemicolonBeforeNextNode } = this; this._printSemicolonBeforeNextToken = -1; this._printSemicolonBeforeNextNode = -1; this.source("start", comment.loc); this._append(val, isBlockComment); this._printSemicolonBeforeNextNode = _printSemicolonBeforeNextNode; this._printSemicolonBeforeNextToken = _printSemicolonBeforeNextToken; } else { this.source("start", comment.loc); this._append(val, isBlockComment); } if (!isBlockComment && !noLineTerminator) { this.newline(1, true); } if (printNewLines && skipNewLines !== 3) { this.newline(1); } } _printComments(type, comments, node, parent, lineOffset = 0, nextToken) { const nodeLoc = node.loc; const len = comments.length; let hasLoc = !!nodeLoc; const nodeStartLine = hasLoc ? nodeLoc.start.line : 0; const nodeEndLine = hasLoc ? nodeLoc.end.line : 0; let lastLine = 0; let leadingCommentNewline = 0; const maybeNewline = this._noLineTerminator ? function () {} : this.newline.bind(this); for (let i = 0; i < len; i++) { const comment = comments[i]; const shouldPrint = this._shouldPrintComment(comment, nextToken); if (shouldPrint === 2) { hasLoc = false; break; } if (hasLoc && comment.loc && shouldPrint === 1) { const commentStartLine = comment.loc.start.line; const commentEndLine = comment.loc.end.line; if (type === 0) { let offset = 0; if (i === 0) { if (this._buf.hasContent() && (comment.type === "CommentLine" || commentStartLine !== commentEndLine)) { offset = leadingCommentNewline = 1; } } else { offset = commentStartLine - lastLine; } lastLine = commentEndLine; maybeNewline(offset); this._printComment(comment, 1); if (i + 1 === len) { maybeNewline(Math.max(nodeStartLine - lastLine, leadingCommentNewline)); lastLine = nodeStartLine; } } else if (type === 1) { const offset = commentStartLine - (i === 0 ? nodeStartLine : lastLine); lastLine = commentEndLine; maybeNewline(offset); this._printComment(comment, 1); if (i + 1 === len) { maybeNewline(Math.min(1, nodeEndLine - lastLine)); lastLine = nodeEndLine; } } else { const offset = commentStartLine - (i === 0 ? nodeEndLine - lineOffset : lastLine); lastLine = commentEndLine; maybeNewline(offset); this._printComment(comment, 1); } } else { hasLoc = false; if (shouldPrint !== 1) { continue; } if (len === 1) { const singleLine = comment.loc ? comment.loc.start.line === comment.loc.end.line : !HAS_NEWLINE.test(comment.value); const shouldSkipNewline = singleLine && !isStatement(node) && !isClassBody(parent) && !isTSInterfaceBody(parent) && !isTSEnumMember(node); if (type === 0) { this._printComment(comment, shouldSkipNewline && node.type !== "ObjectExpression" || singleLine && isFunction(parent, { body: node }) ? 1 : 0); } else if (shouldSkipNewline && type === 2) { this._printComment(comment, 1); } else { this._printComment(comment, 0); } } else if (type === 1 && !(node.type === "ObjectExpression" && node.properties.length > 1) && node.type !== "ClassBody" && node.type !== "TSInterfaceBody") { this._printComment(comment, i === 0 ? 2 : i === len - 1 ? 3 : 0); } else { this._printComment(comment, 0); } } } if (type === 2 && hasLoc && lastLine) { this._lastCommentLine = lastLine; } } } Object.assign(Printer.prototype, generatorFunctions); { (0, _deprecated.addDeprecatedGenerators)(Printer); } var _default = exports["default"] = Printer; function commaSeparator(occurrenceCount, last) { this.token(",", false, occurrenceCount); if (!last) this.space(); } //# sourceMappingURL=printer.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/source-map.js": /*!*********************************************************!*\ !*** ./node_modules/@babel/generator/lib/source-map.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _genMapping = __webpack_require__(/*! @jridgewell/gen-mapping */ "./node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js"); var _traceMapping = __webpack_require__(/*! @jridgewell/trace-mapping */ "./node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"); class SourceMap { constructor(opts, code) { var _opts$sourceFileName; this._map = void 0; this._rawMappings = void 0; this._sourceFileName = void 0; this._lastGenLine = 0; this._lastSourceLine = 0; this._lastSourceColumn = 0; this._inputMap = void 0; const map = this._map = new _genMapping.GenMapping({ sourceRoot: opts.sourceRoot }); this._sourceFileName = (_opts$sourceFileName = opts.sourceFileName) == null ? void 0 : _opts$sourceFileName.replace(/\\/g, "/"); this._rawMappings = undefined; if (opts.inputSourceMap) { this._inputMap = new _traceMapping.TraceMap(opts.inputSourceMap); const resolvedSources = this._inputMap.resolvedSources; if (resolvedSources.length) { for (let i = 0; i < resolvedSources.length; i++) { var _this$_inputMap$sourc; (0, _genMapping.setSourceContent)(map, resolvedSources[i], (_this$_inputMap$sourc = this._inputMap.sourcesContent) == null ? void 0 : _this$_inputMap$sourc[i]); } } } if (typeof code === "string" && !opts.inputSourceMap) { (0, _genMapping.setSourceContent)(map, this._sourceFileName, code); } else if (typeof code === "object") { for (const sourceFileName of Object.keys(code)) { (0, _genMapping.setSourceContent)(map, sourceFileName.replace(/\\/g, "/"), code[sourceFileName]); } } } get() { return (0, _genMapping.toEncodedMap)(this._map); } getDecoded() { return (0, _genMapping.toDecodedMap)(this._map); } getRawMappings() { return this._rawMappings || (this._rawMappings = (0, _genMapping.allMappings)(this._map)); } mark(generated, line, column, identifierName, identifierNamePos, filename) { var _originalMapping; this._rawMappings = undefined; let originalMapping; if (line != null) { if (this._inputMap) { originalMapping = (0, _traceMapping.originalPositionFor)(this._inputMap, { line, column }); if (!originalMapping.name && identifierNamePos) { const originalIdentifierMapping = (0, _traceMapping.originalPositionFor)(this._inputMap, identifierNamePos); if (originalIdentifierMapping.name) { identifierName = originalIdentifierMapping.name; } } } else { originalMapping = { source: (filename == null ? void 0 : filename.replace(/\\/g, "/")) || this._sourceFileName, line: line, column: column }; } } (0, _genMapping.maybeAddMapping)(this._map, { name: identifierName, generated, source: (_originalMapping = originalMapping) == null ? void 0 : _originalMapping.source, original: originalMapping }); } } exports["default"] = SourceMap; //# sourceMappingURL=source-map.js.map /***/ }), /***/ "./node_modules/@babel/generator/lib/token-map.js": /*!********************************************************!*\ !*** ./node_modules/@babel/generator/lib/token-map.js ***! \********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TokenMap = void 0; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { traverseFast, VISITOR_KEYS } = _t; class TokenMap { constructor(ast, tokens, source) { this._tokens = void 0; this._source = void 0; this._nodesToTokenIndexes = new Map(); this._nodesOccurrencesCountCache = new Map(); this._tokensCache = new Map(); this._tokens = tokens; this._source = source; traverseFast(ast, node => { const indexes = this._getTokensIndexesOfNode(node); if (indexes.length > 0) this._nodesToTokenIndexes.set(node, indexes); }); this._tokensCache = null; } has(node) { return this._nodesToTokenIndexes.has(node); } getIndexes(node) { return this._nodesToTokenIndexes.get(node); } find(node, condition) { const indexes = this._nodesToTokenIndexes.get(node); if (indexes) { for (let k = 0; k < indexes.length; k++) { const index = indexes[k]; const tok = this._tokens[index]; if (condition(tok, index)) return tok; } } return null; } findLastIndex(node, condition) { const indexes = this._nodesToTokenIndexes.get(node); if (indexes) { for (let k = indexes.length - 1; k >= 0; k--) { const index = indexes[k]; const tok = this._tokens[index]; if (condition(tok, index)) return index; } } return -1; } findMatching(node, test, occurrenceCount = 0) { const indexes = this._nodesToTokenIndexes.get(node); if (indexes) { let i = 0; const count = occurrenceCount; if (count > 1) { const cache = this._nodesOccurrencesCountCache.get(node); if (cache && cache.test === test && cache.count < count) { i = cache.i + 1; occurrenceCount -= cache.count + 1; } } for (; i < indexes.length; i++) { const tok = this._tokens[indexes[i]]; if (this.matchesOriginal(tok, test)) { if (occurrenceCount === 0) { if (count > 0) { this._nodesOccurrencesCountCache.set(node, { test, count, i }); } return tok; } occurrenceCount--; } } } return null; } matchesOriginal(token, test) { if (token.end - token.start !== test.length) return false; if (token.value != null) return token.value === test; return this._source.startsWith(test, token.start); } startMatches(node, test) { const indexes = this._nodesToTokenIndexes.get(node); if (!indexes) return false; const tok = this._tokens[indexes[0]]; if (tok.start !== node.start) return false; return this.matchesOriginal(tok, test); } endMatches(node, test) { const indexes = this._nodesToTokenIndexes.get(node); if (!indexes) return false; const tok = this._tokens[indexes[indexes.length - 1]]; if (tok.end !== node.end) return false; return this.matchesOriginal(tok, test); } _getTokensIndexesOfNode(node) { if (node.start == null || node.end == null) return []; const { first, last } = this._findTokensOfNode(node, 0, this._tokens.length - 1); let low = first; const children = childrenIterator(node); if ((node.type === "ExportNamedDeclaration" || node.type === "ExportDefaultDeclaration") && node.declaration && node.declaration.type === "ClassDeclaration") { children.next(); } const indexes = []; for (const child of children) { if (child == null) continue; if (child.start == null || child.end == null) continue; const childTok = this._findTokensOfNode(child, low, last); const high = childTok.first; for (let k = low; k < high; k++) indexes.push(k); low = childTok.last + 1; } for (let k = low; k <= last; k++) indexes.push(k); return indexes; } _findTokensOfNode(node, low, high) { const cached = this._tokensCache.get(node); if (cached) return cached; const first = this._findFirstTokenOfNode(node.start, low, high); const last = this._findLastTokenOfNode(node.end, first, high); this._tokensCache.set(node, { first, last }); return { first, last }; } _findFirstTokenOfNode(start, low, high) { while (low <= high) { const mid = high + low >> 1; if (start < this._tokens[mid].start) { high = mid - 1; } else if (start > this._tokens[mid].start) { low = mid + 1; } else { return mid; } } return low; } _findLastTokenOfNode(end, low, high) { while (low <= high) { const mid = high + low >> 1; if (end < this._tokens[mid].end) { high = mid - 1; } else if (end > this._tokens[mid].end) { low = mid + 1; } else { return mid; } } return high; } } exports.TokenMap = TokenMap; function* childrenIterator(node) { if (node.type === "TemplateLiteral") { yield node.quasis[0]; for (let i = 1; i < node.quasis.length; i++) { yield node.expressions[i - 1]; yield node.quasis[i]; } return; } const keys = VISITOR_KEYS[node.type]; for (const key of keys) { const child = node[key]; if (!child) continue; if (Array.isArray(child)) { yield* child; } else { yield child; } } } //# sourceMappingURL=token-map.js.map /***/ }), /***/ "./node_modules/@babel/helper-compilation-targets/lib/debug.js": /*!*********************************************************************!*\ !*** ./node_modules/@babel/helper-compilation-targets/lib/debug.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getInclusionReasons = getInclusionReasons; var _semver = __webpack_require__(/*! semver */ "./node_modules/semver/semver.js"); var _pretty = __webpack_require__(/*! ./pretty.js */ "./node_modules/@babel/helper-compilation-targets/lib/pretty.js"); var _utils = __webpack_require__(/*! ./utils.js */ "./node_modules/@babel/helper-compilation-targets/lib/utils.js"); function getInclusionReasons(item, targetVersions, list) { const minVersions = list[item] || {}; return Object.keys(targetVersions).reduce((result, env) => { const minVersion = (0, _utils.getLowestImplementedVersion)(minVersions, env); const targetVersion = targetVersions[env]; if (!minVersion) { result[env] = (0, _pretty.prettifyVersion)(targetVersion); } else { const minIsUnreleased = (0, _utils.isUnreleasedVersion)(minVersion, env); const targetIsUnreleased = (0, _utils.isUnreleasedVersion)(targetVersion, env); if (!targetIsUnreleased && (minIsUnreleased || _semver.lt(targetVersion.toString(), (0, _utils.semverify)(minVersion)))) { result[env] = (0, _pretty.prettifyVersion)(targetVersion); } } return result; }, {}); } //# sourceMappingURL=debug.js.map /***/ }), /***/ "./node_modules/@babel/helper-compilation-targets/lib/filter-items.js": /*!****************************************************************************!*\ !*** ./node_modules/@babel/helper-compilation-targets/lib/filter-items.js ***! \****************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = filterItems; exports.isRequired = isRequired; exports.targetsSupported = targetsSupported; var _semver = __webpack_require__(/*! semver */ "./node_modules/semver/semver.js"); var _utils = __webpack_require__(/*! ./utils.js */ "./node_modules/@babel/helper-compilation-targets/lib/utils.js"); const pluginsCompatData = __webpack_require__(/*! @babel/compat-data/plugins */ "./node_modules/@babel/compat-data/plugins.js"); function targetsSupported(target, support) { const targetEnvironments = Object.keys(target); if (targetEnvironments.length === 0) { return false; } const unsupportedEnvironments = targetEnvironments.filter(environment => { const lowestImplementedVersion = (0, _utils.getLowestImplementedVersion)(support, environment); if (!lowestImplementedVersion) { return true; } const lowestTargetedVersion = target[environment]; if ((0, _utils.isUnreleasedVersion)(lowestTargetedVersion, environment)) { return false; } if ((0, _utils.isUnreleasedVersion)(lowestImplementedVersion, environment)) { return true; } if (!_semver.valid(lowestTargetedVersion.toString())) { throw new Error(`Invalid version passed for target "${environment}": "${lowestTargetedVersion}". ` + "Versions must be in semver format (major.minor.patch)"); } return _semver.gt((0, _utils.semverify)(lowestImplementedVersion), lowestTargetedVersion.toString()); }); return unsupportedEnvironments.length === 0; } function isRequired(name, targets, { compatData = pluginsCompatData, includes, excludes } = {}) { if (excludes != null && excludes.has(name)) return false; if (includes != null && includes.has(name)) return true; return !targetsSupported(targets, compatData[name]); } function filterItems(list, includes, excludes, targets, defaultIncludes, defaultExcludes, pluginSyntaxMap) { const result = new Set(); const options = { compatData: list, includes, excludes }; for (const item in list) { if (isRequired(item, targets, options)) { result.add(item); } else if (pluginSyntaxMap) { const shippedProposalsSyntax = pluginSyntaxMap.get(item); if (shippedProposalsSyntax) { result.add(shippedProposalsSyntax); } } } defaultIncludes == null || defaultIncludes.forEach(item => !excludes.has(item) && result.add(item)); defaultExcludes == null || defaultExcludes.forEach(item => !includes.has(item) && result.delete(item)); return result; } //# sourceMappingURL=filter-items.js.map /***/ }), /***/ "./node_modules/@babel/helper-compilation-targets/lib/index.js": /*!*********************************************************************!*\ !*** ./node_modules/@babel/helper-compilation-targets/lib/index.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "TargetNames", ({ enumerable: true, get: function () { return _options.TargetNames; } })); exports["default"] = getTargets; Object.defineProperty(exports, "filterItems", ({ enumerable: true, get: function () { return _filterItems.default; } })); Object.defineProperty(exports, "getInclusionReasons", ({ enumerable: true, get: function () { return _debug.getInclusionReasons; } })); exports.isBrowsersQueryValid = isBrowsersQueryValid; Object.defineProperty(exports, "isRequired", ({ enumerable: true, get: function () { return _filterItems.isRequired; } })); Object.defineProperty(exports, "prettifyTargets", ({ enumerable: true, get: function () { return _pretty.prettifyTargets; } })); Object.defineProperty(exports, "unreleasedLabels", ({ enumerable: true, get: function () { return _targets.unreleasedLabels; } })); var _browserslist = __webpack_require__(/*! browserslist */ "./node_modules/browserslist/index.js"); var _helperValidatorOption = __webpack_require__(/*! @babel/helper-validator-option */ "./node_modules/@babel/helper-validator-option/lib/index.js"); var _lruCache = __webpack_require__(/*! lru-cache */ "./node_modules/lru-cache/index.js"); var _utils = __webpack_require__(/*! ./utils.js */ "./node_modules/@babel/helper-compilation-targets/lib/utils.js"); var _targets = __webpack_require__(/*! ./targets.js */ "./node_modules/@babel/helper-compilation-targets/lib/targets.js"); var _options = __webpack_require__(/*! ./options.js */ "./node_modules/@babel/helper-compilation-targets/lib/options.js"); var _pretty = __webpack_require__(/*! ./pretty.js */ "./node_modules/@babel/helper-compilation-targets/lib/pretty.js"); var _debug = __webpack_require__(/*! ./debug.js */ "./node_modules/@babel/helper-compilation-targets/lib/debug.js"); var _filterItems = __webpack_require__(/*! ./filter-items.js */ "./node_modules/@babel/helper-compilation-targets/lib/filter-items.js"); const browserModulesData = __webpack_require__(/*! @babel/compat-data/native-modules */ "./node_modules/@babel/compat-data/native-modules.js"); const ESM_SUPPORT = browserModulesData["es6.module"]; const v = new _helperValidatorOption.OptionValidator("@babel/helper-compilation-targets"); function validateTargetNames(targets) { const validTargets = Object.keys(_options.TargetNames); for (const target of Object.keys(targets)) { if (!(target in _options.TargetNames)) { throw new Error(v.formatMessage(`'${target}' is not a valid target - Did you mean '${(0, _helperValidatorOption.findSuggestion)(target, validTargets)}'?`)); } } return targets; } function isBrowsersQueryValid(browsers) { return typeof browsers === "string" || Array.isArray(browsers) && browsers.every(b => typeof b === "string"); } function validateBrowsers(browsers) { v.invariant(browsers === undefined || isBrowsersQueryValid(browsers), `'${String(browsers)}' is not a valid browserslist query`); return browsers; } function getLowestVersions(browsers) { return browsers.reduce((all, browser) => { const [browserName, browserVersion] = browser.split(" "); const target = _targets.browserNameMap[browserName]; if (!target) { return all; } try { const splitVersion = browserVersion.split("-")[0].toLowerCase(); const isSplitUnreleased = (0, _utils.isUnreleasedVersion)(splitVersion, target); if (!all[target]) { all[target] = isSplitUnreleased ? splitVersion : (0, _utils.semverify)(splitVersion); return all; } const version = all[target]; const isUnreleased = (0, _utils.isUnreleasedVersion)(version, target); if (isUnreleased && isSplitUnreleased) { all[target] = (0, _utils.getLowestUnreleased)(version, splitVersion, target); } else if (isUnreleased) { all[target] = (0, _utils.semverify)(splitVersion); } else if (!isUnreleased && !isSplitUnreleased) { const parsedBrowserVersion = (0, _utils.semverify)(splitVersion); all[target] = (0, _utils.semverMin)(version, parsedBrowserVersion); } } catch (_) {} return all; }, {}); } function outputDecimalWarning(decimalTargets) { if (!decimalTargets.length) { return; } console.warn("Warning, the following targets are using a decimal version:\n"); decimalTargets.forEach(({ target, value }) => console.warn(` ${target}: ${value}`)); console.warn(` We recommend using a string for minor/patch versions to avoid numbers like 6.10 getting parsed as 6.1, which can lead to unexpected behavior. `); } function semverifyTarget(target, value) { try { return (0, _utils.semverify)(value); } catch (_) { throw new Error(v.formatMessage(`'${value}' is not a valid value for 'targets.${target}'.`)); } } function nodeTargetParser(value) { const parsed = value === true || value === "current" ? process.versions.node.split("-")[0] : semverifyTarget("node", value); return ["node", parsed]; } function defaultTargetParser(target, value) { const version = (0, _utils.isUnreleasedVersion)(value, target) ? value.toLowerCase() : semverifyTarget(target, value); return [target, version]; } function generateTargets(inputTargets) { const input = Object.assign({}, inputTargets); delete input.esmodules; delete input.browsers; return input; } function resolveTargets(queries, env) { const resolved = _browserslist(queries, { mobileToDesktop: true, env }); return getLowestVersions(resolved); } const targetsCache = new _lruCache({ max: 64 }); function resolveTargetsCached(queries, env) { const cacheKey = typeof queries === "string" ? queries : queries.join() + env; let cached = targetsCache.get(cacheKey); if (!cached) { cached = resolveTargets(queries, env); targetsCache.set(cacheKey, cached); } return Object.assign({}, cached); } function getTargets(inputTargets = {}, options = {}) { var _browsers, _browsers2; let { browsers, esmodules } = inputTargets; const { configPath = ".", onBrowserslistConfigFound } = options; validateBrowsers(browsers); const input = generateTargets(inputTargets); let targets = validateTargetNames(input); const shouldParseBrowsers = !!browsers; const hasTargets = shouldParseBrowsers || Object.keys(targets).length > 0; const shouldSearchForConfig = !options.ignoreBrowserslistConfig && !hasTargets; if (!browsers && shouldSearchForConfig) { browsers = process.env.BROWSERSLIST; if (!browsers) { const configFile = options.configFile || process.env.BROWSERSLIST_CONFIG || _browserslist.findConfigFile(configPath); if (configFile != null) { onBrowserslistConfigFound == null || onBrowserslistConfigFound(configFile); browsers = _browserslist.loadConfig({ config: configFile, env: options.browserslistEnv }); } } if (browsers == null) { { browsers = []; } } } ; if (esmodules && (esmodules !== "intersect" || !((_browsers = browsers) != null && _browsers.length))) { browsers = Object.keys(ESM_SUPPORT).map(browser => `${browser} >= ${ESM_SUPPORT[browser]}`).join(", "); esmodules = false; } if ((_browsers2 = browsers) != null && _browsers2.length) { const queryBrowsers = resolveTargetsCached(browsers, options.browserslistEnv); if (esmodules === "intersect") { for (const browser of Object.keys(queryBrowsers)) { if (browser !== "deno" && browser !== "ie") { const esmSupportVersion = ESM_SUPPORT[browser === "opera_mobile" ? "op_mob" : browser]; if (esmSupportVersion) { const version = queryBrowsers[browser]; queryBrowsers[browser] = (0, _utils.getHighestUnreleased)(version, (0, _utils.semverify)(esmSupportVersion), browser); } else { delete queryBrowsers[browser]; } } else { delete queryBrowsers[browser]; } } } targets = Object.assign(queryBrowsers, targets); } const result = {}; const decimalWarnings = []; for (const target of Object.keys(targets).sort()) { const value = targets[target]; if (typeof value === "number" && value % 1 !== 0) { decimalWarnings.push({ target, value }); } const [parsedTarget, parsedValue] = target === "node" ? nodeTargetParser(value) : defaultTargetParser(target, value); if (parsedValue) { result[parsedTarget] = parsedValue; } } outputDecimalWarning(decimalWarnings); return result; } //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/helper-compilation-targets/lib/options.js": /*!***********************************************************************!*\ !*** ./node_modules/@babel/helper-compilation-targets/lib/options.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TargetNames = void 0; const TargetNames = exports.TargetNames = { node: "node", deno: "deno", chrome: "chrome", opera: "opera", edge: "edge", firefox: "firefox", safari: "safari", ie: "ie", ios: "ios", android: "android", electron: "electron", samsung: "samsung", rhino: "rhino", opera_mobile: "opera_mobile" }; //# sourceMappingURL=options.js.map /***/ }), /***/ "./node_modules/@babel/helper-compilation-targets/lib/pretty.js": /*!**********************************************************************!*\ !*** ./node_modules/@babel/helper-compilation-targets/lib/pretty.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.prettifyTargets = prettifyTargets; exports.prettifyVersion = prettifyVersion; var _semver = __webpack_require__(/*! semver */ "./node_modules/semver/semver.js"); var _targets = __webpack_require__(/*! ./targets.js */ "./node_modules/@babel/helper-compilation-targets/lib/targets.js"); function prettifyVersion(version) { if (typeof version !== "string") { return version; } const { major, minor, patch } = _semver.parse(version); const parts = [major]; if (minor || patch) { parts.push(minor); } if (patch) { parts.push(patch); } return parts.join("."); } function prettifyTargets(targets) { return Object.keys(targets).reduce((results, target) => { let value = targets[target]; const unreleasedLabel = _targets.unreleasedLabels[target]; if (typeof value === "string" && unreleasedLabel !== value) { value = prettifyVersion(value); } results[target] = value; return results; }, {}); } //# sourceMappingURL=pretty.js.map /***/ }), /***/ "./node_modules/@babel/helper-compilation-targets/lib/targets.js": /*!***********************************************************************!*\ !*** ./node_modules/@babel/helper-compilation-targets/lib/targets.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.unreleasedLabels = exports.browserNameMap = void 0; const unreleasedLabels = exports.unreleasedLabels = { safari: "tp" }; const browserNameMap = exports.browserNameMap = { and_chr: "chrome", and_ff: "firefox", android: "android", chrome: "chrome", edge: "edge", firefox: "firefox", ie: "ie", ie_mob: "ie", ios_saf: "ios", node: "node", deno: "deno", op_mob: "opera_mobile", opera: "opera", safari: "safari", samsung: "samsung" }; //# sourceMappingURL=targets.js.map /***/ }), /***/ "./node_modules/@babel/helper-compilation-targets/lib/utils.js": /*!*********************************************************************!*\ !*** ./node_modules/@babel/helper-compilation-targets/lib/utils.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getHighestUnreleased = getHighestUnreleased; exports.getLowestImplementedVersion = getLowestImplementedVersion; exports.getLowestUnreleased = getLowestUnreleased; exports.isUnreleasedVersion = isUnreleasedVersion; exports.semverMin = semverMin; exports.semverify = semverify; var _semver = __webpack_require__(/*! semver */ "./node_modules/semver/semver.js"); var _helperValidatorOption = __webpack_require__(/*! @babel/helper-validator-option */ "./node_modules/@babel/helper-validator-option/lib/index.js"); var _targets = __webpack_require__(/*! ./targets.js */ "./node_modules/@babel/helper-compilation-targets/lib/targets.js"); const versionRegExp = /^(?:\d+|\d(?:\d?[^\d\n\r\u2028\u2029]\d+|\d{2,}(?:[^\d\n\r\u2028\u2029]\d+)?))$/; const v = new _helperValidatorOption.OptionValidator("@babel/helper-compilation-targets"); function semverMin(first, second) { return first && _semver.lt(first, second) ? first : second; } function semverify(version) { if (typeof version === "string" && _semver.valid(version)) { return version; } v.invariant(typeof version === "number" || typeof version === "string" && versionRegExp.test(version), `'${version}' is not a valid version`); version = version.toString(); let pos = 0; let num = 0; while ((pos = version.indexOf(".", pos + 1)) > 0) { num++; } return version + ".0".repeat(2 - num); } function isUnreleasedVersion(version, env) { const unreleasedLabel = _targets.unreleasedLabels[env]; return !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase(); } function getLowestUnreleased(a, b, env) { const unreleasedLabel = _targets.unreleasedLabels[env]; if (a === unreleasedLabel) { return b; } if (b === unreleasedLabel) { return a; } return semverMin(a, b); } function getHighestUnreleased(a, b, env) { return getLowestUnreleased(a, b, env) === a ? b : a; } function getLowestImplementedVersion(plugin, environment) { const result = plugin[environment]; if (!result && environment === "android") { return plugin.chrome; } return result; } //# sourceMappingURL=utils.js.map /***/ }), /***/ "./node_modules/@babel/helper-globals/data/builtin-lower.json": /*!********************************************************************!*\ !*** ./node_modules/@babel/helper-globals/data/builtin-lower.json ***! \********************************************************************/ /***/ ((module) => { "use strict"; module.exports = /*#__PURE__*/JSON.parse('["decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","globalThis","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"]'); /***/ }), /***/ "./node_modules/@babel/helper-globals/data/builtin-upper.json": /*!********************************************************************!*\ !*** ./node_modules/@babel/helper-globals/data/builtin-upper.json ***! \********************************************************************/ /***/ ((module) => { "use strict"; module.exports = /*#__PURE__*/JSON.parse('["AggregateError","Array","ArrayBuffer","Atomics","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","Error","EvalError","FinalizationRegistry","Float16Array","Float32Array","Float64Array","Function","Infinity","Int16Array","Int32Array","Int8Array","Intl","Iterator","JSON","Map","Math","NaN","Number","Object","Promise","Proxy","RangeError","ReferenceError","Reflect","RegExp","Set","SharedArrayBuffer","String","Symbol","SyntaxError","TypeError","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","URIError","WeakMap","WeakRef","WeakSet"]'); /***/ }), /***/ "./node_modules/@babel/helper-module-imports/lib/import-builder.js": /*!*************************************************************************!*\ !*** ./node_modules/@babel/helper-module-imports/lib/import-builder.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _assert = __webpack_require__(/*! assert */ "./node_modules/assert/build/assert.js"); var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { callExpression, cloneNode, expressionStatement, identifier, importDeclaration, importDefaultSpecifier, importNamespaceSpecifier, importSpecifier, memberExpression, stringLiteral, variableDeclaration, variableDeclarator } = _t; class ImportBuilder { constructor(importedSource, scope, hub) { this._statements = []; this._resultName = null; this._importedSource = void 0; this._scope = scope; this._hub = hub; this._importedSource = importedSource; } done() { return { statements: this._statements, resultName: this._resultName }; } import() { this._statements.push(importDeclaration([], stringLiteral(this._importedSource))); return this; } require() { this._statements.push(expressionStatement(callExpression(identifier("require"), [stringLiteral(this._importedSource)]))); return this; } namespace(name = "namespace") { const local = this._scope.generateUidIdentifier(name); const statement = this._statements[this._statements.length - 1]; _assert(statement.type === "ImportDeclaration"); _assert(statement.specifiers.length === 0); statement.specifiers = [importNamespaceSpecifier(local)]; this._resultName = cloneNode(local); return this; } default(name) { const id = this._scope.generateUidIdentifier(name); const statement = this._statements[this._statements.length - 1]; _assert(statement.type === "ImportDeclaration"); _assert(statement.specifiers.length === 0); statement.specifiers = [importDefaultSpecifier(id)]; this._resultName = cloneNode(id); return this; } named(name, importName) { if (importName === "default") return this.default(name); const id = this._scope.generateUidIdentifier(name); const statement = this._statements[this._statements.length - 1]; _assert(statement.type === "ImportDeclaration"); _assert(statement.specifiers.length === 0); statement.specifiers = [importSpecifier(id, identifier(importName))]; this._resultName = cloneNode(id); return this; } var(name) { const id = this._scope.generateUidIdentifier(name); let statement = this._statements[this._statements.length - 1]; if (statement.type !== "ExpressionStatement") { _assert(this._resultName); statement = expressionStatement(this._resultName); this._statements.push(statement); } this._statements[this._statements.length - 1] = variableDeclaration("var", [variableDeclarator(id, statement.expression)]); this._resultName = cloneNode(id); return this; } defaultInterop() { return this._interop(this._hub.addHelper("interopRequireDefault")); } wildcardInterop() { return this._interop(this._hub.addHelper("interopRequireWildcard")); } _interop(callee) { const statement = this._statements[this._statements.length - 1]; if (statement.type === "ExpressionStatement") { statement.expression = callExpression(callee, [statement.expression]); } else if (statement.type === "VariableDeclaration") { _assert(statement.declarations.length === 1); statement.declarations[0].init = callExpression(callee, [statement.declarations[0].init]); } else { _assert.fail("Unexpected type."); } return this; } prop(name) { const statement = this._statements[this._statements.length - 1]; if (statement.type === "ExpressionStatement") { statement.expression = memberExpression(statement.expression, identifier(name)); } else if (statement.type === "VariableDeclaration") { _assert(statement.declarations.length === 1); statement.declarations[0].init = memberExpression(statement.declarations[0].init, identifier(name)); } else { _assert.fail("Unexpected type:" + statement.type); } return this; } read(name) { this._resultName = memberExpression(this._resultName, identifier(name)); } } exports["default"] = ImportBuilder; //# sourceMappingURL=import-builder.js.map /***/ }), /***/ "./node_modules/@babel/helper-module-imports/lib/import-injector.js": /*!**************************************************************************!*\ !*** ./node_modules/@babel/helper-module-imports/lib/import-injector.js ***! \**************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _assert = __webpack_require__(/*! assert */ "./node_modules/assert/build/assert.js"); var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _importBuilder = __webpack_require__(/*! ./import-builder.js */ "./node_modules/@babel/helper-module-imports/lib/import-builder.js"); var _isModule = __webpack_require__(/*! ./is-module.js */ "./node_modules/@babel/helper-module-imports/lib/is-module.js"); const { identifier, importSpecifier, numericLiteral, sequenceExpression, isImportDeclaration } = _t; class ImportInjector { constructor(path, importedSource, opts) { this._defaultOpts = { importedSource: null, importedType: "commonjs", importedInterop: "babel", importingInterop: "babel", ensureLiveReference: false, ensureNoContext: false, importPosition: "before" }; const programPath = path.find(p => p.isProgram()); this._programPath = programPath; this._programScope = programPath.scope; this._hub = programPath.hub; this._defaultOpts = this._applyDefaults(importedSource, opts, true); } addDefault(importedSourceIn, opts) { return this.addNamed("default", importedSourceIn, opts); } addNamed(importName, importedSourceIn, opts) { _assert(typeof importName === "string"); return this._generateImport(this._applyDefaults(importedSourceIn, opts), importName); } addNamespace(importedSourceIn, opts) { return this._generateImport(this._applyDefaults(importedSourceIn, opts), null); } addSideEffect(importedSourceIn, opts) { return this._generateImport(this._applyDefaults(importedSourceIn, opts), void 0); } _applyDefaults(importedSource, opts, isInit = false) { let newOpts; if (typeof importedSource === "string") { newOpts = Object.assign({}, this._defaultOpts, { importedSource }, opts); } else { _assert(!opts, "Unexpected secondary arguments."); newOpts = Object.assign({}, this._defaultOpts, importedSource); } if (!isInit && opts) { if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint; if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist; } return newOpts; } _generateImport(opts, importName) { const isDefault = importName === "default"; const isNamed = !!importName && !isDefault; const isNamespace = importName === null; const { importedSource, importedType, importedInterop, importingInterop, ensureLiveReference, ensureNoContext, nameHint, importPosition, blockHoist } = opts; let name = nameHint || importName; const isMod = (0, _isModule.default)(this._programPath); const isModuleForNode = isMod && importingInterop === "node"; const isModuleForBabel = isMod && importingInterop === "babel"; if (importPosition === "after" && !isMod) { throw new Error(`"importPosition": "after" is only supported in modules`); } const builder = new _importBuilder.default(importedSource, this._programScope, this._hub); if (importedType === "es6") { if (!isModuleForNode && !isModuleForBabel) { throw new Error("Cannot import an ES6 module from CommonJS"); } builder.import(); if (isNamespace) { builder.namespace(nameHint || importedSource); } else if (isDefault || isNamed) { builder.named(name, importName); } } else if (importedType !== "commonjs") { throw new Error(`Unexpected interopType "${importedType}"`); } else if (importedInterop === "babel") { if (isModuleForNode) { name = name !== "default" ? name : importedSource; const es6Default = `${importedSource}$es6Default`; builder.import(); if (isNamespace) { builder.default(es6Default).var(name || importedSource).wildcardInterop(); } else if (isDefault) { if (ensureLiveReference) { builder.default(es6Default).var(name || importedSource).defaultInterop().read("default"); } else { builder.default(es6Default).var(name).defaultInterop().prop(importName); } } else if (isNamed) { builder.default(es6Default).read(importName); } } else if (isModuleForBabel) { builder.import(); if (isNamespace) { builder.namespace(name || importedSource); } else if (isDefault || isNamed) { builder.named(name, importName); } } else { builder.require(); if (isNamespace) { builder.var(name || importedSource).wildcardInterop(); } else if ((isDefault || isNamed) && ensureLiveReference) { if (isDefault) { name = name !== "default" ? name : importedSource; builder.var(name).read(importName); builder.defaultInterop(); } else { builder.var(importedSource).read(importName); } } else if (isDefault) { builder.var(name).defaultInterop().prop(importName); } else if (isNamed) { builder.var(name).prop(importName); } } } else if (importedInterop === "compiled") { if (isModuleForNode) { builder.import(); if (isNamespace) { builder.default(name || importedSource); } else if (isDefault || isNamed) { builder.default(importedSource).read(name); } } else if (isModuleForBabel) { builder.import(); if (isNamespace) { builder.namespace(name || importedSource); } else if (isDefault || isNamed) { builder.named(name, importName); } } else { builder.require(); if (isNamespace) { builder.var(name || importedSource); } else if (isDefault || isNamed) { if (ensureLiveReference) { builder.var(importedSource).read(name); } else { builder.prop(importName).var(name); } } } } else if (importedInterop === "uncompiled") { if (isDefault && ensureLiveReference) { throw new Error("No live reference for commonjs default"); } if (isModuleForNode) { builder.import(); if (isNamespace) { builder.default(name || importedSource); } else if (isDefault) { builder.default(name); } else if (isNamed) { builder.default(importedSource).read(name); } } else if (isModuleForBabel) { builder.import(); if (isNamespace) { builder.default(name || importedSource); } else if (isDefault) { builder.default(name); } else if (isNamed) { builder.named(name, importName); } } else { builder.require(); if (isNamespace) { builder.var(name || importedSource); } else if (isDefault) { builder.var(name); } else if (isNamed) { if (ensureLiveReference) { builder.var(importedSource).read(name); } else { builder.var(name).prop(importName); } } } } else { throw new Error(`Unknown importedInterop "${importedInterop}".`); } const { statements, resultName } = builder.done(); this._insertStatements(statements, importPosition, blockHoist); if ((isDefault || isNamed) && ensureNoContext && resultName.type !== "Identifier") { return sequenceExpression([numericLiteral(0), resultName]); } return resultName; } _insertStatements(statements, importPosition = "before", blockHoist = 3) { if (importPosition === "after") { if (this._insertStatementsAfter(statements)) return; } else { if (this._insertStatementsBefore(statements, blockHoist)) return; } this._programPath.unshiftContainer("body", statements); } _insertStatementsBefore(statements, blockHoist) { if (statements.length === 1 && isImportDeclaration(statements[0]) && isValueImport(statements[0])) { const firstImportDecl = this._programPath.get("body").find(p => { return p.isImportDeclaration() && isValueImport(p.node); }); if ((firstImportDecl == null ? void 0 : firstImportDecl.node.source.value) === statements[0].source.value && maybeAppendImportSpecifiers(firstImportDecl.node, statements[0])) { return true; } } statements.forEach(node => { node._blockHoist = blockHoist; }); const targetPath = this._programPath.get("body").find(p => { const val = p.node._blockHoist; return Number.isFinite(val) && val < 4; }); if (targetPath) { targetPath.insertBefore(statements); return true; } return false; } _insertStatementsAfter(statements) { const statementsSet = new Set(statements); const importDeclarations = new Map(); for (const statement of statements) { if (isImportDeclaration(statement) && isValueImport(statement)) { const source = statement.source.value; if (!importDeclarations.has(source)) importDeclarations.set(source, []); importDeclarations.get(source).push(statement); } } let lastImportPath = null; for (const bodyStmt of this._programPath.get("body")) { if (bodyStmt.isImportDeclaration() && isValueImport(bodyStmt.node)) { lastImportPath = bodyStmt; const source = bodyStmt.node.source.value; const newImports = importDeclarations.get(source); if (!newImports) continue; for (const decl of newImports) { if (!statementsSet.has(decl)) continue; if (maybeAppendImportSpecifiers(bodyStmt.node, decl)) { statementsSet.delete(decl); } } } } if (statementsSet.size === 0) return true; if (lastImportPath) lastImportPath.insertAfter(Array.from(statementsSet)); return !!lastImportPath; } } exports["default"] = ImportInjector; function isValueImport(node) { return node.importKind !== "type" && node.importKind !== "typeof"; } function hasNamespaceImport(node) { return node.specifiers.length === 1 && node.specifiers[0].type === "ImportNamespaceSpecifier" || node.specifiers.length === 2 && node.specifiers[1].type === "ImportNamespaceSpecifier"; } function hasDefaultImport(node) { return node.specifiers.length > 0 && node.specifiers[0].type === "ImportDefaultSpecifier"; } function maybeAppendImportSpecifiers(target, source) { if (!target.specifiers.length) { target.specifiers = source.specifiers; return true; } if (!source.specifiers.length) return true; if (hasNamespaceImport(target) || hasNamespaceImport(source)) return false; if (hasDefaultImport(source)) { if (hasDefaultImport(target)) { source.specifiers[0] = importSpecifier(source.specifiers[0].local, identifier("default")); } else { target.specifiers.unshift(source.specifiers.shift()); } } target.specifiers.push(...source.specifiers); return true; } //# sourceMappingURL=import-injector.js.map /***/ }), /***/ "./node_modules/@babel/helper-module-imports/lib/index.js": /*!****************************************************************!*\ !*** ./node_modules/@babel/helper-module-imports/lib/index.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "ImportInjector", ({ enumerable: true, get: function () { return _importInjector.default; } })); exports.addDefault = addDefault; exports.addNamed = addNamed; exports.addNamespace = addNamespace; exports.addSideEffect = addSideEffect; Object.defineProperty(exports, "isModule", ({ enumerable: true, get: function () { return _isModule.default; } })); var _importInjector = __webpack_require__(/*! ./import-injector.js */ "./node_modules/@babel/helper-module-imports/lib/import-injector.js"); var _isModule = __webpack_require__(/*! ./is-module.js */ "./node_modules/@babel/helper-module-imports/lib/is-module.js"); function addDefault(path, importedSource, opts) { return new _importInjector.default(path).addDefault(importedSource, opts); } function addNamed(path, name, importedSource, opts) { return new _importInjector.default(path).addNamed(name, importedSource, opts); } function addNamespace(path, importedSource, opts) { return new _importInjector.default(path).addNamespace(importedSource, opts); } function addSideEffect(path, importedSource, opts) { return new _importInjector.default(path).addSideEffect(importedSource, opts); } //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/helper-module-imports/lib/is-module.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/helper-module-imports/lib/is-module.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isModule; function isModule(path) { return path.node.sourceType === "module"; } //# sourceMappingURL=is-module.js.map /***/ }), /***/ "./node_modules/@babel/helper-module-transforms/lib/dynamic-import.js": /*!****************************************************************************!*\ !*** ./node_modules/@babel/helper-module-transforms/lib/dynamic-import.js ***! \****************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.buildDynamicImport = buildDynamicImport; var _core = __webpack_require__(/*! @babel/core */ "./node_modules/@babel/core/lib/index.js"); { exports.getDynamicImportSource = function getDynamicImportSource(node) { const [source] = node.arguments; return _core.types.isStringLiteral(source) || _core.types.isTemplateLiteral(source) ? source : _core.template.expression.ast`\`\${${source}}\``; }; } function buildDynamicImport(node, deferToThen, wrapWithPromise, builder) { const specifier = _core.types.isCallExpression(node) ? node.arguments[0] : node.source; if (_core.types.isStringLiteral(specifier) || _core.types.isTemplateLiteral(specifier) && specifier.quasis.length === 0) { if (deferToThen) { return _core.template.expression.ast` Promise.resolve().then(() => ${builder(specifier)}) `; } else return builder(specifier); } const specifierToString = _core.types.isTemplateLiteral(specifier) ? _core.types.identifier("specifier") : _core.types.templateLiteral([_core.types.templateElement({ raw: "" }), _core.types.templateElement({ raw: "" })], [_core.types.identifier("specifier")]); if (deferToThen) { return _core.template.expression.ast` (specifier => new Promise(r => r(${specifierToString})) .then(s => ${builder(_core.types.identifier("s"))}) )(${specifier}) `; } else if (wrapWithPromise) { return _core.template.expression.ast` (specifier => new Promise(r => r(${builder(specifierToString)})) )(${specifier}) `; } else { return _core.template.expression.ast` (specifier => ${builder(specifierToString)})(${specifier}) `; } } //# sourceMappingURL=dynamic-import.js.map /***/ }), /***/ "./node_modules/@babel/helper-module-transforms/lib/get-module-name.js": /*!*****************************************************************************!*\ !*** ./node_modules/@babel/helper-module-transforms/lib/get-module-name.js ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = getModuleName; { const originalGetModuleName = getModuleName; exports["default"] = getModuleName = function getModuleName(rootOpts, pluginOpts) { var _pluginOpts$moduleId, _pluginOpts$moduleIds, _pluginOpts$getModule, _pluginOpts$moduleRoo; return originalGetModuleName(rootOpts, { moduleId: (_pluginOpts$moduleId = pluginOpts.moduleId) != null ? _pluginOpts$moduleId : rootOpts.moduleId, moduleIds: (_pluginOpts$moduleIds = pluginOpts.moduleIds) != null ? _pluginOpts$moduleIds : rootOpts.moduleIds, getModuleId: (_pluginOpts$getModule = pluginOpts.getModuleId) != null ? _pluginOpts$getModule : rootOpts.getModuleId, moduleRoot: (_pluginOpts$moduleRoo = pluginOpts.moduleRoot) != null ? _pluginOpts$moduleRoo : rootOpts.moduleRoot }); }; } function getModuleName(rootOpts, pluginOpts) { const { filename, filenameRelative = filename, sourceRoot = pluginOpts.moduleRoot } = rootOpts; const { moduleId, moduleIds = !!moduleId, getModuleId, moduleRoot = sourceRoot } = pluginOpts; if (!moduleIds) return null; if (moduleId != null && !getModuleId) { return moduleId; } let moduleName = moduleRoot != null ? moduleRoot + "/" : ""; if (filenameRelative) { const sourceRootReplacer = sourceRoot != null ? new RegExp("^" + sourceRoot + "/?") : ""; moduleName += filenameRelative.replace(sourceRootReplacer, "").replace(/\.\w*$/, ""); } moduleName = moduleName.replace(/\\/g, "/"); if (getModuleId) { return getModuleId(moduleName) || moduleName; } else { return moduleName; } } //# sourceMappingURL=get-module-name.js.map /***/ }), /***/ "./node_modules/@babel/helper-module-transforms/lib/index.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/helper-module-transforms/lib/index.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "buildDynamicImport", ({ enumerable: true, get: function () { return _dynamicImport.buildDynamicImport; } })); exports.buildNamespaceInitStatements = buildNamespaceInitStatements; exports.ensureStatementsHoisted = ensureStatementsHoisted; Object.defineProperty(exports, "getModuleName", ({ enumerable: true, get: function () { return _getModuleName.default; } })); Object.defineProperty(exports, "hasExports", ({ enumerable: true, get: function () { return _normalizeAndLoadMetadata.hasExports; } })); Object.defineProperty(exports, "isModule", ({ enumerable: true, get: function () { return _helperModuleImports.isModule; } })); Object.defineProperty(exports, "isSideEffectImport", ({ enumerable: true, get: function () { return _normalizeAndLoadMetadata.isSideEffectImport; } })); exports.rewriteModuleStatementsAndPrepareHeader = rewriteModuleStatementsAndPrepareHeader; Object.defineProperty(exports, "rewriteThis", ({ enumerable: true, get: function () { return _rewriteThis.default; } })); exports.wrapInterop = wrapInterop; var _assert = __webpack_require__(/*! assert */ "./node_modules/assert/build/assert.js"); var _core = __webpack_require__(/*! @babel/core */ "./node_modules/@babel/core/lib/index.js"); var _helperModuleImports = __webpack_require__(/*! @babel/helper-module-imports */ "./node_modules/@babel/helper-module-imports/lib/index.js"); var _rewriteThis = __webpack_require__(/*! ./rewrite-this.js */ "./node_modules/@babel/helper-module-transforms/lib/rewrite-this.js"); var _rewriteLiveReferences = __webpack_require__(/*! ./rewrite-live-references.js */ "./node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js"); var _normalizeAndLoadMetadata = __webpack_require__(/*! ./normalize-and-load-metadata.js */ "./node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js"); var Lazy = __webpack_require__(/*! ./lazy-modules.js */ "./node_modules/@babel/helper-module-transforms/lib/lazy-modules.js"); var _dynamicImport = __webpack_require__(/*! ./dynamic-import.js */ "./node_modules/@babel/helper-module-transforms/lib/dynamic-import.js"); var _getModuleName = __webpack_require__(/*! ./get-module-name.js */ "./node_modules/@babel/helper-module-transforms/lib/get-module-name.js"); { exports.getDynamicImportSource = __webpack_require__(/*! ./dynamic-import */ "./node_modules/@babel/helper-module-transforms/lib/dynamic-import.js").getDynamicImportSource; } function rewriteModuleStatementsAndPrepareHeader(path, { exportName, strict, allowTopLevelThis, strictMode, noInterop, importInterop = noInterop ? "none" : "babel", lazy, getWrapperPayload = Lazy.toGetWrapperPayload(lazy != null ? lazy : false), wrapReference = Lazy.wrapReference, esNamespaceOnly, filename, constantReexports = arguments[1].loose, enumerableModuleMeta = arguments[1].loose, noIncompleteNsImportDetection }) { (0, _normalizeAndLoadMetadata.validateImportInteropOption)(importInterop); _assert((0, _helperModuleImports.isModule)(path), "Cannot process module statements in a script"); path.node.sourceType = "script"; const meta = (0, _normalizeAndLoadMetadata.default)(path, exportName, { importInterop, initializeReexports: constantReexports, getWrapperPayload, esNamespaceOnly, filename }); if (!allowTopLevelThis) { (0, _rewriteThis.default)(path); } (0, _rewriteLiveReferences.default)(path, meta, wrapReference); if (strictMode !== false) { const hasStrict = path.node.directives.some(directive => { return directive.value.value === "use strict"; }); if (!hasStrict) { path.unshiftContainer("directives", _core.types.directive(_core.types.directiveLiteral("use strict"))); } } const headers = []; if ((0, _normalizeAndLoadMetadata.hasExports)(meta) && !strict) { headers.push(buildESModuleHeader(meta, enumerableModuleMeta)); } const nameList = buildExportNameListDeclaration(path, meta); if (nameList) { meta.exportNameListName = nameList.name; headers.push(nameList.statement); } headers.push(...buildExportInitializationStatements(path, meta, wrapReference, constantReexports, noIncompleteNsImportDetection)); return { meta, headers }; } function ensureStatementsHoisted(statements) { statements.forEach(header => { header._blockHoist = 3; }); } function wrapInterop(programPath, expr, type) { if (type === "none") { return null; } if (type === "node-namespace") { return _core.types.callExpression(programPath.hub.addHelper("interopRequireWildcard"), [expr, _core.types.booleanLiteral(true)]); } else if (type === "node-default") { return null; } let helper; if (type === "default") { helper = "interopRequireDefault"; } else if (type === "namespace") { helper = "interopRequireWildcard"; } else { throw new Error(`Unknown interop: ${type}`); } return _core.types.callExpression(programPath.hub.addHelper(helper), [expr]); } function buildNamespaceInitStatements(metadata, sourceMetadata, constantReexports = false, wrapReference = Lazy.wrapReference) { var _wrapReference; const statements = []; const srcNamespaceId = _core.types.identifier(sourceMetadata.name); for (const localName of sourceMetadata.importsNamespace) { if (localName === sourceMetadata.name) continue; statements.push(_core.template.statement`var NAME = SOURCE;`({ NAME: localName, SOURCE: _core.types.cloneNode(srcNamespaceId) })); } const srcNamespace = (_wrapReference = wrapReference(srcNamespaceId, sourceMetadata.wrap)) != null ? _wrapReference : srcNamespaceId; if (constantReexports) { statements.push(...buildReexportsFromMeta(metadata, sourceMetadata, true, wrapReference)); } for (const exportName of sourceMetadata.reexportNamespace) { statements.push((!_core.types.isIdentifier(srcNamespace) ? _core.template.statement` Object.defineProperty(EXPORTS, "NAME", { enumerable: true, get: function() { return NAMESPACE; } }); ` : _core.template.statement`EXPORTS.NAME = NAMESPACE;`)({ EXPORTS: metadata.exportName, NAME: exportName, NAMESPACE: _core.types.cloneNode(srcNamespace) })); } if (sourceMetadata.reexportAll) { const statement = buildNamespaceReexport(metadata, _core.types.cloneNode(srcNamespace), constantReexports); statement.loc = sourceMetadata.reexportAll.loc; statements.push(statement); } return statements; } const ReexportTemplate = { constant: ({ exports, exportName, namespaceImport }) => _core.template.statement.ast` ${exports}.${exportName} = ${namespaceImport}; `, constantComputed: ({ exports, exportName, namespaceImport }) => _core.template.statement.ast` ${exports}["${exportName}"] = ${namespaceImport}; `, spec: ({ exports, exportName, namespaceImport }) => _core.template.statement.ast` Object.defineProperty(${exports}, "${exportName}", { enumerable: true, get: function() { return ${namespaceImport}; }, }); ` }; function buildReexportsFromMeta(meta, metadata, constantReexports, wrapReference) { var _wrapReference2; let namespace = _core.types.identifier(metadata.name); namespace = (_wrapReference2 = wrapReference(namespace, metadata.wrap)) != null ? _wrapReference2 : namespace; const { stringSpecifiers } = meta; return Array.from(metadata.reexports, ([exportName, importName]) => { let namespaceImport = _core.types.cloneNode(namespace); if (importName === "default" && metadata.interop === "node-default") {} else if (stringSpecifiers.has(importName)) { namespaceImport = _core.types.memberExpression(namespaceImport, _core.types.stringLiteral(importName), true); } else { namespaceImport = _core.types.memberExpression(namespaceImport, _core.types.identifier(importName)); } const astNodes = { exports: meta.exportName, exportName, namespaceImport }; if (constantReexports || _core.types.isIdentifier(namespaceImport)) { if (stringSpecifiers.has(exportName)) { return ReexportTemplate.constantComputed(astNodes); } else { return ReexportTemplate.constant(astNodes); } } else { return ReexportTemplate.spec(astNodes); } }); } function buildESModuleHeader(metadata, enumerableModuleMeta = false) { return (enumerableModuleMeta ? _core.template.statement` EXPORTS.__esModule = true; ` : _core.template.statement` Object.defineProperty(EXPORTS, "__esModule", { value: true, }); `)({ EXPORTS: metadata.exportName }); } function buildNamespaceReexport(metadata, namespace, constantReexports) { return (constantReexports ? _core.template.statement` Object.keys(NAMESPACE).forEach(function(key) { if (key === "default" || key === "__esModule") return; VERIFY_NAME_LIST; if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return; EXPORTS[key] = NAMESPACE[key]; }); ` : _core.template.statement` Object.keys(NAMESPACE).forEach(function(key) { if (key === "default" || key === "__esModule") return; VERIFY_NAME_LIST; if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return; Object.defineProperty(EXPORTS, key, { enumerable: true, get: function() { return NAMESPACE[key]; }, }); }); `)({ NAMESPACE: namespace, EXPORTS: metadata.exportName, VERIFY_NAME_LIST: metadata.exportNameListName ? (0, _core.template)` if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return; `({ EXPORTS_LIST: metadata.exportNameListName }) : null }); } function buildExportNameListDeclaration(programPath, metadata) { const exportedVars = Object.create(null); for (const data of metadata.local.values()) { for (const name of data.names) { exportedVars[name] = true; } } let hasReexport = false; for (const data of metadata.source.values()) { for (const exportName of data.reexports.keys()) { exportedVars[exportName] = true; } for (const exportName of data.reexportNamespace) { exportedVars[exportName] = true; } hasReexport = hasReexport || !!data.reexportAll; } if (!hasReexport || Object.keys(exportedVars).length === 0) return null; const name = programPath.scope.generateUidIdentifier("exportNames"); delete exportedVars.default; return { name: name.name, statement: _core.types.variableDeclaration("var", [_core.types.variableDeclarator(name, _core.types.valueToNode(exportedVars))]) }; } function buildExportInitializationStatements(programPath, metadata, wrapReference, constantReexports = false, noIncompleteNsImportDetection = false) { const initStatements = []; for (const [localName, data] of metadata.local) { if (data.kind === "import") {} else if (data.kind === "hoisted") { initStatements.push([data.names[0], buildInitStatement(metadata, data.names, _core.types.identifier(localName))]); } else if (!noIncompleteNsImportDetection) { for (const exportName of data.names) { initStatements.push([exportName, null]); } } } for (const data of metadata.source.values()) { if (!constantReexports) { const reexportsStatements = buildReexportsFromMeta(metadata, data, false, wrapReference); const reexports = [...data.reexports.keys()]; for (let i = 0; i < reexportsStatements.length; i++) { initStatements.push([reexports[i], reexportsStatements[i]]); } } if (!noIncompleteNsImportDetection) { for (const exportName of data.reexportNamespace) { initStatements.push([exportName, null]); } } } initStatements.sort(([a], [b]) => { if (a < b) return -1; if (b < a) return 1; return 0; }); const results = []; if (noIncompleteNsImportDetection) { for (const [, initStatement] of initStatements) { results.push(initStatement); } } else { const chunkSize = 100; for (let i = 0; i < initStatements.length; i += chunkSize) { let uninitializedExportNames = []; for (let j = 0; j < chunkSize && i + j < initStatements.length; j++) { const [exportName, initStatement] = initStatements[i + j]; if (initStatement !== null) { if (uninitializedExportNames.length > 0) { results.push(buildInitStatement(metadata, uninitializedExportNames, programPath.scope.buildUndefinedNode())); uninitializedExportNames = []; } results.push(initStatement); } else { uninitializedExportNames.push(exportName); } } if (uninitializedExportNames.length > 0) { results.push(buildInitStatement(metadata, uninitializedExportNames, programPath.scope.buildUndefinedNode())); } } } return results; } const InitTemplate = { computed: ({ exports, name, value }) => _core.template.expression.ast`${exports}["${name}"] = ${value}`, default: ({ exports, name, value }) => _core.template.expression.ast`${exports}.${name} = ${value}`, define: ({ exports, name, value }) => _core.template.expression.ast` Object.defineProperty(${exports}, "${name}", { enumerable: true, value: void 0, writable: true })["${name}"] = ${value}` }; function buildInitStatement(metadata, exportNames, initExpr) { const { stringSpecifiers, exportName: exports } = metadata; return _core.types.expressionStatement(exportNames.reduce((value, name) => { const params = { exports, name, value }; if (name === "__proto__") { return InitTemplate.define(params); } if (stringSpecifiers.has(name)) { return InitTemplate.computed(params); } return InitTemplate.default(params); }, initExpr)); } //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/helper-module-transforms/lib/lazy-modules.js": /*!**************************************************************************!*\ !*** ./node_modules/@babel/helper-module-transforms/lib/lazy-modules.js ***! \**************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toGetWrapperPayload = toGetWrapperPayload; exports.wrapReference = wrapReference; var _core = __webpack_require__(/*! @babel/core */ "./node_modules/@babel/core/lib/index.js"); var _normalizeAndLoadMetadata = __webpack_require__(/*! ./normalize-and-load-metadata.js */ "./node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js"); function toGetWrapperPayload(lazy) { return (source, metadata) => { if (lazy === false) return null; if ((0, _normalizeAndLoadMetadata.isSideEffectImport)(metadata) || metadata.reexportAll) return null; if (lazy === true) { return source.includes(".") ? null : "lazy"; } if (Array.isArray(lazy)) { return !lazy.includes(source) ? null : "lazy"; } if (typeof lazy === "function") { return lazy(source) ? "lazy" : null; } throw new Error(`.lazy must be a boolean, string array, or function`); }; } function wrapReference(ref, payload) { if (payload === "lazy") return _core.types.callExpression(ref, []); return null; } //# sourceMappingURL=lazy-modules.js.map /***/ }), /***/ "./node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js": /*!*****************************************************************************************!*\ !*** ./node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js ***! \*****************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = normalizeModuleAndLoadMetadata; exports.hasExports = hasExports; exports.isSideEffectImport = isSideEffectImport; exports.validateImportInteropOption = validateImportInteropOption; var _path = __webpack_require__(/*! path */ "./node_modules/path-browserify/index.js"); var _helperValidatorIdentifier = __webpack_require__(/*! @babel/helper-validator-identifier */ "./node_modules/@babel/helper-validator-identifier/lib/index.js"); function hasExports(metadata) { return metadata.hasExports; } function isSideEffectImport(source) { return source.imports.size === 0 && source.importsNamespace.size === 0 && source.reexports.size === 0 && source.reexportNamespace.size === 0 && !source.reexportAll; } function validateImportInteropOption(importInterop) { if (typeof importInterop !== "function" && importInterop !== "none" && importInterop !== "babel" && importInterop !== "node") { throw new Error(`.importInterop must be one of "none", "babel", "node", or a function returning one of those values (received ${importInterop}).`); } return importInterop; } function resolveImportInterop(importInterop, source, filename) { if (typeof importInterop === "function") { return validateImportInteropOption(importInterop(source, filename)); } return importInterop; } function normalizeModuleAndLoadMetadata(programPath, exportName, { importInterop, initializeReexports = false, getWrapperPayload, esNamespaceOnly = false, filename }) { if (!exportName) { exportName = programPath.scope.generateUidIdentifier("exports").name; } const stringSpecifiers = new Set(); nameAnonymousExports(programPath); const { local, sources, hasExports } = getModuleMetadata(programPath, { initializeReexports, getWrapperPayload }, stringSpecifiers); removeImportExportDeclarations(programPath); for (const [source, metadata] of sources) { const { importsNamespace, imports } = metadata; if (importsNamespace.size > 0 && imports.size === 0) { const [nameOfnamespace] = importsNamespace; metadata.name = nameOfnamespace; } const resolvedInterop = resolveImportInterop(importInterop, source, filename); if (resolvedInterop === "none") { metadata.interop = "none"; } else if (resolvedInterop === "node" && metadata.interop === "namespace") { metadata.interop = "node-namespace"; } else if (resolvedInterop === "node" && metadata.interop === "default") { metadata.interop = "node-default"; } else if (esNamespaceOnly && metadata.interop === "namespace") { metadata.interop = "default"; } } return { exportName, exportNameListName: null, hasExports, local, source: sources, stringSpecifiers }; } function getExportSpecifierName(path, stringSpecifiers) { if (path.isIdentifier()) { return path.node.name; } else if (path.isStringLiteral()) { const stringValue = path.node.value; if (!(0, _helperValidatorIdentifier.isIdentifierName)(stringValue)) { stringSpecifiers.add(stringValue); } return stringValue; } else { throw new Error(`Expected export specifier to be either Identifier or StringLiteral, got ${path.node.type}`); } } function assertExportSpecifier(path) { if (path.isExportSpecifier()) { return; } else if (path.isExportNamespaceSpecifier()) { throw path.buildCodeFrameError("Export namespace should be first transformed by `@babel/plugin-transform-export-namespace-from`."); } else { throw path.buildCodeFrameError("Unexpected export specifier type"); } } function getModuleMetadata(programPath, { getWrapperPayload, initializeReexports }, stringSpecifiers) { const localData = getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers); const importNodes = new Map(); const sourceData = new Map(); const getData = (sourceNode, node) => { const source = sourceNode.value; let data = sourceData.get(source); if (!data) { data = { name: programPath.scope.generateUidIdentifier((0, _path.basename)(source, (0, _path.extname)(source))).name, interop: "none", loc: null, imports: new Map(), importsNamespace: new Set(), reexports: new Map(), reexportNamespace: new Set(), reexportAll: null, wrap: null, get lazy() { return this.wrap === "lazy"; }, referenced: false }; sourceData.set(source, data); importNodes.set(source, [node]); } else { importNodes.get(source).push(node); } return data; }; let hasExports = false; programPath.get("body").forEach(child => { if (child.isImportDeclaration()) { const data = getData(child.node.source, child.node); if (!data.loc) data.loc = child.node.loc; child.get("specifiers").forEach(spec => { if (spec.isImportDefaultSpecifier()) { const localName = spec.get("local").node.name; data.imports.set(localName, "default"); const reexport = localData.get(localName); if (reexport) { localData.delete(localName); reexport.names.forEach(name => { data.reexports.set(name, "default"); }); data.referenced = true; } } else if (spec.isImportNamespaceSpecifier()) { const localName = spec.get("local").node.name; data.importsNamespace.add(localName); const reexport = localData.get(localName); if (reexport) { localData.delete(localName); reexport.names.forEach(name => { data.reexportNamespace.add(name); }); data.referenced = true; } } else if (spec.isImportSpecifier()) { const importName = getExportSpecifierName(spec.get("imported"), stringSpecifiers); const localName = spec.get("local").node.name; data.imports.set(localName, importName); const reexport = localData.get(localName); if (reexport) { localData.delete(localName); reexport.names.forEach(name => { data.reexports.set(name, importName); }); data.referenced = true; } } }); } else if (child.isExportAllDeclaration()) { hasExports = true; const data = getData(child.node.source, child.node); if (!data.loc) data.loc = child.node.loc; data.reexportAll = { loc: child.node.loc }; data.referenced = true; } else if (child.isExportNamedDeclaration() && child.node.source) { hasExports = true; const data = getData(child.node.source, child.node); if (!data.loc) data.loc = child.node.loc; child.get("specifiers").forEach(spec => { assertExportSpecifier(spec); const importName = getExportSpecifierName(spec.get("local"), stringSpecifiers); const exportName = getExportSpecifierName(spec.get("exported"), stringSpecifiers); data.reexports.set(exportName, importName); data.referenced = true; if (exportName === "__esModule") { throw spec.get("exported").buildCodeFrameError('Illegal export "__esModule".'); } }); } else if (child.isExportNamedDeclaration() || child.isExportDefaultDeclaration()) { hasExports = true; } }); for (const metadata of sourceData.values()) { let needsDefault = false; let needsNamed = false; if (metadata.importsNamespace.size > 0) { needsDefault = true; needsNamed = true; } if (metadata.reexportAll) { needsNamed = true; } for (const importName of metadata.imports.values()) { if (importName === "default") needsDefault = true;else needsNamed = true; } for (const importName of metadata.reexports.values()) { if (importName === "default") needsDefault = true;else needsNamed = true; } if (needsDefault && needsNamed) { metadata.interop = "namespace"; } else if (needsDefault) { metadata.interop = "default"; } } if (getWrapperPayload) { for (const [source, metadata] of sourceData) { metadata.wrap = getWrapperPayload(source, metadata, importNodes.get(source)); } } return { hasExports, local: localData, sources: sourceData }; } function getLocalExportMetadata(programPath, initializeReexports, stringSpecifiers) { const bindingKindLookup = new Map(); const programScope = programPath.scope; const programChildren = programPath.get("body"); programChildren.forEach(child => { let kind; if (child.isImportDeclaration()) { kind = "import"; } else { if (child.isExportDefaultDeclaration()) { child = child.get("declaration"); } if (child.isExportNamedDeclaration()) { if (child.node.declaration) { child = child.get("declaration"); } else if (initializeReexports && child.node.source && child.get("source").isStringLiteral()) { child.get("specifiers").forEach(spec => { assertExportSpecifier(spec); bindingKindLookup.set(spec.get("local").node.name, "block"); }); return; } } if (child.isFunctionDeclaration()) { kind = "hoisted"; } else if (child.isClassDeclaration()) { kind = "block"; } else if (child.isVariableDeclaration({ kind: "var" })) { kind = "var"; } else if (child.isVariableDeclaration()) { kind = "block"; } else { return; } } Object.keys(child.getOuterBindingIdentifiers()).forEach(name => { bindingKindLookup.set(name, kind); }); }); const localMetadata = new Map(); const getLocalMetadata = idPath => { const localName = idPath.node.name; let metadata = localMetadata.get(localName); if (!metadata) { var _bindingKindLookup$ge, _programScope$getBind; const kind = (_bindingKindLookup$ge = bindingKindLookup.get(localName)) != null ? _bindingKindLookup$ge : (_programScope$getBind = programScope.getBinding(localName)) == null ? void 0 : _programScope$getBind.kind; if (kind === undefined) { throw idPath.buildCodeFrameError(`Exporting local "${localName}", which is not declared.`); } metadata = { names: [], kind }; localMetadata.set(localName, metadata); } return metadata; }; programChildren.forEach(child => { if (child.isExportNamedDeclaration() && (initializeReexports || !child.node.source)) { if (child.node.declaration) { const declaration = child.get("declaration"); const ids = declaration.getOuterBindingIdentifierPaths(); Object.keys(ids).forEach(name => { if (name === "__esModule") { throw declaration.buildCodeFrameError('Illegal export "__esModule".'); } getLocalMetadata(ids[name]).names.push(name); }); } else { child.get("specifiers").forEach(spec => { const local = spec.get("local"); const exported = spec.get("exported"); const localMetadata = getLocalMetadata(local); const exportName = getExportSpecifierName(exported, stringSpecifiers); if (exportName === "__esModule") { throw exported.buildCodeFrameError('Illegal export "__esModule".'); } localMetadata.names.push(exportName); }); } } else if (child.isExportDefaultDeclaration()) { const declaration = child.get("declaration"); if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) { getLocalMetadata(declaration.get("id")).names.push("default"); } else { throw declaration.buildCodeFrameError("Unexpected default expression export."); } } }); return localMetadata; } function nameAnonymousExports(programPath) { programPath.get("body").forEach(child => { if (!child.isExportDefaultDeclaration()) return; { var _child$splitExportDec; (_child$splitExportDec = child.splitExportDeclaration) != null ? _child$splitExportDec : child.splitExportDeclaration = (__webpack_require__(/*! @babel/traverse */ "./node_modules/@babel/traverse/lib/index.js").NodePath).prototype.splitExportDeclaration; } child.splitExportDeclaration(); }); } function removeImportExportDeclarations(programPath) { programPath.get("body").forEach(child => { if (child.isImportDeclaration()) { child.remove(); } else if (child.isExportNamedDeclaration()) { if (child.node.declaration) { child.node.declaration._blockHoist = child.node._blockHoist; child.replaceWith(child.node.declaration); } else { child.remove(); } } else if (child.isExportDefaultDeclaration()) { const declaration = child.get("declaration"); if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration()) { declaration._blockHoist = child.node._blockHoist; child.replaceWith(declaration); } else { throw declaration.buildCodeFrameError("Unexpected default expression export."); } } else if (child.isExportAllDeclaration()) { child.remove(); } }); } //# sourceMappingURL=normalize-and-load-metadata.js.map /***/ }), /***/ "./node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js": /*!*************************************************************************************!*\ !*** ./node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js ***! \*************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = rewriteLiveReferences; var _core = __webpack_require__(/*! @babel/core */ "./node_modules/@babel/core/lib/index.js"); function isInType(path) { do { switch (path.parent.type) { case "TSTypeAnnotation": case "TSTypeAliasDeclaration": case "TSTypeReference": case "TypeAnnotation": case "TypeAlias": return true; case "ExportSpecifier": return path.parentPath.parent.exportKind === "type"; default: if (path.parentPath.isStatement() || path.parentPath.isExpression()) { return false; } } } while (path = path.parentPath); } function rewriteLiveReferences(programPath, metadata, wrapReference) { const imported = new Map(); const exported = new Map(); const requeueInParent = path => { programPath.requeue(path); }; for (const [source, data] of metadata.source) { for (const [localName, importName] of data.imports) { imported.set(localName, [source, importName, null]); } for (const localName of data.importsNamespace) { imported.set(localName, [source, null, localName]); } } for (const [local, data] of metadata.local) { let exportMeta = exported.get(local); if (!exportMeta) { exportMeta = []; exported.set(local, exportMeta); } exportMeta.push(...data.names); } const rewriteBindingInitVisitorState = { metadata, requeueInParent, scope: programPath.scope, exported }; programPath.traverse(rewriteBindingInitVisitor, rewriteBindingInitVisitorState); const rewriteReferencesVisitorState = { seen: new WeakSet(), metadata, requeueInParent, scope: programPath.scope, imported, exported, buildImportReference([source, importName, localName], identNode) { const meta = metadata.source.get(source); meta.referenced = true; if (localName) { if (meta.wrap) { var _wrapReference; identNode = (_wrapReference = wrapReference(identNode, meta.wrap)) != null ? _wrapReference : identNode; } return identNode; } let namespace = _core.types.identifier(meta.name); if (meta.wrap) { var _wrapReference2; namespace = (_wrapReference2 = wrapReference(namespace, meta.wrap)) != null ? _wrapReference2 : namespace; } if (importName === "default" && meta.interop === "node-default") { return namespace; } const computed = metadata.stringSpecifiers.has(importName); return _core.types.memberExpression(namespace, computed ? _core.types.stringLiteral(importName) : _core.types.identifier(importName), computed); } }; programPath.traverse(rewriteReferencesVisitor, rewriteReferencesVisitorState); } const rewriteBindingInitVisitor = { Scope(path) { path.skip(); }, ClassDeclaration(path) { const { requeueInParent, exported, metadata } = this; const { id } = path.node; if (!id) throw new Error("Expected class to have a name"); const localName = id.name; const exportNames = exported.get(localName) || []; if (exportNames.length > 0) { const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exportNames, _core.types.identifier(localName), path.scope)); statement._blockHoist = path.node._blockHoist; requeueInParent(path.insertAfter(statement)[0]); } }, VariableDeclaration(path) { const { requeueInParent, exported, metadata } = this; const isVar = path.node.kind === "var"; for (const decl of path.get("declarations")) { const { id } = decl.node; let { init } = decl.node; if (_core.types.isIdentifier(id) && exported.has(id.name) && !_core.types.isArrowFunctionExpression(init) && (!_core.types.isFunctionExpression(init) || init.id) && (!_core.types.isClassExpression(init) || init.id)) { if (!init) { if (isVar) { continue; } else { init = path.scope.buildUndefinedNode(); } } decl.node.init = buildBindingExportAssignmentExpression(metadata, exported.get(id.name), init, path.scope); requeueInParent(decl.get("init")); } else { for (const localName of Object.keys(decl.getOuterBindingIdentifiers())) { if (exported.has(localName)) { const statement = _core.types.expressionStatement(buildBindingExportAssignmentExpression(metadata, exported.get(localName), _core.types.identifier(localName), path.scope)); statement._blockHoist = path.node._blockHoist; requeueInParent(path.insertAfter(statement)[0]); } } } } } }; const buildBindingExportAssignmentExpression = (metadata, exportNames, localExpr, scope) => { const exportsObjectName = metadata.exportName; for (let currentScope = scope; currentScope != null; currentScope = currentScope.parent) { if (currentScope.hasOwnBinding(exportsObjectName)) { currentScope.rename(exportsObjectName); } } return (exportNames || []).reduce((expr, exportName) => { const { stringSpecifiers } = metadata; const computed = stringSpecifiers.has(exportName); return _core.types.assignmentExpression("=", _core.types.memberExpression(_core.types.identifier(exportsObjectName), computed ? _core.types.stringLiteral(exportName) : _core.types.identifier(exportName), computed), expr); }, localExpr); }; const buildImportThrow = localName => { return _core.template.expression.ast` (function() { throw new Error('"' + '${localName}' + '" is read-only.'); })() `; }; const rewriteReferencesVisitor = { ReferencedIdentifier(path) { const { seen, buildImportReference, scope, imported, requeueInParent } = this; if (seen.has(path.node)) return; seen.add(path.node); const localName = path.node.name; const importData = imported.get(localName); if (importData) { if (isInType(path)) { throw path.buildCodeFrameError(`Cannot transform the imported binding "${localName}" since it's also used in a type annotation. ` + `Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`); } const localBinding = path.scope.getBinding(localName); const rootBinding = scope.getBinding(localName); if (rootBinding !== localBinding) return; const ref = buildImportReference(importData, path.node); ref.loc = path.node.loc; if ((path.parentPath.isCallExpression({ callee: path.node }) || path.parentPath.isOptionalCallExpression({ callee: path.node }) || path.parentPath.isTaggedTemplateExpression({ tag: path.node })) && _core.types.isMemberExpression(ref)) { path.replaceWith(_core.types.sequenceExpression([_core.types.numericLiteral(0), ref])); } else if (path.isJSXIdentifier() && _core.types.isMemberExpression(ref)) { const { object, property } = ref; path.replaceWith(_core.types.jsxMemberExpression(_core.types.jsxIdentifier(object.name), _core.types.jsxIdentifier(property.name))); } else { path.replaceWith(ref); } requeueInParent(path); path.skip(); } }, UpdateExpression(path) { const { scope, seen, imported, exported, requeueInParent, buildImportReference } = this; if (seen.has(path.node)) return; seen.add(path.node); const arg = path.get("argument"); if (arg.isMemberExpression()) return; const update = path.node; if (arg.isIdentifier()) { const localName = arg.node.name; if (scope.getBinding(localName) !== path.scope.getBinding(localName)) { return; } const exportedNames = exported.get(localName); const importData = imported.get(localName); if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) { if (importData) { path.replaceWith(_core.types.assignmentExpression(update.operator[0] + "=", buildImportReference(importData, arg.node), buildImportThrow(localName))); } else if (update.prefix) { path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.cloneNode(update), path.scope)); } else { const ref = scope.generateDeclaredUidIdentifier(localName); path.replaceWith(_core.types.sequenceExpression([_core.types.assignmentExpression("=", _core.types.cloneNode(ref), _core.types.cloneNode(update)), buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope), _core.types.cloneNode(ref)])); } } } requeueInParent(path); path.skip(); }, AssignmentExpression: { exit(path) { const { scope, seen, imported, exported, requeueInParent, buildImportReference } = this; if (seen.has(path.node)) return; seen.add(path.node); const left = path.get("left"); if (left.isMemberExpression()) return; if (left.isIdentifier()) { const localName = left.node.name; if (scope.getBinding(localName) !== path.scope.getBinding(localName)) { return; } const exportedNames = exported.get(localName); const importData = imported.get(localName); if ((exportedNames == null ? void 0 : exportedNames.length) > 0 || importData) { const assignment = path.node; if (importData) { assignment.left = buildImportReference(importData, left.node); assignment.right = _core.types.sequenceExpression([assignment.right, buildImportThrow(localName)]); } const { operator } = assignment; let newExpr; if (operator === "=") { newExpr = assignment; } else if (operator === "&&=" || operator === "||=" || operator === "??=") { newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.logicalExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right)); } else { newExpr = _core.types.assignmentExpression("=", assignment.left, _core.types.binaryExpression(operator.slice(0, -1), _core.types.cloneNode(assignment.left), assignment.right)); } path.replaceWith(buildBindingExportAssignmentExpression(this.metadata, exportedNames, newExpr, path.scope)); requeueInParent(path); path.skip(); } } else { const ids = left.getOuterBindingIdentifiers(); const programScopeIds = Object.keys(ids).filter(localName => scope.getBinding(localName) === path.scope.getBinding(localName)); const id = programScopeIds.find(localName => imported.has(localName)); if (id) { path.node.right = _core.types.sequenceExpression([path.node.right, buildImportThrow(id)]); } const items = []; programScopeIds.forEach(localName => { const exportedNames = exported.get(localName) || []; if (exportedNames.length > 0) { items.push(buildBindingExportAssignmentExpression(this.metadata, exportedNames, _core.types.identifier(localName), path.scope)); } }); if (items.length > 0) { let node = _core.types.sequenceExpression(items); if (path.parentPath.isExpressionStatement()) { node = _core.types.expressionStatement(node); node._blockHoist = path.parentPath.node._blockHoist; } const statement = path.insertAfter(node)[0]; requeueInParent(statement); } } } }, ForXStatement(path) { const { scope, node } = path; const { left } = node; const { exported, imported, scope: programScope } = this; if (!_core.types.isVariableDeclaration(left)) { let didTransformExport = false, importConstViolationName; const loopBodyScope = path.get("body").scope; for (const name of Object.keys(_core.types.getOuterBindingIdentifiers(left))) { if (programScope.getBinding(name) === scope.getBinding(name)) { if (exported.has(name)) { didTransformExport = true; if (loopBodyScope.hasOwnBinding(name)) { loopBodyScope.rename(name); } } if (imported.has(name) && !importConstViolationName) { importConstViolationName = name; } } } if (!didTransformExport && !importConstViolationName) { return; } path.ensureBlock(); const bodyPath = path.get("body"); const newLoopId = scope.generateUidIdentifierBasedOnNode(left); path.get("left").replaceWith(_core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.cloneNode(newLoopId))])); scope.registerDeclaration(path.get("left")); if (didTransformExport) { bodyPath.unshiftContainer("body", _core.types.expressionStatement(_core.types.assignmentExpression("=", left, newLoopId))); } if (importConstViolationName) { bodyPath.unshiftContainer("body", _core.types.expressionStatement(buildImportThrow(importConstViolationName))); } } } }; //# sourceMappingURL=rewrite-live-references.js.map /***/ }), /***/ "./node_modules/@babel/helper-module-transforms/lib/rewrite-this.js": /*!**************************************************************************!*\ !*** ./node_modules/@babel/helper-module-transforms/lib/rewrite-this.js ***! \**************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = rewriteThis; var _core = __webpack_require__(/*! @babel/core */ "./node_modules/@babel/core/lib/index.js"); var _traverse = __webpack_require__(/*! @babel/traverse */ "./node_modules/@babel/traverse/lib/index.js"); let rewriteThisVisitor; function rewriteThis(programPath) { if (!rewriteThisVisitor) { rewriteThisVisitor = _traverse.visitors.environmentVisitor({ ThisExpression(path) { path.replaceWith(_core.types.unaryExpression("void", _core.types.numericLiteral(0), true)); } }); rewriteThisVisitor.noScope = true; } (0, _traverse.default)(programPath.node, rewriteThisVisitor); } //# sourceMappingURL=rewrite-this.js.map /***/ }), /***/ "./node_modules/@babel/helper-string-parser/lib/index.js": /*!***************************************************************!*\ !*** ./node_modules/@babel/helper-string-parser/lib/index.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.readCodePoint = readCodePoint; exports.readInt = readInt; exports.readStringContents = readStringContents; var _isDigit = function isDigit(code) { return code >= 48 && code <= 57; }; const forbiddenNumericSeparatorSiblings = { decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]), hex: new Set([46, 88, 95, 120]) }; const isAllowedNumericSeparatorSibling = { bin: ch => ch === 48 || ch === 49, oct: ch => ch >= 48 && ch <= 55, dec: ch => ch >= 48 && ch <= 57, hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102 }; function readStringContents(type, input, pos, lineStart, curLine, errors) { const initialPos = pos; const initialLineStart = lineStart; const initialCurLine = curLine; let out = ""; let firstInvalidLoc = null; let chunkStart = pos; const { length } = input; for (;;) { if (pos >= length) { errors.unterminated(initialPos, initialLineStart, initialCurLine); out += input.slice(chunkStart, pos); break; } const ch = input.charCodeAt(pos); if (isStringEnd(type, ch, input, pos)) { out += input.slice(chunkStart, pos); break; } if (ch === 92) { out += input.slice(chunkStart, pos); const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors); if (res.ch === null && !firstInvalidLoc) { firstInvalidLoc = { pos, lineStart, curLine }; } else { out += res.ch; } ({ pos, lineStart, curLine } = res); chunkStart = pos; } else if (ch === 8232 || ch === 8233) { ++pos; ++curLine; lineStart = pos; } else if (ch === 10 || ch === 13) { if (type === "template") { out += input.slice(chunkStart, pos) + "\n"; ++pos; if (ch === 13 && input.charCodeAt(pos) === 10) { ++pos; } ++curLine; chunkStart = lineStart = pos; } else { errors.unterminated(initialPos, initialLineStart, initialCurLine); } } else { ++pos; } } return { pos, str: out, firstInvalidLoc, lineStart, curLine, containsInvalid: !!firstInvalidLoc }; } function isStringEnd(type, ch, input, pos) { if (type === "template") { return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123; } return ch === (type === "double" ? 34 : 39); } function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) { const throwOnInvalid = !inTemplate; pos++; const res = ch => ({ pos, ch, lineStart, curLine }); const ch = input.charCodeAt(pos++); switch (ch) { case 110: return res("\n"); case 114: return res("\r"); case 120: { let code; ({ code, pos } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors)); return res(code === null ? null : String.fromCharCode(code)); } case 117: { let code; ({ code, pos } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors)); return res(code === null ? null : String.fromCodePoint(code)); } case 116: return res("\t"); case 98: return res("\b"); case 118: return res("\u000b"); case 102: return res("\f"); case 13: if (input.charCodeAt(pos) === 10) { ++pos; } case 10: lineStart = pos; ++curLine; case 8232: case 8233: return res(""); case 56: case 57: if (inTemplate) { return res(null); } else { errors.strictNumericEscape(pos - 1, lineStart, curLine); } default: if (ch >= 48 && ch <= 55) { const startPos = pos - 1; const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2)); let octalStr = match[0]; let octal = parseInt(octalStr, 8); if (octal > 255) { octalStr = octalStr.slice(0, -1); octal = parseInt(octalStr, 8); } pos += octalStr.length - 1; const next = input.charCodeAt(pos); if (octalStr !== "0" || next === 56 || next === 57) { if (inTemplate) { return res(null); } else { errors.strictNumericEscape(startPos, lineStart, curLine); } } return res(String.fromCharCode(octal)); } return res(String.fromCharCode(ch)); } } function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) { const initialPos = pos; let n; ({ n, pos } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid)); if (n === null) { if (throwOnInvalid) { errors.invalidEscapeSequence(initialPos, lineStart, curLine); } else { pos = initialPos - 1; } } return { code: n, pos }; } function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) { const start = pos; const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct; const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin; let invalid = false; let total = 0; for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { const code = input.charCodeAt(pos); let val; if (code === 95 && allowNumSeparator !== "bail") { const prev = input.charCodeAt(pos - 1); const next = input.charCodeAt(pos + 1); if (!allowNumSeparator) { if (bailOnError) return { n: null, pos }; errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine); } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) { if (bailOnError) return { n: null, pos }; errors.unexpectedNumericSeparator(pos, lineStart, curLine); } ++pos; continue; } if (code >= 97) { val = code - 97 + 10; } else if (code >= 65) { val = code - 65 + 10; } else if (_isDigit(code)) { val = code - 48; } else { val = Infinity; } if (val >= radix) { if (val <= 9 && bailOnError) { return { n: null, pos }; } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) { val = 0; } else if (forceLen) { val = 0; invalid = true; } else { break; } } ++pos; total = total * radix + val; } if (pos === start || len != null && pos - start !== len || invalid) { return { n: null, pos }; } return { n: total, pos }; } function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) { const ch = input.charCodeAt(pos); let code; if (ch === 123) { ++pos; ({ code, pos } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors)); ++pos; if (code !== null && code > 0x10ffff) { if (throwOnInvalid) { errors.invalidCodePoint(pos, lineStart, curLine); } else { return { code: null, pos }; } } } else { ({ code, pos } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors)); } return { code, pos }; } //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/helper-validator-identifier/lib/identifier.js": /*!***************************************************************************!*\ !*** ./node_modules/@babel/helper-validator-identifier/lib/identifier.js ***! \***************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isIdentifierChar = isIdentifierChar; exports.isIdentifierName = isIdentifierName; exports.isIdentifierStart = isIdentifierStart; let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7cd\ua7d0\ua7d1\ua7d3\ua7d5-\ua7dc\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; let nonASCIIidentifierChars = "\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65"; const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191]; const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; function isInAstralSet(code, set) { let pos = 0x10000; for (let i = 0, length = set.length; i < length; i += 2) { pos += set[i]; if (pos > code) return false; pos += set[i + 1]; if (pos >= code) return true; } return false; } function isIdentifierStart(code) { if (code < 65) return code === 36; if (code <= 90) return true; if (code < 97) return code === 95; if (code <= 122) return true; if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); } return isInAstralSet(code, astralIdentifierStartCodes); } function isIdentifierChar(code) { if (code < 48) return code === 36; if (code < 58) return true; if (code < 65) return false; if (code <= 90) return true; if (code < 97) return code === 95; if (code <= 122) return true; if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); } return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); } function isIdentifierName(name) { let isFirst = true; for (let i = 0; i < name.length; i++) { let cp = name.charCodeAt(i); if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) { const trail = name.charCodeAt(++i); if ((trail & 0xfc00) === 0xdc00) { cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); } } if (isFirst) { isFirst = false; if (!isIdentifierStart(cp)) { return false; } } else if (!isIdentifierChar(cp)) { return false; } } return !isFirst; } //# sourceMappingURL=identifier.js.map /***/ }), /***/ "./node_modules/@babel/helper-validator-identifier/lib/index.js": /*!**********************************************************************!*\ !*** ./node_modules/@babel/helper-validator-identifier/lib/index.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "isIdentifierChar", ({ enumerable: true, get: function () { return _identifier.isIdentifierChar; } })); Object.defineProperty(exports, "isIdentifierName", ({ enumerable: true, get: function () { return _identifier.isIdentifierName; } })); Object.defineProperty(exports, "isIdentifierStart", ({ enumerable: true, get: function () { return _identifier.isIdentifierStart; } })); Object.defineProperty(exports, "isKeyword", ({ enumerable: true, get: function () { return _keyword.isKeyword; } })); Object.defineProperty(exports, "isReservedWord", ({ enumerable: true, get: function () { return _keyword.isReservedWord; } })); Object.defineProperty(exports, "isStrictBindOnlyReservedWord", ({ enumerable: true, get: function () { return _keyword.isStrictBindOnlyReservedWord; } })); Object.defineProperty(exports, "isStrictBindReservedWord", ({ enumerable: true, get: function () { return _keyword.isStrictBindReservedWord; } })); Object.defineProperty(exports, "isStrictReservedWord", ({ enumerable: true, get: function () { return _keyword.isStrictReservedWord; } })); var _identifier = __webpack_require__(/*! ./identifier.js */ "./node_modules/@babel/helper-validator-identifier/lib/identifier.js"); var _keyword = __webpack_require__(/*! ./keyword.js */ "./node_modules/@babel/helper-validator-identifier/lib/keyword.js"); //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/helper-validator-identifier/lib/keyword.js": /*!************************************************************************!*\ !*** ./node_modules/@babel/helper-validator-identifier/lib/keyword.js ***! \************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isKeyword = isKeyword; exports.isReservedWord = isReservedWord; exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord; exports.isStrictBindReservedWord = isStrictBindReservedWord; exports.isStrictReservedWord = isStrictReservedWord; const reservedWords = { keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], strictBind: ["eval", "arguments"] }; const keywords = new Set(reservedWords.keyword); const reservedWordsStrictSet = new Set(reservedWords.strict); const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); function isReservedWord(word, inModule) { return inModule && word === "await" || word === "enum"; } function isStrictReservedWord(word, inModule) { return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); } function isStrictBindOnlyReservedWord(word) { return reservedWordsStrictBindSet.has(word); } function isStrictBindReservedWord(word, inModule) { return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); } function isKeyword(word) { return keywords.has(word); } //# sourceMappingURL=keyword.js.map /***/ }), /***/ "./node_modules/@babel/helper-validator-option/lib/find-suggestion.js": /*!****************************************************************************!*\ !*** ./node_modules/@babel/helper-validator-option/lib/find-suggestion.js ***! \****************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.findSuggestion = findSuggestion; const { min } = Math; function levenshtein(a, b) { let t = [], u = [], i, j; const m = a.length, n = b.length; if (!m) { return n; } if (!n) { return m; } for (j = 0; j <= n; j++) { t[j] = j; } for (i = 1; i <= m; i++) { for (u = [i], j = 1; j <= n; j++) { u[j] = a[i - 1] === b[j - 1] ? t[j - 1] : min(t[j - 1], t[j], u[j - 1]) + 1; } t = u; } return u[n]; } function findSuggestion(str, arr) { const distances = arr.map(el => levenshtein(el, str)); return arr[distances.indexOf(min(...distances))]; } //# sourceMappingURL=find-suggestion.js.map /***/ }), /***/ "./node_modules/@babel/helper-validator-option/lib/index.js": /*!******************************************************************!*\ !*** ./node_modules/@babel/helper-validator-option/lib/index.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "OptionValidator", ({ enumerable: true, get: function () { return _validator.OptionValidator; } })); Object.defineProperty(exports, "findSuggestion", ({ enumerable: true, get: function () { return _findSuggestion.findSuggestion; } })); var _validator = __webpack_require__(/*! ./validator.js */ "./node_modules/@babel/helper-validator-option/lib/validator.js"); var _findSuggestion = __webpack_require__(/*! ./find-suggestion.js */ "./node_modules/@babel/helper-validator-option/lib/find-suggestion.js"); //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/helper-validator-option/lib/validator.js": /*!**********************************************************************!*\ !*** ./node_modules/@babel/helper-validator-option/lib/validator.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OptionValidator = void 0; var _findSuggestion = __webpack_require__(/*! ./find-suggestion.js */ "./node_modules/@babel/helper-validator-option/lib/find-suggestion.js"); class OptionValidator { constructor(descriptor) { this.descriptor = descriptor; } validateTopLevelOptions(options, TopLevelOptionShape) { const validOptionNames = Object.keys(TopLevelOptionShape); for (const option of Object.keys(options)) { if (!validOptionNames.includes(option)) { throw new Error(this.formatMessage(`'${option}' is not a valid top-level option. - Did you mean '${(0, _findSuggestion.findSuggestion)(option, validOptionNames)}'?`)); } } } validateBooleanOption(name, value, defaultValue) { if (value === undefined) { return defaultValue; } else { this.invariant(typeof value === "boolean", `'${name}' option must be a boolean.`); } return value; } validateStringOption(name, value, defaultValue) { if (value === undefined) { return defaultValue; } else { this.invariant(typeof value === "string", `'${name}' option must be a string.`); } return value; } invariant(condition, message) { if (!condition) { throw new Error(this.formatMessage(message)); } } formatMessage(message) { return `${this.descriptor}: ${message}`; } } exports.OptionValidator = OptionValidator; //# sourceMappingURL=validator.js.map /***/ }), /***/ "./node_modules/@babel/helpers/lib/helpers-generated.js": /*!**************************************************************!*\ !*** ./node_modules/@babel/helpers/lib/helpers-generated.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _template = __webpack_require__(/*! @babel/template */ "./node_modules/@babel/template/lib/index.js"); function helper(minVersion, source, metadata) { return Object.freeze({ minVersion, ast: () => _template.default.program.ast(source, { preserveComments: true }), metadata }); } const helpers = exports["default"] = { __proto__: null, OverloadYield: helper("7.18.14", "function _OverloadYield(e,d){this.v=e,this.k=d}", { globals: [], locals: { _OverloadYield: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_OverloadYield", dependencies: {}, internal: false }), applyDecoratedDescriptor: helper("7.0.0-beta.0", 'function _applyDecoratedDescriptor(i,e,r,n,l){var a={};return Object.keys(n).forEach((function(i){a[i]=n[i]})),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=r.slice().reverse().reduce((function(r,n){return n(i,e,r)||r}),a),l&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(l):void 0,a.initializer=void 0),void 0===a.initializer?(Object.defineProperty(i,e,a),null):a}', { globals: ["Object"], locals: { _applyDecoratedDescriptor: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_applyDecoratedDescriptor", dependencies: {}, internal: false }), applyDecs2311: helper("7.24.0", 'function applyDecs2311(e,t,n,r,o,i){var a,c,u,s,f,l,p,d=Symbol.metadata||Symbol.for("Symbol.metadata"),m=Object.defineProperty,h=Object.create,y=[h(null),h(null)],v=t.length;function g(t,n,r){return function(o,i){n&&(i=o,o=e);for(var a=0;a=0;O-=n?2:1){var T=b(h[O],"A decorator","be",!0),z=n?h[O-1]:void 0,A={},H={kind:["field","accessor","method","getter","setter","class"][o],name:r,metadata:a,addInitializer:function(e,t){if(e.v)throw new TypeError("attempted to call addInitializer after decoration was finished");b(t,"An initializer","be",!0),i.push(t)}.bind(null,A)};if(w)c=T.call(z,N,H),A.v=1,b(c,"class decorators","return")&&(N=c);else if(H.static=s,H.private=f,c=H.access={has:f?p.bind():function(e){return r in e}},j||(c.get=f?E?function(e){return d(e),P.value}:I("get",0,d):function(e){return e[r]}),E||S||(c.set=f?I("set",0,d):function(e,t){e[r]=t}),N=T.call(z,D?{get:P.get,set:P.set}:P[F],H),A.v=1,D){if("object"==typeof N&&N)(c=b(N.get,"accessor.get"))&&(P.get=c),(c=b(N.set,"accessor.set"))&&(P.set=c),(c=b(N.init,"accessor.init"))&&k.unshift(c);else if(void 0!==N)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else b(N,(l?"field":"method")+" decorators","return")&&(l?k.unshift(N):P[F]=N)}return o<2&&u.push(g(k,s,1),g(i,s,0)),l||w||(f?D?u.splice(-1,0,I("get",s),I("set",s)):u.push(E?P[F]:b.call.bind(P[F])):m(e,r,P)),N}function w(e){return m(e,d,{configurable:!0,enumerable:!0,value:a})}return void 0!==i&&(a=i[d]),a=h(null==a?null:a),f=[],l=function(e){e&&f.push(g(e))},p=function(t,r){for(var i=0;ir.length)&&(a=r.length);for(var e=0,n=Array(a);e=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function(){t=t.call(r)},n:function(){var r=t.next();return a=r.done,r},e:function(r){u=!0,o=r},f:function(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}', { globals: ["Symbol", "Array", "TypeError"], locals: { _createForOfIteratorHelper: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_createForOfIteratorHelper", dependencies: { unsupportedIterableToArray: ["body.0.body.body.1.consequent.body.0.test.left.right.right.callee"] }, internal: false }), createForOfIteratorHelperLoose: helper("7.9.0", 'function _createForOfIteratorHelperLoose(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}', { globals: ["Symbol", "Array", "TypeError"], locals: { _createForOfIteratorHelperLoose: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_createForOfIteratorHelperLoose", dependencies: { unsupportedIterableToArray: ["body.0.body.body.2.test.left.right.right.callee"] }, internal: false }), createSuper: helper("7.9.0", "function _createSuper(t){var r=isNativeReflectConstruct();return function(){var e,o=getPrototypeOf(t);if(r){var s=getPrototypeOf(this).constructor;e=Reflect.construct(o,arguments,s)}else e=o.apply(this,arguments);return possibleConstructorReturn(this,e)}}", { globals: ["Reflect"], locals: { _createSuper: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_createSuper", dependencies: { getPrototypeOf: ["body.0.body.body.1.argument.body.body.0.declarations.1.init.callee", "body.0.body.body.1.argument.body.body.1.consequent.body.0.declarations.0.init.object.callee"], isNativeReflectConstruct: ["body.0.body.body.0.declarations.0.init.callee"], possibleConstructorReturn: ["body.0.body.body.1.argument.body.body.2.argument.callee"] }, internal: false }), decorate: helper("7.1.5", 'function _decorate(e,r,t,i){var o=_getDecoratorsApi();if(i)for(var n=0;n=0;n--){var s=r[e.placement];s.splice(s.indexOf(e.key),1);var a=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,o[n])(a)||a);e=l.element,this.addElementPlacement(e,r),l.finisher&&i.push(l.finisher);var c=l.extras;if(c){for(var p=0;p=0;i--){var o=this.fromClassDescriptor(e),n=this.toClassDescriptor((0,r[i])(o)||o);if(void 0!==n.finisher&&t.push(n.finisher),void 0!==n.elements){e=n.elements;for(var s=0;s1){for(var t=Array(n),f=0;f3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&dn||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a \'"+o+"\' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(define(t={},n,(function(){return this})),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,define(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(u,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",define(GeneratorFunctionPrototype,o,"GeneratorFunction"),define(u),define(u,o,"Generator"),define(u,n,(function(){return this})),define(u,"toString",(function(){return"[object Generator]"})),(_regenerator=function(){return{w:i,m:f}})()}', { globals: ["Symbol", "Object", "TypeError"], locals: { _regenerator: ["body.0.id", "body.0.body.body.9.argument.expressions.9.callee.left"] }, exportBindingAssignments: ["body.0.body.body.9.argument.expressions.9.callee"], exportName: "_regenerator", dependencies: { regeneratorDefine: ["body.0.body.body.1.body.body.1.argument.expressions.0.callee", "body.0.body.body.7.declarations.0.init.alternate.expressions.0.callee", "body.0.body.body.8.body.body.0.argument.expressions.0.alternate.expressions.1.callee", "body.0.body.body.9.argument.expressions.1.callee", "body.0.body.body.9.argument.expressions.2.callee", "body.0.body.body.9.argument.expressions.4.callee", "body.0.body.body.9.argument.expressions.5.callee", "body.0.body.body.9.argument.expressions.6.callee", "body.0.body.body.9.argument.expressions.7.callee", "body.0.body.body.9.argument.expressions.8.callee"] }, internal: false }), regeneratorAsync: helper("7.27.0", "function _regeneratorAsync(n,e,r,t,o){var a=asyncGen(n,e,r,t,o);return a.next().then((function(n){return n.done?n.value:a.next()}))}", { globals: [], locals: { _regeneratorAsync: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_regeneratorAsync", dependencies: { regeneratorAsyncGen: ["body.0.body.body.0.declarations.0.init.callee"] }, internal: false }), regeneratorAsyncGen: helper("7.27.0", "function _regeneratorAsyncGen(r,e,t,o,n){return new regeneratorAsyncIterator(regenerator().w(r,e,t,o),n||Promise)}", { globals: ["Promise"], locals: { _regeneratorAsyncGen: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_regeneratorAsyncGen", dependencies: { regenerator: ["body.0.body.body.0.argument.arguments.0.callee.object.callee"], regeneratorAsyncIterator: ["body.0.body.body.0.argument.callee"] }, internal: false }), regeneratorAsyncIterator: helper("7.27.0", 'function AsyncIterator(t,e){function n(r,o,i,f){try{var c=t[r](o),u=c.value;return u instanceof OverloadYield?e.resolve(u.v).then((function(t){n("next",t,i,f)}),(function(t){n("throw",t,i,f)})):e.resolve(u).then((function(t){c.value=t,i(c)}),(function(t){return n("throw",t,i,f)}))}catch(t){f(t)}}var r;this.next||(define(AsyncIterator.prototype),define(AsyncIterator.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),define(this,"_invoke",(function(t,o,i){function f(){return new e((function(e,r){n(t,i,e,r)}))}return r=r?r.then(f,f):f()}),!0)}', { globals: ["Symbol"], locals: { AsyncIterator: ["body.0.id", "body.0.body.body.2.expression.expressions.0.right.expressions.0.arguments.0.object", "body.0.body.body.2.expression.expressions.0.right.expressions.1.arguments.0.object"] }, exportBindingAssignments: [], exportName: "AsyncIterator", dependencies: { OverloadYield: ["body.0.body.body.0.body.body.0.block.body.1.argument.test.right"], regeneratorDefine: ["body.0.body.body.2.expression.expressions.0.right.expressions.0.callee", "body.0.body.body.2.expression.expressions.0.right.expressions.1.callee", "body.0.body.body.2.expression.expressions.1.callee"] }, internal: true }), regeneratorDefine: helper("7.27.0", 'function regeneratorDefine(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}regeneratorDefine=function(e,r,n,t){function o(r,n){regeneratorDefine(e,r,(function(e){return this._invoke(r,n,e)}))}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},regeneratorDefine(e,r,n,t)}', { globals: ["Object"], locals: { regeneratorDefine: ["body.0.id", "body.0.body.body.2.expression.expressions.0.right.body.body.0.body.body.0.expression.callee", "body.0.body.body.2.expression.expressions.1.callee", "body.0.body.body.2.expression.expressions.0.left"] }, exportBindingAssignments: ["body.0.body.body.2.expression.expressions.0"], exportName: "regeneratorDefine", dependencies: {}, internal: true }), regeneratorKeys: helper("7.27.0", "function _regeneratorKeys(e){var n=Object(e),r=[];for(var t in n)r.unshift(t);return function e(){for(;r.length;)if((t=r.pop())in n)return e.value=t,e.done=!1,e;return e.done=!0,e}}", { globals: ["Object"], locals: { _regeneratorKeys: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_regeneratorKeys", dependencies: {}, internal: false }), regeneratorValues: helper("7.18.0", 'function _regeneratorValues(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}', { globals: ["Symbol", "isNaN", "TypeError"], locals: { _regeneratorValues: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_regeneratorValues", dependencies: {}, internal: false }), set: helper("7.0.0-beta.0", 'function set(e,r,t,o){return set="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(e,r,t,o){var f,i=superPropBase(e,r);if(i){if((f=Object.getOwnPropertyDescriptor(i,r)).set)return f.set.call(o,t),!0;if(!f.writable)return!1}if(f=Object.getOwnPropertyDescriptor(o,r)){if(!f.writable)return!1;f.value=t,Object.defineProperty(o,r,f)}else defineProperty(o,r,t);return!0},set(e,r,t,o)}function _set(e,r,t,o,f){if(!set(e,r,t,o||e)&&f)throw new TypeError("failed to set property");return t}', { globals: ["Reflect", "Object", "TypeError"], locals: { set: ["body.0.id", "body.0.body.body.0.argument.expressions.1.callee", "body.1.body.body.0.test.left.argument.callee", "body.0.body.body.0.argument.expressions.0.left"], _set: ["body.1.id"] }, exportBindingAssignments: [], exportName: "_set", dependencies: { superPropBase: ["body.0.body.body.0.argument.expressions.0.right.alternate.body.body.0.declarations.1.init.callee"], defineProperty: ["body.0.body.body.0.argument.expressions.0.right.alternate.body.body.2.alternate.expression.callee"] }, internal: false }), setFunctionName: helper("7.23.6", 'function setFunctionName(e,t,n){"symbol"==typeof t&&(t=(t=t.description)?"["+t+"]":"");try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+" "+t:t})}catch(e){}return e}', { globals: ["Object"], locals: { setFunctionName: ["body.0.id"] }, exportBindingAssignments: [], exportName: "setFunctionName", dependencies: {}, internal: false }), setPrototypeOf: helper("7.0.0-beta.0", "function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}", { globals: ["Object"], locals: { _setPrototypeOf: ["body.0.id", "body.0.body.body.0.argument.expressions.1.callee", "body.0.body.body.0.argument.expressions.0.left"] }, exportBindingAssignments: ["body.0.body.body.0.argument.expressions.0"], exportName: "_setPrototypeOf", dependencies: {}, internal: false }), skipFirstGeneratorNext: helper("7.0.0-beta.0", "function _skipFirstGeneratorNext(t){return function(){var r=t.apply(this,arguments);return r.next(),r}}", { globals: [], locals: { _skipFirstGeneratorNext: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_skipFirstGeneratorNext", dependencies: {}, internal: false }), slicedToArray: helper("7.0.0-beta.0", "function _slicedToArray(r,e){return arrayWithHoles(r)||iterableToArrayLimit(r,e)||unsupportedIterableToArray(r,e)||nonIterableRest()}", { globals: [], locals: { _slicedToArray: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_slicedToArray", dependencies: { arrayWithHoles: ["body.0.body.body.0.argument.left.left.left.callee"], iterableToArrayLimit: ["body.0.body.body.0.argument.left.left.right.callee"], unsupportedIterableToArray: ["body.0.body.body.0.argument.left.right.callee"], nonIterableRest: ["body.0.body.body.0.argument.right.callee"] }, internal: false }), superPropBase: helper("7.0.0-beta.0", "function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=getPrototypeOf(t)););return t}", { globals: [], locals: { _superPropBase: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_superPropBase", dependencies: { getPrototypeOf: ["body.0.body.body.0.test.right.right.right.callee"] }, internal: false }), superPropGet: helper("7.25.0", 'function _superPropGet(t,o,e,r){var p=get(getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}', { globals: [], locals: { _superPropGet: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_superPropGet", dependencies: { get: ["body.0.body.body.0.declarations.0.init.callee"], getPrototypeOf: ["body.0.body.body.0.declarations.0.init.arguments.0.callee"] }, internal: false }), superPropSet: helper("7.25.0", "function _superPropSet(t,e,o,r,p,f){return set(getPrototypeOf(f?t.prototype:t),e,o,r,p)}", { globals: [], locals: { _superPropSet: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_superPropSet", dependencies: { set: ["body.0.body.body.0.argument.callee"], getPrototypeOf: ["body.0.body.body.0.argument.arguments.0.callee"] }, internal: false }), taggedTemplateLiteral: helper("7.0.0-beta.0", "function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}", { globals: ["Object"], locals: { _taggedTemplateLiteral: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_taggedTemplateLiteral", dependencies: {}, internal: false }), taggedTemplateLiteralLoose: helper("7.0.0-beta.0", "function _taggedTemplateLiteralLoose(e,t){return t||(t=e.slice(0)),e.raw=t,e}", { globals: [], locals: { _taggedTemplateLiteralLoose: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_taggedTemplateLiteralLoose", dependencies: {}, internal: false }), tdz: helper("7.5.5", 'function _tdzError(e){throw new ReferenceError(e+" is not defined - temporal dead zone")}', { globals: ["ReferenceError"], locals: { _tdzError: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_tdzError", dependencies: {}, internal: false }), temporalRef: helper("7.0.0-beta.0", "function _temporalRef(r,e){return r===undef?err(e):r}", { globals: [], locals: { _temporalRef: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_temporalRef", dependencies: { temporalUndefined: ["body.0.body.body.0.argument.test.right"], tdz: ["body.0.body.body.0.argument.consequent.callee"] }, internal: false }), temporalUndefined: helper("7.0.0-beta.0", "function _temporalUndefined(){}", { globals: [], locals: { _temporalUndefined: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_temporalUndefined", dependencies: {}, internal: false }), toArray: helper("7.0.0-beta.0", "function _toArray(r){return arrayWithHoles(r)||iterableToArray(r)||unsupportedIterableToArray(r)||nonIterableRest()}", { globals: [], locals: { _toArray: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_toArray", dependencies: { arrayWithHoles: ["body.0.body.body.0.argument.left.left.left.callee"], iterableToArray: ["body.0.body.body.0.argument.left.left.right.callee"], unsupportedIterableToArray: ["body.0.body.body.0.argument.left.right.callee"], nonIterableRest: ["body.0.body.body.0.argument.right.callee"] }, internal: false }), toConsumableArray: helper("7.0.0-beta.0", "function _toConsumableArray(r){return arrayWithoutHoles(r)||iterableToArray(r)||unsupportedIterableToArray(r)||nonIterableSpread()}", { globals: [], locals: { _toConsumableArray: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_toConsumableArray", dependencies: { arrayWithoutHoles: ["body.0.body.body.0.argument.left.left.left.callee"], iterableToArray: ["body.0.body.body.0.argument.left.left.right.callee"], unsupportedIterableToArray: ["body.0.body.body.0.argument.left.right.callee"], nonIterableSpread: ["body.0.body.body.0.argument.right.callee"] }, internal: false }), toPrimitive: helper("7.1.5", 'function toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}', { globals: ["Symbol", "TypeError", "String", "Number"], locals: { toPrimitive: ["body.0.id"] }, exportBindingAssignments: [], exportName: "toPrimitive", dependencies: {}, internal: false }), toPropertyKey: helper("7.1.5", 'function toPropertyKey(t){var i=toPrimitive(t,"string");return"symbol"==typeof i?i:i+""}', { globals: [], locals: { toPropertyKey: ["body.0.id"] }, exportBindingAssignments: [], exportName: "toPropertyKey", dependencies: { toPrimitive: ["body.0.body.body.0.declarations.0.init.callee"] }, internal: false }), toSetter: helper("7.24.0", 'function _toSetter(t,e,n){e||(e=[]);var r=e.length++;return Object.defineProperty({},"_",{set:function(o){e[r]=o,t.apply(n,e)}})}', { globals: ["Object"], locals: { _toSetter: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_toSetter", dependencies: {}, internal: false }), tsRewriteRelativeImportExtensions: helper("7.27.0", 'function tsRewriteRelativeImportExtensions(t,e){return"string"==typeof t&&/^\\.\\.?\\//.test(t)?t.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+)?)\\.([cm]?)ts$/i,(function(t,s,r,n,o){return s?e?".jsx":".js":!r||n&&o?r+n+"."+o.toLowerCase()+"js":t})):t}', { globals: [], locals: { tsRewriteRelativeImportExtensions: ["body.0.id"] }, exportBindingAssignments: [], exportName: "tsRewriteRelativeImportExtensions", dependencies: {}, internal: false }), typeof: helper("7.0.0-beta.0", 'function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}', { globals: ["Symbol"], locals: { _typeof: ["body.0.id", "body.0.body.body.0.argument.expressions.1.callee", "body.0.body.body.0.argument.expressions.0.left"] }, exportBindingAssignments: ["body.0.body.body.0.argument.expressions.0"], exportName: "_typeof", dependencies: {}, internal: false }), unsupportedIterableToArray: helper("7.9.0", 'function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?arrayLikeToArray(r,a):void 0}}', { globals: ["Array"], locals: { _unsupportedIterableToArray: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_unsupportedIterableToArray", dependencies: { arrayLikeToArray: ["body.0.body.body.0.consequent.body.0.consequent.argument.callee", "body.0.body.body.0.consequent.body.2.argument.expressions.1.alternate.consequent.callee"] }, internal: false }), usingCtx: helper("7.23.9", 'function _usingCtx(){var r="function"==typeof SuppressedError?SuppressedError:function(r,e){var n=Error();return n.name="SuppressedError",n.error=r,n.suppressed=e,n},e={},n=[];function using(r,e){if(null!=e){if(Object(e)!==e)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(r)var o=e[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(void 0===o&&(o=e[Symbol.dispose||Symbol.for("Symbol.dispose")],r))var t=o;if("function"!=typeof o)throw new TypeError("Object is not disposable.");t&&(o=function(){try{t.call(e)}catch(r){return Promise.reject(r)}}),n.push({v:e,d:o,a:r})}else r&&n.push({d:e,a:r});return e}return{e:e,u:using.bind(null,!1),a:using.bind(null,!0),d:function(){var o,t=this.e,s=0;function next(){for(;o=n.pop();)try{if(!o.a&&1===s)return s=0,n.push(o),Promise.resolve().then(next);if(o.d){var r=o.d.call(o.v);if(o.a)return s|=2,Promise.resolve(r).then(next,err)}else s|=1}catch(r){return err(r)}if(1===s)return t!==e?Promise.reject(t):Promise.resolve();if(t!==e)throw t}function err(n){return t=t!==e?new r(n,t):n,next()}return next()}}}', { globals: ["SuppressedError", "Error", "Object", "TypeError", "Symbol", "Promise"], locals: { _usingCtx: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_usingCtx", dependencies: {}, internal: false }), wrapAsyncGenerator: helper("7.0.0-beta.0", 'function _wrapAsyncGenerator(e){return function(){return new AsyncGenerator(e.apply(this,arguments))}}function AsyncGenerator(e){var r,t;function resume(r,t){try{var n=e[r](t),o=n.value,u=o instanceof OverloadYield;Promise.resolve(u?o.v:o).then((function(t){if(u){var i="return"===r?"return":"next";if(!o.k||t.done)return resume(i,t);t=e[i](t).value}settle(n.done?"return":"normal",t)}),(function(e){resume("throw",e)}))}catch(e){settle("throw",e)}}function settle(e,n){switch(e){case"return":r.resolve({value:n,done:!0});break;case"throw":r.reject(n);break;default:r.resolve({value:n,done:!1})}(r=r.next)?resume(r.key,r.arg):t=null}this._invoke=function(e,n){return new Promise((function(o,u){var i={key:e,arg:n,resolve:o,reject:u,next:null};t?t=t.next=i:(r=t=i,resume(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}AsyncGenerator.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},AsyncGenerator.prototype.next=function(e){return this._invoke("next",e)},AsyncGenerator.prototype.throw=function(e){return this._invoke("throw",e)},AsyncGenerator.prototype.return=function(e){return this._invoke("return",e)};', { globals: ["Promise", "Symbol"], locals: { _wrapAsyncGenerator: ["body.0.id"], AsyncGenerator: ["body.1.id", "body.0.body.body.0.argument.body.body.0.argument.callee", "body.2.expression.expressions.0.left.object.object", "body.2.expression.expressions.1.left.object.object", "body.2.expression.expressions.2.left.object.object", "body.2.expression.expressions.3.left.object.object"] }, exportBindingAssignments: [], exportName: "_wrapAsyncGenerator", dependencies: { OverloadYield: ["body.1.body.body.1.body.body.0.block.body.0.declarations.2.init.right"] }, internal: false }), wrapNativeSuper: helper("7.0.0-beta.0", 'function _wrapNativeSuper(t){var r="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(t){if(null===t||!isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper)}function Wrapper(){return construct(t,arguments,getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),setPrototypeOf(Wrapper,t)},_wrapNativeSuper(t)}', { globals: ["Map", "TypeError", "Object"], locals: { _wrapNativeSuper: ["body.0.id", "body.0.body.body.1.argument.expressions.1.callee", "body.0.body.body.1.argument.expressions.0.left"] }, exportBindingAssignments: ["body.0.body.body.1.argument.expressions.0"], exportName: "_wrapNativeSuper", dependencies: { getPrototypeOf: ["body.0.body.body.1.argument.expressions.0.right.body.body.3.body.body.0.argument.arguments.2.object.callee"], setPrototypeOf: ["body.0.body.body.1.argument.expressions.0.right.body.body.4.argument.expressions.1.callee"], isNativeFunction: ["body.0.body.body.1.argument.expressions.0.right.body.body.0.test.right.argument.callee"], construct: ["body.0.body.body.1.argument.expressions.0.right.body.body.3.body.body.0.argument.callee"] }, internal: false }), wrapRegExp: helper("7.19.0", 'function _wrapRegExp(){_wrapRegExp=function(e,r){return new BabelRegExp(e,void 0,r)};var e=RegExp.prototype,r=new WeakMap;function BabelRegExp(e,t,p){var o=RegExp(e,t);return r.set(o,p||r.get(e)),setPrototypeOf(o,BabelRegExp.prototype)}function buildGroups(e,t){var p=r.get(t);return Object.keys(p).reduce((function(r,t){var o=p[t];if("number"==typeof o)r[t]=e[o];else{for(var i=0;void 0===e[o[i]]&&i+1]+)(>|$)/g,(function(e,r,t){if(""===t)return e;var p=o[r];return Array.isArray(p)?"$"+p.join("$"):"number"==typeof p?"$"+p:""})))}if("function"==typeof p){var i=this;return e[Symbol.replace].call(this,t,(function(){var e=arguments;return"object"!=typeof e[e.length-1]&&(e=[].slice.call(e)).push(buildGroups(e,i)),p.apply(this,e)}))}return e[Symbol.replace].call(this,t,p)},_wrapRegExp.apply(this,arguments)}', { globals: ["RegExp", "WeakMap", "Object", "Symbol", "Array"], locals: { _wrapRegExp: ["body.0.id", "body.0.body.body.4.argument.expressions.3.callee.object", "body.0.body.body.0.expression.left"] }, exportBindingAssignments: ["body.0.body.body.0.expression"], exportName: "_wrapRegExp", dependencies: { setPrototypeOf: ["body.0.body.body.2.body.body.1.argument.expressions.1.callee"], inherits: ["body.0.body.body.4.argument.expressions.0.callee"] }, internal: false }), writeOnlyError: helper("7.12.13", "function _writeOnlyError(r){throw new TypeError('\"'+r+'\" is write-only')}", { globals: ["TypeError"], locals: { _writeOnlyError: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_writeOnlyError", dependencies: {}, internal: false }) }; { Object.assign(helpers, { AwaitValue: helper("7.0.0-beta.0", "function _AwaitValue(t){this.wrapped=t}", { globals: [], locals: { _AwaitValue: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_AwaitValue", dependencies: {}, internal: false }), applyDecs: helper("7.17.8", 'function old_createMetadataMethodsForProperty(e,t,a,r){return{getMetadata:function(o){old_assertNotFinished(r,"getMetadata"),old_assertMetadataKey(o);var i=e[o];if(void 0!==i)if(1===t){var n=i.public;if(void 0!==n)return n[a]}else if(2===t){var l=i.private;if(void 0!==l)return l.get(a)}else if(Object.hasOwnProperty.call(i,"constructor"))return i.constructor},setMetadata:function(o,i){old_assertNotFinished(r,"setMetadata"),old_assertMetadataKey(o);var n=e[o];if(void 0===n&&(n=e[o]={}),1===t){var l=n.public;void 0===l&&(l=n.public={}),l[a]=i}else if(2===t){var s=n.priv;void 0===s&&(s=n.private=new Map),s.set(a,i)}else n.constructor=i}}}function old_convertMetadataMapToFinal(e,t){var a=e[Symbol.metadata||Symbol.for("Symbol.metadata")],r=Object.getOwnPropertySymbols(t);if(0!==r.length){for(var o=0;o=0;m--){var b;void 0!==(p=old_memberDec(h[m],r,c,l,s,o,i,n,f))&&(old_assertValidReturnValue(o,p),0===o?b=p:1===o?(b=old_getInit(p),v=p.get||f.get,y=p.set||f.set,f={get:v,set:y}):f=p,void 0!==b&&(void 0===d?d=b:"function"==typeof d?d=[d,b]:d.push(b)))}if(0===o||1===o){if(void 0===d)d=function(e,t){return t};else if("function"!=typeof d){var g=d;d=function(e,t){for(var a=t,r=0;r3,m=v>=5;if(m?(u=t,f=r,0!=(v-=5)&&(p=n=n||[])):(u=t.prototype,f=a,0!==v&&(p=i=i||[])),0!==v&&!h){var b=m?s:l,g=b.get(y)||0;if(!0===g||3===g&&4!==v||4===g&&3!==v)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+y);!g&&v>2?b.set(y,v):b.set(y,!0)}old_applyMemberDec(e,u,d,y,v,m,h,f,p)}}old_pushInitializers(e,i),old_pushInitializers(e,n)}function old_pushInitializers(e,t){t&&e.push((function(e){for(var a=0;a0){for(var o=[],i=t,n=t.name,l=r.length-1;l>=0;l--){var s={v:!1};try{var c=Object.assign({kind:"class",name:n,addInitializer:old_createAddInitializerMethod(o,s)},old_createMetadataMethodsForProperty(a,0,n,s)),d=r[l](i,c)}finally{s.v=!0}void 0!==d&&(old_assertValidReturnValue(10,d),i=d)}e.push(i,(function(){for(var e=0;e=0;v--){var g;void 0!==(f=memberDec(h[v],a,c,o,n,i,s,u))&&(assertValidReturnValue(n,f),0===n?g=f:1===n?(g=f.init,p=f.get||u.get,d=f.set||u.set,u={get:p,set:d}):u=f,void 0!==g&&(void 0===l?l=g:"function"==typeof l?l=[l,g]:l.push(g)))}if(0===n||1===n){if(void 0===l)l=function(e,t){return t};else if("function"!=typeof l){var y=l;l=function(e,t){for(var r=t,a=0;a3,h=f>=5;if(h?(l=t,0!=(f-=5)&&(u=n=n||[])):(l=t.prototype,0!==f&&(u=a=a||[])),0!==f&&!d){var v=h?s:i,g=v.get(p)||0;if(!0===g||3===g&&4!==f||4===g&&3!==f)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);!g&&f>2?v.set(p,f):v.set(p,!0)}applyMemberDec(e,l,c,p,f,h,d,u)}}pushInitializers(e,a),pushInitializers(e,n)}(a,e,t),function(e,t,r){if(r.length>0){for(var a=[],n=t,i=t.name,s=r.length-1;s>=0;s--){var o={v:!1};try{var c=r[s](n,{kind:"class",name:i,addInitializer:createAddInitializerMethod(a,o)})}finally{o.v=!0}void 0!==c&&(assertValidReturnValue(10,c),n=c)}e.push(n,(function(){for(var e=0;e=0;g--){var y;void 0!==(p=memberDec(v[g],n,c,s,a,i,o,f))&&(assertValidReturnValue(a,p),0===a?y=p:1===a?(y=p.init,d=p.get||f.get,h=p.set||f.set,f={get:d,set:h}):f=p,void 0!==y&&(void 0===l?l=y:"function"==typeof l?l=[l,y]:l.push(y)))}if(0===a||1===a){if(void 0===l)l=function(e,t){return t};else if("function"!=typeof l){var m=l;l=function(e,t){for(var r=t,n=0;n3,h=f>=5;if(h?(l=e,0!=(f-=5)&&(u=n=n||[])):(l=e.prototype,0!==f&&(u=r=r||[])),0!==f&&!d){var v=h?o:i,g=v.get(p)||0;if(!0===g||3===g&&4!==f||4===g&&3!==f)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+p);!g&&f>2?v.set(p,f):v.set(p,!0)}applyMemberDec(a,l,c,p,f,h,d,u)}}return pushInitializers(a,r),pushInitializers(a,n),a}function pushInitializers(e,t){t&&e.push((function(e){for(var r=0;r0){for(var r=[],n=e,a=e.name,i=t.length-1;i>=0;i--){var o={v:!1};try{var s=t[i](n,{kind:"class",name:a,addInitializer:createAddInitializerMethod(r,o)})}finally{o.v=!0}void 0!==s&&(assertValidReturnValue(10,s),n=s)}return[n,function(){for(var e=0;e=0;m--){var b;void 0!==(h=memberDec(g[m],n,u,o,a,i,s,p,c))&&(assertValidReturnValue(a,h),0===a?b=h:1===a?(b=h.init,v=h.get||p.get,y=h.set||p.set,p={get:v,set:y}):p=h,void 0!==b&&(void 0===l?l=b:"function"==typeof l?l=[l,b]:l.push(b)))}if(0===a||1===a){if(void 0===l)l=function(e,t){return t};else if("function"!=typeof l){var I=l;l=function(e,t){for(var r=t,n=0;n3,y=d>=5,g=r;if(y?(f=e,0!=(d-=5)&&(p=a=a||[]),v&&!i&&(i=function(t){return checkInRHS(t)===e}),g=i):(f=e.prototype,0!==d&&(p=n=n||[])),0!==d&&!v){var m=y?c:o,b=m.get(h)||0;if(!0===b||3===b&&4!==d||4===b&&3!==d)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+h);!b&&d>2?m.set(h,d):m.set(h,!0)}applyMemberDec(s,f,l,h,d,y,v,p,g)}}return pushInitializers(s,n),pushInitializers(s,a),s}function pushInitializers(e,t){t&&e.push((function(e){for(var r=0;r0){for(var r=[],n=e,a=e.name,i=t.length-1;i>=0;i--){var s={v:!1};try{var o=t[i](n,{kind:"class",name:a,addInitializer:createAddInitializerMethod(r,s)})}finally{s.v=!0}void 0!==o&&(assertValidReturnValue(10,o),n=o)}return[n,function(){for(var e=0;e=0;j-=r?2:1){var D=v[j],E=r?v[j-1]:void 0,I={},O={kind:["field","accessor","method","getter","setter","class"][o],name:n,metadata:a,addInitializer:function(e,t){if(e.v)throw Error("attempted to call addInitializer after decoration was finished");s(t,"An initializer","be",!0),c.push(t)}.bind(null,I)};try{if(b)(y=s(D.call(E,P,O),"class decorators","return"))&&(P=y);else{var k,F;O.static=l,O.private=f,f?2===o?k=function(e){return m(e),w.value}:(o<4&&(k=i(w,"get",m)),3!==o&&(F=i(w,"set",m))):(k=function(e){return e[n]},(o<2||4===o)&&(F=function(e,t){e[n]=t}));var N=O.access={has:f?h.bind():function(e){return n in e}};if(k&&(N.get=k),F&&(N.set=F),P=D.call(E,d?{get:w.get,set:w.set}:w[A],O),d){if("object"==typeof P&&P)(y=s(P.get,"accessor.get"))&&(w.get=y),(y=s(P.set,"accessor.set"))&&(w.set=y),(y=s(P.init,"accessor.init"))&&S.push(y);else if(void 0!==P)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else s(P,(p?"field":"method")+" decorators","return")&&(p?S.push(P):w[A]=P)}}finally{I.v=!0}}return(p||d)&&u.push((function(e,t){for(var r=S.length-1;r>=0;r--)t=S[r].call(e,t);return t})),p||b||(f?d?u.push(i(w,"get"),i(w,"set")):u.push(2===o?w[A]:i.call.bind(w[A])):Object.defineProperty(e,n,w)),P}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var l=a[Symbol.metadata||Symbol.for("Symbol.metadata")];var f=Object.create(null==l?null:l),p=function(e,t,r,n){var o,a,i=[],s=function(t){return checkInRHS(t)===e},u=new Map;function l(e){e&&i.push(c.bind(null,e))}for(var f=0;f3,y=16&d,v=!!(8&d),g=0==(d&=7),b=h+"/"+v;if(!g&&!m){var w=u.get(b);if(!0===w||3===w&&4!==d||4===w&&3!==d)throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+h);u.set(b,!(d>2)||d)}applyDec(v?e:e.prototype,p,y,m?"#"+h:toPropertyKey(h),d,n,v?a=a||[]:o=o||[],i,v,m,g,1===d,v&&m?s:r)}}return l(o),l(a),i}(e,t,o,f);return r.length||u(e,f),{e:p,get c(){var t=[];return r.length&&[u(applyDec(e,[r],n,e.name,5,f,t),f),c.bind(null,t,e)]}}}', { globals: ["TypeError", "Array", "Object", "Error", "Symbol", "Map"], locals: { applyDecs2305: ["body.0.id"] }, exportBindingAssignments: [], exportName: "applyDecs2305", dependencies: { checkInRHS: ["body.0.body.body.6.declarations.1.init.callee.body.body.0.declarations.3.init.body.body.0.argument.left.callee"], setFunctionName: ["body.0.body.body.3.body.body.2.consequent.body.2.expression.consequent.expressions.0.consequent.right.properties.0.value.callee", "body.0.body.body.3.body.body.2.consequent.body.2.expression.consequent.expressions.1.right.callee"], toPropertyKey: ["body.0.body.body.6.declarations.1.init.callee.body.body.2.body.body.1.consequent.body.2.expression.arguments.3.alternate.callee"] }, internal: false }), classApplyDescriptorDestructureSet: helper("7.13.10", 'function _classApplyDescriptorDestructureSet(e,t){if(t.set)return"__destrObj"in t||(t.__destrObj={set value(r){t.set.call(e,r)}}),t.__destrObj;if(!t.writable)throw new TypeError("attempted to set read only private field");return t}', { globals: ["TypeError"], locals: { _classApplyDescriptorDestructureSet: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classApplyDescriptorDestructureSet", dependencies: {}, internal: false }), classApplyDescriptorGet: helper("7.13.10", "function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}", { globals: [], locals: { _classApplyDescriptorGet: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classApplyDescriptorGet", dependencies: {}, internal: false }), classApplyDescriptorSet: helper("7.13.10", 'function _classApplyDescriptorSet(e,t,l){if(t.set)t.set.call(e,l);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=l}}', { globals: ["TypeError"], locals: { _classApplyDescriptorSet: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classApplyDescriptorSet", dependencies: {}, internal: false }), classCheckPrivateStaticAccess: helper("7.13.10", "function _classCheckPrivateStaticAccess(s,a,r){return assertClassBrand(a,s,r)}", { globals: [], locals: { _classCheckPrivateStaticAccess: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classCheckPrivateStaticAccess", dependencies: { assertClassBrand: ["body.0.body.body.0.argument.callee"] }, internal: false }), classCheckPrivateStaticFieldDescriptor: helper("7.13.10", 'function _classCheckPrivateStaticFieldDescriptor(t,e){if(void 0===t)throw new TypeError("attempted to "+e+" private static field before its declaration")}', { globals: ["TypeError"], locals: { _classCheckPrivateStaticFieldDescriptor: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classCheckPrivateStaticFieldDescriptor", dependencies: {}, internal: false }), classExtractFieldDescriptor: helper("7.13.10", "function _classExtractFieldDescriptor(e,t){return classPrivateFieldGet2(t,e)}", { globals: [], locals: { _classExtractFieldDescriptor: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classExtractFieldDescriptor", dependencies: { classPrivateFieldGet2: ["body.0.body.body.0.argument.callee"] }, internal: false }), classPrivateFieldDestructureSet: helper("7.4.4", "function _classPrivateFieldDestructureSet(e,t){var r=classPrivateFieldGet2(t,e);return classApplyDescriptorDestructureSet(e,r)}", { globals: [], locals: { _classPrivateFieldDestructureSet: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classPrivateFieldDestructureSet", dependencies: { classApplyDescriptorDestructureSet: ["body.0.body.body.1.argument.callee"], classPrivateFieldGet2: ["body.0.body.body.0.declarations.0.init.callee"] }, internal: false }), classPrivateFieldGet: helper("7.0.0-beta.0", "function _classPrivateFieldGet(e,t){var r=classPrivateFieldGet2(t,e);return classApplyDescriptorGet(e,r)}", { globals: [], locals: { _classPrivateFieldGet: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classPrivateFieldGet", dependencies: { classApplyDescriptorGet: ["body.0.body.body.1.argument.callee"], classPrivateFieldGet2: ["body.0.body.body.0.declarations.0.init.callee"] }, internal: false }), classPrivateFieldSet: helper("7.0.0-beta.0", "function _classPrivateFieldSet(e,t,r){var s=classPrivateFieldGet2(t,e);return classApplyDescriptorSet(e,s,r),r}", { globals: [], locals: { _classPrivateFieldSet: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classPrivateFieldSet", dependencies: { classApplyDescriptorSet: ["body.0.body.body.1.argument.expressions.0.callee"], classPrivateFieldGet2: ["body.0.body.body.0.declarations.0.init.callee"] }, internal: false }), classPrivateMethodGet: helper("7.1.6", "function _classPrivateMethodGet(s,a,r){return assertClassBrand(a,s),r}", { globals: [], locals: { _classPrivateMethodGet: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classPrivateMethodGet", dependencies: { assertClassBrand: ["body.0.body.body.0.argument.expressions.0.callee"] }, internal: false }), classPrivateMethodSet: helper("7.1.6", 'function _classPrivateMethodSet(){throw new TypeError("attempted to reassign private method")}', { globals: ["TypeError"], locals: { _classPrivateMethodSet: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classPrivateMethodSet", dependencies: {}, internal: false }), classStaticPrivateFieldDestructureSet: helper("7.13.10", 'function _classStaticPrivateFieldDestructureSet(t,r,s){return assertClassBrand(r,t),classCheckPrivateStaticFieldDescriptor(s,"set"),classApplyDescriptorDestructureSet(t,s)}', { globals: [], locals: { _classStaticPrivateFieldDestructureSet: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classStaticPrivateFieldDestructureSet", dependencies: { classApplyDescriptorDestructureSet: ["body.0.body.body.0.argument.expressions.2.callee"], assertClassBrand: ["body.0.body.body.0.argument.expressions.0.callee"], classCheckPrivateStaticFieldDescriptor: ["body.0.body.body.0.argument.expressions.1.callee"] }, internal: false }), classStaticPrivateFieldSpecGet: helper("7.0.2", 'function _classStaticPrivateFieldSpecGet(t,s,r){return assertClassBrand(s,t),classCheckPrivateStaticFieldDescriptor(r,"get"),classApplyDescriptorGet(t,r)}', { globals: [], locals: { _classStaticPrivateFieldSpecGet: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classStaticPrivateFieldSpecGet", dependencies: { classApplyDescriptorGet: ["body.0.body.body.0.argument.expressions.2.callee"], assertClassBrand: ["body.0.body.body.0.argument.expressions.0.callee"], classCheckPrivateStaticFieldDescriptor: ["body.0.body.body.0.argument.expressions.1.callee"] }, internal: false }), classStaticPrivateFieldSpecSet: helper("7.0.2", 'function _classStaticPrivateFieldSpecSet(s,t,r,e){return assertClassBrand(t,s),classCheckPrivateStaticFieldDescriptor(r,"set"),classApplyDescriptorSet(s,r,e),e}', { globals: [], locals: { _classStaticPrivateFieldSpecSet: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classStaticPrivateFieldSpecSet", dependencies: { classApplyDescriptorSet: ["body.0.body.body.0.argument.expressions.2.callee"], assertClassBrand: ["body.0.body.body.0.argument.expressions.0.callee"], classCheckPrivateStaticFieldDescriptor: ["body.0.body.body.0.argument.expressions.1.callee"] }, internal: false }), classStaticPrivateMethodSet: helper("7.3.2", 'function _classStaticPrivateMethodSet(){throw new TypeError("attempted to set read only static private field")}', { globals: ["TypeError"], locals: { _classStaticPrivateMethodSet: ["body.0.id"] }, exportBindingAssignments: [], exportName: "_classStaticPrivateMethodSet", dependencies: {}, internal: false }), defineEnumerableProperties: helper("7.0.0-beta.0", 'function _defineEnumerableProperties(e,r){for(var t in r){var n=r[t];n.configurable=n.enumerable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t,n)}if(Object.getOwnPropertySymbols)for(var a=Object.getOwnPropertySymbols(r),b=0;b0;)try{var o=r.pop(),p=o.d.call(o.v);if(o.a)return Promise.resolve(p).then(next,err)}catch(r){return err(r)}if(s)throw e}function err(r){return e=s?new dispose_SuppressedError(e,r):r,s=!0,next()}return next()}', { globals: ["SuppressedError", "Error", "Object", "Promise"], locals: { dispose_SuppressedError: ["body.0.id", "body.0.body.body.0.argument.expressions.0.alternate.expressions.1.left.object", "body.0.body.body.0.argument.expressions.0.alternate.expressions.1.right.arguments.1.properties.0.value.properties.0.value", "body.0.body.body.0.argument.expressions.1.callee", "body.1.body.body.1.body.body.0.argument.expressions.0.right.consequent.callee", "body.0.body.body.0.argument.expressions.0.consequent.left", "body.0.body.body.0.argument.expressions.0.alternate.expressions.0.left"], _dispose: ["body.1.id"] }, exportBindingAssignments: [], exportName: "_dispose", dependencies: {}, internal: false }), objectSpread: helper("7.0.0-beta.0", 'function _objectSpread(e){for(var r=1;r { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; exports.get = get; exports.getDependencies = getDependencies; exports.isInternal = isInternal; exports.list = void 0; exports.minVersion = minVersion; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _helpersGenerated = __webpack_require__(/*! ./helpers-generated.js */ "./node_modules/@babel/helpers/lib/helpers-generated.js"); const { cloneNode, identifier } = _t; function deep(obj, path, value) { try { const parts = path.split("."); let last = parts.shift(); while (parts.length > 0) { obj = obj[last]; last = parts.shift(); } if (arguments.length > 2) { obj[last] = value; } else { return obj[last]; } } catch (e) { e.message += ` (when accessing ${path})`; throw e; } } function permuteHelperAST(ast, metadata, bindingName, localBindings, getDependency, adjustAst) { const { locals, dependencies, exportBindingAssignments, exportName } = metadata; const bindings = new Set(localBindings || []); if (bindingName) bindings.add(bindingName); for (const [name, paths] of (Object.entries || (o => Object.keys(o).map(k => [k, o[k]])))(locals)) { let newName = name; if (bindingName && name === exportName) { newName = bindingName; } else { while (bindings.has(newName)) newName = "_" + newName; } if (newName !== name) { for (const path of paths) { deep(ast, path, identifier(newName)); } } } for (const [name, paths] of (Object.entries || (o => Object.keys(o).map(k => [k, o[k]])))(dependencies)) { const ref = typeof getDependency === "function" && getDependency(name) || identifier(name); for (const path of paths) { deep(ast, path, cloneNode(ref)); } } adjustAst == null || adjustAst(ast, exportName, map => { exportBindingAssignments.forEach(p => deep(ast, p, map(deep(ast, p)))); }); } const helperData = Object.create(null); function loadHelper(name) { if (!helperData[name]) { const helper = _helpersGenerated.default[name]; if (!helper) { throw Object.assign(new ReferenceError(`Unknown helper ${name}`), { code: "BABEL_HELPER_UNKNOWN", helper: name }); } helperData[name] = { minVersion: helper.minVersion, build(getDependency, bindingName, localBindings, adjustAst) { const ast = helper.ast(); permuteHelperAST(ast, helper.metadata, bindingName, localBindings, getDependency, adjustAst); return { nodes: ast.body, globals: helper.metadata.globals }; }, getDependencies() { return Object.keys(helper.metadata.dependencies); } }; } return helperData[name]; } function get(name, getDependency, bindingName, localBindings, adjustAst) { { if (typeof bindingName === "object") { const id = bindingName; if ((id == null ? void 0 : id.type) === "Identifier") { bindingName = id.name; } else { bindingName = undefined; } } } return loadHelper(name).build(getDependency, bindingName, localBindings, adjustAst); } function minVersion(name) { return loadHelper(name).minVersion; } function getDependencies(name) { return loadHelper(name).getDependencies(); } function isInternal(name) { var _helpers$name; return (_helpers$name = _helpersGenerated.default[name]) == null ? void 0 : _helpers$name.metadata.internal; } { exports.ensure = name => { loadHelper(name); }; } const list = exports.list = Object.keys(_helpersGenerated.default).map(name => name.replace(/^_/, "")); var _default = exports["default"] = get; //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/parser/lib/index.js": /*!*************************************************!*\ !*** ./node_modules/@babel/parser/lib/index.js ***! \*************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } class Position { constructor(line, col, index) { this.line = void 0; this.column = void 0; this.index = void 0; this.line = line; this.column = col; this.index = index; } } class SourceLocation { constructor(start, end) { this.start = void 0; this.end = void 0; this.filename = void 0; this.identifierName = void 0; this.start = start; this.end = end; } } function createPositionWithColumnOffset(position, columnOffset) { const { line, column, index } = position; return new Position(line, column + columnOffset, index + columnOffset); } const code = "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"; var ModuleErrors = { ImportMetaOutsideModule: { message: `import.meta may appear only with 'sourceType: "module"'`, code }, ImportOutsideModule: { message: `'import' and 'export' may appear only with 'sourceType: "module"'`, code } }; const NodeDescriptions = { ArrayPattern: "array destructuring pattern", AssignmentExpression: "assignment expression", AssignmentPattern: "assignment expression", ArrowFunctionExpression: "arrow function expression", ConditionalExpression: "conditional expression", CatchClause: "catch clause", ForOfStatement: "for-of statement", ForInStatement: "for-in statement", ForStatement: "for-loop", FormalParameters: "function parameter list", Identifier: "identifier", ImportSpecifier: "import specifier", ImportDefaultSpecifier: "import default specifier", ImportNamespaceSpecifier: "import namespace specifier", ObjectPattern: "object destructuring pattern", ParenthesizedExpression: "parenthesized expression", RestElement: "rest element", UpdateExpression: { true: "prefix operation", false: "postfix operation" }, VariableDeclarator: "variable declaration", YieldExpression: "yield expression" }; const toNodeDescription = node => node.type === "UpdateExpression" ? NodeDescriptions.UpdateExpression[`${node.prefix}`] : NodeDescriptions[node.type]; var StandardErrors = { AccessorIsGenerator: ({ kind }) => `A ${kind}ter cannot be a generator.`, ArgumentsInClass: "'arguments' is only allowed in functions and class methods.", AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block.", AwaitBindingIdentifier: "Can not use 'await' as identifier inside an async function.", AwaitBindingIdentifierInStaticBlock: "Can not use 'await' as identifier inside a static block.", AwaitExpressionFormalParameter: "'await' is not allowed in async function parameters.", AwaitUsingNotInAsyncContext: "'await using' is only allowed within async functions and at the top levels of modules.", AwaitNotInAsyncContext: "'await' is only allowed within async functions and at the top levels of modules.", BadGetterArity: "A 'get' accessor must not have any formal parameters.", BadSetterArity: "A 'set' accessor must have exactly one formal parameter.", BadSetterRestParameter: "A 'set' accessor function argument must not be a rest parameter.", ConstructorClassField: "Classes may not have a field named 'constructor'.", ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'.", ConstructorIsAccessor: "Class constructor may not be an accessor.", ConstructorIsAsync: "Constructor can't be an async function.", ConstructorIsGenerator: "Constructor can't be a generator.", DeclarationMissingInitializer: ({ kind }) => `Missing initializer in ${kind} declaration.`, DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.", DecoratorBeforeExport: "Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.", DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.", DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", DecoratorExportClass: "Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.", DecoratorSemicolon: "Decorators must not be followed by a semicolon.", DecoratorStaticBlock: "Decorators can't be used with a static block.", DeferImportRequiresNamespace: 'Only `import defer * as x from "./module"` is valid.', DeletePrivateField: "Deleting a private field is not allowed.", DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", DuplicateConstructor: "Duplicate constructor in the same class.", DuplicateDefaultExport: "Only one default export allowed per module.", DuplicateExport: ({ exportName }) => `\`${exportName}\` has already been exported. Exported identifiers must be unique.`, DuplicateProto: "Redefinition of __proto__ property.", DuplicateRegExpFlags: "Duplicate regular expression flag.", ElementAfterRest: "Rest element must be last element.", EscapedCharNotAnIdentifier: "Invalid Unicode escape.", ExportBindingIsString: ({ localName, exportName }) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`, ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.", ForInOfLoopInitializer: ({ type }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`, ForInUsing: "For-in loop may not start with 'using' declaration.", ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.", ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.", GeneratorInSingleStatementContext: "Generators can only be declared at the top level or inside a block.", IllegalBreakContinue: ({ type }) => `Unsyntactic ${type === "BreakStatement" ? "break" : "continue"}.`, IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.", IllegalReturn: "'return' outside of function.", ImportAttributesUseAssert: "The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.", ImportBindingIsString: ({ importName }) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`, ImportCallArity: `\`import()\` requires exactly one or two arguments.`, ImportCallNotNewExpression: "Cannot use new with import(...).", ImportCallSpreadArgument: "`...` is not allowed in `import()`.", ImportJSONBindingNotDefault: "A JSON module can only be imported with `default`.", ImportReflectionHasAssertion: "`import module x` cannot have assertions.", ImportReflectionNotBinding: 'Only `import module x from "./module"` is valid.', IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.", InvalidBigIntLiteral: "Invalid BigIntLiteral.", InvalidCodePoint: "Code point out of bounds.", InvalidCoverDiscardElement: "'void' must be followed by an expression when not used in a binding position.", InvalidCoverInitializedName: "Invalid shorthand property initializer.", InvalidDecimal: "Invalid decimal.", InvalidDigit: ({ radix }) => `Expected number in radix ${radix}.`, InvalidEscapeSequence: "Bad character escape sequence.", InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.", InvalidEscapedReservedWord: ({ reservedWord }) => `Escape sequence in keyword ${reservedWord}.`, InvalidIdentifier: ({ identifierName }) => `Invalid identifier ${identifierName}.`, InvalidLhs: ({ ancestor }) => `Invalid left-hand side in ${toNodeDescription(ancestor)}.`, InvalidLhsBinding: ({ ancestor }) => `Binding invalid left-hand side in ${toNodeDescription(ancestor)}.`, InvalidLhsOptionalChaining: ({ ancestor }) => `Invalid optional chaining in the left-hand side of ${toNodeDescription(ancestor)}.`, InvalidNumber: "Invalid number.", InvalidOrMissingExponent: "Floating-point numbers require a valid exponent after the 'e'.", InvalidOrUnexpectedToken: ({ unexpected }) => `Unexpected character '${unexpected}'.`, InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.", InvalidPrivateFieldResolution: ({ identifierName }) => `Private name #${identifierName} is not defined.`, InvalidPropertyBindingPattern: "Binding member expression.", InvalidRecordProperty: "Only properties and spread elements are allowed in record definitions.", InvalidRestAssignmentPattern: "Invalid rest operator's argument.", LabelRedeclaration: ({ labelName }) => `Label '${labelName}' is already declared.`, LetInLexicalBinding: "'let' is disallowed as a lexically bound name.", LineTerminatorBeforeArrow: "No line break is allowed before '=>'.", MalformedRegExpFlags: "Invalid regular expression flag.", MissingClassName: "A class name is required.", MissingEqInAssignment: "Only '=' operator can be used for specifying default value.", MissingSemicolon: "Missing semicolon.", MissingPlugin: ({ missingPlugin }) => `This experimental syntax requires enabling the parser plugin: ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, MissingOneOfPlugins: ({ missingPlugin }) => `This experimental syntax requires enabling one of the following parser plugin(s): ${missingPlugin.map(name => JSON.stringify(name)).join(", ")}.`, MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.", MixingCoalesceWithLogical: "Nullish coalescing operator(??) requires parens when mixing with logical operators.", ModuleAttributeDifferentFromType: "The only accepted module attribute is `type`.", ModuleAttributeInvalidValue: "Only string literals are allowed as module attribute values.", ModuleAttributesWithDuplicateKeys: ({ key }) => `Duplicate key "${key}" is not allowed in module attributes.`, ModuleExportNameHasLoneSurrogate: ({ surrogateCharCode }) => `An export name cannot include a lone surrogate, found '\\u${surrogateCharCode.toString(16)}'.`, ModuleExportUndefined: ({ localName }) => `Export '${localName}' is not defined.`, MultipleDefaultsInSwitch: "Multiple default clauses.", NewlineAfterThrow: "Illegal newline after throw.", NoCatchOrFinally: "Missing catch or finally clause.", NumberIdentifier: "Identifier directly after number.", NumericSeparatorInEscapeSequence: "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.", ObsoleteAwaitStar: "'await*' has been removed from the async functions proposal. Use Promise.all() instead.", OptionalChainingNoNew: "Constructors in/after an Optional Chain are not allowed.", OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain.", OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.", ParamDupe: "Argument name clash.", PatternHasAccessor: "Object pattern can't contain getter or setter.", PatternHasMethod: "Object pattern can't contain methods.", PrivateInExpectedIn: ({ identifierName }) => `Private names are only allowed in property accesses (\`obj.#${identifierName}\`) or in \`in\` expressions (\`#${identifierName} in obj\`).`, PrivateNameRedeclaration: ({ identifierName }) => `Duplicate private name #${identifierName}.`, RecordExpressionBarIncorrectEndSyntaxType: "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", RecordExpressionBarIncorrectStartSyntaxType: "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", RecordExpressionHashIncorrectStartSyntaxType: "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", RecordNoProto: "'__proto__' is not allowed in Record expressions.", RestTrailingComma: "Unexpected trailing comma after rest element.", SloppyFunction: "In non-strict mode code, functions can only be declared at top level or inside a block.", SloppyFunctionAnnexB: "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.", SourcePhaseImportRequiresDefault: 'Only `import source x from "./module"` is valid.', StaticPrototype: "Classes may not have static property named prototype.", SuperNotAllowed: "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?", SuperPrivateField: "Private fields can't be accessed on super.", TrailingDecorator: "Decorators must be attached to a class element.", TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", TupleExpressionBarIncorrectStartSyntaxType: "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", TupleExpressionHashIncorrectStartSyntaxType: "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.", UnexpectedAwaitAfterPipelineBody: 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.', UnexpectedDigitAfterHash: "Unexpected digit after hash token.", UnexpectedImportExport: "'import' and 'export' may only appear at the top level.", UnexpectedKeyword: ({ keyword }) => `Unexpected keyword '${keyword}'.`, UnexpectedLeadingDecorator: "Leading decorators must be attached to a class declaration.", UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.", UnexpectedNewTarget: "`new.target` can only be used in functions or class properties.", UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.", UnexpectedPrivateField: "Unexpected private name.", UnexpectedReservedWord: ({ reservedWord }) => `Unexpected reserved word '${reservedWord}'.`, UnexpectedSuper: "'super' is only allowed in object methods and classes.", UnexpectedToken: ({ expected, unexpected }) => `Unexpected token${unexpected ? ` '${unexpected}'.` : ""}${expected ? `, expected "${expected}"` : ""}`, UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", UnexpectedUsingDeclaration: "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.", UnexpectedVoidPattern: "Unexpected void binding.", UnsupportedBind: "Binding should be performed on object property.", UnsupportedDecoratorExport: "A decorated export must export a class declaration.", UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.", UnsupportedImport: "`import` can only be used in `import()` or `import.meta`.", UnsupportedMetaProperty: ({ target, onlyValidPropertyName }) => `The only valid meta property for ${target} is ${target}.${onlyValidPropertyName}.`, UnsupportedParameterDecorator: "Decorators cannot be used to decorate parameters.", UnsupportedPropertyDecorator: "Decorators cannot be used to decorate object literal properties.", UnsupportedSuper: "'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).", UnterminatedComment: "Unterminated comment.", UnterminatedRegExp: "Unterminated regular expression.", UnterminatedString: "Unterminated string constant.", UnterminatedTemplate: "Unterminated template.", UsingDeclarationExport: "Using declaration cannot be exported.", UsingDeclarationHasBindingPattern: "Using declaration cannot have destructuring patterns.", VarRedeclaration: ({ identifierName }) => `Identifier '${identifierName}' has already been declared.`, VoidPatternCatchClauseParam: "A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.", VoidPatternInitializer: "A void binding may not have an initializer.", YieldBindingIdentifier: "Can not use 'yield' as identifier inside a generator.", YieldInParameter: "Yield expression is not allowed in formal parameters.", YieldNotInGeneratorFunction: "'yield' is only allowed within generator functions.", ZeroDigitNumericSeparator: "Numeric separator can not be used after leading 0." }; var StrictModeErrors = { StrictDelete: "Deleting local variable in strict mode.", StrictEvalArguments: ({ referenceName }) => `Assigning to '${referenceName}' in strict mode.`, StrictEvalArgumentsBinding: ({ bindingName }) => `Binding '${bindingName}' in strict mode.`, StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block.", StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'.", StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode.", StrictWith: "'with' in strict mode." }; var ParseExpressionErrors = { ParseExpressionEmptyInput: "Unexpected parseExpression() input: The input is empty or contains only comments.", ParseExpressionExpectsEOF: ({ unexpected }) => `Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(unexpected)}\`.` }; const UnparenthesizedPipeBodyDescriptions = new Set(["ArrowFunctionExpression", "AssignmentExpression", "ConditionalExpression", "YieldExpression"]); var PipelineOperatorErrors = Object.assign({ PipeBodyIsTighter: "Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.", PipeTopicRequiresHackPipes: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.', PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.", PipeTopicUnconfiguredToken: ({ token }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`, PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.", PipeUnparenthesizedBody: ({ type }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({ type })}; please wrap it in parentheses.` }, { PipelineBodyNoArrow: 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.', PipelineBodySequenceExpression: "Pipeline body may not be a comma-separated sequence expression.", PipelineHeadSequenceExpression: "Pipeline head should not be a comma-separated sequence expression.", PipelineTopicUnused: "Pipeline is in topic style but does not use topic reference.", PrimaryTopicNotAllowed: "Topic reference was used in a lexical context without topic binding.", PrimaryTopicRequiresSmartPipeline: 'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.' }); const _excluded = ["message"]; function defineHidden(obj, key, value) { Object.defineProperty(obj, key, { enumerable: false, configurable: true, value }); } function toParseErrorConstructor({ toMessage, code, reasonCode, syntaxPlugin }) { const hasMissingPlugin = reasonCode === "MissingPlugin" || reasonCode === "MissingOneOfPlugins"; { const oldReasonCodes = { AccessorCannotDeclareThisParameter: "AccesorCannotDeclareThisParameter", AccessorCannotHaveTypeParameters: "AccesorCannotHaveTypeParameters", ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference", SetAccessorCannotHaveOptionalParameter: "SetAccesorCannotHaveOptionalParameter", SetAccessorCannotHaveRestParameter: "SetAccesorCannotHaveRestParameter", SetAccessorCannotHaveReturnType: "SetAccesorCannotHaveReturnType" }; if (oldReasonCodes[reasonCode]) { reasonCode = oldReasonCodes[reasonCode]; } } return function constructor(loc, details) { const error = new SyntaxError(); error.code = code; error.reasonCode = reasonCode; error.loc = loc; error.pos = loc.index; error.syntaxPlugin = syntaxPlugin; if (hasMissingPlugin) { error.missingPlugin = details.missingPlugin; } defineHidden(error, "clone", function clone(overrides = {}) { var _overrides$loc; const { line, column, index } = (_overrides$loc = overrides.loc) != null ? _overrides$loc : loc; return constructor(new Position(line, column, index), Object.assign({}, details, overrides.details)); }); defineHidden(error, "details", details); Object.defineProperty(error, "message", { configurable: true, get() { const message = `${toMessage(details)} (${loc.line}:${loc.column})`; this.message = message; return message; }, set(value) { Object.defineProperty(this, "message", { value, writable: true }); } }); return error; }; } function ParseErrorEnum(argument, syntaxPlugin) { if (Array.isArray(argument)) { return parseErrorTemplates => ParseErrorEnum(parseErrorTemplates, argument[0]); } const ParseErrorConstructors = {}; for (const reasonCode of Object.keys(argument)) { const template = argument[reasonCode]; const _ref = typeof template === "string" ? { message: () => template } : typeof template === "function" ? { message: template } : template, { message } = _ref, rest = _objectWithoutPropertiesLoose(_ref, _excluded); const toMessage = typeof message === "string" ? () => message : message; ParseErrorConstructors[reasonCode] = toParseErrorConstructor(Object.assign({ code: "BABEL_PARSER_SYNTAX_ERROR", reasonCode, toMessage }, syntaxPlugin ? { syntaxPlugin } : {}, rest)); } return ParseErrorConstructors; } const Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum(ParseExpressionErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors)); function createDefaultOptions() { return { sourceType: "script", sourceFilename: undefined, startIndex: 0, startColumn: 0, startLine: 1, allowAwaitOutsideFunction: false, allowReturnOutsideFunction: false, allowNewTargetOutsideFunction: false, allowImportExportEverywhere: false, allowSuperOutsideMethod: false, allowUndeclaredExports: false, allowYieldOutsideFunction: false, plugins: [], strictMode: null, ranges: false, tokens: false, createImportExpressions: false, createParenthesizedExpressions: false, errorRecovery: false, attachComment: true, annexB: true }; } function getOptions(opts) { const options = createDefaultOptions(); if (opts == null) { return options; } if (opts.annexB != null && opts.annexB !== false) { throw new Error("The `annexB` option can only be set to `false`."); } for (const key of Object.keys(options)) { if (opts[key] != null) options[key] = opts[key]; } if (options.startLine === 1) { if (opts.startIndex == null && options.startColumn > 0) { options.startIndex = options.startColumn; } else if (opts.startColumn == null && options.startIndex > 0) { options.startColumn = options.startIndex; } } else if (opts.startColumn == null || opts.startIndex == null) { if (opts.startIndex != null) { throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`."); } } if (options.sourceType === "commonjs") { if (opts.allowAwaitOutsideFunction != null) { throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`."); } if (opts.allowReturnOutsideFunction != null) { throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`."); } if (opts.allowNewTargetOutsideFunction != null) { throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`."); } } return options; } const { defineProperty } = Object; const toUnenumerable = (object, key) => { if (object) { defineProperty(object, key, { enumerable: false, value: object[key] }); } }; function toESTreeLocation(node) { toUnenumerable(node.loc.start, "index"); toUnenumerable(node.loc.end, "index"); return node; } var estree = superClass => class ESTreeParserMixin extends superClass { parse() { const file = toESTreeLocation(super.parse()); if (this.optionFlags & 256) { file.tokens = file.tokens.map(toESTreeLocation); } return file; } parseRegExpLiteral({ pattern, flags }) { let regex = null; try { regex = new RegExp(pattern, flags); } catch (_) {} const node = this.estreeParseLiteral(regex); node.regex = { pattern, flags }; return node; } parseBigIntLiteral(value) { let bigInt; try { bigInt = BigInt(value); } catch (_unused) { bigInt = null; } const node = this.estreeParseLiteral(bigInt); node.bigint = String(node.value || value); return node; } parseDecimalLiteral(value) { const decimal = null; const node = this.estreeParseLiteral(decimal); node.decimal = String(node.value || value); return node; } estreeParseLiteral(value) { return this.parseLiteral(value, "Literal"); } parseStringLiteral(value) { return this.estreeParseLiteral(value); } parseNumericLiteral(value) { return this.estreeParseLiteral(value); } parseNullLiteral() { return this.estreeParseLiteral(null); } parseBooleanLiteral(value) { return this.estreeParseLiteral(value); } estreeParseChainExpression(node, endLoc) { const chain = this.startNodeAtNode(node); chain.expression = node; return this.finishNodeAt(chain, "ChainExpression", endLoc); } directiveToStmt(directive) { const expression = directive.value; delete directive.value; this.castNodeTo(expression, "Literal"); expression.raw = expression.extra.raw; expression.value = expression.extra.expressionValue; const stmt = this.castNodeTo(directive, "ExpressionStatement"); stmt.expression = expression; stmt.directive = expression.extra.rawValue; delete expression.extra; return stmt; } fillOptionalPropertiesForTSESLint(node) {} cloneEstreeStringLiteral(node) { const { start, end, loc, range, raw, value } = node; const cloned = Object.create(node.constructor.prototype); cloned.type = "Literal"; cloned.start = start; cloned.end = end; cloned.loc = loc; cloned.range = range; cloned.raw = raw; cloned.value = value; return cloned; } initFunction(node, isAsync) { super.initFunction(node, isAsync); node.expression = false; } checkDeclaration(node) { if (node != null && this.isObjectProperty(node)) { this.checkDeclaration(node.value); } else { super.checkDeclaration(node); } } getObjectOrClassMethodParams(method) { return method.value.params; } isValidDirective(stmt) { var _stmt$expression$extr; return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !((_stmt$expression$extr = stmt.expression.extra) != null && _stmt$expression$extr.parenthesized); } parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { super.parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse); const directiveStatements = node.directives.map(d => this.directiveToStmt(d)); node.body = directiveStatements.concat(node.body); delete node.directives; } parsePrivateName() { const node = super.parsePrivateName(); { if (!this.getPluginOption("estree", "classFeatures")) { return node; } } return this.convertPrivateNameToPrivateIdentifier(node); } convertPrivateNameToPrivateIdentifier(node) { const name = super.getPrivateNameSV(node); node = node; delete node.id; node.name = name; return this.castNodeTo(node, "PrivateIdentifier"); } isPrivateName(node) { { if (!this.getPluginOption("estree", "classFeatures")) { return super.isPrivateName(node); } } return node.type === "PrivateIdentifier"; } getPrivateNameSV(node) { { if (!this.getPluginOption("estree", "classFeatures")) { return super.getPrivateNameSV(node); } } return node.name; } parseLiteral(value, type) { const node = super.parseLiteral(value, type); node.raw = node.extra.raw; delete node.extra; return node; } parseFunctionBody(node, allowExpression, isMethod = false) { super.parseFunctionBody(node, allowExpression, isMethod); node.expression = node.body.type !== "BlockStatement"; } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { let funcNode = this.startNode(); funcNode.kind = node.kind; funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); delete funcNode.kind; const { typeParameters } = node; if (typeParameters) { delete node.typeParameters; funcNode.typeParameters = typeParameters; this.resetStartLocationFromNode(funcNode, typeParameters); } const valueNode = this.castNodeTo(funcNode, "FunctionExpression"); node.value = valueNode; if (type === "ClassPrivateMethod") { node.computed = false; } if (type === "ObjectMethod") { if (node.kind === "method") { node.kind = "init"; } node.shorthand = false; return this.finishNode(node, "Property"); } else { return this.finishNode(node, "MethodDefinition"); } } nameIsConstructor(key) { if (key.type === "Literal") return key.value === "constructor"; return super.nameIsConstructor(key); } parseClassProperty(...args) { const propertyNode = super.parseClassProperty(...args); { if (!this.getPluginOption("estree", "classFeatures")) { return propertyNode; } } { this.castNodeTo(propertyNode, "PropertyDefinition"); } return propertyNode; } parseClassPrivateProperty(...args) { const propertyNode = super.parseClassPrivateProperty(...args); { if (!this.getPluginOption("estree", "classFeatures")) { return propertyNode; } } { this.castNodeTo(propertyNode, "PropertyDefinition"); } propertyNode.computed = false; return propertyNode; } parseClassAccessorProperty(node) { const accessorPropertyNode = super.parseClassAccessorProperty(node); { if (!this.getPluginOption("estree", "classFeatures")) { return accessorPropertyNode; } } if (accessorPropertyNode.abstract && this.hasPlugin("typescript")) { delete accessorPropertyNode.abstract; this.castNodeTo(accessorPropertyNode, "TSAbstractAccessorProperty"); } else { this.castNodeTo(accessorPropertyNode, "AccessorProperty"); } return accessorPropertyNode; } parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { const node = super.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); if (node) { node.kind = "init"; this.castNodeTo(node, "Property"); } return node; } finishObjectProperty(node) { node.kind = "init"; return this.finishNode(node, "Property"); } isValidLVal(type, isUnparenthesizedInAssign, binding) { return type === "Property" ? "value" : super.isValidLVal(type, isUnparenthesizedInAssign, binding); } isAssignable(node, isBinding) { if (node != null && this.isObjectProperty(node)) { return this.isAssignable(node.value, isBinding); } return super.isAssignable(node, isBinding); } toAssignable(node, isLHS = false) { if (node != null && this.isObjectProperty(node)) { const { key, value } = node; if (this.isPrivateName(key)) { this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); } this.toAssignable(value, isLHS); } else { super.toAssignable(node, isLHS); } } toAssignableObjectExpressionProp(prop, isLast, isLHS) { if (prop.type === "Property" && (prop.kind === "get" || prop.kind === "set")) { this.raise(Errors.PatternHasAccessor, prop.key); } else if (prop.type === "Property" && prop.method) { this.raise(Errors.PatternHasMethod, prop.key); } else { super.toAssignableObjectExpressionProp(prop, isLast, isLHS); } } finishCallExpression(unfinished, optional) { const node = super.finishCallExpression(unfinished, optional); if (node.callee.type === "Import") { var _ref; this.castNodeTo(node, "ImportExpression"); node.source = node.arguments[0]; node.options = (_ref = node.arguments[1]) != null ? _ref : null; { var _ref2; node.attributes = (_ref2 = node.arguments[1]) != null ? _ref2 : null; } delete node.arguments; delete node.callee; } else if (node.type === "OptionalCallExpression") { this.castNodeTo(node, "CallExpression"); } else { node.optional = false; } return node; } toReferencedArguments(node) { if (node.type === "ImportExpression") { return; } super.toReferencedArguments(node); } parseExport(unfinished, decorators) { const exportStartLoc = this.state.lastTokStartLoc; const node = super.parseExport(unfinished, decorators); switch (node.type) { case "ExportAllDeclaration": node.exported = null; break; case "ExportNamedDeclaration": if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") { this.castNodeTo(node, "ExportAllDeclaration"); node.exported = node.specifiers[0].exported; delete node.specifiers; } case "ExportDefaultDeclaration": { var _declaration$decorato; const { declaration } = node; if ((declaration == null ? void 0 : declaration.type) === "ClassDeclaration" && ((_declaration$decorato = declaration.decorators) == null ? void 0 : _declaration$decorato.length) > 0 && declaration.start === node.start) { this.resetStartLocation(node, exportStartLoc); } } break; } return node; } stopParseSubscript(base, state) { const node = super.stopParseSubscript(base, state); if (state.optionalChainMember) { return this.estreeParseChainExpression(node, base.loc.end); } return node; } parseMember(base, startLoc, state, computed, optional) { const node = super.parseMember(base, startLoc, state, computed, optional); if (node.type === "OptionalMemberExpression") { this.castNodeTo(node, "MemberExpression"); } else { node.optional = false; } return node; } isOptionalMemberExpression(node) { if (node.type === "ChainExpression") { return node.expression.type === "MemberExpression"; } return super.isOptionalMemberExpression(node); } hasPropertyAsPrivateName(node) { if (node.type === "ChainExpression") { node = node.expression; } return super.hasPropertyAsPrivateName(node); } isObjectProperty(node) { return node.type === "Property" && node.kind === "init" && !node.method; } isObjectMethod(node) { return node.type === "Property" && (node.method || node.kind === "get" || node.kind === "set"); } castNodeTo(node, type) { const result = super.castNodeTo(node, type); this.fillOptionalPropertiesForTSESLint(result); return result; } cloneIdentifier(node) { const cloned = super.cloneIdentifier(node); this.fillOptionalPropertiesForTSESLint(cloned); return cloned; } cloneStringLiteral(node) { if (node.type === "Literal") { return this.cloneEstreeStringLiteral(node); } return super.cloneStringLiteral(node); } finishNodeAt(node, type, endLoc) { return toESTreeLocation(super.finishNodeAt(node, type, endLoc)); } finishNode(node, type) { const result = super.finishNode(node, type); this.fillOptionalPropertiesForTSESLint(result); return result; } resetStartLocation(node, startLoc) { super.resetStartLocation(node, startLoc); toESTreeLocation(node); } resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { super.resetEndLocation(node, endLoc); toESTreeLocation(node); } }; class TokContext { constructor(token, preserveSpace) { this.token = void 0; this.preserveSpace = void 0; this.token = token; this.preserveSpace = !!preserveSpace; } } const types = { brace: new TokContext("{"), j_oTag: new TokContext("...", true) }; { types.template = new TokContext("`", true); } const beforeExpr = true; const startsExpr = true; const isLoop = true; const isAssign = true; const prefix = true; const postfix = true; class ExportedTokenType { constructor(label, conf = {}) { this.label = void 0; this.keyword = void 0; this.beforeExpr = void 0; this.startsExpr = void 0; this.rightAssociative = void 0; this.isLoop = void 0; this.isAssign = void 0; this.prefix = void 0; this.postfix = void 0; this.binop = void 0; this.label = label; this.keyword = conf.keyword; this.beforeExpr = !!conf.beforeExpr; this.startsExpr = !!conf.startsExpr; this.rightAssociative = !!conf.rightAssociative; this.isLoop = !!conf.isLoop; this.isAssign = !!conf.isAssign; this.prefix = !!conf.prefix; this.postfix = !!conf.postfix; this.binop = conf.binop != null ? conf.binop : null; { this.updateContext = null; } } } const keywords$1 = new Map(); function createKeyword(name, options = {}) { options.keyword = name; const token = createToken(name, options); keywords$1.set(name, token); return token; } function createBinop(name, binop) { return createToken(name, { beforeExpr, binop }); } let tokenTypeCounter = -1; const tokenTypes = []; const tokenLabels = []; const tokenBinops = []; const tokenBeforeExprs = []; const tokenStartsExprs = []; const tokenPrefixes = []; function createToken(name, options = {}) { var _options$binop, _options$beforeExpr, _options$startsExpr, _options$prefix; ++tokenTypeCounter; tokenLabels.push(name); tokenBinops.push((_options$binop = options.binop) != null ? _options$binop : -1); tokenBeforeExprs.push((_options$beforeExpr = options.beforeExpr) != null ? _options$beforeExpr : false); tokenStartsExprs.push((_options$startsExpr = options.startsExpr) != null ? _options$startsExpr : false); tokenPrefixes.push((_options$prefix = options.prefix) != null ? _options$prefix : false); tokenTypes.push(new ExportedTokenType(name, options)); return tokenTypeCounter; } function createKeywordLike(name, options = {}) { var _options$binop2, _options$beforeExpr2, _options$startsExpr2, _options$prefix2; ++tokenTypeCounter; keywords$1.set(name, tokenTypeCounter); tokenLabels.push(name); tokenBinops.push((_options$binop2 = options.binop) != null ? _options$binop2 : -1); tokenBeforeExprs.push((_options$beforeExpr2 = options.beforeExpr) != null ? _options$beforeExpr2 : false); tokenStartsExprs.push((_options$startsExpr2 = options.startsExpr) != null ? _options$startsExpr2 : false); tokenPrefixes.push((_options$prefix2 = options.prefix) != null ? _options$prefix2 : false); tokenTypes.push(new ExportedTokenType("name", options)); return tokenTypeCounter; } const tt = { bracketL: createToken("[", { beforeExpr, startsExpr }), bracketHashL: createToken("#[", { beforeExpr, startsExpr }), bracketBarL: createToken("[|", { beforeExpr, startsExpr }), bracketR: createToken("]"), bracketBarR: createToken("|]"), braceL: createToken("{", { beforeExpr, startsExpr }), braceBarL: createToken("{|", { beforeExpr, startsExpr }), braceHashL: createToken("#{", { beforeExpr, startsExpr }), braceR: createToken("}"), braceBarR: createToken("|}"), parenL: createToken("(", { beforeExpr, startsExpr }), parenR: createToken(")"), comma: createToken(",", { beforeExpr }), semi: createToken(";", { beforeExpr }), colon: createToken(":", { beforeExpr }), doubleColon: createToken("::", { beforeExpr }), dot: createToken("."), question: createToken("?", { beforeExpr }), questionDot: createToken("?."), arrow: createToken("=>", { beforeExpr }), template: createToken("template"), ellipsis: createToken("...", { beforeExpr }), backQuote: createToken("`", { startsExpr }), dollarBraceL: createToken("${", { beforeExpr, startsExpr }), templateTail: createToken("...`", { startsExpr }), templateNonTail: createToken("...${", { beforeExpr, startsExpr }), at: createToken("@"), hash: createToken("#", { startsExpr }), interpreterDirective: createToken("#!..."), eq: createToken("=", { beforeExpr, isAssign }), assign: createToken("_=", { beforeExpr, isAssign }), slashAssign: createToken("_=", { beforeExpr, isAssign }), xorAssign: createToken("_=", { beforeExpr, isAssign }), moduloAssign: createToken("_=", { beforeExpr, isAssign }), incDec: createToken("++/--", { prefix, postfix, startsExpr }), bang: createToken("!", { beforeExpr, prefix, startsExpr }), tilde: createToken("~", { beforeExpr, prefix, startsExpr }), doubleCaret: createToken("^^", { startsExpr }), doubleAt: createToken("@@", { startsExpr }), pipeline: createBinop("|>", 0), nullishCoalescing: createBinop("??", 1), logicalOR: createBinop("||", 1), logicalAND: createBinop("&&", 2), bitwiseOR: createBinop("|", 3), bitwiseXOR: createBinop("^", 4), bitwiseAND: createBinop("&", 5), equality: createBinop("==/!=/===/!==", 6), lt: createBinop("/<=/>=", 7), gt: createBinop("/<=/>=", 7), relational: createBinop("/<=/>=", 7), bitShift: createBinop("<>/>>>", 8), bitShiftL: createBinop("<>/>>>", 8), bitShiftR: createBinop("<>/>>>", 8), plusMin: createToken("+/-", { beforeExpr, binop: 9, prefix, startsExpr }), modulo: createToken("%", { binop: 10, startsExpr }), star: createToken("*", { binop: 10 }), slash: createBinop("/", 10), exponent: createToken("**", { beforeExpr, binop: 11, rightAssociative: true }), _in: createKeyword("in", { beforeExpr, binop: 7 }), _instanceof: createKeyword("instanceof", { beforeExpr, binop: 7 }), _break: createKeyword("break"), _case: createKeyword("case", { beforeExpr }), _catch: createKeyword("catch"), _continue: createKeyword("continue"), _debugger: createKeyword("debugger"), _default: createKeyword("default", { beforeExpr }), _else: createKeyword("else", { beforeExpr }), _finally: createKeyword("finally"), _function: createKeyword("function", { startsExpr }), _if: createKeyword("if"), _return: createKeyword("return", { beforeExpr }), _switch: createKeyword("switch"), _throw: createKeyword("throw", { beforeExpr, prefix, startsExpr }), _try: createKeyword("try"), _var: createKeyword("var"), _const: createKeyword("const"), _with: createKeyword("with"), _new: createKeyword("new", { beforeExpr, startsExpr }), _this: createKeyword("this", { startsExpr }), _super: createKeyword("super", { startsExpr }), _class: createKeyword("class", { startsExpr }), _extends: createKeyword("extends", { beforeExpr }), _export: createKeyword("export"), _import: createKeyword("import", { startsExpr }), _null: createKeyword("null", { startsExpr }), _true: createKeyword("true", { startsExpr }), _false: createKeyword("false", { startsExpr }), _typeof: createKeyword("typeof", { beforeExpr, prefix, startsExpr }), _void: createKeyword("void", { beforeExpr, prefix, startsExpr }), _delete: createKeyword("delete", { beforeExpr, prefix, startsExpr }), _do: createKeyword("do", { isLoop, beforeExpr }), _for: createKeyword("for", { isLoop }), _while: createKeyword("while", { isLoop }), _as: createKeywordLike("as", { startsExpr }), _assert: createKeywordLike("assert", { startsExpr }), _async: createKeywordLike("async", { startsExpr }), _await: createKeywordLike("await", { startsExpr }), _defer: createKeywordLike("defer", { startsExpr }), _from: createKeywordLike("from", { startsExpr }), _get: createKeywordLike("get", { startsExpr }), _let: createKeywordLike("let", { startsExpr }), _meta: createKeywordLike("meta", { startsExpr }), _of: createKeywordLike("of", { startsExpr }), _sent: createKeywordLike("sent", { startsExpr }), _set: createKeywordLike("set", { startsExpr }), _source: createKeywordLike("source", { startsExpr }), _static: createKeywordLike("static", { startsExpr }), _using: createKeywordLike("using", { startsExpr }), _yield: createKeywordLike("yield", { startsExpr }), _asserts: createKeywordLike("asserts", { startsExpr }), _checks: createKeywordLike("checks", { startsExpr }), _exports: createKeywordLike("exports", { startsExpr }), _global: createKeywordLike("global", { startsExpr }), _implements: createKeywordLike("implements", { startsExpr }), _intrinsic: createKeywordLike("intrinsic", { startsExpr }), _infer: createKeywordLike("infer", { startsExpr }), _is: createKeywordLike("is", { startsExpr }), _mixins: createKeywordLike("mixins", { startsExpr }), _proto: createKeywordLike("proto", { startsExpr }), _require: createKeywordLike("require", { startsExpr }), _satisfies: createKeywordLike("satisfies", { startsExpr }), _keyof: createKeywordLike("keyof", { startsExpr }), _readonly: createKeywordLike("readonly", { startsExpr }), _unique: createKeywordLike("unique", { startsExpr }), _abstract: createKeywordLike("abstract", { startsExpr }), _declare: createKeywordLike("declare", { startsExpr }), _enum: createKeywordLike("enum", { startsExpr }), _module: createKeywordLike("module", { startsExpr }), _namespace: createKeywordLike("namespace", { startsExpr }), _interface: createKeywordLike("interface", { startsExpr }), _type: createKeywordLike("type", { startsExpr }), _opaque: createKeywordLike("opaque", { startsExpr }), name: createToken("name", { startsExpr }), placeholder: createToken("%%", { startsExpr }), string: createToken("string", { startsExpr }), num: createToken("num", { startsExpr }), bigint: createToken("bigint", { startsExpr }), decimal: createToken("decimal", { startsExpr }), regexp: createToken("regexp", { startsExpr }), privateName: createToken("#name", { startsExpr }), eof: createToken("eof"), jsxName: createToken("jsxName"), jsxText: createToken("jsxText", { beforeExpr }), jsxTagStart: createToken("jsxTagStart", { startsExpr }), jsxTagEnd: createToken("jsxTagEnd") }; function tokenIsIdentifier(token) { return token >= 93 && token <= 133; } function tokenKeywordOrIdentifierIsKeyword(token) { return token <= 92; } function tokenIsKeywordOrIdentifier(token) { return token >= 58 && token <= 133; } function tokenIsLiteralPropertyName(token) { return token >= 58 && token <= 137; } function tokenComesBeforeExpression(token) { return tokenBeforeExprs[token]; } function tokenCanStartExpression(token) { return tokenStartsExprs[token]; } function tokenIsAssignment(token) { return token >= 29 && token <= 33; } function tokenIsFlowInterfaceOrTypeOrOpaque(token) { return token >= 129 && token <= 131; } function tokenIsLoop(token) { return token >= 90 && token <= 92; } function tokenIsKeyword(token) { return token >= 58 && token <= 92; } function tokenIsOperator(token) { return token >= 39 && token <= 59; } function tokenIsPostfix(token) { return token === 34; } function tokenIsPrefix(token) { return tokenPrefixes[token]; } function tokenIsTSTypeOperator(token) { return token >= 121 && token <= 123; } function tokenIsTSDeclarationStart(token) { return token >= 124 && token <= 130; } function tokenLabelName(token) { return tokenLabels[token]; } function tokenOperatorPrecedence(token) { return tokenBinops[token]; } function tokenIsRightAssociative(token) { return token === 57; } function tokenIsTemplate(token) { return token >= 24 && token <= 25; } function getExportedToken(token) { return tokenTypes[token]; } { tokenTypes[8].updateContext = context => { context.pop(); }; tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = context => { context.push(types.brace); }; tokenTypes[22].updateContext = context => { if (context[context.length - 1] === types.template) { context.pop(); } else { context.push(types.template); } }; tokenTypes[143].updateContext = context => { context.push(types.j_expr, types.j_oTag); }; } let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7cd\ua7d0\ua7d1\ua7d3\ua7d5-\ua7dc\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; let nonASCIIidentifierChars = "\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65"; const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191]; const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239]; function isInAstralSet(code, set) { let pos = 0x10000; for (let i = 0, length = set.length; i < length; i += 2) { pos += set[i]; if (pos > code) return false; pos += set[i + 1]; if (pos >= code) return true; } return false; } function isIdentifierStart(code) { if (code < 65) return code === 36; if (code <= 90) return true; if (code < 97) return code === 95; if (code <= 122) return true; if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); } return isInAstralSet(code, astralIdentifierStartCodes); } function isIdentifierChar(code) { if (code < 48) return code === 36; if (code < 58) return true; if (code < 65) return false; if (code <= 90) return true; if (code < 97) return code === 95; if (code <= 122) return true; if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); } return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); } const reservedWords = { keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"], strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"], strictBind: ["eval", "arguments"] }; const keywords = new Set(reservedWords.keyword); const reservedWordsStrictSet = new Set(reservedWords.strict); const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); function isReservedWord(word, inModule) { return inModule && word === "await" || word === "enum"; } function isStrictReservedWord(word, inModule) { return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); } function isStrictBindOnlyReservedWord(word) { return reservedWordsStrictBindSet.has(word); } function isStrictBindReservedWord(word, inModule) { return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word); } function isKeyword(word) { return keywords.has(word); } function isIteratorStart(current, next, next2) { return current === 64 && next === 64 && isIdentifierStart(next2); } const reservedWordLikeSet = new Set(["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete", "implements", "interface", "let", "package", "private", "protected", "public", "static", "yield", "eval", "arguments", "enum", "await"]); function canBeReservedWord(word) { return reservedWordLikeSet.has(word); } class Scope { constructor(flags) { this.flags = 0; this.names = new Map(); this.firstLexicalName = ""; this.flags = flags; } } class ScopeHandler { constructor(parser, inModule) { this.parser = void 0; this.scopeStack = []; this.inModule = void 0; this.undefinedExports = new Map(); this.parser = parser; this.inModule = inModule; } get inTopLevel() { return (this.currentScope().flags & 1) > 0; } get inFunction() { return (this.currentVarScopeFlags() & 2) > 0; } get allowSuper() { return (this.currentThisScopeFlags() & 16) > 0; } get allowDirectSuper() { return (this.currentThisScopeFlags() & 32) > 0; } get allowNewTarget() { return (this.currentThisScopeFlags() & 512) > 0; } get inClass() { return (this.currentThisScopeFlags() & 64) > 0; } get inClassAndNotInNonArrowFunction() { const flags = this.currentThisScopeFlags(); return (flags & 64) > 0 && (flags & 2) === 0; } get inStaticBlock() { for (let i = this.scopeStack.length - 1;; i--) { const { flags } = this.scopeStack[i]; if (flags & 128) { return true; } if (flags & (1667 | 64)) { return false; } } } get inNonArrowFunction() { return (this.currentThisScopeFlags() & 2) > 0; } get inBareCaseStatement() { return (this.currentScope().flags & 256) > 0; } get treatFunctionsAsVar() { return this.treatFunctionsAsVarInScope(this.currentScope()); } createScope(flags) { return new Scope(flags); } enter(flags) { this.scopeStack.push(this.createScope(flags)); } exit() { const scope = this.scopeStack.pop(); return scope.flags; } treatFunctionsAsVarInScope(scope) { return !!(scope.flags & (2 | 128) || !this.parser.inModule && scope.flags & 1); } declareName(name, bindingType, loc) { let scope = this.currentScope(); if (bindingType & 8 || bindingType & 16) { this.checkRedeclarationInScope(scope, name, bindingType, loc); let type = scope.names.get(name) || 0; if (bindingType & 16) { type = type | 4; } else { if (!scope.firstLexicalName) { scope.firstLexicalName = name; } type = type | 2; } scope.names.set(name, type); if (bindingType & 8) { this.maybeExportDefined(scope, name); } } else if (bindingType & 4) { for (let i = this.scopeStack.length - 1; i >= 0; --i) { scope = this.scopeStack[i]; this.checkRedeclarationInScope(scope, name, bindingType, loc); scope.names.set(name, (scope.names.get(name) || 0) | 1); this.maybeExportDefined(scope, name); if (scope.flags & 1667) break; } } if (this.parser.inModule && scope.flags & 1) { this.undefinedExports.delete(name); } } maybeExportDefined(scope, name) { if (this.parser.inModule && scope.flags & 1) { this.undefinedExports.delete(name); } } checkRedeclarationInScope(scope, name, bindingType, loc) { if (this.isRedeclaredInScope(scope, name, bindingType)) { this.parser.raise(Errors.VarRedeclaration, loc, { identifierName: name }); } } isRedeclaredInScope(scope, name, bindingType) { if (!(bindingType & 1)) return false; if (bindingType & 8) { return scope.names.has(name); } const type = scope.names.get(name); if (bindingType & 16) { return (type & 2) > 0 || !this.treatFunctionsAsVarInScope(scope) && (type & 1) > 0; } return (type & 2) > 0 && !(scope.flags & 8 && scope.firstLexicalName === name) || !this.treatFunctionsAsVarInScope(scope) && (type & 4) > 0; } checkLocalExport(id) { const { name } = id; const topLevelScope = this.scopeStack[0]; if (!topLevelScope.names.has(name)) { this.undefinedExports.set(name, id.loc.start); } } currentScope() { return this.scopeStack[this.scopeStack.length - 1]; } currentVarScopeFlags() { for (let i = this.scopeStack.length - 1;; i--) { const { flags } = this.scopeStack[i]; if (flags & 1667) { return flags; } } } currentThisScopeFlags() { for (let i = this.scopeStack.length - 1;; i--) { const { flags } = this.scopeStack[i]; if (flags & (1667 | 64) && !(flags & 4)) { return flags; } } } } class FlowScope extends Scope { constructor(...args) { super(...args); this.declareFunctions = new Set(); } } class FlowScopeHandler extends ScopeHandler { createScope(flags) { return new FlowScope(flags); } declareName(name, bindingType, loc) { const scope = this.currentScope(); if (bindingType & 2048) { this.checkRedeclarationInScope(scope, name, bindingType, loc); this.maybeExportDefined(scope, name); scope.declareFunctions.add(name); return; } super.declareName(name, bindingType, loc); } isRedeclaredInScope(scope, name, bindingType) { if (super.isRedeclaredInScope(scope, name, bindingType)) return true; if (bindingType & 2048 && !scope.declareFunctions.has(name)) { const type = scope.names.get(name); return (type & 4) > 0 || (type & 2) > 0; } return false; } checkLocalExport(id) { if (!this.scopeStack[0].declareFunctions.has(id.name)) { super.checkLocalExport(id); } } } const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]); const FlowErrors = ParseErrorEnum`flow`({ AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.", AssignReservedType: ({ reservedType }) => `Cannot overwrite reserved type ${reservedType}.`, DeclareClassElement: "The `declare` modifier can only appear on class fields.", DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.", DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement.", EnumBooleanMemberNotInitialized: ({ memberName, enumName }) => `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` or \`${memberName} = false,\` in enum \`${enumName}\`.`, EnumDuplicateMemberName: ({ memberName, enumName }) => `Enum member names need to be unique, but the name \`${memberName}\` has already been used before in enum \`${enumName}\`.`, EnumInconsistentMemberValues: ({ enumName }) => `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`, EnumInvalidExplicitType: ({ invalidEnumType, enumName }) => `Enum type \`${invalidEnumType}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, EnumInvalidExplicitTypeUnknownSupplied: ({ enumName }) => `Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${enumName}\`.`, EnumInvalidMemberInitializerPrimaryType: ({ enumName, memberName, explicitType }) => `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of \`${memberName}\` needs to be a ${explicitType} literal.`, EnumInvalidMemberInitializerSymbolType: ({ enumName, memberName }) => `Symbol enum members cannot be initialized. Use \`${memberName},\` in enum \`${enumName}\`.`, EnumInvalidMemberInitializerUnknownType: ({ enumName, memberName }) => `The enum member initializer for \`${memberName}\` needs to be a literal (either a boolean, number, or string) in enum \`${enumName}\`.`, EnumInvalidMemberName: ({ enumName, memberName, suggestion }) => `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`, EnumNumberMemberNotInitialized: ({ enumName, memberName }) => `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`, EnumStringMemberInconsistentlyInitialized: ({ enumName }) => `String enum members need to consistently either all use initializers, or use no initializers, in enum \`${enumName}\`.`, GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", ImportReflectionHasImportType: "An `import module` declaration can not use `type` or `typeof` keyword.", ImportTypeShorthandOnlyInPureImport: "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.", InexactInsideExact: "Explicit inexact syntax cannot appear inside an explicit exact object type.", InexactInsideNonObject: "Explicit inexact syntax cannot appear in class or interface definitions.", InexactVariance: "Explicit inexact syntax cannot have variance.", InvalidNonTypeImportInDeclareModule: "Imports within a `declare module` body must always be `import type` or `import typeof`.", MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", NestedDeclareModule: "`declare module` cannot be used inside another `declare module`.", NestedFlowComment: "Cannot have a flow comment inside another flow comment.", PatternIsOptional: Object.assign({ message: "A binding pattern parameter cannot be optional in an implementation signature." }, { reasonCode: "OptionalBindingPattern" }), SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", SpreadVariance: "Spread properties cannot have variance.", ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.", ThisParamBannedInConstructor: "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.", ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.", ThisParamMustBeFirst: "The `this` parameter must be the first function parameter.", ThisParamNoDefault: "The `this` parameter may not have a default value.", TypeBeforeInitializer: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeCastInPattern: "The type cast expression is expected to be wrapped with parenthesis.", UnexpectedExplicitInexactInObject: "Explicit inexact syntax must appear at the end of an inexact object.", UnexpectedReservedType: ({ reservedType }) => `Unexpected reserved type ${reservedType}.`, UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new.", UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.", UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions.", UnexpectedSubtractionOperand: 'Unexpected token, expected "number" or "bigint".', UnexpectedTokenAfterTypeParameter: "Expected an arrow function after this type parameter declaration.", UnexpectedTypeParameterBeforeAsyncArrowFunction: "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.", UnsupportedDeclareExportKind: ({ unsupportedExportKind, suggestion }) => `\`declare export ${unsupportedExportKind}\` is not supported. Use \`${suggestion}\` instead.`, UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.", UnterminatedFlowComment: "Unterminated flow-comment." }); function isEsModuleType(bodyElement) { return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration"); } function hasTypeImportKind(node) { return node.importKind === "type" || node.importKind === "typeof"; } const exportSuggestions = { const: "declare export var", let: "declare export var", type: "export type", interface: "export interface" }; function partition(list, test) { const list1 = []; const list2 = []; for (let i = 0; i < list.length; i++) { (test(list[i], i, list) ? list1 : list2).push(list[i]); } return [list1, list2]; } const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/; var flow = superClass => class FlowParserMixin extends superClass { constructor(...args) { super(...args); this.flowPragma = undefined; } getScopeHandler() { return FlowScopeHandler; } shouldParseTypes() { return this.getPluginOption("flow", "all") || this.flowPragma === "flow"; } finishToken(type, val) { if (type !== 134 && type !== 13 && type !== 28) { if (this.flowPragma === undefined) { this.flowPragma = null; } } super.finishToken(type, val); } addComment(comment) { if (this.flowPragma === undefined) { const matches = FLOW_PRAGMA_REGEX.exec(comment.value); if (!matches) ;else if (matches[1] === "flow") { this.flowPragma = "flow"; } else if (matches[1] === "noflow") { this.flowPragma = "noflow"; } else { throw new Error("Unexpected flow pragma"); } } super.addComment(comment); } flowParseTypeInitialiser(tok) { const oldInType = this.state.inType; this.state.inType = true; this.expect(tok || 14); const type = this.flowParseType(); this.state.inType = oldInType; return type; } flowParsePredicate() { const node = this.startNode(); const moduloLoc = this.state.startLoc; this.next(); this.expectContextual(110); if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) { this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc); } if (this.eat(10)) { node.value = super.parseExpression(); this.expect(11); return this.finishNode(node, "DeclaredPredicate"); } else { return this.finishNode(node, "InferredPredicate"); } } flowParseTypeAndPredicateInitialiser() { const oldInType = this.state.inType; this.state.inType = true; this.expect(14); let type = null; let predicate = null; if (this.match(54)) { this.state.inType = oldInType; predicate = this.flowParsePredicate(); } else { type = this.flowParseType(); this.state.inType = oldInType; if (this.match(54)) { predicate = this.flowParsePredicate(); } } return [type, predicate]; } flowParseDeclareClass(node) { this.next(); this.flowParseInterfaceish(node, true); return this.finishNode(node, "DeclareClass"); } flowParseDeclareFunction(node) { this.next(); const id = node.id = this.parseIdentifier(); const typeNode = this.startNode(); const typeContainer = this.startNode(); if (this.match(47)) { typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); } else { typeNode.typeParameters = null; } this.expect(10); const tmp = this.flowParseFunctionTypeParams(); typeNode.params = tmp.params; typeNode.rest = tmp.rest; typeNode.this = tmp._this; this.expect(11); [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); this.resetEndLocation(id); this.semicolon(); this.scope.declareName(node.id.name, 2048, node.id.loc.start); return this.finishNode(node, "DeclareFunction"); } flowParseDeclare(node, insideModule) { if (this.match(80)) { return this.flowParseDeclareClass(node); } else if (this.match(68)) { return this.flowParseDeclareFunction(node); } else if (this.match(74)) { return this.flowParseDeclareVariable(node); } else if (this.eatContextual(127)) { if (this.match(16)) { return this.flowParseDeclareModuleExports(node); } else { if (insideModule) { this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc); } return this.flowParseDeclareModule(node); } } else if (this.isContextual(130)) { return this.flowParseDeclareTypeAlias(node); } else if (this.isContextual(131)) { return this.flowParseDeclareOpaqueType(node); } else if (this.isContextual(129)) { return this.flowParseDeclareInterface(node); } else if (this.match(82)) { return this.flowParseDeclareExportDeclaration(node, insideModule); } else { this.unexpected(); } } flowParseDeclareVariable(node) { this.next(); node.id = this.flowParseTypeAnnotatableIdentifier(true); this.scope.declareName(node.id.name, 5, node.id.loc.start); this.semicolon(); return this.finishNode(node, "DeclareVariable"); } flowParseDeclareModule(node) { this.scope.enter(0); if (this.match(134)) { node.id = super.parseExprAtom(); } else { node.id = this.parseIdentifier(); } const bodyNode = node.body = this.startNode(); const body = bodyNode.body = []; this.expect(5); while (!this.match(8)) { let bodyNode = this.startNode(); if (this.match(83)) { this.next(); if (!this.isContextual(130) && !this.match(87)) { this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc); } super.parseImport(bodyNode); } else { this.expectContextual(125, FlowErrors.UnsupportedStatementInDeclareModule); bodyNode = this.flowParseDeclare(bodyNode, true); } body.push(bodyNode); } this.scope.exit(); this.expect(8); this.finishNode(bodyNode, "BlockStatement"); let kind = null; let hasModuleExport = false; body.forEach(bodyElement => { if (isEsModuleType(bodyElement)) { if (kind === "CommonJS") { this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); } kind = "ES"; } else if (bodyElement.type === "DeclareModuleExports") { if (hasModuleExport) { this.raise(FlowErrors.DuplicateDeclareModuleExports, bodyElement); } if (kind === "ES") { this.raise(FlowErrors.AmbiguousDeclareModuleKind, bodyElement); } kind = "CommonJS"; hasModuleExport = true; } }); node.kind = kind || "CommonJS"; return this.finishNode(node, "DeclareModule"); } flowParseDeclareExportDeclaration(node, insideModule) { this.expect(82); if (this.eat(65)) { if (this.match(68) || this.match(80)) { node.declaration = this.flowParseDeclare(this.startNode()); } else { node.declaration = this.flowParseType(); this.semicolon(); } node.default = true; return this.finishNode(node, "DeclareExportDeclaration"); } else { if (this.match(75) || this.isLet() || (this.isContextual(130) || this.isContextual(129)) && !insideModule) { const label = this.state.value; throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, { unsupportedExportKind: label, suggestion: exportSuggestions[label] }); } if (this.match(74) || this.match(68) || this.match(80) || this.isContextual(131)) { node.declaration = this.flowParseDeclare(this.startNode()); node.default = false; return this.finishNode(node, "DeclareExportDeclaration"); } else if (this.match(55) || this.match(5) || this.isContextual(129) || this.isContextual(130) || this.isContextual(131)) { node = this.parseExport(node, null); if (node.type === "ExportNamedDeclaration") { node.default = false; delete node.exportKind; return this.castNodeTo(node, "DeclareExportDeclaration"); } else { return this.castNodeTo(node, "DeclareExportAllDeclaration"); } } } this.unexpected(); } flowParseDeclareModuleExports(node) { this.next(); this.expectContextual(111); node.typeAnnotation = this.flowParseTypeAnnotation(); this.semicolon(); return this.finishNode(node, "DeclareModuleExports"); } flowParseDeclareTypeAlias(node) { this.next(); const finished = this.flowParseTypeAlias(node); this.castNodeTo(finished, "DeclareTypeAlias"); return finished; } flowParseDeclareOpaqueType(node) { this.next(); const finished = this.flowParseOpaqueType(node, true); this.castNodeTo(finished, "DeclareOpaqueType"); return finished; } flowParseDeclareInterface(node) { this.next(); this.flowParseInterfaceish(node, false); return this.finishNode(node, "DeclareInterface"); } flowParseInterfaceish(node, isClass) { node.id = this.flowParseRestrictedIdentifier(!isClass, true); this.scope.declareName(node.id.name, isClass ? 17 : 8201, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { node.typeParameters = null; } node.extends = []; if (this.eat(81)) { do { node.extends.push(this.flowParseInterfaceExtends()); } while (!isClass && this.eat(12)); } if (isClass) { node.implements = []; node.mixins = []; if (this.eatContextual(117)) { do { node.mixins.push(this.flowParseInterfaceExtends()); } while (this.eat(12)); } if (this.eatContextual(113)) { do { node.implements.push(this.flowParseInterfaceExtends()); } while (this.eat(12)); } } node.body = this.flowParseObjectType({ allowStatic: isClass, allowExact: false, allowSpread: false, allowProto: isClass, allowInexact: false }); } flowParseInterfaceExtends() { const node = this.startNode(); node.id = this.flowParseQualifiedTypeIdentifier(); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterInstantiation(); } else { node.typeParameters = null; } return this.finishNode(node, "InterfaceExtends"); } flowParseInterface(node) { this.flowParseInterfaceish(node, false); return this.finishNode(node, "InterfaceDeclaration"); } checkNotUnderscore(word) { if (word === "_") { this.raise(FlowErrors.UnexpectedReservedUnderscore, this.state.startLoc); } } checkReservedType(word, startLoc, declaration) { if (!reservedTypes.has(word)) return; this.raise(declaration ? FlowErrors.AssignReservedType : FlowErrors.UnexpectedReservedType, startLoc, { reservedType: word }); } flowParseRestrictedIdentifier(liberal, declaration) { this.checkReservedType(this.state.value, this.state.startLoc, declaration); return this.parseIdentifier(liberal); } flowParseTypeAlias(node) { node.id = this.flowParseRestrictedIdentifier(false, true); this.scope.declareName(node.id.name, 8201, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { node.typeParameters = null; } node.right = this.flowParseTypeInitialiser(29); this.semicolon(); return this.finishNode(node, "TypeAlias"); } flowParseOpaqueType(node, declare) { this.expectContextual(130); node.id = this.flowParseRestrictedIdentifier(true, true); this.scope.declareName(node.id.name, 8201, node.id.loc.start); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { node.typeParameters = null; } node.supertype = null; if (this.match(14)) { node.supertype = this.flowParseTypeInitialiser(14); } node.impltype = null; if (!declare) { node.impltype = this.flowParseTypeInitialiser(29); } this.semicolon(); return this.finishNode(node, "OpaqueType"); } flowParseTypeParameter(requireDefault = false) { const nodeStartLoc = this.state.startLoc; const node = this.startNode(); const variance = this.flowParseVariance(); const ident = this.flowParseTypeAnnotatableIdentifier(); node.name = ident.name; node.variance = variance; node.bound = ident.typeAnnotation; if (this.match(29)) { this.eat(29); node.default = this.flowParseType(); } else { if (requireDefault) { this.raise(FlowErrors.MissingTypeParamDefault, nodeStartLoc); } } return this.finishNode(node, "TypeParameter"); } flowParseTypeParameterDeclaration() { const oldInType = this.state.inType; const node = this.startNode(); node.params = []; this.state.inType = true; if (this.match(47) || this.match(143)) { this.next(); } else { this.unexpected(); } let defaultRequired = false; do { const typeParameter = this.flowParseTypeParameter(defaultRequired); node.params.push(typeParameter); if (typeParameter.default) { defaultRequired = true; } if (!this.match(48)) { this.expect(12); } } while (!this.match(48)); this.expect(48); this.state.inType = oldInType; return this.finishNode(node, "TypeParameterDeclaration"); } flowInTopLevelContext(cb) { if (this.curContext() !== types.brace) { const oldContext = this.state.context; this.state.context = [oldContext[0]]; try { return cb(); } finally { this.state.context = oldContext; } } else { return cb(); } } flowParseTypeParameterInstantiationInExpression() { if (this.reScan_lt() !== 47) return; return this.flowParseTypeParameterInstantiation(); } flowParseTypeParameterInstantiation() { const node = this.startNode(); const oldInType = this.state.inType; this.state.inType = true; node.params = []; this.flowInTopLevelContext(() => { this.expect(47); const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = false; while (!this.match(48)) { node.params.push(this.flowParseType()); if (!this.match(48)) { this.expect(12); } } this.state.noAnonFunctionType = oldNoAnonFunctionType; }); this.state.inType = oldInType; if (!this.state.inType && this.curContext() === types.brace) { this.reScan_lt_gt(); } this.expect(48); return this.finishNode(node, "TypeParameterInstantiation"); } flowParseTypeParameterInstantiationCallOrNew() { if (this.reScan_lt() !== 47) return; const node = this.startNode(); const oldInType = this.state.inType; node.params = []; this.state.inType = true; this.expect(47); while (!this.match(48)) { node.params.push(this.flowParseTypeOrImplicitInstantiation()); if (!this.match(48)) { this.expect(12); } } this.expect(48); this.state.inType = oldInType; return this.finishNode(node, "TypeParameterInstantiation"); } flowParseInterfaceType() { const node = this.startNode(); this.expectContextual(129); node.extends = []; if (this.eat(81)) { do { node.extends.push(this.flowParseInterfaceExtends()); } while (this.eat(12)); } node.body = this.flowParseObjectType({ allowStatic: false, allowExact: false, allowSpread: false, allowProto: false, allowInexact: false }); return this.finishNode(node, "InterfaceTypeAnnotation"); } flowParseObjectPropertyKey() { return this.match(135) || this.match(134) ? super.parseExprAtom() : this.parseIdentifier(true); } flowParseObjectTypeIndexer(node, isStatic, variance) { node.static = isStatic; if (this.lookahead().type === 14) { node.id = this.flowParseObjectPropertyKey(); node.key = this.flowParseTypeInitialiser(); } else { node.id = null; node.key = this.flowParseType(); } this.expect(3); node.value = this.flowParseTypeInitialiser(); node.variance = variance; return this.finishNode(node, "ObjectTypeIndexer"); } flowParseObjectTypeInternalSlot(node, isStatic) { node.static = isStatic; node.id = this.flowParseObjectPropertyKey(); this.expect(3); this.expect(3); if (this.match(47) || this.match(10)) { node.method = true; node.optional = false; node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); } else { node.method = false; if (this.eat(17)) { node.optional = true; } node.value = this.flowParseTypeInitialiser(); } return this.finishNode(node, "ObjectTypeInternalSlot"); } flowParseObjectTypeMethodish(node) { node.params = []; node.rest = null; node.typeParameters = null; node.this = null; if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } this.expect(10); if (this.match(78)) { node.this = this.flowParseFunctionTypeParam(true); node.this.name = null; if (!this.match(11)) { this.expect(12); } } while (!this.match(11) && !this.match(21)) { node.params.push(this.flowParseFunctionTypeParam(false)); if (!this.match(11)) { this.expect(12); } } if (this.eat(21)) { node.rest = this.flowParseFunctionTypeParam(false); } this.expect(11); node.returnType = this.flowParseTypeInitialiser(); return this.finishNode(node, "FunctionTypeAnnotation"); } flowParseObjectTypeCallProperty(node, isStatic) { const valueNode = this.startNode(); node.static = isStatic; node.value = this.flowParseObjectTypeMethodish(valueNode); return this.finishNode(node, "ObjectTypeCallProperty"); } flowParseObjectType({ allowStatic, allowExact, allowSpread, allowProto, allowInexact }) { const oldInType = this.state.inType; this.state.inType = true; const nodeStart = this.startNode(); nodeStart.callProperties = []; nodeStart.properties = []; nodeStart.indexers = []; nodeStart.internalSlots = []; let endDelim; let exact; let inexact = false; if (allowExact && this.match(6)) { this.expect(6); endDelim = 9; exact = true; } else { this.expect(5); endDelim = 8; exact = false; } nodeStart.exact = exact; while (!this.match(endDelim)) { let isStatic = false; let protoStartLoc = null; let inexactStartLoc = null; const node = this.startNode(); if (allowProto && this.isContextual(118)) { const lookahead = this.lookahead(); if (lookahead.type !== 14 && lookahead.type !== 17) { this.next(); protoStartLoc = this.state.startLoc; allowStatic = false; } } if (allowStatic && this.isContextual(106)) { const lookahead = this.lookahead(); if (lookahead.type !== 14 && lookahead.type !== 17) { this.next(); isStatic = true; } } const variance = this.flowParseVariance(); if (this.eat(0)) { if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (this.eat(0)) { if (variance) { this.unexpected(variance.loc.start); } nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic)); } else { nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance)); } } else if (this.match(10) || this.match(47)) { if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (variance) { this.unexpected(variance.loc.start); } nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic)); } else { let kind = "init"; if (this.isContextual(99) || this.isContextual(104)) { const lookahead = this.lookahead(); if (tokenIsLiteralPropertyName(lookahead.type)) { kind = this.state.value; this.next(); } } const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact); if (propOrInexact === null) { inexact = true; inexactStartLoc = this.state.lastTokStartLoc; } else { nodeStart.properties.push(propOrInexact); } } this.flowObjectTypeSemicolon(); if (inexactStartLoc && !this.match(8) && !this.match(9)) { this.raise(FlowErrors.UnexpectedExplicitInexactInObject, inexactStartLoc); } } this.expect(endDelim); if (allowSpread) { nodeStart.inexact = inexact; } const out = this.finishNode(nodeStart, "ObjectTypeAnnotation"); this.state.inType = oldInType; return out; } flowParseObjectTypeProperty(node, isStatic, protoStartLoc, variance, kind, allowSpread, allowInexact) { if (this.eat(21)) { const isInexactToken = this.match(12) || this.match(13) || this.match(8) || this.match(9); if (isInexactToken) { if (!allowSpread) { this.raise(FlowErrors.InexactInsideNonObject, this.state.lastTokStartLoc); } else if (!allowInexact) { this.raise(FlowErrors.InexactInsideExact, this.state.lastTokStartLoc); } if (variance) { this.raise(FlowErrors.InexactVariance, variance); } return null; } if (!allowSpread) { this.raise(FlowErrors.UnexpectedSpreadType, this.state.lastTokStartLoc); } if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (variance) { this.raise(FlowErrors.SpreadVariance, variance); } node.argument = this.flowParseType(); return this.finishNode(node, "ObjectTypeSpreadProperty"); } else { node.key = this.flowParseObjectPropertyKey(); node.static = isStatic; node.proto = protoStartLoc != null; node.kind = kind; let optional = false; if (this.match(47) || this.match(10)) { node.method = true; if (protoStartLoc != null) { this.unexpected(protoStartLoc); } if (variance) { this.unexpected(variance.loc.start); } node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.loc.start)); if (kind === "get" || kind === "set") { this.flowCheckGetterSetterParams(node); } if (!allowSpread && node.key.name === "constructor" && node.value.this) { this.raise(FlowErrors.ThisParamBannedInConstructor, node.value.this); } } else { if (kind !== "init") this.unexpected(); node.method = false; if (this.eat(17)) { optional = true; } node.value = this.flowParseTypeInitialiser(); node.variance = variance; } node.optional = optional; return this.finishNode(node, "ObjectTypeProperty"); } } flowCheckGetterSetterParams(property) { const paramCount = property.kind === "get" ? 0 : 1; const length = property.value.params.length + (property.value.rest ? 1 : 0); if (property.value.this) { this.raise(property.kind === "get" ? FlowErrors.GetterMayNotHaveThisParam : FlowErrors.SetterMayNotHaveThisParam, property.value.this); } if (length !== paramCount) { this.raise(property.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, property); } if (property.kind === "set" && property.value.rest) { this.raise(Errors.BadSetterRestParameter, property); } } flowObjectTypeSemicolon() { if (!this.eat(13) && !this.eat(12) && !this.match(8) && !this.match(9)) { this.unexpected(); } } flowParseQualifiedTypeIdentifier(startLoc, id) { startLoc != null ? startLoc : startLoc = this.state.startLoc; let node = id || this.flowParseRestrictedIdentifier(true); while (this.eat(16)) { const node2 = this.startNodeAt(startLoc); node2.qualification = node; node2.id = this.flowParseRestrictedIdentifier(true); node = this.finishNode(node2, "QualifiedTypeIdentifier"); } return node; } flowParseGenericType(startLoc, id) { const node = this.startNodeAt(startLoc); node.typeParameters = null; node.id = this.flowParseQualifiedTypeIdentifier(startLoc, id); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterInstantiation(); } return this.finishNode(node, "GenericTypeAnnotation"); } flowParseTypeofType() { const node = this.startNode(); this.expect(87); node.argument = this.flowParsePrimaryType(); return this.finishNode(node, "TypeofTypeAnnotation"); } flowParseTupleType() { const node = this.startNode(); node.types = []; this.expect(0); while (this.state.pos < this.length && !this.match(3)) { node.types.push(this.flowParseType()); if (this.match(3)) break; this.expect(12); } this.expect(3); return this.finishNode(node, "TupleTypeAnnotation"); } flowParseFunctionTypeParam(first) { let name = null; let optional = false; let typeAnnotation = null; const node = this.startNode(); const lh = this.lookahead(); const isThis = this.state.type === 78; if (lh.type === 14 || lh.type === 17) { if (isThis && !first) { this.raise(FlowErrors.ThisParamMustBeFirst, node); } name = this.parseIdentifier(isThis); if (this.eat(17)) { optional = true; if (isThis) { this.raise(FlowErrors.ThisParamMayNotBeOptional, node); } } typeAnnotation = this.flowParseTypeInitialiser(); } else { typeAnnotation = this.flowParseType(); } node.name = name; node.optional = optional; node.typeAnnotation = typeAnnotation; return this.finishNode(node, "FunctionTypeParam"); } reinterpretTypeAsFunctionTypeParam(type) { const node = this.startNodeAt(type.loc.start); node.name = null; node.optional = false; node.typeAnnotation = type; return this.finishNode(node, "FunctionTypeParam"); } flowParseFunctionTypeParams(params = []) { let rest = null; let _this = null; if (this.match(78)) { _this = this.flowParseFunctionTypeParam(true); _this.name = null; if (!this.match(11)) { this.expect(12); } } while (!this.match(11) && !this.match(21)) { params.push(this.flowParseFunctionTypeParam(false)); if (!this.match(11)) { this.expect(12); } } if (this.eat(21)) { rest = this.flowParseFunctionTypeParam(false); } return { params, rest, _this }; } flowIdentToTypeAnnotation(startLoc, node, id) { switch (id.name) { case "any": return this.finishNode(node, "AnyTypeAnnotation"); case "bool": case "boolean": return this.finishNode(node, "BooleanTypeAnnotation"); case "mixed": return this.finishNode(node, "MixedTypeAnnotation"); case "empty": return this.finishNode(node, "EmptyTypeAnnotation"); case "number": return this.finishNode(node, "NumberTypeAnnotation"); case "string": return this.finishNode(node, "StringTypeAnnotation"); case "symbol": return this.finishNode(node, "SymbolTypeAnnotation"); default: this.checkNotUnderscore(id.name); return this.flowParseGenericType(startLoc, id); } } flowParsePrimaryType() { const startLoc = this.state.startLoc; const node = this.startNode(); let tmp; let type; let isGroupedType = false; const oldNoAnonFunctionType = this.state.noAnonFunctionType; switch (this.state.type) { case 5: return this.flowParseObjectType({ allowStatic: false, allowExact: false, allowSpread: true, allowProto: false, allowInexact: true }); case 6: return this.flowParseObjectType({ allowStatic: false, allowExact: true, allowSpread: true, allowProto: false, allowInexact: false }); case 0: this.state.noAnonFunctionType = false; type = this.flowParseTupleType(); this.state.noAnonFunctionType = oldNoAnonFunctionType; return type; case 47: { const node = this.startNode(); node.typeParameters = this.flowParseTypeParameterDeclaration(); this.expect(10); tmp = this.flowParseFunctionTypeParams(); node.params = tmp.params; node.rest = tmp.rest; node.this = tmp._this; this.expect(11); this.expect(19); node.returnType = this.flowParseType(); return this.finishNode(node, "FunctionTypeAnnotation"); } case 10: { const node = this.startNode(); this.next(); if (!this.match(11) && !this.match(21)) { if (tokenIsIdentifier(this.state.type) || this.match(78)) { const token = this.lookahead().type; isGroupedType = token !== 17 && token !== 14; } else { isGroupedType = true; } } if (isGroupedType) { this.state.noAnonFunctionType = false; type = this.flowParseType(); this.state.noAnonFunctionType = oldNoAnonFunctionType; if (this.state.noAnonFunctionType || !(this.match(12) || this.match(11) && this.lookahead().type === 19)) { this.expect(11); return type; } else { this.eat(12); } } if (type) { tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]); } else { tmp = this.flowParseFunctionTypeParams(); } node.params = tmp.params; node.rest = tmp.rest; node.this = tmp._this; this.expect(11); this.expect(19); node.returnType = this.flowParseType(); node.typeParameters = null; return this.finishNode(node, "FunctionTypeAnnotation"); } case 134: return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation"); case 85: case 86: node.value = this.match(85); this.next(); return this.finishNode(node, "BooleanLiteralTypeAnnotation"); case 53: if (this.state.value === "-") { this.next(); if (this.match(135)) { return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node); } if (this.match(136)) { return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node); } throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc); } this.unexpected(); return; case 135: return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation"); case 136: return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation"); case 88: this.next(); return this.finishNode(node, "VoidTypeAnnotation"); case 84: this.next(); return this.finishNode(node, "NullLiteralTypeAnnotation"); case 78: this.next(); return this.finishNode(node, "ThisTypeAnnotation"); case 55: this.next(); return this.finishNode(node, "ExistsTypeAnnotation"); case 87: return this.flowParseTypeofType(); default: if (tokenIsKeyword(this.state.type)) { const label = tokenLabelName(this.state.type); this.next(); return super.createIdentifier(node, label); } else if (tokenIsIdentifier(this.state.type)) { if (this.isContextual(129)) { return this.flowParseInterfaceType(); } return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier()); } } this.unexpected(); } flowParsePostfixType() { const startLoc = this.state.startLoc; let type = this.flowParsePrimaryType(); let seenOptionalIndexedAccess = false; while ((this.match(0) || this.match(18)) && !this.canInsertSemicolon()) { const node = this.startNodeAt(startLoc); const optional = this.eat(18); seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional; this.expect(0); if (!optional && this.match(3)) { node.elementType = type; this.next(); type = this.finishNode(node, "ArrayTypeAnnotation"); } else { node.objectType = type; node.indexType = this.flowParseType(); this.expect(3); if (seenOptionalIndexedAccess) { node.optional = optional; type = this.finishNode(node, "OptionalIndexedAccessType"); } else { type = this.finishNode(node, "IndexedAccessType"); } } } return type; } flowParsePrefixType() { const node = this.startNode(); if (this.eat(17)) { node.typeAnnotation = this.flowParsePrefixType(); return this.finishNode(node, "NullableTypeAnnotation"); } else { return this.flowParsePostfixType(); } } flowParseAnonFunctionWithoutParens() { const param = this.flowParsePrefixType(); if (!this.state.noAnonFunctionType && this.eat(19)) { const node = this.startNodeAt(param.loc.start); node.params = [this.reinterpretTypeAsFunctionTypeParam(param)]; node.rest = null; node.this = null; node.returnType = this.flowParseType(); node.typeParameters = null; return this.finishNode(node, "FunctionTypeAnnotation"); } return param; } flowParseIntersectionType() { const node = this.startNode(); this.eat(45); const type = this.flowParseAnonFunctionWithoutParens(); node.types = [type]; while (this.eat(45)) { node.types.push(this.flowParseAnonFunctionWithoutParens()); } return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); } flowParseUnionType() { const node = this.startNode(); this.eat(43); const type = this.flowParseIntersectionType(); node.types = [type]; while (this.eat(43)) { node.types.push(this.flowParseIntersectionType()); } return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); } flowParseType() { const oldInType = this.state.inType; this.state.inType = true; const type = this.flowParseUnionType(); this.state.inType = oldInType; return type; } flowParseTypeOrImplicitInstantiation() { if (this.state.type === 132 && this.state.value === "_") { const startLoc = this.state.startLoc; const node = this.parseIdentifier(); return this.flowParseGenericType(startLoc, node); } else { return this.flowParseType(); } } flowParseTypeAnnotation() { const node = this.startNode(); node.typeAnnotation = this.flowParseTypeInitialiser(); return this.finishNode(node, "TypeAnnotation"); } flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) { const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier(); if (this.match(14)) { ident.typeAnnotation = this.flowParseTypeAnnotation(); this.resetEndLocation(ident); } return ident; } typeCastToParameter(node) { node.expression.typeAnnotation = node.typeAnnotation; this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); return node.expression; } flowParseVariance() { let variance = null; if (this.match(53)) { variance = this.startNode(); if (this.state.value === "+") { variance.kind = "plus"; } else { variance.kind = "minus"; } this.next(); return this.finishNode(variance, "Variance"); } return variance; } parseFunctionBody(node, allowExpressionBody, isMethod = false) { if (allowExpressionBody) { this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod)); return; } super.parseFunctionBody(node, false, isMethod); } parseFunctionBodyAndFinish(node, type, isMethod = false) { if (this.match(14)) { const typeNode = this.startNode(); [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null; } return super.parseFunctionBodyAndFinish(node, type, isMethod); } parseStatementLike(flags) { if (this.state.strict && this.isContextual(129)) { const lookahead = this.lookahead(); if (tokenIsKeywordOrIdentifier(lookahead.type)) { const node = this.startNode(); this.next(); return this.flowParseInterface(node); } } else if (this.isContextual(126)) { const node = this.startNode(); this.next(); return this.flowParseEnumDeclaration(node); } const stmt = super.parseStatementLike(flags); if (this.flowPragma === undefined && !this.isValidDirective(stmt)) { this.flowPragma = null; } return stmt; } parseExpressionStatement(node, expr, decorators) { if (expr.type === "Identifier") { if (expr.name === "declare") { if (this.match(80) || tokenIsIdentifier(this.state.type) || this.match(68) || this.match(74) || this.match(82)) { return this.flowParseDeclare(node); } } else if (tokenIsIdentifier(this.state.type)) { if (expr.name === "interface") { return this.flowParseInterface(node); } else if (expr.name === "type") { return this.flowParseTypeAlias(node); } else if (expr.name === "opaque") { return this.flowParseOpaqueType(node, false); } } } return super.parseExpressionStatement(node, expr, decorators); } shouldParseExportDeclaration() { const { type } = this.state; if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) { return !this.state.containsEsc; } return super.shouldParseExportDeclaration(); } isExportDefaultSpecifier() { const { type } = this.state; if (type === 126 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) { return this.state.containsEsc; } return super.isExportDefaultSpecifier(); } parseExportDefaultExpression() { if (this.isContextual(126)) { const node = this.startNode(); this.next(); return this.flowParseEnumDeclaration(node); } return super.parseExportDefaultExpression(); } parseConditional(expr, startLoc, refExpressionErrors) { if (!this.match(17)) return expr; if (this.state.maybeInArrowParameters) { const nextCh = this.lookaheadCharCode(); if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) { this.setOptionalParametersError(refExpressionErrors); return expr; } } this.expect(17); const state = this.state.clone(); const originalNoArrowAt = this.state.noArrowAt; const node = this.startNodeAt(startLoc); let { consequent, failed } = this.tryParseConditionalConsequent(); let [valid, invalid] = this.getArrowLikeExpressions(consequent); if (failed || invalid.length > 0) { const noArrowAt = [...originalNoArrowAt]; if (invalid.length > 0) { this.state = state; this.state.noArrowAt = noArrowAt; for (let i = 0; i < invalid.length; i++) { noArrowAt.push(invalid[i].start); } ({ consequent, failed } = this.tryParseConditionalConsequent()); [valid, invalid] = this.getArrowLikeExpressions(consequent); } if (failed && valid.length > 1) { this.raise(FlowErrors.AmbiguousConditionalArrow, state.startLoc); } if (failed && valid.length === 1) { this.state = state; noArrowAt.push(valid[0].start); this.state.noArrowAt = noArrowAt; ({ consequent, failed } = this.tryParseConditionalConsequent()); } } this.getArrowLikeExpressions(consequent, true); this.state.noArrowAt = originalNoArrowAt; this.expect(14); node.test = expr; node.consequent = consequent; node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(undefined, undefined)); return this.finishNode(node, "ConditionalExpression"); } tryParseConditionalConsequent() { this.state.noArrowParamsConversionAt.push(this.state.start); const consequent = this.parseMaybeAssignAllowIn(); const failed = !this.match(14); this.state.noArrowParamsConversionAt.pop(); return { consequent, failed }; } getArrowLikeExpressions(node, disallowInvalid) { const stack = [node]; const arrows = []; while (stack.length !== 0) { const node = stack.pop(); if (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") { if (node.typeParameters || !node.returnType) { this.finishArrowValidation(node); } else { arrows.push(node); } stack.push(node.body); } else if (node.type === "ConditionalExpression") { stack.push(node.consequent); stack.push(node.alternate); } } if (disallowInvalid) { arrows.forEach(node => this.finishArrowValidation(node)); return [arrows, []]; } return partition(arrows, node => node.params.every(param => this.isAssignable(param, true))); } finishArrowValidation(node) { var _node$extra; this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingCommaLoc, false); this.scope.enter(514 | 4); super.checkParams(node, false, true); this.scope.exit(); } forwardNoArrowParamsConversionAt(node, parse) { let result; if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { this.state.noArrowParamsConversionAt.push(this.state.start); result = parse(); this.state.noArrowParamsConversionAt.pop(); } else { result = parse(); } return result; } parseParenItem(node, startLoc) { const newNode = super.parseParenItem(node, startLoc); if (this.eat(17)) { newNode.optional = true; this.resetEndLocation(node); } if (this.match(14)) { const typeCastNode = this.startNodeAt(startLoc); typeCastNode.expression = newNode; typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); return this.finishNode(typeCastNode, "TypeCastExpression"); } return newNode; } assertModuleNodeAllowed(node) { if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") { return; } super.assertModuleNodeAllowed(node); } parseExportDeclaration(node) { if (this.isContextual(130)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); if (this.match(5)) { node.specifiers = this.parseExportSpecifiers(true); super.parseExportFrom(node); return null; } else { return this.flowParseTypeAlias(declarationNode); } } else if (this.isContextual(131)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); return this.flowParseOpaqueType(declarationNode, false); } else if (this.isContextual(129)) { node.exportKind = "type"; const declarationNode = this.startNode(); this.next(); return this.flowParseInterface(declarationNode); } else if (this.isContextual(126)) { node.exportKind = "value"; const declarationNode = this.startNode(); this.next(); return this.flowParseEnumDeclaration(declarationNode); } else { return super.parseExportDeclaration(node); } } eatExportStar(node) { if (super.eatExportStar(node)) return true; if (this.isContextual(130) && this.lookahead().type === 55) { node.exportKind = "type"; this.next(); this.next(); return true; } return false; } maybeParseExportNamespaceSpecifier(node) { const { startLoc } = this.state; const hasNamespace = super.maybeParseExportNamespaceSpecifier(node); if (hasNamespace && node.exportKind === "type") { this.unexpected(startLoc); } return hasNamespace; } parseClassId(node, isStatement, optionalId) { super.parseClassId(node, isStatement, optionalId); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } } parseClassMember(classBody, member, state) { const { startLoc } = this.state; if (this.isContextual(125)) { if (super.parseClassMemberFromModifier(classBody, member)) { return; } member.declare = true; } super.parseClassMember(classBody, member, state); if (member.declare) { if (member.type !== "ClassProperty" && member.type !== "ClassPrivateProperty" && member.type !== "PropertyDefinition") { this.raise(FlowErrors.DeclareClassElement, startLoc); } else if (member.value) { this.raise(FlowErrors.DeclareClassFieldInitializer, member.value); } } } isIterator(word) { return word === "iterator" || word === "asyncIterator"; } readIterator() { const word = super.readWord1(); const fullWord = "@@" + word; if (!this.isIterator(word) || !this.state.inType) { this.raise(Errors.InvalidIdentifier, this.state.curPosition(), { identifierName: fullWord }); } this.finishToken(132, fullWord); } getTokenFromCode(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (code === 123 && next === 124) { this.finishOp(6, 2); } else if (this.state.inType && (code === 62 || code === 60)) { this.finishOp(code === 62 ? 48 : 47, 1); } else if (this.state.inType && code === 63) { if (next === 46) { this.finishOp(18, 2); } else { this.finishOp(17, 1); } } else if (isIteratorStart(code, next, this.input.charCodeAt(this.state.pos + 2))) { this.state.pos += 2; this.readIterator(); } else { super.getTokenFromCode(code); } } isAssignable(node, isBinding) { if (node.type === "TypeCastExpression") { return this.isAssignable(node.expression, isBinding); } else { return super.isAssignable(node, isBinding); } } toAssignable(node, isLHS = false) { if (!isLHS && node.type === "AssignmentExpression" && node.left.type === "TypeCastExpression") { node.left = this.typeCastToParameter(node.left); } super.toAssignable(node, isLHS); } toAssignableList(exprList, trailingCommaLoc, isLHS) { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; if ((expr == null ? void 0 : expr.type) === "TypeCastExpression") { exprList[i] = this.typeCastToParameter(expr); } } super.toAssignableList(exprList, trailingCommaLoc, isLHS); } toReferencedList(exprList, isParenthesizedExpr) { for (let i = 0; i < exprList.length; i++) { var _expr$extra; const expr = exprList[i]; if (expr && expr.type === "TypeCastExpression" && !((_expr$extra = expr.extra) != null && _expr$extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) { this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation); } } return exprList; } parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); if (canBePattern && !this.state.maybeInArrowParameters) { this.toReferencedList(node.elements); } return node; } isValidLVal(type, isParenthesized, binding) { return type === "TypeCastExpression" || super.isValidLVal(type, isParenthesized, binding); } parseClassProperty(node) { if (this.match(14)) { node.typeAnnotation = this.flowParseTypeAnnotation(); } return super.parseClassProperty(node); } parseClassPrivateProperty(node) { if (this.match(14)) { node.typeAnnotation = this.flowParseTypeAnnotation(); } return super.parseClassPrivateProperty(node); } isClassMethod() { return this.match(47) || super.isClassMethod(); } isClassProperty() { return this.match(14) || super.isClassProperty(); } isNonstaticConstructor(method) { return !this.match(14) && super.isNonstaticConstructor(method); } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { if (method.variance) { this.unexpected(method.variance.loc.start); } delete method.variance; if (this.match(47)) { method.typeParameters = this.flowParseTypeParameterDeclaration(); } super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); if (method.params && isConstructor) { const params = method.params; if (params.length > 0 && this.isThisParam(params[0])) { this.raise(FlowErrors.ThisParamBannedInConstructor, method); } } else if (method.type === "MethodDefinition" && isConstructor && method.value.params) { const params = method.value.params; if (params.length > 0 && this.isThisParam(params[0])) { this.raise(FlowErrors.ThisParamBannedInConstructor, method); } } } pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { if (method.variance) { this.unexpected(method.variance.loc.start); } delete method.variance; if (this.match(47)) { method.typeParameters = this.flowParseTypeParameterDeclaration(); } super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); } parseClassSuper(node) { super.parseClassSuper(node); if (node.superClass && (this.match(47) || this.match(51))) { { node.superTypeParameters = this.flowParseTypeParameterInstantiationInExpression(); } } if (this.isContextual(113)) { this.next(); const implemented = node.implements = []; do { const node = this.startNode(); node.id = this.flowParseRestrictedIdentifier(true); if (this.match(47)) { node.typeParameters = this.flowParseTypeParameterInstantiation(); } else { node.typeParameters = null; } implemented.push(this.finishNode(node, "ClassImplements")); } while (this.eat(12)); } } checkGetterSetterParams(method) { super.checkGetterSetterParams(method); const params = this.getObjectOrClassMethodParams(method); if (params.length > 0) { const param = params[0]; if (this.isThisParam(param) && method.kind === "get") { this.raise(FlowErrors.GetterMayNotHaveThisParam, param); } else if (this.isThisParam(param)) { this.raise(FlowErrors.SetterMayNotHaveThisParam, param); } } } parsePropertyNamePrefixOperator(node) { node.variance = this.flowParseVariance(); } parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { if (prop.variance) { this.unexpected(prop.variance.loc.start); } delete prop.variance; let typeParameters; if (this.match(47) && !isAccessor) { typeParameters = this.flowParseTypeParameterDeclaration(); if (!this.match(10)) this.unexpected(); } const result = super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); if (typeParameters) { (result.value || result).typeParameters = typeParameters; } return result; } parseFunctionParamType(param) { if (this.eat(17)) { if (param.type !== "Identifier") { this.raise(FlowErrors.PatternIsOptional, param); } if (this.isThisParam(param)) { this.raise(FlowErrors.ThisParamMayNotBeOptional, param); } param.optional = true; } if (this.match(14)) { param.typeAnnotation = this.flowParseTypeAnnotation(); } else if (this.isThisParam(param)) { this.raise(FlowErrors.ThisParamAnnotationRequired, param); } if (this.match(29) && this.isThisParam(param)) { this.raise(FlowErrors.ThisParamNoDefault, param); } this.resetEndLocation(param); return param; } parseMaybeDefault(startLoc, left) { const node = super.parseMaybeDefault(startLoc, left); if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { this.raise(FlowErrors.TypeBeforeInitializer, node.typeAnnotation); } return node; } checkImportReflection(node) { super.checkImportReflection(node); if (node.module && node.importKind !== "value") { this.raise(FlowErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start); } } parseImportSpecifierLocal(node, specifier, type) { specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier(); node.specifiers.push(this.finishImportSpecifier(specifier, type)); } isPotentialImportPhase(isExport) { if (super.isPotentialImportPhase(isExport)) return true; if (this.isContextual(130)) { if (!isExport) return true; const ch = this.lookaheadCharCode(); return ch === 123 || ch === 42; } return !isExport && this.isContextual(87); } applyImportPhase(node, isExport, phase, loc) { super.applyImportPhase(node, isExport, phase, loc); if (isExport) { if (!phase && this.match(65)) { return; } node.exportKind = phase === "type" ? phase : "value"; } else { if (phase === "type" && this.match(55)) this.unexpected(); node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; } } parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { const firstIdent = specifier.imported; let specifierTypeKind = null; if (firstIdent.type === "Identifier") { if (firstIdent.name === "type") { specifierTypeKind = "type"; } else if (firstIdent.name === "typeof") { specifierTypeKind = "typeof"; } } let isBinding = false; if (this.isContextual(93) && !this.isLookaheadContextual("as")) { const as_ident = this.parseIdentifier(true); if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) { specifier.imported = as_ident; specifier.importKind = specifierTypeKind; specifier.local = this.cloneIdentifier(as_ident); } else { specifier.imported = firstIdent; specifier.importKind = null; specifier.local = this.parseIdentifier(); } } else { if (specifierTypeKind !== null && tokenIsKeywordOrIdentifier(this.state.type)) { specifier.imported = this.parseIdentifier(true); specifier.importKind = specifierTypeKind; } else { if (importedIsString) { throw this.raise(Errors.ImportBindingIsString, specifier, { importName: firstIdent.value }); } specifier.imported = firstIdent; specifier.importKind = null; } if (this.eatContextual(93)) { specifier.local = this.parseIdentifier(); } else { isBinding = true; specifier.local = this.cloneIdentifier(specifier.imported); } } const specifierIsTypeImport = hasTypeImportKind(specifier); if (isInTypeOnlyImport && specifierIsTypeImport) { this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier); } if (isInTypeOnlyImport || specifierIsTypeImport) { this.checkReservedType(specifier.local.name, specifier.local.loc.start, true); } if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) { this.checkReservedWord(specifier.local.name, specifier.loc.start, true, true); } return this.finishImportSpecifier(specifier, "ImportSpecifier"); } parseBindingAtom() { switch (this.state.type) { case 78: return this.parseIdentifier(true); default: return super.parseBindingAtom(); } } parseFunctionParams(node, isConstructor) { const kind = node.kind; if (kind !== "get" && kind !== "set" && this.match(47)) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } super.parseFunctionParams(node, isConstructor); } parseVarId(decl, kind) { super.parseVarId(decl, kind); if (this.match(14)) { decl.id.typeAnnotation = this.flowParseTypeAnnotation(); this.resetEndLocation(decl.id); } } parseAsyncArrowFromCallExpression(node, call) { if (this.match(14)) { const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = true; node.returnType = this.flowParseTypeAnnotation(); this.state.noAnonFunctionType = oldNoAnonFunctionType; } return super.parseAsyncArrowFromCallExpression(node, call); } shouldParseAsyncArrow() { return this.match(14) || super.shouldParseAsyncArrow(); } parseMaybeAssign(refExpressionErrors, afterLeftParse) { var _jsx; let state = null; let jsx; if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) { state = this.state.clone(); jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); if (!jsx.error) return jsx.node; const { context } = this.state; const currentContext = context[context.length - 1]; if (currentContext === types.j_oTag || currentContext === types.j_expr) { context.pop(); } } if ((_jsx = jsx) != null && _jsx.error || this.match(47)) { var _jsx2, _jsx3; state = state || this.state.clone(); let typeParameters; const arrow = this.tryParse(abort => { var _arrowExpression$extr; typeParameters = this.flowParseTypeParameterDeclaration(); const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => { const result = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); this.resetStartLocationFromNode(result, typeParameters); return result; }); if ((_arrowExpression$extr = arrowExpression.extra) != null && _arrowExpression$extr.parenthesized) abort(); const expr = this.maybeUnwrapTypeCastExpression(arrowExpression); if (expr.type !== "ArrowFunctionExpression") abort(); expr.typeParameters = typeParameters; this.resetStartLocationFromNode(expr, typeParameters); return arrowExpression; }, state); let arrowExpression = null; if (arrow.node && this.maybeUnwrapTypeCastExpression(arrow.node).type === "ArrowFunctionExpression") { if (!arrow.error && !arrow.aborted) { if (arrow.node.async) { this.raise(FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction, typeParameters); } return arrow.node; } arrowExpression = arrow.node; } if ((_jsx2 = jsx) != null && _jsx2.node) { this.state = jsx.failState; return jsx.node; } if (arrowExpression) { this.state = arrow.failState; return arrowExpression; } if ((_jsx3 = jsx) != null && _jsx3.thrown) throw jsx.error; if (arrow.thrown) throw arrow.error; throw this.raise(FlowErrors.UnexpectedTokenAfterTypeParameter, typeParameters); } return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); } parseArrow(node) { if (this.match(14)) { const result = this.tryParse(() => { const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = true; const typeNode = this.startNode(); [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser(); this.state.noAnonFunctionType = oldNoAnonFunctionType; if (this.canInsertSemicolon()) this.unexpected(); if (!this.match(19)) this.unexpected(); return typeNode; }); if (result.thrown) return null; if (result.error) this.state = result.failState; node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null; } return super.parseArrow(node); } shouldParseArrow(params) { return this.match(14) || super.shouldParseArrow(params); } setArrowFunctionParameters(node, params) { if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { node.params = params; } else { super.setArrowFunctionParameters(node, params); } } checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { if (isArrowFunction && this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) { return; } for (let i = 0; i < node.params.length; i++) { if (this.isThisParam(node.params[i]) && i > 0) { this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]); } } super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged); } parseParenAndDistinguishExpression(canBeArrow) { return super.parseParenAndDistinguishExpression(canBeArrow && !this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start))); } parseSubscripts(base, startLoc, noCalls) { if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.includes(startLoc.index)) { this.next(); const node = this.startNodeAt(startLoc); node.callee = base; node.arguments = super.parseCallExpressionArguments(); base = this.finishNode(node, "CallExpression"); } else if (base.type === "Identifier" && base.name === "async" && this.match(47)) { const state = this.state.clone(); const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(), state); if (!arrow.error && !arrow.aborted) return arrow.node; const result = this.tryParse(() => super.parseSubscripts(base, startLoc, noCalls), state); if (result.node && !result.error) return result.node; if (arrow.node) { this.state = arrow.failState; return arrow.node; } if (result.node) { this.state = result.failState; return result.node; } throw arrow.error || result.error; } return super.parseSubscripts(base, startLoc, noCalls); } parseSubscript(base, startLoc, noCalls, subscriptState) { if (this.match(18) && this.isLookaheadToken_lt()) { subscriptState.optionalChainMember = true; if (noCalls) { subscriptState.stop = true; return base; } this.next(); const node = this.startNodeAt(startLoc); node.callee = base; node.typeArguments = this.flowParseTypeParameterInstantiationInExpression(); this.expect(10); node.arguments = this.parseCallExpressionArguments(); node.optional = true; return this.finishCallExpression(node, true); } else if (!noCalls && this.shouldParseTypes() && (this.match(47) || this.match(51))) { const node = this.startNodeAt(startLoc); node.callee = base; const result = this.tryParse(() => { node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); this.expect(10); node.arguments = super.parseCallExpressionArguments(); if (subscriptState.optionalChainMember) { node.optional = false; } return this.finishCallExpression(node, subscriptState.optionalChainMember); }); if (result.node) { if (result.error) this.state = result.failState; return result.node; } } return super.parseSubscript(base, startLoc, noCalls, subscriptState); } parseNewCallee(node) { super.parseNewCallee(node); let targs = null; if (this.shouldParseTypes() && this.match(47)) { targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node; } node.typeArguments = targs; } parseAsyncArrowWithTypeParameters(startLoc) { const node = this.startNodeAt(startLoc); this.parseFunctionParams(node, false); if (!this.parseArrow(node)) return; return super.parseArrowExpression(node, undefined, true); } readToken_mult_modulo(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (code === 42 && next === 47 && this.state.hasFlowComment) { this.state.hasFlowComment = false; this.state.pos += 2; this.nextToken(); return; } super.readToken_mult_modulo(code); } readToken_pipe_amp(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (code === 124 && next === 125) { this.finishOp(9, 2); return; } super.readToken_pipe_amp(code); } parseTopLevel(file, program) { const fileNode = super.parseTopLevel(file, program); if (this.state.hasFlowComment) { this.raise(FlowErrors.UnterminatedFlowComment, this.state.curPosition()); } return fileNode; } skipBlockComment() { if (this.hasPlugin("flowComments") && this.skipFlowComment()) { if (this.state.hasFlowComment) { throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc); } this.hasFlowCommentCompletion(); const commentSkip = this.skipFlowComment(); if (commentSkip) { this.state.pos += commentSkip; this.state.hasFlowComment = true; } return; } return super.skipBlockComment(this.state.hasFlowComment ? "*-/" : "*/"); } skipFlowComment() { const { pos } = this.state; let shiftToFirstNonWhiteSpace = 2; while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) { shiftToFirstNonWhiteSpace++; } const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos); const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1); if (ch2 === 58 && ch3 === 58) { return shiftToFirstNonWhiteSpace + 2; } if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") { return shiftToFirstNonWhiteSpace + 12; } if (ch2 === 58 && ch3 !== 58) { return shiftToFirstNonWhiteSpace; } return false; } hasFlowCommentCompletion() { const end = this.input.indexOf("*/", this.state.pos); if (end === -1) { throw this.raise(Errors.UnterminatedComment, this.state.curPosition()); } } flowEnumErrorBooleanMemberNotInitialized(loc, { enumName, memberName }) { this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, { memberName, enumName }); } flowEnumErrorInvalidMemberInitializer(loc, enumContext) { return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, loc, enumContext); } flowEnumErrorNumberMemberNotInitialized(loc, details) { this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details); } flowEnumErrorStringMemberInconsistentlyInitialized(node, details) { this.raise(FlowErrors.EnumStringMemberInconsistentlyInitialized, node, details); } flowEnumMemberInit() { const startLoc = this.state.startLoc; const endOfInit = () => this.match(12) || this.match(8); switch (this.state.type) { case 135: { const literal = this.parseNumericLiteral(this.state.value); if (endOfInit()) { return { type: "number", loc: literal.loc.start, value: literal }; } return { type: "invalid", loc: startLoc }; } case 134: { const literal = this.parseStringLiteral(this.state.value); if (endOfInit()) { return { type: "string", loc: literal.loc.start, value: literal }; } return { type: "invalid", loc: startLoc }; } case 85: case 86: { const literal = this.parseBooleanLiteral(this.match(85)); if (endOfInit()) { return { type: "boolean", loc: literal.loc.start, value: literal }; } return { type: "invalid", loc: startLoc }; } default: return { type: "invalid", loc: startLoc }; } } flowEnumMemberRaw() { const loc = this.state.startLoc; const id = this.parseIdentifier(true); const init = this.eat(29) ? this.flowEnumMemberInit() : { type: "none", loc }; return { id, init }; } flowEnumCheckExplicitTypeMismatch(loc, context, expectedType) { const { explicitType } = context; if (explicitType === null) { return; } if (explicitType !== expectedType) { this.flowEnumErrorInvalidMemberInitializer(loc, context); } } flowEnumMembers({ enumName, explicitType }) { const seenNames = new Set(); const members = { booleanMembers: [], numberMembers: [], stringMembers: [], defaultedMembers: [] }; let hasUnknownMembers = false; while (!this.match(8)) { if (this.eat(21)) { hasUnknownMembers = true; break; } const memberNode = this.startNode(); const { id, init } = this.flowEnumMemberRaw(); const memberName = id.name; if (memberName === "") { continue; } if (/^[a-z]/.test(memberName)) { this.raise(FlowErrors.EnumInvalidMemberName, id, { memberName, suggestion: memberName[0].toUpperCase() + memberName.slice(1), enumName }); } if (seenNames.has(memberName)) { this.raise(FlowErrors.EnumDuplicateMemberName, id, { memberName, enumName }); } seenNames.add(memberName); const context = { enumName, explicitType, memberName }; memberNode.id = id; switch (init.type) { case "boolean": { this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "boolean"); memberNode.init = init.value; members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember")); break; } case "number": { this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "number"); memberNode.init = init.value; members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember")); break; } case "string": { this.flowEnumCheckExplicitTypeMismatch(init.loc, context, "string"); memberNode.init = init.value; members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember")); break; } case "invalid": { throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context); } case "none": { switch (explicitType) { case "boolean": this.flowEnumErrorBooleanMemberNotInitialized(init.loc, context); break; case "number": this.flowEnumErrorNumberMemberNotInitialized(init.loc, context); break; default: members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember")); } } } if (!this.match(8)) { this.expect(12); } } return { members, hasUnknownMembers }; } flowEnumStringMembers(initializedMembers, defaultedMembers, { enumName }) { if (initializedMembers.length === 0) { return defaultedMembers; } else if (defaultedMembers.length === 0) { return initializedMembers; } else if (defaultedMembers.length > initializedMembers.length) { for (const member of initializedMembers) { this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { enumName }); } return defaultedMembers; } else { for (const member of defaultedMembers) { this.flowEnumErrorStringMemberInconsistentlyInitialized(member, { enumName }); } return initializedMembers; } } flowEnumParseExplicitType({ enumName }) { if (!this.eatContextual(102)) return null; if (!tokenIsIdentifier(this.state.type)) { throw this.raise(FlowErrors.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, { enumName }); } const { value } = this.state; this.next(); if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") { this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, { enumName, invalidEnumType: value }); } return value; } flowEnumBody(node, id) { const enumName = id.name; const nameLoc = id.loc.start; const explicitType = this.flowEnumParseExplicitType({ enumName }); this.expect(5); const { members, hasUnknownMembers } = this.flowEnumMembers({ enumName, explicitType }); node.hasUnknownMembers = hasUnknownMembers; switch (explicitType) { case "boolean": node.explicitType = true; node.members = members.booleanMembers; this.expect(8); return this.finishNode(node, "EnumBooleanBody"); case "number": node.explicitType = true; node.members = members.numberMembers; this.expect(8); return this.finishNode(node, "EnumNumberBody"); case "string": node.explicitType = true; node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { enumName }); this.expect(8); return this.finishNode(node, "EnumStringBody"); case "symbol": node.members = members.defaultedMembers; this.expect(8); return this.finishNode(node, "EnumSymbolBody"); default: { const empty = () => { node.members = []; this.expect(8); return this.finishNode(node, "EnumStringBody"); }; node.explicitType = false; const boolsLen = members.booleanMembers.length; const numsLen = members.numberMembers.length; const strsLen = members.stringMembers.length; const defaultedLen = members.defaultedMembers.length; if (!boolsLen && !numsLen && !strsLen && !defaultedLen) { return empty(); } else if (!boolsLen && !numsLen) { node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, { enumName }); this.expect(8); return this.finishNode(node, "EnumStringBody"); } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) { for (const member of members.defaultedMembers) { this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, { enumName, memberName: member.id.name }); } node.members = members.booleanMembers; this.expect(8); return this.finishNode(node, "EnumBooleanBody"); } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) { for (const member of members.defaultedMembers) { this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, { enumName, memberName: member.id.name }); } node.members = members.numberMembers; this.expect(8); return this.finishNode(node, "EnumNumberBody"); } else { this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, { enumName }); return empty(); } } } } flowParseEnumDeclaration(node) { const id = this.parseIdentifier(); node.id = id; node.body = this.flowEnumBody(this.startNode(), id); return this.finishNode(node, "EnumDeclaration"); } jsxParseOpeningElementAfterName(node) { if (this.shouldParseTypes()) { if (this.match(47) || this.match(51)) { node.typeArguments = this.flowParseTypeParameterInstantiationInExpression(); } } return super.jsxParseOpeningElementAfterName(node); } isLookaheadToken_lt() { const next = this.nextTokenStart(); if (this.input.charCodeAt(next) === 60) { const afterNext = this.input.charCodeAt(next + 1); return afterNext !== 60 && afterNext !== 61; } return false; } reScan_lt_gt() { const { type } = this.state; if (type === 47) { this.state.pos -= 1; this.readToken_lt(); } else if (type === 48) { this.state.pos -= 1; this.readToken_gt(); } } reScan_lt() { const { type } = this.state; if (type === 51) { this.state.pos -= 2; this.finishOp(47, 1); return 47; } return type; } maybeUnwrapTypeCastExpression(node) { return node.type === "TypeCastExpression" ? node.expression : node; } }; const entities = { __proto__: null, quot: "\u0022", amp: "&", apos: "\u0027", lt: "<", gt: ">", nbsp: "\u00A0", iexcl: "\u00A1", cent: "\u00A2", pound: "\u00A3", curren: "\u00A4", yen: "\u00A5", brvbar: "\u00A6", sect: "\u00A7", uml: "\u00A8", copy: "\u00A9", ordf: "\u00AA", laquo: "\u00AB", not: "\u00AC", shy: "\u00AD", reg: "\u00AE", macr: "\u00AF", deg: "\u00B0", plusmn: "\u00B1", sup2: "\u00B2", sup3: "\u00B3", acute: "\u00B4", micro: "\u00B5", para: "\u00B6", middot: "\u00B7", cedil: "\u00B8", sup1: "\u00B9", ordm: "\u00BA", raquo: "\u00BB", frac14: "\u00BC", frac12: "\u00BD", frac34: "\u00BE", iquest: "\u00BF", Agrave: "\u00C0", Aacute: "\u00C1", Acirc: "\u00C2", Atilde: "\u00C3", Auml: "\u00C4", Aring: "\u00C5", AElig: "\u00C6", Ccedil: "\u00C7", Egrave: "\u00C8", Eacute: "\u00C9", Ecirc: "\u00CA", Euml: "\u00CB", Igrave: "\u00CC", Iacute: "\u00CD", Icirc: "\u00CE", Iuml: "\u00CF", ETH: "\u00D0", Ntilde: "\u00D1", Ograve: "\u00D2", Oacute: "\u00D3", Ocirc: "\u00D4", Otilde: "\u00D5", Ouml: "\u00D6", times: "\u00D7", Oslash: "\u00D8", Ugrave: "\u00D9", Uacute: "\u00DA", Ucirc: "\u00DB", Uuml: "\u00DC", Yacute: "\u00DD", THORN: "\u00DE", szlig: "\u00DF", agrave: "\u00E0", aacute: "\u00E1", acirc: "\u00E2", atilde: "\u00E3", auml: "\u00E4", aring: "\u00E5", aelig: "\u00E6", ccedil: "\u00E7", egrave: "\u00E8", eacute: "\u00E9", ecirc: "\u00EA", euml: "\u00EB", igrave: "\u00EC", iacute: "\u00ED", icirc: "\u00EE", iuml: "\u00EF", eth: "\u00F0", ntilde: "\u00F1", ograve: "\u00F2", oacute: "\u00F3", ocirc: "\u00F4", otilde: "\u00F5", ouml: "\u00F6", divide: "\u00F7", oslash: "\u00F8", ugrave: "\u00F9", uacute: "\u00FA", ucirc: "\u00FB", uuml: "\u00FC", yacute: "\u00FD", thorn: "\u00FE", yuml: "\u00FF", OElig: "\u0152", oelig: "\u0153", Scaron: "\u0160", scaron: "\u0161", Yuml: "\u0178", fnof: "\u0192", circ: "\u02C6", tilde: "\u02DC", Alpha: "\u0391", Beta: "\u0392", Gamma: "\u0393", Delta: "\u0394", Epsilon: "\u0395", Zeta: "\u0396", Eta: "\u0397", Theta: "\u0398", Iota: "\u0399", Kappa: "\u039A", Lambda: "\u039B", Mu: "\u039C", Nu: "\u039D", Xi: "\u039E", Omicron: "\u039F", Pi: "\u03A0", Rho: "\u03A1", Sigma: "\u03A3", Tau: "\u03A4", Upsilon: "\u03A5", Phi: "\u03A6", Chi: "\u03A7", Psi: "\u03A8", Omega: "\u03A9", alpha: "\u03B1", beta: "\u03B2", gamma: "\u03B3", delta: "\u03B4", epsilon: "\u03B5", zeta: "\u03B6", eta: "\u03B7", theta: "\u03B8", iota: "\u03B9", kappa: "\u03BA", lambda: "\u03BB", mu: "\u03BC", nu: "\u03BD", xi: "\u03BE", omicron: "\u03BF", pi: "\u03C0", rho: "\u03C1", sigmaf: "\u03C2", sigma: "\u03C3", tau: "\u03C4", upsilon: "\u03C5", phi: "\u03C6", chi: "\u03C7", psi: "\u03C8", omega: "\u03C9", thetasym: "\u03D1", upsih: "\u03D2", piv: "\u03D6", ensp: "\u2002", emsp: "\u2003", thinsp: "\u2009", zwnj: "\u200C", zwj: "\u200D", lrm: "\u200E", rlm: "\u200F", ndash: "\u2013", mdash: "\u2014", lsquo: "\u2018", rsquo: "\u2019", sbquo: "\u201A", ldquo: "\u201C", rdquo: "\u201D", bdquo: "\u201E", dagger: "\u2020", Dagger: "\u2021", bull: "\u2022", hellip: "\u2026", permil: "\u2030", prime: "\u2032", Prime: "\u2033", lsaquo: "\u2039", rsaquo: "\u203A", oline: "\u203E", frasl: "\u2044", euro: "\u20AC", image: "\u2111", weierp: "\u2118", real: "\u211C", trade: "\u2122", alefsym: "\u2135", larr: "\u2190", uarr: "\u2191", rarr: "\u2192", darr: "\u2193", harr: "\u2194", crarr: "\u21B5", lArr: "\u21D0", uArr: "\u21D1", rArr: "\u21D2", dArr: "\u21D3", hArr: "\u21D4", forall: "\u2200", part: "\u2202", exist: "\u2203", empty: "\u2205", nabla: "\u2207", isin: "\u2208", notin: "\u2209", ni: "\u220B", prod: "\u220F", sum: "\u2211", minus: "\u2212", lowast: "\u2217", radic: "\u221A", prop: "\u221D", infin: "\u221E", ang: "\u2220", and: "\u2227", or: "\u2228", cap: "\u2229", cup: "\u222A", int: "\u222B", there4: "\u2234", sim: "\u223C", cong: "\u2245", asymp: "\u2248", ne: "\u2260", equiv: "\u2261", le: "\u2264", ge: "\u2265", sub: "\u2282", sup: "\u2283", nsub: "\u2284", sube: "\u2286", supe: "\u2287", oplus: "\u2295", otimes: "\u2297", perp: "\u22A5", sdot: "\u22C5", lceil: "\u2308", rceil: "\u2309", lfloor: "\u230A", rfloor: "\u230B", lang: "\u2329", rang: "\u232A", loz: "\u25CA", spades: "\u2660", clubs: "\u2663", hearts: "\u2665", diams: "\u2666" }; const lineBreak = /\r\n|[\r\n\u2028\u2029]/; const lineBreakG = new RegExp(lineBreak.source, "g"); function isNewLine(code) { switch (code) { case 10: case 13: case 8232: case 8233: return true; default: return false; } } function hasNewLine(input, start, end) { for (let i = start; i < end; i++) { if (isNewLine(input.charCodeAt(i))) { return true; } } return false; } const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; const skipWhiteSpaceInLine = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g; function isWhitespace(code) { switch (code) { case 0x0009: case 0x000b: case 0x000c: case 32: case 160: case 5760: case 0x2000: case 0x2001: case 0x2002: case 0x2003: case 0x2004: case 0x2005: case 0x2006: case 0x2007: case 0x2008: case 0x2009: case 0x200a: case 0x202f: case 0x205f: case 0x3000: case 0xfeff: return true; default: return false; } } const JsxErrors = ParseErrorEnum`jsx`({ AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.", MissingClosingTagElement: ({ openingTagName }) => `Expected corresponding JSX closing tag for <${openingTagName}>.`, MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.", UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", UnexpectedToken: ({ unexpected, HTMLEntity }) => `Unexpected token \`${unexpected}\`. Did you mean \`${HTMLEntity}\` or \`{'${unexpected}'}\`?`, UnsupportedJsxValue: "JSX value should be either an expression or a quoted JSX text.", UnterminatedJsxContent: "Unterminated JSX contents.", UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?" }); function isFragment(object) { return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false; } function getQualifiedJSXName(object) { if (object.type === "JSXIdentifier") { return object.name; } if (object.type === "JSXNamespacedName") { return object.namespace.name + ":" + object.name.name; } if (object.type === "JSXMemberExpression") { return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); } throw new Error("Node had unexpected type: " + object.type); } var jsx = superClass => class JSXParserMixin extends superClass { jsxReadToken() { let out = ""; let chunkStart = this.state.pos; for (;;) { if (this.state.pos >= this.length) { throw this.raise(JsxErrors.UnterminatedJsxContent, this.state.startLoc); } const ch = this.input.charCodeAt(this.state.pos); switch (ch) { case 60: case 123: if (this.state.pos === this.state.start) { if (ch === 60 && this.state.canStartJSXElement) { ++this.state.pos; this.finishToken(143); } else { super.getTokenFromCode(ch); } return; } out += this.input.slice(chunkStart, this.state.pos); this.finishToken(142, out); return; case 38: out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadEntity(); chunkStart = this.state.pos; break; case 62: case 125: default: if (isNewLine(ch)) { out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadNewLine(true); chunkStart = this.state.pos; } else { ++this.state.pos; } } } } jsxReadNewLine(normalizeCRLF) { const ch = this.input.charCodeAt(this.state.pos); let out; ++this.state.pos; if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { ++this.state.pos; out = normalizeCRLF ? "\n" : "\r\n"; } else { out = String.fromCharCode(ch); } ++this.state.curLine; this.state.lineStart = this.state.pos; return out; } jsxReadString(quote) { let out = ""; let chunkStart = ++this.state.pos; for (;;) { if (this.state.pos >= this.length) { throw this.raise(Errors.UnterminatedString, this.state.startLoc); } const ch = this.input.charCodeAt(this.state.pos); if (ch === quote) break; if (ch === 38) { out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadEntity(); chunkStart = this.state.pos; } else if (isNewLine(ch)) { out += this.input.slice(chunkStart, this.state.pos); out += this.jsxReadNewLine(false); chunkStart = this.state.pos; } else { ++this.state.pos; } } out += this.input.slice(chunkStart, this.state.pos++); this.finishToken(134, out); } jsxReadEntity() { const startPos = ++this.state.pos; if (this.codePointAtPos(this.state.pos) === 35) { ++this.state.pos; let radix = 10; if (this.codePointAtPos(this.state.pos) === 120) { radix = 16; ++this.state.pos; } const codePoint = this.readInt(radix, undefined, false, "bail"); if (codePoint !== null && this.codePointAtPos(this.state.pos) === 59) { ++this.state.pos; return String.fromCodePoint(codePoint); } } else { let count = 0; let semi = false; while (count++ < 10 && this.state.pos < this.length && !(semi = this.codePointAtPos(this.state.pos) === 59)) { ++this.state.pos; } if (semi) { const desc = this.input.slice(startPos, this.state.pos); const entity = entities[desc]; ++this.state.pos; if (entity) { return entity; } } } this.state.pos = startPos; return "&"; } jsxReadWord() { let ch; const start = this.state.pos; do { ch = this.input.charCodeAt(++this.state.pos); } while (isIdentifierChar(ch) || ch === 45); this.finishToken(141, this.input.slice(start, this.state.pos)); } jsxParseIdentifier() { const node = this.startNode(); if (this.match(141)) { node.name = this.state.value; } else if (tokenIsKeyword(this.state.type)) { node.name = tokenLabelName(this.state.type); } else { this.unexpected(); } this.next(); return this.finishNode(node, "JSXIdentifier"); } jsxParseNamespacedName() { const startLoc = this.state.startLoc; const name = this.jsxParseIdentifier(); if (!this.eat(14)) return name; const node = this.startNodeAt(startLoc); node.namespace = name; node.name = this.jsxParseIdentifier(); return this.finishNode(node, "JSXNamespacedName"); } jsxParseElementName() { const startLoc = this.state.startLoc; let node = this.jsxParseNamespacedName(); if (node.type === "JSXNamespacedName") { return node; } while (this.eat(16)) { const newNode = this.startNodeAt(startLoc); newNode.object = node; newNode.property = this.jsxParseIdentifier(); node = this.finishNode(newNode, "JSXMemberExpression"); } return node; } jsxParseAttributeValue() { let node; switch (this.state.type) { case 5: node = this.startNode(); this.setContext(types.brace); this.next(); node = this.jsxParseExpressionContainer(node, types.j_oTag); if (node.expression.type === "JSXEmptyExpression") { this.raise(JsxErrors.AttributeIsEmpty, node); } return node; case 143: case 134: return this.parseExprAtom(); default: throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc); } } jsxParseEmptyExpression() { const node = this.startNodeAt(this.state.lastTokEndLoc); return this.finishNodeAt(node, "JSXEmptyExpression", this.state.startLoc); } jsxParseSpreadChild(node) { this.next(); node.expression = this.parseExpression(); this.setContext(types.j_expr); this.state.canStartJSXElement = true; this.expect(8); return this.finishNode(node, "JSXSpreadChild"); } jsxParseExpressionContainer(node, previousContext) { if (this.match(8)) { node.expression = this.jsxParseEmptyExpression(); } else { const expression = this.parseExpression(); node.expression = expression; } this.setContext(previousContext); this.state.canStartJSXElement = true; this.expect(8); return this.finishNode(node, "JSXExpressionContainer"); } jsxParseAttribute() { const node = this.startNode(); if (this.match(5)) { this.setContext(types.brace); this.next(); this.expect(21); node.argument = this.parseMaybeAssignAllowIn(); this.setContext(types.j_oTag); this.state.canStartJSXElement = true; this.expect(8); return this.finishNode(node, "JSXSpreadAttribute"); } node.name = this.jsxParseNamespacedName(); node.value = this.eat(29) ? this.jsxParseAttributeValue() : null; return this.finishNode(node, "JSXAttribute"); } jsxParseOpeningElementAt(startLoc) { const node = this.startNodeAt(startLoc); if (this.eat(144)) { return this.finishNode(node, "JSXOpeningFragment"); } node.name = this.jsxParseElementName(); return this.jsxParseOpeningElementAfterName(node); } jsxParseOpeningElementAfterName(node) { const attributes = []; while (!this.match(56) && !this.match(144)) { attributes.push(this.jsxParseAttribute()); } node.attributes = attributes; node.selfClosing = this.eat(56); this.expect(144); return this.finishNode(node, "JSXOpeningElement"); } jsxParseClosingElementAt(startLoc) { const node = this.startNodeAt(startLoc); if (this.eat(144)) { return this.finishNode(node, "JSXClosingFragment"); } node.name = this.jsxParseElementName(); this.expect(144); return this.finishNode(node, "JSXClosingElement"); } jsxParseElementAt(startLoc) { const node = this.startNodeAt(startLoc); const children = []; const openingElement = this.jsxParseOpeningElementAt(startLoc); let closingElement = null; if (!openingElement.selfClosing) { contents: for (;;) { switch (this.state.type) { case 143: startLoc = this.state.startLoc; this.next(); if (this.eat(56)) { closingElement = this.jsxParseClosingElementAt(startLoc); break contents; } children.push(this.jsxParseElementAt(startLoc)); break; case 142: children.push(this.parseLiteral(this.state.value, "JSXText")); break; case 5: { const node = this.startNode(); this.setContext(types.brace); this.next(); if (this.match(21)) { children.push(this.jsxParseSpreadChild(node)); } else { children.push(this.jsxParseExpressionContainer(node, types.j_expr)); } break; } default: this.unexpected(); } } if (isFragment(openingElement) && !isFragment(closingElement) && closingElement !== null) { this.raise(JsxErrors.MissingClosingTagFragment, closingElement); } else if (!isFragment(openingElement) && isFragment(closingElement)) { this.raise(JsxErrors.MissingClosingTagElement, closingElement, { openingTagName: getQualifiedJSXName(openingElement.name) }); } else if (!isFragment(openingElement) && !isFragment(closingElement)) { if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) { this.raise(JsxErrors.MissingClosingTagElement, closingElement, { openingTagName: getQualifiedJSXName(openingElement.name) }); } } } if (isFragment(openingElement)) { node.openingFragment = openingElement; node.closingFragment = closingElement; } else { node.openingElement = openingElement; node.closingElement = closingElement; } node.children = children; if (this.match(47)) { throw this.raise(JsxErrors.UnwrappedAdjacentJSXElements, this.state.startLoc); } return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement"); } jsxParseElement() { const startLoc = this.state.startLoc; this.next(); return this.jsxParseElementAt(startLoc); } setContext(newContext) { const { context } = this.state; context[context.length - 1] = newContext; } parseExprAtom(refExpressionErrors) { if (this.match(143)) { return this.jsxParseElement(); } else if (this.match(47) && this.input.charCodeAt(this.state.pos) !== 33) { this.replaceToken(143); return this.jsxParseElement(); } else { return super.parseExprAtom(refExpressionErrors); } } skipSpace() { const curContext = this.curContext(); if (!curContext.preserveSpace) super.skipSpace(); } getTokenFromCode(code) { const context = this.curContext(); if (context === types.j_expr) { this.jsxReadToken(); return; } if (context === types.j_oTag || context === types.j_cTag) { if (isIdentifierStart(code)) { this.jsxReadWord(); return; } if (code === 62) { ++this.state.pos; this.finishToken(144); return; } if ((code === 34 || code === 39) && context === types.j_oTag) { this.jsxReadString(code); return; } } if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) { ++this.state.pos; this.finishToken(143); return; } super.getTokenFromCode(code); } updateContext(prevType) { const { context, type } = this.state; if (type === 56 && prevType === 143) { context.splice(-2, 2, types.j_cTag); this.state.canStartJSXElement = false; } else if (type === 143) { context.push(types.j_oTag); } else if (type === 144) { const out = context[context.length - 1]; if (out === types.j_oTag && prevType === 56 || out === types.j_cTag) { context.pop(); this.state.canStartJSXElement = context[context.length - 1] === types.j_expr; } else { this.setContext(types.j_expr); this.state.canStartJSXElement = true; } } else { this.state.canStartJSXElement = tokenComesBeforeExpression(type); } } }; class TypeScriptScope extends Scope { constructor(...args) { super(...args); this.tsNames = new Map(); } } class TypeScriptScopeHandler extends ScopeHandler { constructor(...args) { super(...args); this.importsStack = []; } createScope(flags) { this.importsStack.push(new Set()); return new TypeScriptScope(flags); } enter(flags) { if (flags === 1024) { this.importsStack.push(new Set()); } super.enter(flags); } exit() { const flags = super.exit(); if (flags === 1024) { this.importsStack.pop(); } return flags; } hasImport(name, allowShadow) { const len = this.importsStack.length; if (this.importsStack[len - 1].has(name)) { return true; } if (!allowShadow && len > 1) { for (let i = 0; i < len - 1; i++) { if (this.importsStack[i].has(name)) return true; } } return false; } declareName(name, bindingType, loc) { if (bindingType & 4096) { if (this.hasImport(name, true)) { this.parser.raise(Errors.VarRedeclaration, loc, { identifierName: name }); } this.importsStack[this.importsStack.length - 1].add(name); return; } const scope = this.currentScope(); let type = scope.tsNames.get(name) || 0; if (bindingType & 1024) { this.maybeExportDefined(scope, name); scope.tsNames.set(name, type | 16); return; } super.declareName(name, bindingType, loc); if (bindingType & 2) { if (!(bindingType & 1)) { this.checkRedeclarationInScope(scope, name, bindingType, loc); this.maybeExportDefined(scope, name); } type = type | 1; } if (bindingType & 256) { type = type | 2; } if (bindingType & 512) { type = type | 4; } if (bindingType & 128) { type = type | 8; } if (type) scope.tsNames.set(name, type); } isRedeclaredInScope(scope, name, bindingType) { const type = scope.tsNames.get(name); if ((type & 2) > 0) { if (bindingType & 256) { const isConst = !!(bindingType & 512); const wasConst = (type & 4) > 0; return isConst !== wasConst; } return true; } if (bindingType & 128 && (type & 8) > 0) { if (scope.names.get(name) & 2) { return !!(bindingType & 1); } else { return false; } } if (bindingType & 2 && (type & 1) > 0) { return true; } return super.isRedeclaredInScope(scope, name, bindingType); } checkLocalExport(id) { const { name } = id; if (this.hasImport(name)) return; const len = this.scopeStack.length; for (let i = len - 1; i >= 0; i--) { const scope = this.scopeStack[i]; const type = scope.tsNames.get(name); if ((type & 1) > 0 || (type & 16) > 0) { return; } } super.checkLocalExport(id); } } class ProductionParameterHandler { constructor() { this.stacks = []; } enter(flags) { this.stacks.push(flags); } exit() { this.stacks.pop(); } currentFlags() { return this.stacks[this.stacks.length - 1]; } get hasAwait() { return (this.currentFlags() & 2) > 0; } get hasYield() { return (this.currentFlags() & 1) > 0; } get hasReturn() { return (this.currentFlags() & 4) > 0; } get hasIn() { return (this.currentFlags() & 8) > 0; } } function functionFlags(isAsync, isGenerator) { return (isAsync ? 2 : 0) | (isGenerator ? 1 : 0); } class BaseParser { constructor() { this.sawUnambiguousESM = false; this.ambiguousScriptDifferentAst = false; } sourceToOffsetPos(sourcePos) { return sourcePos + this.startIndex; } offsetToSourcePos(offsetPos) { return offsetPos - this.startIndex; } hasPlugin(pluginConfig) { if (typeof pluginConfig === "string") { return this.plugins.has(pluginConfig); } else { const [pluginName, pluginOptions] = pluginConfig; if (!this.hasPlugin(pluginName)) { return false; } const actualOptions = this.plugins.get(pluginName); for (const key of Object.keys(pluginOptions)) { if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) { return false; } } return true; } } getPluginOption(plugin, name) { var _this$plugins$get; return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name]; } } function setTrailingComments(node, comments) { if (node.trailingComments === undefined) { node.trailingComments = comments; } else { node.trailingComments.unshift(...comments); } } function setLeadingComments(node, comments) { if (node.leadingComments === undefined) { node.leadingComments = comments; } else { node.leadingComments.unshift(...comments); } } function setInnerComments(node, comments) { if (node.innerComments === undefined) { node.innerComments = comments; } else { node.innerComments.unshift(...comments); } } function adjustInnerComments(node, elements, commentWS) { let lastElement = null; let i = elements.length; while (lastElement === null && i > 0) { lastElement = elements[--i]; } if (lastElement === null || lastElement.start > commentWS.start) { setInnerComments(node, commentWS.comments); } else { setTrailingComments(lastElement, commentWS.comments); } } class CommentsParser extends BaseParser { addComment(comment) { if (this.filename) comment.loc.filename = this.filename; const { commentsLen } = this.state; if (this.comments.length !== commentsLen) { this.comments.length = commentsLen; } this.comments.push(comment); this.state.commentsLen++; } processComment(node) { const { commentStack } = this.state; const commentStackLength = commentStack.length; if (commentStackLength === 0) return; let i = commentStackLength - 1; const lastCommentWS = commentStack[i]; if (lastCommentWS.start === node.end) { lastCommentWS.leadingNode = node; i--; } const { start: nodeStart } = node; for (; i >= 0; i--) { const commentWS = commentStack[i]; const commentEnd = commentWS.end; if (commentEnd > nodeStart) { commentWS.containingNode = node; this.finalizeComment(commentWS); commentStack.splice(i, 1); } else { if (commentEnd === nodeStart) { commentWS.trailingNode = node; } break; } } } finalizeComment(commentWS) { var _node$options; const { comments } = commentWS; if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) { if (commentWS.leadingNode !== null) { setTrailingComments(commentWS.leadingNode, comments); } if (commentWS.trailingNode !== null) { setLeadingComments(commentWS.trailingNode, comments); } } else { const { containingNode: node, start: commentStart } = commentWS; if (this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) === 44) { switch (node.type) { case "ObjectExpression": case "ObjectPattern": case "RecordExpression": adjustInnerComments(node, node.properties, commentWS); break; case "CallExpression": case "OptionalCallExpression": adjustInnerComments(node, node.arguments, commentWS); break; case "ImportExpression": adjustInnerComments(node, [node.source, (_node$options = node.options) != null ? _node$options : null], commentWS); break; case "FunctionDeclaration": case "FunctionExpression": case "ArrowFunctionExpression": case "ObjectMethod": case "ClassMethod": case "ClassPrivateMethod": adjustInnerComments(node, node.params, commentWS); break; case "ArrayExpression": case "ArrayPattern": case "TupleExpression": adjustInnerComments(node, node.elements, commentWS); break; case "ExportNamedDeclaration": case "ImportDeclaration": adjustInnerComments(node, node.specifiers, commentWS); break; case "TSEnumDeclaration": { adjustInnerComments(node, node.members, commentWS); } break; case "TSEnumBody": adjustInnerComments(node, node.members, commentWS); break; default: { setInnerComments(node, comments); } } } else { setInnerComments(node, comments); } } } finalizeRemainingComments() { const { commentStack } = this.state; for (let i = commentStack.length - 1; i >= 0; i--) { this.finalizeComment(commentStack[i]); } this.state.commentStack = []; } resetPreviousNodeTrailingComments(node) { const { commentStack } = this.state; const { length } = commentStack; if (length === 0) return; const commentWS = commentStack[length - 1]; if (commentWS.leadingNode === node) { commentWS.leadingNode = null; } } takeSurroundingComments(node, start, end) { const { commentStack } = this.state; const commentStackLength = commentStack.length; if (commentStackLength === 0) return; let i = commentStackLength - 1; for (; i >= 0; i--) { const commentWS = commentStack[i]; const commentEnd = commentWS.end; const commentStart = commentWS.start; if (commentStart === end) { commentWS.leadingNode = node; } else if (commentEnd === start) { commentWS.trailingNode = node; } else if (commentEnd < start) { break; } } } } class State { constructor() { this.flags = 1024; this.startIndex = void 0; this.curLine = void 0; this.lineStart = void 0; this.startLoc = void 0; this.endLoc = void 0; this.errors = []; this.potentialArrowAt = -1; this.noArrowAt = []; this.noArrowParamsConversionAt = []; this.topicContext = { maxNumOfResolvableTopics: 0, maxTopicIndex: null }; this.labels = []; this.commentsLen = 0; this.commentStack = []; this.pos = 0; this.type = 140; this.value = null; this.start = 0; this.end = 0; this.lastTokEndLoc = null; this.lastTokStartLoc = null; this.context = [types.brace]; this.firstInvalidTemplateEscapePos = null; this.strictErrors = new Map(); this.tokensLength = 0; } get strict() { return (this.flags & 1) > 0; } set strict(v) { if (v) this.flags |= 1;else this.flags &= -2; } init({ strictMode, sourceType, startIndex, startLine, startColumn }) { this.strict = strictMode === false ? false : strictMode === true ? true : sourceType === "module"; this.startIndex = startIndex; this.curLine = startLine; this.lineStart = -startColumn; this.startLoc = this.endLoc = new Position(startLine, startColumn, startIndex); } get maybeInArrowParameters() { return (this.flags & 2) > 0; } set maybeInArrowParameters(v) { if (v) this.flags |= 2;else this.flags &= -3; } get inType() { return (this.flags & 4) > 0; } set inType(v) { if (v) this.flags |= 4;else this.flags &= -5; } get noAnonFunctionType() { return (this.flags & 8) > 0; } set noAnonFunctionType(v) { if (v) this.flags |= 8;else this.flags &= -9; } get hasFlowComment() { return (this.flags & 16) > 0; } set hasFlowComment(v) { if (v) this.flags |= 16;else this.flags &= -17; } get isAmbientContext() { return (this.flags & 32) > 0; } set isAmbientContext(v) { if (v) this.flags |= 32;else this.flags &= -33; } get inAbstractClass() { return (this.flags & 64) > 0; } set inAbstractClass(v) { if (v) this.flags |= 64;else this.flags &= -65; } get inDisallowConditionalTypesContext() { return (this.flags & 128) > 0; } set inDisallowConditionalTypesContext(v) { if (v) this.flags |= 128;else this.flags &= -129; } get soloAwait() { return (this.flags & 256) > 0; } set soloAwait(v) { if (v) this.flags |= 256;else this.flags &= -257; } get inFSharpPipelineDirectBody() { return (this.flags & 512) > 0; } set inFSharpPipelineDirectBody(v) { if (v) this.flags |= 512;else this.flags &= -513; } get canStartJSXElement() { return (this.flags & 1024) > 0; } set canStartJSXElement(v) { if (v) this.flags |= 1024;else this.flags &= -1025; } get containsEsc() { return (this.flags & 2048) > 0; } set containsEsc(v) { if (v) this.flags |= 2048;else this.flags &= -2049; } get hasTopLevelAwait() { return (this.flags & 4096) > 0; } set hasTopLevelAwait(v) { if (v) this.flags |= 4096;else this.flags &= -4097; } curPosition() { return new Position(this.curLine, this.pos - this.lineStart, this.pos + this.startIndex); } clone() { const state = new State(); state.flags = this.flags; state.startIndex = this.startIndex; state.curLine = this.curLine; state.lineStart = this.lineStart; state.startLoc = this.startLoc; state.endLoc = this.endLoc; state.errors = this.errors.slice(); state.potentialArrowAt = this.potentialArrowAt; state.noArrowAt = this.noArrowAt.slice(); state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice(); state.topicContext = this.topicContext; state.labels = this.labels.slice(); state.commentsLen = this.commentsLen; state.commentStack = this.commentStack.slice(); state.pos = this.pos; state.type = this.type; state.value = this.value; state.start = this.start; state.end = this.end; state.lastTokEndLoc = this.lastTokEndLoc; state.lastTokStartLoc = this.lastTokStartLoc; state.context = this.context.slice(); state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos; state.strictErrors = this.strictErrors; state.tokensLength = this.tokensLength; return state; } } var _isDigit = function isDigit(code) { return code >= 48 && code <= 57; }; const forbiddenNumericSeparatorSiblings = { decBinOct: new Set([46, 66, 69, 79, 95, 98, 101, 111]), hex: new Set([46, 88, 95, 120]) }; const isAllowedNumericSeparatorSibling = { bin: ch => ch === 48 || ch === 49, oct: ch => ch >= 48 && ch <= 55, dec: ch => ch >= 48 && ch <= 57, hex: ch => ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102 }; function readStringContents(type, input, pos, lineStart, curLine, errors) { const initialPos = pos; const initialLineStart = lineStart; const initialCurLine = curLine; let out = ""; let firstInvalidLoc = null; let chunkStart = pos; const { length } = input; for (;;) { if (pos >= length) { errors.unterminated(initialPos, initialLineStart, initialCurLine); out += input.slice(chunkStart, pos); break; } const ch = input.charCodeAt(pos); if (isStringEnd(type, ch, input, pos)) { out += input.slice(chunkStart, pos); break; } if (ch === 92) { out += input.slice(chunkStart, pos); const res = readEscapedChar(input, pos, lineStart, curLine, type === "template", errors); if (res.ch === null && !firstInvalidLoc) { firstInvalidLoc = { pos, lineStart, curLine }; } else { out += res.ch; } ({ pos, lineStart, curLine } = res); chunkStart = pos; } else if (ch === 8232 || ch === 8233) { ++pos; ++curLine; lineStart = pos; } else if (ch === 10 || ch === 13) { if (type === "template") { out += input.slice(chunkStart, pos) + "\n"; ++pos; if (ch === 13 && input.charCodeAt(pos) === 10) { ++pos; } ++curLine; chunkStart = lineStart = pos; } else { errors.unterminated(initialPos, initialLineStart, initialCurLine); } } else { ++pos; } } return { pos, str: out, firstInvalidLoc, lineStart, curLine, containsInvalid: !!firstInvalidLoc }; } function isStringEnd(type, ch, input, pos) { if (type === "template") { return ch === 96 || ch === 36 && input.charCodeAt(pos + 1) === 123; } return ch === (type === "double" ? 34 : 39); } function readEscapedChar(input, pos, lineStart, curLine, inTemplate, errors) { const throwOnInvalid = !inTemplate; pos++; const res = ch => ({ pos, ch, lineStart, curLine }); const ch = input.charCodeAt(pos++); switch (ch) { case 110: return res("\n"); case 114: return res("\r"); case 120: { let code; ({ code, pos } = readHexChar(input, pos, lineStart, curLine, 2, false, throwOnInvalid, errors)); return res(code === null ? null : String.fromCharCode(code)); } case 117: { let code; ({ code, pos } = readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors)); return res(code === null ? null : String.fromCodePoint(code)); } case 116: return res("\t"); case 98: return res("\b"); case 118: return res("\u000b"); case 102: return res("\f"); case 13: if (input.charCodeAt(pos) === 10) { ++pos; } case 10: lineStart = pos; ++curLine; case 8232: case 8233: return res(""); case 56: case 57: if (inTemplate) { return res(null); } else { errors.strictNumericEscape(pos - 1, lineStart, curLine); } default: if (ch >= 48 && ch <= 55) { const startPos = pos - 1; const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2)); let octalStr = match[0]; let octal = parseInt(octalStr, 8); if (octal > 255) { octalStr = octalStr.slice(0, -1); octal = parseInt(octalStr, 8); } pos += octalStr.length - 1; const next = input.charCodeAt(pos); if (octalStr !== "0" || next === 56 || next === 57) { if (inTemplate) { return res(null); } else { errors.strictNumericEscape(startPos, lineStart, curLine); } } return res(String.fromCharCode(octal)); } return res(String.fromCharCode(ch)); } } function readHexChar(input, pos, lineStart, curLine, len, forceLen, throwOnInvalid, errors) { const initialPos = pos; let n; ({ n, pos } = readInt(input, pos, lineStart, curLine, 16, len, forceLen, false, errors, !throwOnInvalid)); if (n === null) { if (throwOnInvalid) { errors.invalidEscapeSequence(initialPos, lineStart, curLine); } else { pos = initialPos - 1; } } return { code: n, pos }; } function readInt(input, pos, lineStart, curLine, radix, len, forceLen, allowNumSeparator, errors, bailOnError) { const start = pos; const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct; const isAllowedSibling = radix === 16 ? isAllowedNumericSeparatorSibling.hex : radix === 10 ? isAllowedNumericSeparatorSibling.dec : radix === 8 ? isAllowedNumericSeparatorSibling.oct : isAllowedNumericSeparatorSibling.bin; let invalid = false; let total = 0; for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { const code = input.charCodeAt(pos); let val; if (code === 95 && allowNumSeparator !== "bail") { const prev = input.charCodeAt(pos - 1); const next = input.charCodeAt(pos + 1); if (!allowNumSeparator) { if (bailOnError) return { n: null, pos }; errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine); } else if (Number.isNaN(next) || !isAllowedSibling(next) || forbiddenSiblings.has(prev) || forbiddenSiblings.has(next)) { if (bailOnError) return { n: null, pos }; errors.unexpectedNumericSeparator(pos, lineStart, curLine); } ++pos; continue; } if (code >= 97) { val = code - 97 + 10; } else if (code >= 65) { val = code - 65 + 10; } else if (_isDigit(code)) { val = code - 48; } else { val = Infinity; } if (val >= radix) { if (val <= 9 && bailOnError) { return { n: null, pos }; } else if (val <= 9 && errors.invalidDigit(pos, lineStart, curLine, radix)) { val = 0; } else if (forceLen) { val = 0; invalid = true; } else { break; } } ++pos; total = total * radix + val; } if (pos === start || len != null && pos - start !== len || invalid) { return { n: null, pos }; } return { n: total, pos }; } function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) { const ch = input.charCodeAt(pos); let code; if (ch === 123) { ++pos; ({ code, pos } = readHexChar(input, pos, lineStart, curLine, input.indexOf("}", pos) - pos, true, throwOnInvalid, errors)); ++pos; if (code !== null && code > 0x10ffff) { if (throwOnInvalid) { errors.invalidCodePoint(pos, lineStart, curLine); } else { return { code: null, pos }; } } } else { ({ code, pos } = readHexChar(input, pos, lineStart, curLine, 4, false, throwOnInvalid, errors)); } return { code, pos }; } function buildPosition(pos, lineStart, curLine) { return new Position(curLine, pos - lineStart, pos); } const VALID_REGEX_FLAGS = new Set([103, 109, 115, 105, 121, 117, 100, 118]); class Token { constructor(state) { const startIndex = state.startIndex || 0; this.type = state.type; this.value = state.value; this.start = startIndex + state.start; this.end = startIndex + state.end; this.loc = new SourceLocation(state.startLoc, state.endLoc); } } class Tokenizer extends CommentsParser { constructor(options, input) { super(); this.isLookahead = void 0; this.tokens = []; this.errorHandlers_readInt = { invalidDigit: (pos, lineStart, curLine, radix) => { if (!(this.optionFlags & 2048)) return false; this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), { radix }); return true; }, numericSeparatorInEscapeSequence: this.errorBuilder(Errors.NumericSeparatorInEscapeSequence), unexpectedNumericSeparator: this.errorBuilder(Errors.UnexpectedNumericSeparator) }; this.errorHandlers_readCodePoint = Object.assign({}, this.errorHandlers_readInt, { invalidEscapeSequence: this.errorBuilder(Errors.InvalidEscapeSequence), invalidCodePoint: this.errorBuilder(Errors.InvalidCodePoint) }); this.errorHandlers_readStringContents_string = Object.assign({}, this.errorHandlers_readCodePoint, { strictNumericEscape: (pos, lineStart, curLine) => { this.recordStrictModeErrors(Errors.StrictNumericEscape, buildPosition(pos, lineStart, curLine)); }, unterminated: (pos, lineStart, curLine) => { throw this.raise(Errors.UnterminatedString, buildPosition(pos - 1, lineStart, curLine)); } }); this.errorHandlers_readStringContents_template = Object.assign({}, this.errorHandlers_readCodePoint, { strictNumericEscape: this.errorBuilder(Errors.StrictNumericEscape), unterminated: (pos, lineStart, curLine) => { throw this.raise(Errors.UnterminatedTemplate, buildPosition(pos, lineStart, curLine)); } }); this.state = new State(); this.state.init(options); this.input = input; this.length = input.length; this.comments = []; this.isLookahead = false; } pushToken(token) { this.tokens.length = this.state.tokensLength; this.tokens.push(token); ++this.state.tokensLength; } next() { this.checkKeywordEscapes(); if (this.optionFlags & 256) { this.pushToken(new Token(this.state)); } this.state.lastTokEndLoc = this.state.endLoc; this.state.lastTokStartLoc = this.state.startLoc; this.nextToken(); } eat(type) { if (this.match(type)) { this.next(); return true; } else { return false; } } match(type) { return this.state.type === type; } createLookaheadState(state) { return { pos: state.pos, value: null, type: state.type, start: state.start, end: state.end, context: [this.curContext()], inType: state.inType, startLoc: state.startLoc, lastTokEndLoc: state.lastTokEndLoc, curLine: state.curLine, lineStart: state.lineStart, curPosition: state.curPosition }; } lookahead() { const old = this.state; this.state = this.createLookaheadState(old); this.isLookahead = true; this.nextToken(); this.isLookahead = false; const curr = this.state; this.state = old; return curr; } nextTokenStart() { return this.nextTokenStartSince(this.state.pos); } nextTokenStartSince(pos) { skipWhiteSpace.lastIndex = pos; return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos; } lookaheadCharCode() { return this.lookaheadCharCodeSince(this.state.pos); } lookaheadCharCodeSince(pos) { return this.input.charCodeAt(this.nextTokenStartSince(pos)); } nextTokenInLineStart() { return this.nextTokenInLineStartSince(this.state.pos); } nextTokenInLineStartSince(pos) { skipWhiteSpaceInLine.lastIndex = pos; return skipWhiteSpaceInLine.test(this.input) ? skipWhiteSpaceInLine.lastIndex : pos; } lookaheadInLineCharCode() { return this.input.charCodeAt(this.nextTokenInLineStart()); } codePointAtPos(pos) { let cp = this.input.charCodeAt(pos); if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) { const trail = this.input.charCodeAt(pos); if ((trail & 0xfc00) === 0xdc00) { cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff); } } return cp; } setStrict(strict) { this.state.strict = strict; if (strict) { this.state.strictErrors.forEach(([toParseError, at]) => this.raise(toParseError, at)); this.state.strictErrors.clear(); } } curContext() { return this.state.context[this.state.context.length - 1]; } nextToken() { this.skipSpace(); this.state.start = this.state.pos; if (!this.isLookahead) this.state.startLoc = this.state.curPosition(); if (this.state.pos >= this.length) { this.finishToken(140); return; } this.getTokenFromCode(this.codePointAtPos(this.state.pos)); } skipBlockComment(commentEnd) { let startLoc; if (!this.isLookahead) startLoc = this.state.curPosition(); const start = this.state.pos; const end = this.input.indexOf(commentEnd, start + 2); if (end === -1) { throw this.raise(Errors.UnterminatedComment, this.state.curPosition()); } this.state.pos = end + commentEnd.length; lineBreakG.lastIndex = start + 2; while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) { ++this.state.curLine; this.state.lineStart = lineBreakG.lastIndex; } if (this.isLookahead) return; const comment = { type: "CommentBlock", value: this.input.slice(start + 2, end), start: this.sourceToOffsetPos(start), end: this.sourceToOffsetPos(end + commentEnd.length), loc: new SourceLocation(startLoc, this.state.curPosition()) }; if (this.optionFlags & 256) this.pushToken(comment); return comment; } skipLineComment(startSkip) { const start = this.state.pos; let startLoc; if (!this.isLookahead) startLoc = this.state.curPosition(); let ch = this.input.charCodeAt(this.state.pos += startSkip); if (this.state.pos < this.length) { while (!isNewLine(ch) && ++this.state.pos < this.length) { ch = this.input.charCodeAt(this.state.pos); } } if (this.isLookahead) return; const end = this.state.pos; const value = this.input.slice(start + startSkip, end); const comment = { type: "CommentLine", value, start: this.sourceToOffsetPos(start), end: this.sourceToOffsetPos(end), loc: new SourceLocation(startLoc, this.state.curPosition()) }; if (this.optionFlags & 256) this.pushToken(comment); return comment; } skipSpace() { const spaceStart = this.state.pos; const comments = this.optionFlags & 4096 ? [] : null; loop: while (this.state.pos < this.length) { const ch = this.input.charCodeAt(this.state.pos); switch (ch) { case 32: case 160: case 9: ++this.state.pos; break; case 13: if (this.input.charCodeAt(this.state.pos + 1) === 10) { ++this.state.pos; } case 10: case 8232: case 8233: ++this.state.pos; ++this.state.curLine; this.state.lineStart = this.state.pos; break; case 47: switch (this.input.charCodeAt(this.state.pos + 1)) { case 42: { const comment = this.skipBlockComment("*/"); if (comment !== undefined) { this.addComment(comment); comments == null || comments.push(comment); } break; } case 47: { const comment = this.skipLineComment(2); if (comment !== undefined) { this.addComment(comment); comments == null || comments.push(comment); } break; } default: break loop; } break; default: if (isWhitespace(ch)) { ++this.state.pos; } else if (ch === 45 && !this.inModule && this.optionFlags & 8192) { const pos = this.state.pos; if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) { const comment = this.skipLineComment(3); if (comment !== undefined) { this.addComment(comment); comments == null || comments.push(comment); } } else { break loop; } } else if (ch === 60 && !this.inModule && this.optionFlags & 8192) { const pos = this.state.pos; if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) { const comment = this.skipLineComment(4); if (comment !== undefined) { this.addComment(comment); comments == null || comments.push(comment); } } else { break loop; } } else { break loop; } } } if ((comments == null ? void 0 : comments.length) > 0) { const end = this.state.pos; const commentWhitespace = { start: this.sourceToOffsetPos(spaceStart), end: this.sourceToOffsetPos(end), comments, leadingNode: null, trailingNode: null, containingNode: null }; this.state.commentStack.push(commentWhitespace); } } finishToken(type, val) { this.state.end = this.state.pos; this.state.endLoc = this.state.curPosition(); const prevType = this.state.type; this.state.type = type; this.state.value = val; if (!this.isLookahead) { this.updateContext(prevType); } } replaceToken(type) { this.state.type = type; this.updateContext(); } readToken_numberSign() { if (this.state.pos === 0 && this.readToken_interpreter()) { return; } const nextPos = this.state.pos + 1; const next = this.codePointAtPos(nextPos); if (next >= 48 && next <= 57) { throw this.raise(Errors.UnexpectedDigitAfterHash, this.state.curPosition()); } if (next === 123 || next === 91 && this.hasPlugin("recordAndTuple")) { this.expectPlugin("recordAndTuple"); if (this.getPluginOption("recordAndTuple", "syntaxType") === "bar") { throw this.raise(next === 123 ? Errors.RecordExpressionHashIncorrectStartSyntaxType : Errors.TupleExpressionHashIncorrectStartSyntaxType, this.state.curPosition()); } this.state.pos += 2; if (next === 123) { this.finishToken(7); } else { this.finishToken(1); } } else if (isIdentifierStart(next)) { ++this.state.pos; this.finishToken(139, this.readWord1(next)); } else if (next === 92) { ++this.state.pos; this.finishToken(139, this.readWord1()); } else { this.finishOp(27, 1); } } readToken_dot() { const next = this.input.charCodeAt(this.state.pos + 1); if (next >= 48 && next <= 57) { this.readNumber(true); return; } if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) { this.state.pos += 3; this.finishToken(21); } else { ++this.state.pos; this.finishToken(16); } } readToken_slash() { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61) { this.finishOp(31, 2); } else { this.finishOp(56, 1); } } readToken_interpreter() { if (this.state.pos !== 0 || this.length < 2) return false; let ch = this.input.charCodeAt(this.state.pos + 1); if (ch !== 33) return false; const start = this.state.pos; this.state.pos += 1; while (!isNewLine(ch) && ++this.state.pos < this.length) { ch = this.input.charCodeAt(this.state.pos); } const value = this.input.slice(start + 2, this.state.pos); this.finishToken(28, value); return true; } readToken_mult_modulo(code) { let type = code === 42 ? 55 : 54; let width = 1; let next = this.input.charCodeAt(this.state.pos + 1); if (code === 42 && next === 42) { width++; next = this.input.charCodeAt(this.state.pos + 2); type = 57; } if (next === 61 && !this.state.inType) { width++; type = code === 37 ? 33 : 30; } this.finishOp(type, width); } readToken_pipe_amp(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (next === code) { if (this.input.charCodeAt(this.state.pos + 2) === 61) { this.finishOp(30, 3); } else { this.finishOp(code === 124 ? 41 : 42, 2); } return; } if (code === 124) { if (next === 62) { this.finishOp(39, 2); return; } if (this.hasPlugin("recordAndTuple") && next === 125) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(Errors.RecordExpressionBarIncorrectEndSyntaxType, this.state.curPosition()); } this.state.pos += 2; this.finishToken(9); return; } if (this.hasPlugin("recordAndTuple") && next === 93) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(Errors.TupleExpressionBarIncorrectEndSyntaxType, this.state.curPosition()); } this.state.pos += 2; this.finishToken(4); return; } } if (next === 61) { this.finishOp(30, 2); return; } this.finishOp(code === 124 ? 43 : 45, 1); } readToken_caret() { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61 && !this.state.inType) { this.finishOp(32, 2); } else if (next === 94 && this.hasPlugin(["pipelineOperator", { proposal: "hack", topicToken: "^^" }])) { this.finishOp(37, 2); const lookaheadCh = this.input.codePointAt(this.state.pos); if (lookaheadCh === 94) { this.unexpected(); } } else { this.finishOp(44, 1); } } readToken_atSign() { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 64 && this.hasPlugin(["pipelineOperator", { proposal: "hack", topicToken: "@@" }])) { this.finishOp(38, 2); } else { this.finishOp(26, 1); } } readToken_plus_min(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (next === code) { this.finishOp(34, 2); return; } if (next === 61) { this.finishOp(30, 2); } else { this.finishOp(53, 1); } } readToken_lt() { const { pos } = this.state; const next = this.input.charCodeAt(pos + 1); if (next === 60) { if (this.input.charCodeAt(pos + 2) === 61) { this.finishOp(30, 3); return; } this.finishOp(51, 2); return; } if (next === 61) { this.finishOp(49, 2); return; } this.finishOp(47, 1); } readToken_gt() { const { pos } = this.state; const next = this.input.charCodeAt(pos + 1); if (next === 62) { const size = this.input.charCodeAt(pos + 2) === 62 ? 3 : 2; if (this.input.charCodeAt(pos + size) === 61) { this.finishOp(30, size + 1); return; } this.finishOp(52, size); return; } if (next === 61) { this.finishOp(49, 2); return; } this.finishOp(48, 1); } readToken_eq_excl(code) { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 61) { this.finishOp(46, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2); return; } if (code === 61 && next === 62) { this.state.pos += 2; this.finishToken(19); return; } this.finishOp(code === 61 ? 29 : 35, 1); } readToken_question() { const next = this.input.charCodeAt(this.state.pos + 1); const next2 = this.input.charCodeAt(this.state.pos + 2); if (next === 63) { if (next2 === 61) { this.finishOp(30, 3); } else { this.finishOp(40, 2); } } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) { this.state.pos += 2; this.finishToken(18); } else { ++this.state.pos; this.finishToken(17); } } getTokenFromCode(code) { switch (code) { case 46: this.readToken_dot(); return; case 40: ++this.state.pos; this.finishToken(10); return; case 41: ++this.state.pos; this.finishToken(11); return; case 59: ++this.state.pos; this.finishToken(13); return; case 44: ++this.state.pos; this.finishToken(12); return; case 91: if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(Errors.TupleExpressionBarIncorrectStartSyntaxType, this.state.curPosition()); } this.state.pos += 2; this.finishToken(2); } else { ++this.state.pos; this.finishToken(0); } return; case 93: ++this.state.pos; this.finishToken(3); return; case 123: if (this.hasPlugin("recordAndTuple") && this.input.charCodeAt(this.state.pos + 1) === 124) { if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") { throw this.raise(Errors.RecordExpressionBarIncorrectStartSyntaxType, this.state.curPosition()); } this.state.pos += 2; this.finishToken(6); } else { ++this.state.pos; this.finishToken(5); } return; case 125: ++this.state.pos; this.finishToken(8); return; case 58: if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) { this.finishOp(15, 2); } else { ++this.state.pos; this.finishToken(14); } return; case 63: this.readToken_question(); return; case 96: this.readTemplateToken(); return; case 48: { const next = this.input.charCodeAt(this.state.pos + 1); if (next === 120 || next === 88) { this.readRadixNumber(16); return; } if (next === 111 || next === 79) { this.readRadixNumber(8); return; } if (next === 98 || next === 66) { this.readRadixNumber(2); return; } } case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: this.readNumber(false); return; case 34: case 39: this.readString(code); return; case 47: this.readToken_slash(); return; case 37: case 42: this.readToken_mult_modulo(code); return; case 124: case 38: this.readToken_pipe_amp(code); return; case 94: this.readToken_caret(); return; case 43: case 45: this.readToken_plus_min(code); return; case 60: this.readToken_lt(); return; case 62: this.readToken_gt(); return; case 61: case 33: this.readToken_eq_excl(code); return; case 126: this.finishOp(36, 1); return; case 64: this.readToken_atSign(); return; case 35: this.readToken_numberSign(); return; case 92: this.readWord(); return; default: if (isIdentifierStart(code)) { this.readWord(code); return; } } throw this.raise(Errors.InvalidOrUnexpectedToken, this.state.curPosition(), { unexpected: String.fromCodePoint(code) }); } finishOp(type, size) { const str = this.input.slice(this.state.pos, this.state.pos + size); this.state.pos += size; this.finishToken(type, str); } readRegexp() { const startLoc = this.state.startLoc; const start = this.state.start + 1; let escaped, inClass; let { pos } = this.state; for (;; ++pos) { if (pos >= this.length) { throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1)); } const ch = this.input.charCodeAt(pos); if (isNewLine(ch)) { throw this.raise(Errors.UnterminatedRegExp, createPositionWithColumnOffset(startLoc, 1)); } if (escaped) { escaped = false; } else { if (ch === 91) { inClass = true; } else if (ch === 93 && inClass) { inClass = false; } else if (ch === 47 && !inClass) { break; } escaped = ch === 92; } } const content = this.input.slice(start, pos); ++pos; let mods = ""; const nextPos = () => createPositionWithColumnOffset(startLoc, pos + 2 - start); while (pos < this.length) { const cp = this.codePointAtPos(pos); const char = String.fromCharCode(cp); if (VALID_REGEX_FLAGS.has(cp)) { if (cp === 118) { if (mods.includes("u")) { this.raise(Errors.IncompatibleRegExpUVFlags, nextPos()); } } else if (cp === 117) { if (mods.includes("v")) { this.raise(Errors.IncompatibleRegExpUVFlags, nextPos()); } } if (mods.includes(char)) { this.raise(Errors.DuplicateRegExpFlags, nextPos()); } } else if (isIdentifierChar(cp) || cp === 92) { this.raise(Errors.MalformedRegExpFlags, nextPos()); } else { break; } ++pos; mods += char; } this.state.pos = pos; this.finishToken(138, { pattern: content, flags: mods }); } readInt(radix, len, forceLen = false, allowNumSeparator = true) { const { n, pos } = readInt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, radix, len, forceLen, allowNumSeparator, this.errorHandlers_readInt, false); this.state.pos = pos; return n; } readRadixNumber(radix) { const start = this.state.pos; const startLoc = this.state.curPosition(); let isBigInt = false; this.state.pos += 2; const val = this.readInt(radix); if (val == null) { this.raise(Errors.InvalidDigit, createPositionWithColumnOffset(startLoc, 2), { radix }); } const next = this.input.charCodeAt(this.state.pos); if (next === 110) { ++this.state.pos; isBigInt = true; } else if (next === 109) { throw this.raise(Errors.InvalidDecimal, startLoc); } if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { throw this.raise(Errors.NumberIdentifier, this.state.curPosition()); } if (isBigInt) { const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, ""); this.finishToken(136, str); return; } this.finishToken(135, val); } readNumber(startsWithDot) { const start = this.state.pos; const startLoc = this.state.curPosition(); let isFloat = false; let isBigInt = false; let hasExponent = false; let isOctal = false; if (!startsWithDot && this.readInt(10) === null) { this.raise(Errors.InvalidNumber, this.state.curPosition()); } const hasLeadingZero = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48; if (hasLeadingZero) { const integer = this.input.slice(start, this.state.pos); this.recordStrictModeErrors(Errors.StrictOctalLiteral, startLoc); if (!this.state.strict) { const underscorePos = integer.indexOf("_"); if (underscorePos > 0) { this.raise(Errors.ZeroDigitNumericSeparator, createPositionWithColumnOffset(startLoc, underscorePos)); } } isOctal = hasLeadingZero && !/[89]/.test(integer); } let next = this.input.charCodeAt(this.state.pos); if (next === 46 && !isOctal) { ++this.state.pos; this.readInt(10); isFloat = true; next = this.input.charCodeAt(this.state.pos); } if ((next === 69 || next === 101) && !isOctal) { next = this.input.charCodeAt(++this.state.pos); if (next === 43 || next === 45) { ++this.state.pos; } if (this.readInt(10) === null) { this.raise(Errors.InvalidOrMissingExponent, startLoc); } isFloat = true; hasExponent = true; next = this.input.charCodeAt(this.state.pos); } if (next === 110) { if (isFloat || hasLeadingZero) { this.raise(Errors.InvalidBigIntLiteral, startLoc); } ++this.state.pos; isBigInt = true; } if (next === 109) { this.expectPlugin("decimal", this.state.curPosition()); if (hasExponent || hasLeadingZero) { this.raise(Errors.InvalidDecimal, startLoc); } ++this.state.pos; var isDecimal = true; } if (isIdentifierStart(this.codePointAtPos(this.state.pos))) { throw this.raise(Errors.NumberIdentifier, this.state.curPosition()); } const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, ""); if (isBigInt) { this.finishToken(136, str); return; } if (isDecimal) { this.finishToken(137, str); return; } const val = isOctal ? parseInt(str, 8) : parseFloat(str); this.finishToken(135, val); } readCodePoint(throwOnInvalid) { const { code, pos } = readCodePoint(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint); this.state.pos = pos; return code; } readString(quote) { const { str, pos, curLine, lineStart } = readStringContents(quote === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string); this.state.pos = pos + 1; this.state.lineStart = lineStart; this.state.curLine = curLine; this.finishToken(134, str); } readTemplateContinuation() { if (!this.match(8)) { this.unexpected(null, 8); } this.state.pos--; this.readTemplateToken(); } readTemplateToken() { const opening = this.input[this.state.pos]; const { str, firstInvalidLoc, pos, curLine, lineStart } = readStringContents("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template); this.state.pos = pos + 1; this.state.lineStart = lineStart; this.state.curLine = curLine; if (firstInvalidLoc) { this.state.firstInvalidTemplateEscapePos = new Position(firstInvalidLoc.curLine, firstInvalidLoc.pos - firstInvalidLoc.lineStart, this.sourceToOffsetPos(firstInvalidLoc.pos)); } if (this.input.codePointAt(pos) === 96) { this.finishToken(24, firstInvalidLoc ? null : opening + str + "`"); } else { this.state.pos++; this.finishToken(25, firstInvalidLoc ? null : opening + str + "${"); } } recordStrictModeErrors(toParseError, at) { const index = at.index; if (this.state.strict && !this.state.strictErrors.has(index)) { this.raise(toParseError, at); } else { this.state.strictErrors.set(index, [toParseError, at]); } } readWord1(firstCode) { this.state.containsEsc = false; let word = ""; const start = this.state.pos; let chunkStart = this.state.pos; if (firstCode !== undefined) { this.state.pos += firstCode <= 0xffff ? 1 : 2; } while (this.state.pos < this.length) { const ch = this.codePointAtPos(this.state.pos); if (isIdentifierChar(ch)) { this.state.pos += ch <= 0xffff ? 1 : 2; } else if (ch === 92) { this.state.containsEsc = true; word += this.input.slice(chunkStart, this.state.pos); const escStart = this.state.curPosition(); const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar; if (this.input.charCodeAt(++this.state.pos) !== 117) { this.raise(Errors.MissingUnicodeEscape, this.state.curPosition()); chunkStart = this.state.pos - 1; continue; } ++this.state.pos; const esc = this.readCodePoint(true); if (esc !== null) { if (!identifierCheck(esc)) { this.raise(Errors.EscapedCharNotAnIdentifier, escStart); } word += String.fromCodePoint(esc); } chunkStart = this.state.pos; } else { break; } } return word + this.input.slice(chunkStart, this.state.pos); } readWord(firstCode) { const word = this.readWord1(firstCode); const type = keywords$1.get(word); if (type !== undefined) { this.finishToken(type, tokenLabelName(type)); } else { this.finishToken(132, word); } } checkKeywordEscapes() { const { type } = this.state; if (tokenIsKeyword(type) && this.state.containsEsc) { this.raise(Errors.InvalidEscapedReservedWord, this.state.startLoc, { reservedWord: tokenLabelName(type) }); } } raise(toParseError, at, details = {}) { const loc = at instanceof Position ? at : at.loc.start; const error = toParseError(loc, details); if (!(this.optionFlags & 2048)) throw error; if (!this.isLookahead) this.state.errors.push(error); return error; } raiseOverwrite(toParseError, at, details = {}) { const loc = at instanceof Position ? at : at.loc.start; const pos = loc.index; const errors = this.state.errors; for (let i = errors.length - 1; i >= 0; i--) { const error = errors[i]; if (error.loc.index === pos) { return errors[i] = toParseError(loc, details); } if (error.loc.index < pos) break; } return this.raise(toParseError, at, details); } updateContext(prevType) {} unexpected(loc, type) { throw this.raise(Errors.UnexpectedToken, loc != null ? loc : this.state.startLoc, { expected: type ? tokenLabelName(type) : null }); } expectPlugin(pluginName, loc) { if (this.hasPlugin(pluginName)) { return true; } throw this.raise(Errors.MissingPlugin, loc != null ? loc : this.state.startLoc, { missingPlugin: [pluginName] }); } expectOnePlugin(pluginNames) { if (!pluginNames.some(name => this.hasPlugin(name))) { throw this.raise(Errors.MissingOneOfPlugins, this.state.startLoc, { missingPlugin: pluginNames }); } } errorBuilder(error) { return (pos, lineStart, curLine) => { this.raise(error, buildPosition(pos, lineStart, curLine)); }; } } class ClassScope { constructor() { this.privateNames = new Set(); this.loneAccessors = new Map(); this.undefinedPrivateNames = new Map(); } } class ClassScopeHandler { constructor(parser) { this.parser = void 0; this.stack = []; this.undefinedPrivateNames = new Map(); this.parser = parser; } current() { return this.stack[this.stack.length - 1]; } enter() { this.stack.push(new ClassScope()); } exit() { const oldClassScope = this.stack.pop(); const current = this.current(); for (const [name, loc] of Array.from(oldClassScope.undefinedPrivateNames)) { if (current) { if (!current.undefinedPrivateNames.has(name)) { current.undefinedPrivateNames.set(name, loc); } } else { this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, { identifierName: name }); } } } declarePrivateName(name, elementType, loc) { const { privateNames, loneAccessors, undefinedPrivateNames } = this.current(); let redefined = privateNames.has(name); if (elementType & 3) { const accessor = redefined && loneAccessors.get(name); if (accessor) { const oldStatic = accessor & 4; const newStatic = elementType & 4; const oldKind = accessor & 3; const newKind = elementType & 3; redefined = oldKind === newKind || oldStatic !== newStatic; if (!redefined) loneAccessors.delete(name); } else if (!redefined) { loneAccessors.set(name, elementType); } } if (redefined) { this.parser.raise(Errors.PrivateNameRedeclaration, loc, { identifierName: name }); } privateNames.add(name); undefinedPrivateNames.delete(name); } usePrivateName(name, loc) { let classScope; for (classScope of this.stack) { if (classScope.privateNames.has(name)) return; } if (classScope) { classScope.undefinedPrivateNames.set(name, loc); } else { this.parser.raise(Errors.InvalidPrivateFieldResolution, loc, { identifierName: name }); } } } class ExpressionScope { constructor(type = 0) { this.type = type; } canBeArrowParameterDeclaration() { return this.type === 2 || this.type === 1; } isCertainlyParameterDeclaration() { return this.type === 3; } } class ArrowHeadParsingScope extends ExpressionScope { constructor(type) { super(type); this.declarationErrors = new Map(); } recordDeclarationError(ParsingErrorClass, at) { const index = at.index; this.declarationErrors.set(index, [ParsingErrorClass, at]); } clearDeclarationError(index) { this.declarationErrors.delete(index); } iterateErrors(iterator) { this.declarationErrors.forEach(iterator); } } class ExpressionScopeHandler { constructor(parser) { this.parser = void 0; this.stack = [new ExpressionScope()]; this.parser = parser; } enter(scope) { this.stack.push(scope); } exit() { this.stack.pop(); } recordParameterInitializerError(toParseError, node) { const origin = node.loc.start; const { stack } = this; let i = stack.length - 1; let scope = stack[i]; while (!scope.isCertainlyParameterDeclaration()) { if (scope.canBeArrowParameterDeclaration()) { scope.recordDeclarationError(toParseError, origin); } else { return; } scope = stack[--i]; } this.parser.raise(toParseError, origin); } recordArrowParameterBindingError(error, node) { const { stack } = this; const scope = stack[stack.length - 1]; const origin = node.loc.start; if (scope.isCertainlyParameterDeclaration()) { this.parser.raise(error, origin); } else if (scope.canBeArrowParameterDeclaration()) { scope.recordDeclarationError(error, origin); } else { return; } } recordAsyncArrowParametersError(at) { const { stack } = this; let i = stack.length - 1; let scope = stack[i]; while (scope.canBeArrowParameterDeclaration()) { if (scope.type === 2) { scope.recordDeclarationError(Errors.AwaitBindingIdentifier, at); } scope = stack[--i]; } } validateAsPattern() { const { stack } = this; const currentScope = stack[stack.length - 1]; if (!currentScope.canBeArrowParameterDeclaration()) return; currentScope.iterateErrors(([toParseError, loc]) => { this.parser.raise(toParseError, loc); let i = stack.length - 2; let scope = stack[i]; while (scope.canBeArrowParameterDeclaration()) { scope.clearDeclarationError(loc.index); scope = stack[--i]; } }); } } function newParameterDeclarationScope() { return new ExpressionScope(3); } function newArrowHeadScope() { return new ArrowHeadParsingScope(1); } function newAsyncArrowScope() { return new ArrowHeadParsingScope(2); } function newExpressionScope() { return new ExpressionScope(); } class UtilParser extends Tokenizer { addExtra(node, key, value, enumerable = true) { if (!node) return; let { extra } = node; if (extra == null) { extra = {}; node.extra = extra; } if (enumerable) { extra[key] = value; } else { Object.defineProperty(extra, key, { enumerable, value }); } } isContextual(token) { return this.state.type === token && !this.state.containsEsc; } isUnparsedContextual(nameStart, name) { if (this.input.startsWith(name, nameStart)) { const nextCh = this.input.charCodeAt(nameStart + name.length); return !(isIdentifierChar(nextCh) || (nextCh & 0xfc00) === 0xd800); } return false; } isLookaheadContextual(name) { const next = this.nextTokenStart(); return this.isUnparsedContextual(next, name); } eatContextual(token) { if (this.isContextual(token)) { this.next(); return true; } return false; } expectContextual(token, toParseError) { if (!this.eatContextual(token)) { if (toParseError != null) { throw this.raise(toParseError, this.state.startLoc); } this.unexpected(null, token); } } canInsertSemicolon() { return this.match(140) || this.match(8) || this.hasPrecedingLineBreak(); } hasPrecedingLineBreak() { return hasNewLine(this.input, this.offsetToSourcePos(this.state.lastTokEndLoc.index), this.state.start); } hasFollowingLineBreak() { return hasNewLine(this.input, this.state.end, this.nextTokenStart()); } isLineTerminator() { return this.eat(13) || this.canInsertSemicolon(); } semicolon(allowAsi = true) { if (allowAsi ? this.isLineTerminator() : this.eat(13)) return; this.raise(Errors.MissingSemicolon, this.state.lastTokEndLoc); } expect(type, loc) { if (!this.eat(type)) { this.unexpected(loc, type); } } tryParse(fn, oldState = this.state.clone()) { const abortSignal = { node: null }; try { const node = fn((node = null) => { abortSignal.node = node; throw abortSignal; }); if (this.state.errors.length > oldState.errors.length) { const failState = this.state; this.state = oldState; this.state.tokensLength = failState.tokensLength; return { node, error: failState.errors[oldState.errors.length], thrown: false, aborted: false, failState }; } return { node, error: null, thrown: false, aborted: false, failState: null }; } catch (error) { const failState = this.state; this.state = oldState; if (error instanceof SyntaxError) { return { node: null, error, thrown: true, aborted: false, failState }; } if (error === abortSignal) { return { node: abortSignal.node, error: null, thrown: false, aborted: true, failState }; } throw error; } } checkExpressionErrors(refExpressionErrors, andThrow) { if (!refExpressionErrors) return false; const { shorthandAssignLoc, doubleProtoLoc, privateKeyLoc, optionalParametersLoc, voidPatternLoc } = refExpressionErrors; const hasErrors = !!shorthandAssignLoc || !!doubleProtoLoc || !!optionalParametersLoc || !!privateKeyLoc || !!voidPatternLoc; if (!andThrow) { return hasErrors; } if (shorthandAssignLoc != null) { this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc); } if (doubleProtoLoc != null) { this.raise(Errors.DuplicateProto, doubleProtoLoc); } if (privateKeyLoc != null) { this.raise(Errors.UnexpectedPrivateField, privateKeyLoc); } if (optionalParametersLoc != null) { this.unexpected(optionalParametersLoc); } if (voidPatternLoc != null) { this.raise(Errors.InvalidCoverDiscardElement, voidPatternLoc); } } isLiteralPropertyName() { return tokenIsLiteralPropertyName(this.state.type); } isPrivateName(node) { return node.type === "PrivateName"; } getPrivateNameSV(node) { return node.id.name; } hasPropertyAsPrivateName(node) { return (node.type === "MemberExpression" || node.type === "OptionalMemberExpression") && this.isPrivateName(node.property); } isObjectProperty(node) { return node.type === "ObjectProperty"; } isObjectMethod(node) { return node.type === "ObjectMethod"; } initializeScopes(inModule = this.options.sourceType === "module") { const oldLabels = this.state.labels; this.state.labels = []; const oldExportedIdentifiers = this.exportedIdentifiers; this.exportedIdentifiers = new Set(); const oldInModule = this.inModule; this.inModule = inModule; const oldScope = this.scope; const ScopeHandler = this.getScopeHandler(); this.scope = new ScopeHandler(this, inModule); const oldProdParam = this.prodParam; this.prodParam = new ProductionParameterHandler(); const oldClassScope = this.classScope; this.classScope = new ClassScopeHandler(this); const oldExpressionScope = this.expressionScope; this.expressionScope = new ExpressionScopeHandler(this); return () => { this.state.labels = oldLabels; this.exportedIdentifiers = oldExportedIdentifiers; this.inModule = oldInModule; this.scope = oldScope; this.prodParam = oldProdParam; this.classScope = oldClassScope; this.expressionScope = oldExpressionScope; }; } enterInitialScopes() { let paramFlags = 0; if (this.inModule || this.optionFlags & 1) { paramFlags |= 2; } if (this.optionFlags & 32) { paramFlags |= 1; } const isCommonJS = !this.inModule && this.options.sourceType === "commonjs"; if (isCommonJS || this.optionFlags & 2) { paramFlags |= 4; } this.prodParam.enter(paramFlags); let scopeFlags = isCommonJS ? 514 : 1; if (this.optionFlags & 4) { scopeFlags |= 512; } this.scope.enter(scopeFlags); } checkDestructuringPrivate(refExpressionErrors) { const { privateKeyLoc } = refExpressionErrors; if (privateKeyLoc !== null) { this.expectPlugin("destructuringPrivate", privateKeyLoc); } } } class ExpressionErrors { constructor() { this.shorthandAssignLoc = null; this.doubleProtoLoc = null; this.privateKeyLoc = null; this.optionalParametersLoc = null; this.voidPatternLoc = null; } } class Node { constructor(parser, pos, loc) { this.type = ""; this.start = pos; this.end = 0; this.loc = new SourceLocation(loc); if ((parser == null ? void 0 : parser.optionFlags) & 128) this.range = [pos, 0]; if (parser != null && parser.filename) this.loc.filename = parser.filename; } } const NodePrototype = Node.prototype; { NodePrototype.__clone = function () { const newNode = new Node(undefined, this.start, this.loc.start); const keys = Object.keys(this); for (let i = 0, length = keys.length; i < length; i++) { const key = keys[i]; if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") { newNode[key] = this[key]; } } return newNode; }; } class NodeUtils extends UtilParser { startNode() { const loc = this.state.startLoc; return new Node(this, loc.index, loc); } startNodeAt(loc) { return new Node(this, loc.index, loc); } startNodeAtNode(type) { return this.startNodeAt(type.loc.start); } finishNode(node, type) { return this.finishNodeAt(node, type, this.state.lastTokEndLoc); } finishNodeAt(node, type, endLoc) { node.type = type; node.end = endLoc.index; node.loc.end = endLoc; if (this.optionFlags & 128) node.range[1] = endLoc.index; if (this.optionFlags & 4096) { this.processComment(node); } return node; } resetStartLocation(node, startLoc) { node.start = startLoc.index; node.loc.start = startLoc; if (this.optionFlags & 128) node.range[0] = startLoc.index; } resetEndLocation(node, endLoc = this.state.lastTokEndLoc) { node.end = endLoc.index; node.loc.end = endLoc; if (this.optionFlags & 128) node.range[1] = endLoc.index; } resetStartLocationFromNode(node, locationNode) { this.resetStartLocation(node, locationNode.loc.start); } castNodeTo(node, type) { node.type = type; return node; } cloneIdentifier(node) { const { type, start, end, loc, range, name } = node; const cloned = Object.create(NodePrototype); cloned.type = type; cloned.start = start; cloned.end = end; cloned.loc = loc; cloned.range = range; cloned.name = name; if (node.extra) cloned.extra = node.extra; return cloned; } cloneStringLiteral(node) { const { type, start, end, loc, range, extra } = node; const cloned = Object.create(NodePrototype); cloned.type = type; cloned.start = start; cloned.end = end; cloned.loc = loc; cloned.range = range; cloned.extra = extra; cloned.value = node.value; return cloned; } } const unwrapParenthesizedExpression = node => { return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node; }; class LValParser extends NodeUtils { toAssignable(node, isLHS = false) { var _node$extra, _node$extra3; let parenthesized = undefined; if (node.type === "ParenthesizedExpression" || (_node$extra = node.extra) != null && _node$extra.parenthesized) { parenthesized = unwrapParenthesizedExpression(node); if (isLHS) { if (parenthesized.type === "Identifier") { this.expressionScope.recordArrowParameterBindingError(Errors.InvalidParenthesizedAssignment, node); } else if (parenthesized.type !== "MemberExpression" && !this.isOptionalMemberExpression(parenthesized)) { this.raise(Errors.InvalidParenthesizedAssignment, node); } } else { this.raise(Errors.InvalidParenthesizedAssignment, node); } } switch (node.type) { case "Identifier": case "ObjectPattern": case "ArrayPattern": case "AssignmentPattern": case "RestElement": case "VoidPattern": break; case "ObjectExpression": this.castNodeTo(node, "ObjectPattern"); for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) { var _node$extra2; const prop = node.properties[i]; const isLast = i === last; this.toAssignableObjectExpressionProp(prop, isLast, isLHS); if (isLast && prop.type === "RestElement" && (_node$extra2 = node.extra) != null && _node$extra2.trailingCommaLoc) { this.raise(Errors.RestTrailingComma, node.extra.trailingCommaLoc); } } break; case "ObjectProperty": { const { key, value } = node; if (this.isPrivateName(key)) { this.classScope.usePrivateName(this.getPrivateNameSV(key), key.loc.start); } this.toAssignable(value, isLHS); break; } case "SpreadElement": { throw new Error("Internal @babel/parser error (this is a bug, please report it)." + " SpreadElement should be converted by .toAssignable's caller."); } case "ArrayExpression": this.castNodeTo(node, "ArrayPattern"); this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingCommaLoc, isLHS); break; case "AssignmentExpression": if (node.operator !== "=") { this.raise(Errors.MissingEqInAssignment, node.left.loc.end); } this.castNodeTo(node, "AssignmentPattern"); delete node.operator; if (node.left.type === "VoidPattern") { this.raise(Errors.VoidPatternInitializer, node.left); } this.toAssignable(node.left, isLHS); break; case "ParenthesizedExpression": this.toAssignable(parenthesized, isLHS); break; } } toAssignableObjectExpressionProp(prop, isLast, isLHS) { if (prop.type === "ObjectMethod") { this.raise(prop.kind === "get" || prop.kind === "set" ? Errors.PatternHasAccessor : Errors.PatternHasMethod, prop.key); } else if (prop.type === "SpreadElement") { this.castNodeTo(prop, "RestElement"); const arg = prop.argument; this.checkToRestConversion(arg, false); this.toAssignable(arg, isLHS); if (!isLast) { this.raise(Errors.RestTrailingComma, prop); } } else { this.toAssignable(prop, isLHS); } } toAssignableList(exprList, trailingCommaLoc, isLHS) { const end = exprList.length - 1; for (let i = 0; i <= end; i++) { const elt = exprList[i]; if (!elt) continue; this.toAssignableListItem(exprList, i, isLHS); if (elt.type === "RestElement") { if (i < end) { this.raise(Errors.RestTrailingComma, elt); } else if (trailingCommaLoc) { this.raise(Errors.RestTrailingComma, trailingCommaLoc); } } } } toAssignableListItem(exprList, index, isLHS) { const node = exprList[index]; if (node.type === "SpreadElement") { this.castNodeTo(node, "RestElement"); const arg = node.argument; this.checkToRestConversion(arg, true); this.toAssignable(arg, isLHS); } else { this.toAssignable(node, isLHS); } } isAssignable(node, isBinding) { switch (node.type) { case "Identifier": case "ObjectPattern": case "ArrayPattern": case "AssignmentPattern": case "RestElement": case "VoidPattern": return true; case "ObjectExpression": { const last = node.properties.length - 1; return node.properties.every((prop, i) => { return prop.type !== "ObjectMethod" && (i === last || prop.type !== "SpreadElement") && this.isAssignable(prop); }); } case "ObjectProperty": return this.isAssignable(node.value); case "SpreadElement": return this.isAssignable(node.argument); case "ArrayExpression": return node.elements.every(element => element === null || this.isAssignable(element)); case "AssignmentExpression": return node.operator === "="; case "ParenthesizedExpression": return this.isAssignable(node.expression); case "MemberExpression": case "OptionalMemberExpression": return !isBinding; default: return false; } } toReferencedList(exprList, isParenthesizedExpr) { return exprList; } toReferencedListDeep(exprList, isParenthesizedExpr) { this.toReferencedList(exprList, isParenthesizedExpr); for (const expr of exprList) { if ((expr == null ? void 0 : expr.type) === "ArrayExpression") { this.toReferencedListDeep(expr.elements); } } } parseSpread(refExpressionErrors) { const node = this.startNode(); this.next(); node.argument = this.parseMaybeAssignAllowIn(refExpressionErrors, undefined); return this.finishNode(node, "SpreadElement"); } parseRestBinding() { const node = this.startNode(); this.next(); const argument = this.parseBindingAtom(); if (argument.type === "VoidPattern") { this.raise(Errors.UnexpectedVoidPattern, argument); } node.argument = argument; return this.finishNode(node, "RestElement"); } parseBindingAtom() { switch (this.state.type) { case 0: { const node = this.startNode(); this.next(); node.elements = this.parseBindingList(3, 93, 1); return this.finishNode(node, "ArrayPattern"); } case 5: return this.parseObjectLike(8, true); case 88: return this.parseVoidPattern(null); } return this.parseIdentifier(); } parseBindingList(close, closeCharCode, flags) { const allowEmpty = flags & 1; const elts = []; let first = true; while (!this.eat(close)) { if (first) { first = false; } else { this.expect(12); } if (allowEmpty && this.match(12)) { elts.push(null); } else if (this.eat(close)) { break; } else if (this.match(21)) { let rest = this.parseRestBinding(); if (this.hasPlugin("flow") || flags & 2) { rest = this.parseFunctionParamType(rest); } elts.push(rest); if (!this.checkCommaAfterRest(closeCharCode)) { this.expect(close); break; } } else { const decorators = []; if (flags & 2) { if (this.match(26) && this.hasPlugin("decorators")) { this.raise(Errors.UnsupportedParameterDecorator, this.state.startLoc); } while (this.match(26)) { decorators.push(this.parseDecorator()); } } elts.push(this.parseBindingElement(flags, decorators)); } } return elts; } parseBindingRestProperty(prop) { this.next(); if (this.hasPlugin("discardBinding") && this.match(88)) { prop.argument = this.parseVoidPattern(null); this.raise(Errors.UnexpectedVoidPattern, prop.argument); } else { prop.argument = this.parseIdentifier(); } this.checkCommaAfterRest(125); return this.finishNode(prop, "RestElement"); } parseBindingProperty() { const { type, startLoc } = this.state; if (type === 21) { return this.parseBindingRestProperty(this.startNode()); } const prop = this.startNode(); if (type === 139) { this.expectPlugin("destructuringPrivate", startLoc); this.classScope.usePrivateName(this.state.value, startLoc); prop.key = this.parsePrivateName(); } else { this.parsePropertyName(prop); } prop.method = false; return this.parseObjPropValue(prop, startLoc, false, false, true, false); } parseBindingElement(flags, decorators) { const left = this.parseMaybeDefault(); if (this.hasPlugin("flow") || flags & 2) { this.parseFunctionParamType(left); } if (decorators.length) { left.decorators = decorators; this.resetStartLocationFromNode(left, decorators[0]); } const elt = this.parseMaybeDefault(left.loc.start, left); return elt; } parseFunctionParamType(param) { return param; } parseMaybeDefault(startLoc, left) { startLoc != null ? startLoc : startLoc = this.state.startLoc; left = left != null ? left : this.parseBindingAtom(); if (!this.eat(29)) return left; const node = this.startNodeAt(startLoc); if (left.type === "VoidPattern") { this.raise(Errors.VoidPatternInitializer, left); } node.left = left; node.right = this.parseMaybeAssignAllowIn(); return this.finishNode(node, "AssignmentPattern"); } isValidLVal(type, isUnparenthesizedInAssign, binding) { switch (type) { case "AssignmentPattern": return "left"; case "RestElement": return "argument"; case "ObjectProperty": return "value"; case "ParenthesizedExpression": return "expression"; case "ArrayPattern": return "elements"; case "ObjectPattern": return "properties"; case "VoidPattern": return true; } return false; } isOptionalMemberExpression(expression) { return expression.type === "OptionalMemberExpression"; } checkLVal(expression, ancestor, binding = 64, checkClashes = false, strictModeChanged = false, hasParenthesizedAncestor = false) { var _expression$extra; const type = expression.type; if (this.isObjectMethod(expression)) return; const isOptionalMemberExpression = this.isOptionalMemberExpression(expression); if (isOptionalMemberExpression || type === "MemberExpression") { if (isOptionalMemberExpression) { this.expectPlugin("optionalChainingAssign", expression.loc.start); if (ancestor.type !== "AssignmentExpression") { this.raise(Errors.InvalidLhsOptionalChaining, expression, { ancestor }); } } if (binding !== 64) { this.raise(Errors.InvalidPropertyBindingPattern, expression); } return; } if (type === "Identifier") { this.checkIdentifier(expression, binding, strictModeChanged); const { name } = expression; if (checkClashes) { if (checkClashes.has(name)) { this.raise(Errors.ParamDupe, expression); } else { checkClashes.add(name); } } return; } else if (type === "VoidPattern" && ancestor.type === "CatchClause") { this.raise(Errors.VoidPatternCatchClauseParam, expression); } const validity = this.isValidLVal(type, !(hasParenthesizedAncestor || (_expression$extra = expression.extra) != null && _expression$extra.parenthesized) && ancestor.type === "AssignmentExpression", binding); if (validity === true) return; if (validity === false) { const ParseErrorClass = binding === 64 ? Errors.InvalidLhs : Errors.InvalidLhsBinding; this.raise(ParseErrorClass, expression, { ancestor }); return; } let key, isParenthesizedExpression; if (typeof validity === "string") { key = validity; isParenthesizedExpression = type === "ParenthesizedExpression"; } else { [key, isParenthesizedExpression] = validity; } const nextAncestor = type === "ArrayPattern" || type === "ObjectPattern" ? { type } : ancestor; const val = expression[key]; if (Array.isArray(val)) { for (const child of val) { if (child) { this.checkLVal(child, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression); } } } else if (val) { this.checkLVal(val, nextAncestor, binding, checkClashes, strictModeChanged, isParenthesizedExpression); } } checkIdentifier(at, bindingType, strictModeChanged = false) { if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(at.name, this.inModule) : isStrictBindOnlyReservedWord(at.name))) { if (bindingType === 64) { this.raise(Errors.StrictEvalArguments, at, { referenceName: at.name }); } else { this.raise(Errors.StrictEvalArgumentsBinding, at, { bindingName: at.name }); } } if (bindingType & 8192 && at.name === "let") { this.raise(Errors.LetInLexicalBinding, at); } if (!(bindingType & 64)) { this.declareNameFromIdentifier(at, bindingType); } } declareNameFromIdentifier(identifier, binding) { this.scope.declareName(identifier.name, binding, identifier.loc.start); } checkToRestConversion(node, allowPattern) { switch (node.type) { case "ParenthesizedExpression": this.checkToRestConversion(node.expression, allowPattern); break; case "Identifier": case "MemberExpression": break; case "ArrayExpression": case "ObjectExpression": if (allowPattern) break; default: this.raise(Errors.InvalidRestAssignmentPattern, node); } } checkCommaAfterRest(close) { if (!this.match(12)) { return false; } this.raise(this.lookaheadCharCode() === close ? Errors.RestTrailingComma : Errors.ElementAfterRest, this.state.startLoc); return true; } } function nonNull(x) { if (x == null) { throw new Error(`Unexpected ${x} value.`); } return x; } function assert(x) { if (!x) { throw new Error("Assert fail"); } } const TSErrors = ParseErrorEnum`typescript`({ AbstractMethodHasImplementation: ({ methodName }) => `Method '${methodName}' cannot have an implementation because it is marked abstract.`, AbstractPropertyHasInitializer: ({ propertyName }) => `Property '${propertyName}' cannot have an initializer because it is marked abstract.`, AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.", AccessorCannotDeclareThisParameter: "'get' and 'set' accessors cannot declare 'this' parameters.", AccessorCannotHaveTypeParameters: "An accessor cannot have type parameters.", ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.", ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.", ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference: "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.", ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", DeclareAccessor: ({ kind }) => `'declare' is not allowed in ${kind}ters.`, DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.", DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", DuplicateAccessibilityModifier: ({ modifier }) => `Accessibility modifier already seen: '${modifier}'.`, DuplicateModifier: ({ modifier }) => `Duplicate modifier: '${modifier}'.`, EmptyHeritageClauseType: ({ token }) => `'${token}' list cannot be empty.`, EmptyTypeArguments: "Type argument list cannot be empty.", EmptyTypeParameters: "Type parameter list cannot be empty.", ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.", ImportAliasHasImportType: "An import alias can not use 'import type'.", ImportReflectionHasImportType: "An `import module` declaration can not use `type` modifier", IncompatibleModifiers: ({ modifiers }) => `'${modifiers[0]}' modifier cannot be used with '${modifiers[1]}' modifier.`, IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier.", IndexSignatureHasAccessibility: ({ modifier }) => `Index signatures cannot have an accessibility modifier ('${modifier}').`, IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier.", IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.", IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier.", InitializerNotAllowedInAmbientContext: "Initializers are not allowed in ambient contexts.", InvalidHeritageClauseType: ({ token }) => `'${token}' list can only include identifiers or qualified-names with optional type arguments.`, InvalidModifierOnAwaitUsingDeclaration: modifier => `'${modifier}' modifier cannot appear on an await using declaration.`, InvalidModifierOnTypeMember: ({ modifier }) => `'${modifier}' modifier cannot appear on a type member.`, InvalidModifierOnTypeParameter: ({ modifier }) => `'${modifier}' modifier cannot appear on a type parameter.`, InvalidModifierOnTypeParameterPositions: ({ modifier }) => `'${modifier}' modifier can only appear on a type parameter of a class, interface or type alias.`, InvalidModifierOnUsingDeclaration: modifier => `'${modifier}' modifier cannot appear on a using declaration.`, InvalidModifiersOrder: ({ orderedModifiers }) => `'${orderedModifiers[0]}' modifier must precede '${orderedModifiers[1]}' modifier.`, InvalidPropertyAccessAfterInstantiationExpression: "Invalid property access after an instantiation expression. " + "You can either wrap the instantiation expression in parentheses, or delete the type arguments.", InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", MissingInterfaceName: "'interface' declarations must be followed by an identifier.", NonAbstractClassHasAbstractMethod: "Abstract methods can only appear within an abstract class.", NonClassMethodPropertyHasAbstractModifier: "'abstract' modifier can only appear on a class, method, or property declaration.", OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", OverrideNotInSubClass: "This member cannot have an 'override' modifier because its containing class does not extend another class.", PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.", PrivateElementHasAccessibility: ({ modifier }) => `Private elements cannot have an accessibility modifier ('${modifier}').`, ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.", ReservedArrowTypeParam: "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.", ReservedTypeAssertion: "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.", SetAccessorCannotHaveOptionalParameter: "A 'set' accessor cannot have an optional parameter.", SetAccessorCannotHaveRestParameter: "A 'set' accessor cannot have rest parameter.", SetAccessorCannotHaveReturnType: "A 'set' accessor cannot have a return type annotation.", SingleTypeParameterWithoutTrailingComma: ({ typeParameterName }) => `Single type parameter ${typeParameterName} should have a trailing comma. Example usage: <${typeParameterName},>.`, StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", TupleOptionalAfterType: "A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).", TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.", TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.", UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", UnexpectedTypeAnnotation: "Did not expect a type annotation here.", UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", UnsupportedSignatureParameterKind: ({ type }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${type}.`, UsingDeclarationInAmbientContext: kind => `'${kind}' declarations are not allowed in ambient contexts.` }); function keywordTypeFromName(value) { switch (value) { case "any": return "TSAnyKeyword"; case "boolean": return "TSBooleanKeyword"; case "bigint": return "TSBigIntKeyword"; case "never": return "TSNeverKeyword"; case "number": return "TSNumberKeyword"; case "object": return "TSObjectKeyword"; case "string": return "TSStringKeyword"; case "symbol": return "TSSymbolKeyword"; case "undefined": return "TSUndefinedKeyword"; case "unknown": return "TSUnknownKeyword"; default: return undefined; } } function tsIsAccessModifier(modifier) { return modifier === "private" || modifier === "public" || modifier === "protected"; } function tsIsVarianceAnnotations(modifier) { return modifier === "in" || modifier === "out"; } var typescript = superClass => class TypeScriptParserMixin extends superClass { constructor(...args) { super(...args); this.tsParseInOutModifiers = this.tsParseModifiers.bind(this, { allowedModifiers: ["in", "out"], disallowedModifiers: ["const", "public", "private", "protected", "readonly", "declare", "abstract", "override"], errorTemplate: TSErrors.InvalidModifierOnTypeParameter }); this.tsParseConstModifier = this.tsParseModifiers.bind(this, { allowedModifiers: ["const"], disallowedModifiers: ["in", "out"], errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions }); this.tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, { allowedModifiers: ["in", "out", "const"], disallowedModifiers: ["public", "private", "protected", "readonly", "declare", "abstract", "override"], errorTemplate: TSErrors.InvalidModifierOnTypeParameter }); } getScopeHandler() { return TypeScriptScopeHandler; } tsIsIdentifier() { return tokenIsIdentifier(this.state.type); } tsTokenCanFollowModifier() { return this.match(0) || this.match(5) || this.match(55) || this.match(21) || this.match(139) || this.isLiteralPropertyName(); } tsNextTokenOnSameLineAndCanFollowModifier() { this.next(); if (this.hasPrecedingLineBreak()) { return false; } return this.tsTokenCanFollowModifier(); } tsNextTokenCanFollowModifier() { if (this.match(106)) { this.next(); return this.tsTokenCanFollowModifier(); } return this.tsNextTokenOnSameLineAndCanFollowModifier(); } tsParseModifier(allowedModifiers, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) { if (!tokenIsIdentifier(this.state.type) && this.state.type !== 58 && this.state.type !== 75) { return undefined; } const modifier = this.state.value; if (allowedModifiers.includes(modifier)) { if (hasSeenStaticModifier && this.match(106)) { return undefined; } if (stopOnStartOfClassStaticBlock && this.tsIsStartOfStaticBlocks()) { return undefined; } if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) { return modifier; } } return undefined; } tsParseModifiers({ allowedModifiers, disallowedModifiers, stopOnStartOfClassStaticBlock, errorTemplate = TSErrors.InvalidModifierOnTypeMember }, modified) { const enforceOrder = (loc, modifier, before, after) => { if (modifier === before && modified[after]) { this.raise(TSErrors.InvalidModifiersOrder, loc, { orderedModifiers: [before, after] }); } }; const incompatible = (loc, modifier, mod1, mod2) => { if (modified[mod1] && modifier === mod2 || modified[mod2] && modifier === mod1) { this.raise(TSErrors.IncompatibleModifiers, loc, { modifiers: [mod1, mod2] }); } }; for (;;) { const { startLoc } = this.state; const modifier = this.tsParseModifier(allowedModifiers.concat(disallowedModifiers != null ? disallowedModifiers : []), stopOnStartOfClassStaticBlock, modified.static); if (!modifier) break; if (tsIsAccessModifier(modifier)) { if (modified.accessibility) { this.raise(TSErrors.DuplicateAccessibilityModifier, startLoc, { modifier }); } else { enforceOrder(startLoc, modifier, modifier, "override"); enforceOrder(startLoc, modifier, modifier, "static"); enforceOrder(startLoc, modifier, modifier, "readonly"); modified.accessibility = modifier; } } else if (tsIsVarianceAnnotations(modifier)) { if (modified[modifier]) { this.raise(TSErrors.DuplicateModifier, startLoc, { modifier }); } modified[modifier] = true; enforceOrder(startLoc, modifier, "in", "out"); } else { if (hasOwnProperty.call(modified, modifier)) { this.raise(TSErrors.DuplicateModifier, startLoc, { modifier }); } else { enforceOrder(startLoc, modifier, "static", "readonly"); enforceOrder(startLoc, modifier, "static", "override"); enforceOrder(startLoc, modifier, "override", "readonly"); enforceOrder(startLoc, modifier, "abstract", "override"); incompatible(startLoc, modifier, "declare", "override"); incompatible(startLoc, modifier, "static", "abstract"); } modified[modifier] = true; } if (disallowedModifiers != null && disallowedModifiers.includes(modifier)) { this.raise(errorTemplate, startLoc, { modifier }); } } } tsIsListTerminator(kind) { switch (kind) { case "EnumMembers": case "TypeMembers": return this.match(8); case "HeritageClauseElement": return this.match(5); case "TupleElementTypes": return this.match(3); case "TypeParametersOrArguments": return this.match(48); } } tsParseList(kind, parseElement) { const result = []; while (!this.tsIsListTerminator(kind)) { result.push(parseElement()); } return result; } tsParseDelimitedList(kind, parseElement, refTrailingCommaPos) { return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true, refTrailingCommaPos)); } tsParseDelimitedListWorker(kind, parseElement, expectSuccess, refTrailingCommaPos) { const result = []; let trailingCommaPos = -1; for (;;) { if (this.tsIsListTerminator(kind)) { break; } trailingCommaPos = -1; const element = parseElement(); if (element == null) { return undefined; } result.push(element); if (this.eat(12)) { trailingCommaPos = this.state.lastTokStartLoc.index; continue; } if (this.tsIsListTerminator(kind)) { break; } if (expectSuccess) { this.expect(12); } return undefined; } if (refTrailingCommaPos) { refTrailingCommaPos.value = trailingCommaPos; } return result; } tsParseBracketedList(kind, parseElement, bracket, skipFirstToken, refTrailingCommaPos) { if (!skipFirstToken) { if (bracket) { this.expect(0); } else { this.expect(47); } } const result = this.tsParseDelimitedList(kind, parseElement, refTrailingCommaPos); if (bracket) { this.expect(3); } else { this.expect(48); } return result; } tsParseImportType() { const node = this.startNode(); this.expect(83); this.expect(10); if (!this.match(134)) { this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc); { node.argument = super.parseExprAtom(); } } else { { node.argument = this.parseStringLiteral(this.state.value); } } if (this.eat(12)) { node.options = this.tsParseImportTypeOptions(); } else { node.options = null; } this.expect(11); if (this.eat(16)) { node.qualifier = this.tsParseEntityName(1 | 2); } if (this.match(47)) { { node.typeParameters = this.tsParseTypeArguments(); } } return this.finishNode(node, "TSImportType"); } tsParseImportTypeOptions() { const node = this.startNode(); this.expect(5); const withProperty = this.startNode(); if (this.isContextual(76)) { withProperty.method = false; withProperty.key = this.parseIdentifier(true); withProperty.computed = false; withProperty.shorthand = false; } else { this.unexpected(null, 76); } this.expect(14); withProperty.value = this.tsParseImportTypeWithPropertyValue(); node.properties = [this.finishObjectProperty(withProperty)]; this.eat(12); this.expect(8); return this.finishNode(node, "ObjectExpression"); } tsParseImportTypeWithPropertyValue() { const node = this.startNode(); const properties = []; this.expect(5); while (!this.match(8)) { const type = this.state.type; if (tokenIsIdentifier(type) || type === 134) { properties.push(super.parsePropertyDefinition(null)); } else { this.unexpected(); } this.eat(12); } node.properties = properties; this.next(); return this.finishNode(node, "ObjectExpression"); } tsParseEntityName(flags) { let entity; if (flags & 1 && this.match(78)) { if (flags & 2) { entity = this.parseIdentifier(true); } else { const node = this.startNode(); this.next(); entity = this.finishNode(node, "ThisExpression"); } } else { entity = this.parseIdentifier(!!(flags & 1)); } while (this.eat(16)) { const node = this.startNodeAtNode(entity); node.left = entity; node.right = this.parseIdentifier(!!(flags & 1)); entity = this.finishNode(node, "TSQualifiedName"); } return entity; } tsParseTypeReference() { const node = this.startNode(); node.typeName = this.tsParseEntityName(1); if (!this.hasPrecedingLineBreak() && this.match(47)) { { node.typeParameters = this.tsParseTypeArguments(); } } return this.finishNode(node, "TSTypeReference"); } tsParseThisTypePredicate(lhs) { this.next(); const node = this.startNodeAtNode(lhs); node.parameterName = lhs; node.typeAnnotation = this.tsParseTypeAnnotation(false); node.asserts = false; return this.finishNode(node, "TSTypePredicate"); } tsParseThisTypeNode() { const node = this.startNode(); this.next(); return this.finishNode(node, "TSThisType"); } tsParseTypeQuery() { const node = this.startNode(); this.expect(87); if (this.match(83)) { node.exprName = this.tsParseImportType(); } else { { node.exprName = this.tsParseEntityName(1 | 2); } } if (!this.hasPrecedingLineBreak() && this.match(47)) { { node.typeParameters = this.tsParseTypeArguments(); } } return this.finishNode(node, "TSTypeQuery"); } tsParseTypeParameter(parseModifiers) { const node = this.startNode(); parseModifiers(node); node.name = this.tsParseTypeParameterName(); node.constraint = this.tsEatThenParseType(81); node.default = this.tsEatThenParseType(29); return this.finishNode(node, "TSTypeParameter"); } tsTryParseTypeParameters(parseModifiers) { if (this.match(47)) { return this.tsParseTypeParameters(parseModifiers); } } tsParseTypeParameters(parseModifiers) { const node = this.startNode(); if (this.match(47) || this.match(143)) { this.next(); } else { this.unexpected(); } const refTrailingCommaPos = { value: -1 }; node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos); if (node.params.length === 0) { this.raise(TSErrors.EmptyTypeParameters, node); } if (refTrailingCommaPos.value !== -1) { this.addExtra(node, "trailingComma", refTrailingCommaPos.value); } return this.finishNode(node, "TSTypeParameterDeclaration"); } tsFillSignature(returnToken, signature) { const returnTokenRequired = returnToken === 19; const paramsKey = "parameters"; const returnTypeKey = "typeAnnotation"; signature.typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); this.expect(10); signature[paramsKey] = this.tsParseBindingListForSignature(); if (returnTokenRequired) { signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); } else if (this.match(returnToken)) { signature[returnTypeKey] = this.tsParseTypeOrTypePredicateAnnotation(returnToken); } } tsParseBindingListForSignature() { const list = super.parseBindingList(11, 41, 2); for (const pattern of list) { const { type } = pattern; if (type === "AssignmentPattern" || type === "TSParameterProperty") { this.raise(TSErrors.UnsupportedSignatureParameterKind, pattern, { type }); } } return list; } tsParseTypeMemberSemicolon() { if (!this.eat(12) && !this.isLineTerminator()) { this.expect(13); } } tsParseSignatureMember(kind, node) { this.tsFillSignature(14, node); this.tsParseTypeMemberSemicolon(); return this.finishNode(node, kind); } tsIsUnambiguouslyIndexSignature() { this.next(); if (tokenIsIdentifier(this.state.type)) { this.next(); return this.match(14); } return false; } tsTryParseIndexSignature(node) { if (!(this.match(0) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) { return; } this.expect(0); const id = this.parseIdentifier(); id.typeAnnotation = this.tsParseTypeAnnotation(); this.resetEndLocation(id); this.expect(3); node.parameters = [id]; const type = this.tsTryParseTypeAnnotation(); if (type) node.typeAnnotation = type; this.tsParseTypeMemberSemicolon(); return this.finishNode(node, "TSIndexSignature"); } tsParsePropertyOrMethodSignature(node, readonly) { if (this.eat(17)) node.optional = true; if (this.match(10) || this.match(47)) { if (readonly) { this.raise(TSErrors.ReadonlyForMethodSignature, node); } const method = node; if (method.kind && this.match(47)) { this.raise(TSErrors.AccessorCannotHaveTypeParameters, this.state.curPosition()); } this.tsFillSignature(14, method); this.tsParseTypeMemberSemicolon(); const paramsKey = "parameters"; const returnTypeKey = "typeAnnotation"; if (method.kind === "get") { if (method[paramsKey].length > 0) { this.raise(Errors.BadGetterArity, this.state.curPosition()); if (this.isThisParam(method[paramsKey][0])) { this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition()); } } } else if (method.kind === "set") { if (method[paramsKey].length !== 1) { this.raise(Errors.BadSetterArity, this.state.curPosition()); } else { const firstParameter = method[paramsKey][0]; if (this.isThisParam(firstParameter)) { this.raise(TSErrors.AccessorCannotDeclareThisParameter, this.state.curPosition()); } if (firstParameter.type === "Identifier" && firstParameter.optional) { this.raise(TSErrors.SetAccessorCannotHaveOptionalParameter, this.state.curPosition()); } if (firstParameter.type === "RestElement") { this.raise(TSErrors.SetAccessorCannotHaveRestParameter, this.state.curPosition()); } } if (method[returnTypeKey]) { this.raise(TSErrors.SetAccessorCannotHaveReturnType, method[returnTypeKey]); } } else { method.kind = "method"; } return this.finishNode(method, "TSMethodSignature"); } else { const property = node; if (readonly) property.readonly = true; const type = this.tsTryParseTypeAnnotation(); if (type) property.typeAnnotation = type; this.tsParseTypeMemberSemicolon(); return this.finishNode(property, "TSPropertySignature"); } } tsParseTypeMember() { const node = this.startNode(); if (this.match(10) || this.match(47)) { return this.tsParseSignatureMember("TSCallSignatureDeclaration", node); } if (this.match(77)) { const id = this.startNode(); this.next(); if (this.match(10) || this.match(47)) { return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node); } else { node.key = this.createIdentifier(id, "new"); return this.tsParsePropertyOrMethodSignature(node, false); } } this.tsParseModifiers({ allowedModifiers: ["readonly"], disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"] }, node); const idx = this.tsTryParseIndexSignature(node); if (idx) { return idx; } super.parsePropertyName(node); if (!node.computed && node.key.type === "Identifier" && (node.key.name === "get" || node.key.name === "set") && this.tsTokenCanFollowModifier()) { node.kind = node.key.name; super.parsePropertyName(node); if (!this.match(10) && !this.match(47)) { this.unexpected(null, 10); } } return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); } tsParseTypeLiteral() { const node = this.startNode(); node.members = this.tsParseObjectTypeMembers(); return this.finishNode(node, "TSTypeLiteral"); } tsParseObjectTypeMembers() { this.expect(5); const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this)); this.expect(8); return members; } tsIsStartOfMappedType() { this.next(); if (this.eat(53)) { return this.isContextual(122); } if (this.isContextual(122)) { this.next(); } if (!this.match(0)) { return false; } this.next(); if (!this.tsIsIdentifier()) { return false; } this.next(); return this.match(58); } tsParseMappedType() { const node = this.startNode(); this.expect(5); if (this.match(53)) { node.readonly = this.state.value; this.next(); this.expectContextual(122); } else if (this.eatContextual(122)) { node.readonly = true; } this.expect(0); { const typeParameter = this.startNode(); typeParameter.name = this.tsParseTypeParameterName(); typeParameter.constraint = this.tsExpectThenParseType(58); node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); } node.nameType = this.eatContextual(93) ? this.tsParseType() : null; this.expect(3); if (this.match(53)) { node.optional = this.state.value; this.next(); this.expect(17); } else if (this.eat(17)) { node.optional = true; } node.typeAnnotation = this.tsTryParseType(); this.semicolon(); this.expect(8); return this.finishNode(node, "TSMappedType"); } tsParseTupleType() { const node = this.startNode(); node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false); let seenOptionalElement = false; node.elementTypes.forEach(elementNode => { const { type } = elementNode; if (seenOptionalElement && type !== "TSRestType" && type !== "TSOptionalType" && !(type === "TSNamedTupleMember" && elementNode.optional)) { this.raise(TSErrors.OptionalTypeBeforeRequired, elementNode); } seenOptionalElement || (seenOptionalElement = type === "TSNamedTupleMember" && elementNode.optional || type === "TSOptionalType"); }); return this.finishNode(node, "TSTupleType"); } tsParseTupleElementType() { const restStartLoc = this.state.startLoc; const rest = this.eat(21); const { startLoc } = this.state; let labeled; let label; let optional; let type; const isWord = tokenIsKeywordOrIdentifier(this.state.type); const chAfterWord = isWord ? this.lookaheadCharCode() : null; if (chAfterWord === 58) { labeled = true; optional = false; label = this.parseIdentifier(true); this.expect(14); type = this.tsParseType(); } else if (chAfterWord === 63) { optional = true; const wordName = this.state.value; const typeOrLabel = this.tsParseNonArrayType(); if (this.lookaheadCharCode() === 58) { labeled = true; label = this.createIdentifier(this.startNodeAt(startLoc), wordName); this.expect(17); this.expect(14); type = this.tsParseType(); } else { labeled = false; type = typeOrLabel; this.expect(17); } } else { type = this.tsParseType(); optional = this.eat(17); labeled = this.eat(14); } if (labeled) { let labeledNode; if (label) { labeledNode = this.startNodeAt(startLoc); labeledNode.optional = optional; labeledNode.label = label; labeledNode.elementType = type; if (this.eat(17)) { labeledNode.optional = true; this.raise(TSErrors.TupleOptionalAfterType, this.state.lastTokStartLoc); } } else { labeledNode = this.startNodeAt(startLoc); labeledNode.optional = optional; this.raise(TSErrors.InvalidTupleMemberLabel, type); labeledNode.label = type; labeledNode.elementType = this.tsParseType(); } type = this.finishNode(labeledNode, "TSNamedTupleMember"); } else if (optional) { const optionalTypeNode = this.startNodeAt(startLoc); optionalTypeNode.typeAnnotation = type; type = this.finishNode(optionalTypeNode, "TSOptionalType"); } if (rest) { const restNode = this.startNodeAt(restStartLoc); restNode.typeAnnotation = type; type = this.finishNode(restNode, "TSRestType"); } return type; } tsParseParenthesizedType() { const node = this.startNode(); this.expect(10); node.typeAnnotation = this.tsParseType(); this.expect(11); return this.finishNode(node, "TSParenthesizedType"); } tsParseFunctionOrConstructorType(type, abstract) { const node = this.startNode(); if (type === "TSConstructorType") { node.abstract = !!abstract; if (abstract) this.next(); this.next(); } this.tsInAllowConditionalTypesContext(() => this.tsFillSignature(19, node)); return this.finishNode(node, type); } tsParseLiteralTypeNode() { const node = this.startNode(); switch (this.state.type) { case 135: case 136: case 134: case 85: case 86: node.literal = super.parseExprAtom(); break; default: this.unexpected(); } return this.finishNode(node, "TSLiteralType"); } tsParseTemplateLiteralType() { { const node = this.startNode(); node.literal = super.parseTemplate(false); return this.finishNode(node, "TSLiteralType"); } } parseTemplateSubstitution() { if (this.state.inType) return this.tsParseType(); return super.parseTemplateSubstitution(); } tsParseThisTypeOrThisTypePredicate() { const thisKeyword = this.tsParseThisTypeNode(); if (this.isContextual(116) && !this.hasPrecedingLineBreak()) { return this.tsParseThisTypePredicate(thisKeyword); } else { return thisKeyword; } } tsParseNonArrayType() { switch (this.state.type) { case 134: case 135: case 136: case 85: case 86: return this.tsParseLiteralTypeNode(); case 53: if (this.state.value === "-") { const node = this.startNode(); const nextToken = this.lookahead(); if (nextToken.type !== 135 && nextToken.type !== 136) { this.unexpected(); } node.literal = this.parseMaybeUnary(); return this.finishNode(node, "TSLiteralType"); } break; case 78: return this.tsParseThisTypeOrThisTypePredicate(); case 87: return this.tsParseTypeQuery(); case 83: return this.tsParseImportType(); case 5: return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral(); case 0: return this.tsParseTupleType(); case 10: return this.tsParseParenthesizedType(); case 25: case 24: return this.tsParseTemplateLiteralType(); default: { const { type } = this.state; if (tokenIsIdentifier(type) || type === 88 || type === 84) { const nodeType = type === 88 ? "TSVoidKeyword" : type === 84 ? "TSNullKeyword" : keywordTypeFromName(this.state.value); if (nodeType !== undefined && this.lookaheadCharCode() !== 46) { const node = this.startNode(); this.next(); return this.finishNode(node, nodeType); } return this.tsParseTypeReference(); } } } this.unexpected(); } tsParseArrayTypeOrHigher() { const { startLoc } = this.state; let type = this.tsParseNonArrayType(); while (!this.hasPrecedingLineBreak() && this.eat(0)) { if (this.match(3)) { const node = this.startNodeAt(startLoc); node.elementType = type; this.expect(3); type = this.finishNode(node, "TSArrayType"); } else { const node = this.startNodeAt(startLoc); node.objectType = type; node.indexType = this.tsParseType(); this.expect(3); type = this.finishNode(node, "TSIndexedAccessType"); } } return type; } tsParseTypeOperator() { const node = this.startNode(); const operator = this.state.value; this.next(); node.operator = operator; node.typeAnnotation = this.tsParseTypeOperatorOrHigher(); if (operator === "readonly") { this.tsCheckTypeAnnotationForReadOnly(node); } return this.finishNode(node, "TSTypeOperator"); } tsCheckTypeAnnotationForReadOnly(node) { switch (node.typeAnnotation.type) { case "TSTupleType": case "TSArrayType": return; default: this.raise(TSErrors.UnexpectedReadonly, node); } } tsParseInferType() { const node = this.startNode(); this.expectContextual(115); const typeParameter = this.startNode(); typeParameter.name = this.tsParseTypeParameterName(); typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType()); node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter"); return this.finishNode(node, "TSInferType"); } tsParseConstraintForInferType() { if (this.eat(81)) { const constraint = this.tsInDisallowConditionalTypesContext(() => this.tsParseType()); if (this.state.inDisallowConditionalTypesContext || !this.match(17)) { return constraint; } } } tsParseTypeOperatorOrHigher() { const isTypeOperator = tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc; return isTypeOperator ? this.tsParseTypeOperator() : this.isContextual(115) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher()); } tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) { const node = this.startNode(); const hasLeadingOperator = this.eat(operator); const types = []; do { types.push(parseConstituentType()); } while (this.eat(operator)); if (types.length === 1 && !hasLeadingOperator) { return types[0]; } node.types = types; return this.finishNode(node, kind); } tsParseIntersectionTypeOrHigher() { return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), 45); } tsParseUnionTypeOrHigher() { return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), 43); } tsIsStartOfFunctionType() { if (this.match(47)) { return true; } return this.match(10) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this)); } tsSkipParameterStart() { if (tokenIsIdentifier(this.state.type) || this.match(78)) { this.next(); return true; } if (this.match(5)) { const { errors } = this.state; const previousErrorCount = errors.length; try { this.parseObjectLike(8, true); return errors.length === previousErrorCount; } catch (_unused) { return false; } } if (this.match(0)) { this.next(); const { errors } = this.state; const previousErrorCount = errors.length; try { super.parseBindingList(3, 93, 1); return errors.length === previousErrorCount; } catch (_unused2) { return false; } } return false; } tsIsUnambiguouslyStartOfFunctionType() { this.next(); if (this.match(11) || this.match(21)) { return true; } if (this.tsSkipParameterStart()) { if (this.match(14) || this.match(12) || this.match(17) || this.match(29)) { return true; } if (this.match(11)) { this.next(); if (this.match(19)) { return true; } } } return false; } tsParseTypeOrTypePredicateAnnotation(returnToken) { return this.tsInType(() => { const t = this.startNode(); this.expect(returnToken); const node = this.startNode(); const asserts = !!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this)); if (asserts && this.match(78)) { let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); if (thisTypePredicate.type === "TSThisType") { node.parameterName = thisTypePredicate; node.asserts = true; node.typeAnnotation = null; thisTypePredicate = this.finishNode(node, "TSTypePredicate"); } else { this.resetStartLocationFromNode(thisTypePredicate, node); thisTypePredicate.asserts = true; } t.typeAnnotation = thisTypePredicate; return this.finishNode(t, "TSTypeAnnotation"); } const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); if (!typePredicateVariable) { if (!asserts) { return this.tsParseTypeAnnotation(false, t); } node.parameterName = this.parseIdentifier(); node.asserts = asserts; node.typeAnnotation = null; t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); return this.finishNode(t, "TSTypeAnnotation"); } const type = this.tsParseTypeAnnotation(false); node.parameterName = typePredicateVariable; node.typeAnnotation = type; node.asserts = asserts; t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); return this.finishNode(t, "TSTypeAnnotation"); }); } tsTryParseTypeOrTypePredicateAnnotation() { if (this.match(14)) { return this.tsParseTypeOrTypePredicateAnnotation(14); } } tsTryParseTypeAnnotation() { if (this.match(14)) { return this.tsParseTypeAnnotation(); } } tsTryParseType() { return this.tsEatThenParseType(14); } tsParseTypePredicatePrefix() { const id = this.parseIdentifier(); if (this.isContextual(116) && !this.hasPrecedingLineBreak()) { this.next(); return id; } } tsParseTypePredicateAsserts() { if (this.state.type !== 109) { return false; } const containsEsc = this.state.containsEsc; this.next(); if (!tokenIsIdentifier(this.state.type) && !this.match(78)) { return false; } if (containsEsc) { this.raise(Errors.InvalidEscapedReservedWord, this.state.lastTokStartLoc, { reservedWord: "asserts" }); } return true; } tsParseTypeAnnotation(eatColon = true, t = this.startNode()) { this.tsInType(() => { if (eatColon) this.expect(14); t.typeAnnotation = this.tsParseType(); }); return this.finishNode(t, "TSTypeAnnotation"); } tsParseType() { assert(this.state.inType); const type = this.tsParseNonConditionalType(); if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) { return type; } const node = this.startNodeAtNode(type); node.checkType = type; node.extendsType = this.tsInDisallowConditionalTypesContext(() => this.tsParseNonConditionalType()); this.expect(17); node.trueType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); this.expect(14); node.falseType = this.tsInAllowConditionalTypesContext(() => this.tsParseType()); return this.finishNode(node, "TSConditionalType"); } isAbstractConstructorSignature() { return this.isContextual(124) && this.isLookaheadContextual("new"); } tsParseNonConditionalType() { if (this.tsIsStartOfFunctionType()) { return this.tsParseFunctionOrConstructorType("TSFunctionType"); } if (this.match(77)) { return this.tsParseFunctionOrConstructorType("TSConstructorType"); } else if (this.isAbstractConstructorSignature()) { return this.tsParseFunctionOrConstructorType("TSConstructorType", true); } return this.tsParseUnionTypeOrHigher(); } tsParseTypeAssertion() { if (this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { this.raise(TSErrors.ReservedTypeAssertion, this.state.startLoc); } const node = this.startNode(); node.typeAnnotation = this.tsInType(() => { this.next(); return this.match(75) ? this.tsParseTypeReference() : this.tsParseType(); }); this.expect(48); node.expression = this.parseMaybeUnary(); return this.finishNode(node, "TSTypeAssertion"); } tsParseHeritageClause(token) { const originalStartLoc = this.state.startLoc; const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => { { const node = this.startNode(); node.expression = this.tsParseEntityName(1 | 2); if (this.match(47)) { node.typeParameters = this.tsParseTypeArguments(); } return this.finishNode(node, "TSExpressionWithTypeArguments"); } }); if (!delimitedList.length) { this.raise(TSErrors.EmptyHeritageClauseType, originalStartLoc, { token }); } return delimitedList; } tsParseInterfaceDeclaration(node, properties = {}) { if (this.hasFollowingLineBreak()) return null; this.expectContextual(129); if (properties.declare) node.declare = true; if (tokenIsIdentifier(this.state.type)) { node.id = this.parseIdentifier(); this.checkIdentifier(node.id, 130); } else { node.id = null; this.raise(TSErrors.MissingInterfaceName, this.state.startLoc); } node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); if (this.eat(81)) { node.extends = this.tsParseHeritageClause("extends"); } const body = this.startNode(); body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)); node.body = this.finishNode(body, "TSInterfaceBody"); return this.finishNode(node, "TSInterfaceDeclaration"); } tsParseTypeAliasDeclaration(node) { node.id = this.parseIdentifier(); this.checkIdentifier(node.id, 2); node.typeAnnotation = this.tsInType(() => { node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers); this.expect(29); if (this.isContextual(114) && this.lookaheadCharCode() !== 46) { const node = this.startNode(); this.next(); return this.finishNode(node, "TSIntrinsicKeyword"); } return this.tsParseType(); }); this.semicolon(); return this.finishNode(node, "TSTypeAliasDeclaration"); } tsInTopLevelContext(cb) { if (this.curContext() !== types.brace) { const oldContext = this.state.context; this.state.context = [oldContext[0]]; try { return cb(); } finally { this.state.context = oldContext; } } else { return cb(); } } tsInType(cb) { const oldInType = this.state.inType; this.state.inType = true; try { return cb(); } finally { this.state.inType = oldInType; } } tsInDisallowConditionalTypesContext(cb) { const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; this.state.inDisallowConditionalTypesContext = true; try { return cb(); } finally { this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; } } tsInAllowConditionalTypesContext(cb) { const oldInDisallowConditionalTypesContext = this.state.inDisallowConditionalTypesContext; this.state.inDisallowConditionalTypesContext = false; try { return cb(); } finally { this.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; } } tsEatThenParseType(token) { if (this.match(token)) { return this.tsNextThenParseType(); } } tsExpectThenParseType(token) { return this.tsInType(() => { this.expect(token); return this.tsParseType(); }); } tsNextThenParseType() { return this.tsInType(() => { this.next(); return this.tsParseType(); }); } tsParseEnumMember() { const node = this.startNode(); node.id = this.match(134) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true); if (this.eat(29)) { node.initializer = super.parseMaybeAssignAllowIn(); } return this.finishNode(node, "TSEnumMember"); } tsParseEnumDeclaration(node, properties = {}) { if (properties.const) node.const = true; if (properties.declare) node.declare = true; this.expectContextual(126); node.id = this.parseIdentifier(); this.checkIdentifier(node.id, node.const ? 8971 : 8459); { this.expect(5); node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); this.expect(8); } return this.finishNode(node, "TSEnumDeclaration"); } tsParseEnumBody() { const node = this.startNode(); this.expect(5); node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this)); this.expect(8); return this.finishNode(node, "TSEnumBody"); } tsParseModuleBlock() { const node = this.startNode(); this.scope.enter(0); this.expect(5); super.parseBlockOrModuleBlockBody(node.body = [], undefined, true, 8); this.scope.exit(); return this.finishNode(node, "TSModuleBlock"); } tsParseModuleOrNamespaceDeclaration(node, nested = false) { node.id = this.parseIdentifier(); if (!nested) { this.checkIdentifier(node.id, 1024); } if (this.eat(16)) { const inner = this.startNode(); this.tsParseModuleOrNamespaceDeclaration(inner, true); node.body = inner; } else { this.scope.enter(1024); this.prodParam.enter(0); node.body = this.tsParseModuleBlock(); this.prodParam.exit(); this.scope.exit(); } return this.finishNode(node, "TSModuleDeclaration"); } tsParseAmbientExternalModuleDeclaration(node) { if (this.isContextual(112)) { node.kind = "global"; { node.global = true; } node.id = this.parseIdentifier(); } else if (this.match(134)) { node.kind = "module"; node.id = super.parseStringLiteral(this.state.value); } else { this.unexpected(); } if (this.match(5)) { this.scope.enter(1024); this.prodParam.enter(0); node.body = this.tsParseModuleBlock(); this.prodParam.exit(); this.scope.exit(); } else { this.semicolon(); } return this.finishNode(node, "TSModuleDeclaration"); } tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier, isExport) { { node.isExport = isExport || false; } node.id = maybeDefaultIdentifier || this.parseIdentifier(); this.checkIdentifier(node.id, 4096); this.expect(29); const moduleReference = this.tsParseModuleReference(); if (node.importKind === "type" && moduleReference.type !== "TSExternalModuleReference") { this.raise(TSErrors.ImportAliasHasImportType, moduleReference); } node.moduleReference = moduleReference; this.semicolon(); return this.finishNode(node, "TSImportEqualsDeclaration"); } tsIsExternalModuleReference() { return this.isContextual(119) && this.lookaheadCharCode() === 40; } tsParseModuleReference() { return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(0); } tsParseExternalModuleReference() { const node = this.startNode(); this.expectContextual(119); this.expect(10); if (!this.match(134)) { this.unexpected(); } node.expression = super.parseExprAtom(); this.expect(11); this.sawUnambiguousESM = true; return this.finishNode(node, "TSExternalModuleReference"); } tsLookAhead(f) { const state = this.state.clone(); const res = f(); this.state = state; return res; } tsTryParseAndCatch(f) { const result = this.tryParse(abort => f() || abort()); if (result.aborted || !result.node) return; if (result.error) this.state = result.failState; return result.node; } tsTryParse(f) { const state = this.state.clone(); const result = f(); if (result !== undefined && result !== false) { return result; } this.state = state; } tsTryParseDeclare(node) { if (this.isLineTerminator()) { return; } const startType = this.state.type; return this.tsInAmbientContext(() => { switch (startType) { case 68: node.declare = true; return super.parseFunctionStatement(node, false, false); case 80: node.declare = true; return this.parseClass(node, true, false); case 126: return this.tsParseEnumDeclaration(node, { declare: true }); case 112: return this.tsParseAmbientExternalModuleDeclaration(node); case 100: if (this.state.containsEsc) { return; } case 75: case 74: if (!this.match(75) || !this.isLookaheadContextual("enum")) { node.declare = true; return this.parseVarStatement(node, this.state.value, true); } this.expect(75); return this.tsParseEnumDeclaration(node, { const: true, declare: true }); case 107: if (this.isUsing()) { this.raise(TSErrors.InvalidModifierOnUsingDeclaration, this.state.startLoc, "declare"); node.declare = true; return this.parseVarStatement(node, "using", true); } break; case 96: if (this.isAwaitUsing()) { this.raise(TSErrors.InvalidModifierOnAwaitUsingDeclaration, this.state.startLoc, "declare"); node.declare = true; this.next(); return this.parseVarStatement(node, "await using", true); } break; case 129: { const result = this.tsParseInterfaceDeclaration(node, { declare: true }); if (result) return result; } default: if (tokenIsIdentifier(startType)) { return this.tsParseDeclaration(node, this.state.value, true, null); } } }); } tsTryParseExportDeclaration() { return this.tsParseDeclaration(this.startNode(), this.state.value, true, null); } tsParseExpressionStatement(node, expr, decorators) { switch (expr.name) { case "declare": { const declaration = this.tsTryParseDeclare(node); if (declaration) { declaration.declare = true; } return declaration; } case "global": if (this.match(5)) { this.scope.enter(1024); this.prodParam.enter(0); const mod = node; mod.kind = "global"; { node.global = true; } mod.id = expr; mod.body = this.tsParseModuleBlock(); this.scope.exit(); this.prodParam.exit(); return this.finishNode(mod, "TSModuleDeclaration"); } break; default: return this.tsParseDeclaration(node, expr.name, false, decorators); } } tsParseDeclaration(node, value, next, decorators) { switch (value) { case "abstract": if (this.tsCheckLineTerminator(next) && (this.match(80) || tokenIsIdentifier(this.state.type))) { return this.tsParseAbstractDeclaration(node, decorators); } break; case "module": if (this.tsCheckLineTerminator(next)) { if (this.match(134)) { return this.tsParseAmbientExternalModuleDeclaration(node); } else if (tokenIsIdentifier(this.state.type)) { node.kind = "module"; return this.tsParseModuleOrNamespaceDeclaration(node); } } break; case "namespace": if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { node.kind = "namespace"; return this.tsParseModuleOrNamespaceDeclaration(node); } break; case "type": if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) { return this.tsParseTypeAliasDeclaration(node); } break; } } tsCheckLineTerminator(next) { if (next) { if (this.hasFollowingLineBreak()) return false; this.next(); return true; } return !this.isLineTerminator(); } tsTryParseGenericAsyncArrowFunction(startLoc) { if (!this.match(47)) return; const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; this.state.maybeInArrowParameters = true; const res = this.tsTryParseAndCatch(() => { const node = this.startNodeAt(startLoc); node.typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); super.parseFunctionParams(node); node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation(); this.expect(19); return node; }); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; if (!res) return; return super.parseArrowExpression(res, null, true); } tsParseTypeArgumentsInExpression() { if (this.reScan_lt() !== 47) return; return this.tsParseTypeArguments(); } tsParseTypeArguments() { const node = this.startNode(); node.params = this.tsInType(() => this.tsInTopLevelContext(() => { this.expect(47); return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this)); })); if (node.params.length === 0) { this.raise(TSErrors.EmptyTypeArguments, node); } else if (!this.state.inType && this.curContext() === types.brace) { this.reScan_lt_gt(); } this.expect(48); return this.finishNode(node, "TSTypeParameterInstantiation"); } tsIsDeclarationStart() { return tokenIsTSDeclarationStart(this.state.type); } isExportDefaultSpecifier() { if (this.tsIsDeclarationStart()) return false; return super.isExportDefaultSpecifier(); } parseBindingElement(flags, decorators) { const startLoc = decorators.length ? decorators[0].loc.start : this.state.startLoc; const modified = {}; this.tsParseModifiers({ allowedModifiers: ["public", "private", "protected", "override", "readonly"] }, modified); const accessibility = modified.accessibility; const override = modified.override; const readonly = modified.readonly; if (!(flags & 4) && (accessibility || readonly || override)) { this.raise(TSErrors.UnexpectedParameterModifier, startLoc); } const left = this.parseMaybeDefault(); if (flags & 2) { this.parseFunctionParamType(left); } const elt = this.parseMaybeDefault(left.loc.start, left); if (accessibility || readonly || override) { const pp = this.startNodeAt(startLoc); if (decorators.length) { pp.decorators = decorators; } if (accessibility) pp.accessibility = accessibility; if (readonly) pp.readonly = readonly; if (override) pp.override = override; if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { this.raise(TSErrors.UnsupportedParameterPropertyKind, pp); } pp.parameter = elt; return this.finishNode(pp, "TSParameterProperty"); } if (decorators.length) { left.decorators = decorators; } return elt; } isSimpleParameter(node) { return node.type === "TSParameterProperty" && super.isSimpleParameter(node.parameter) || super.isSimpleParameter(node); } tsDisallowOptionalPattern(node) { for (const param of node.params) { if (param.type !== "Identifier" && param.optional && !this.state.isAmbientContext) { this.raise(TSErrors.PatternIsOptional, param); } } } setArrowFunctionParameters(node, params, trailingCommaLoc) { super.setArrowFunctionParameters(node, params, trailingCommaLoc); this.tsDisallowOptionalPattern(node); } parseFunctionBodyAndFinish(node, type, isMethod = false) { if (this.match(14)) { node.returnType = this.tsParseTypeOrTypePredicateAnnotation(14); } const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" || type === "ClassPrivateMethod" ? "TSDeclareMethod" : undefined; if (bodilessType && !this.match(5) && this.isLineTerminator()) { return this.finishNode(node, bodilessType); } if (bodilessType === "TSDeclareFunction" && this.state.isAmbientContext) { this.raise(TSErrors.DeclareFunctionHasImplementation, node); if (node.declare) { return super.parseFunctionBodyAndFinish(node, bodilessType, isMethod); } } this.tsDisallowOptionalPattern(node); return super.parseFunctionBodyAndFinish(node, type, isMethod); } registerFunctionStatementId(node) { if (!node.body && node.id) { this.checkIdentifier(node.id, 1024); } else { super.registerFunctionStatementId(node); } } tsCheckForInvalidTypeCasts(items) { items.forEach(node => { if ((node == null ? void 0 : node.type) === "TSTypeCastExpression") { this.raise(TSErrors.UnexpectedTypeAnnotation, node.typeAnnotation); } }); } toReferencedList(exprList, isInParens) { this.tsCheckForInvalidTypeCasts(exprList); return exprList; } parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { const node = super.parseArrayLike(close, canBePattern, isTuple, refExpressionErrors); if (node.type === "ArrayExpression") { this.tsCheckForInvalidTypeCasts(node.elements); } return node; } parseSubscript(base, startLoc, noCalls, state) { if (!this.hasPrecedingLineBreak() && this.match(35)) { this.state.canStartJSXElement = false; this.next(); const nonNullExpression = this.startNodeAt(startLoc); nonNullExpression.expression = base; return this.finishNode(nonNullExpression, "TSNonNullExpression"); } let isOptionalCall = false; if (this.match(18) && this.lookaheadCharCode() === 60) { if (noCalls) { state.stop = true; return base; } state.optionalChainMember = isOptionalCall = true; this.next(); } if (this.match(47) || this.match(51)) { let missingParenErrorLoc; const result = this.tsTryParseAndCatch(() => { if (!noCalls && this.atPossibleAsyncArrow(base)) { const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startLoc); if (asyncArrowFn) { state.stop = true; return asyncArrowFn; } } const typeArguments = this.tsParseTypeArgumentsInExpression(); if (!typeArguments) return; if (isOptionalCall && !this.match(10)) { missingParenErrorLoc = this.state.curPosition(); return; } if (tokenIsTemplate(this.state.type)) { const result = super.parseTaggedTemplateExpression(base, startLoc, state); { result.typeParameters = typeArguments; } return result; } if (!noCalls && this.eat(10)) { const node = this.startNodeAt(startLoc); node.callee = base; node.arguments = this.parseCallExpressionArguments(); this.tsCheckForInvalidTypeCasts(node.arguments); { node.typeParameters = typeArguments; } if (state.optionalChainMember) { node.optional = isOptionalCall; } return this.finishCallExpression(node, state.optionalChainMember); } const tokenType = this.state.type; if (tokenType === 48 || tokenType === 52 || tokenType !== 10 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) { return; } const node = this.startNodeAt(startLoc); node.expression = base; { node.typeParameters = typeArguments; } return this.finishNode(node, "TSInstantiationExpression"); }); if (missingParenErrorLoc) { this.unexpected(missingParenErrorLoc, 10); } if (result) { if (result.type === "TSInstantiationExpression") { if (this.match(16) || this.match(18) && this.lookaheadCharCode() !== 40) { this.raise(TSErrors.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc); } if (!this.match(16) && !this.match(18)) { result.expression = super.stopParseSubscript(base, state); } } return result; } } return super.parseSubscript(base, startLoc, noCalls, state); } parseNewCallee(node) { var _callee$extra; super.parseNewCallee(node); const { callee } = node; if (callee.type === "TSInstantiationExpression" && !((_callee$extra = callee.extra) != null && _callee$extra.parenthesized)) { { node.typeParameters = callee.typeParameters; } node.callee = callee.expression; } } parseExprOp(left, leftStartLoc, minPrec) { let isSatisfies; if (tokenOperatorPrecedence(58) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(93) || (isSatisfies = this.isContextual(120)))) { const node = this.startNodeAt(leftStartLoc); node.expression = left; node.typeAnnotation = this.tsInType(() => { this.next(); if (this.match(75)) { if (isSatisfies) { this.raise(Errors.UnexpectedKeyword, this.state.startLoc, { keyword: "const" }); } return this.tsParseTypeReference(); } return this.tsParseType(); }); this.finishNode(node, isSatisfies ? "TSSatisfiesExpression" : "TSAsExpression"); this.reScan_lt_gt(); return this.parseExprOp(node, leftStartLoc, minPrec); } return super.parseExprOp(left, leftStartLoc, minPrec); } checkReservedWord(word, startLoc, checkKeywords, isBinding) { if (!this.state.isAmbientContext) { super.checkReservedWord(word, startLoc, checkKeywords, isBinding); } } checkImportReflection(node) { super.checkImportReflection(node); if (node.module && node.importKind !== "value") { this.raise(TSErrors.ImportReflectionHasImportType, node.specifiers[0].loc.start); } } checkDuplicateExports() {} isPotentialImportPhase(isExport) { if (super.isPotentialImportPhase(isExport)) return true; if (this.isContextual(130)) { const ch = this.lookaheadCharCode(); return isExport ? ch === 123 || ch === 42 : ch !== 61; } return !isExport && this.isContextual(87); } applyImportPhase(node, isExport, phase, loc) { super.applyImportPhase(node, isExport, phase, loc); if (isExport) { node.exportKind = phase === "type" ? "type" : "value"; } else { node.importKind = phase === "type" || phase === "typeof" ? phase : "value"; } } parseImport(node) { if (this.match(134)) { node.importKind = "value"; return super.parseImport(node); } let importNode; if (tokenIsIdentifier(this.state.type) && this.lookaheadCharCode() === 61) { node.importKind = "value"; return this.tsParseImportEqualsDeclaration(node); } else if (this.isContextual(130)) { const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false); if (this.lookaheadCharCode() === 61) { return this.tsParseImportEqualsDeclaration(node, maybeDefaultIdentifier); } else { importNode = super.parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier); } } else { importNode = super.parseImport(node); } if (importNode.importKind === "type" && importNode.specifiers.length > 1 && importNode.specifiers[0].type === "ImportDefaultSpecifier") { this.raise(TSErrors.TypeImportCannotSpecifyDefaultAndNamed, importNode); } return importNode; } parseExport(node, decorators) { if (this.match(83)) { const nodeImportEquals = node; this.next(); let maybeDefaultIdentifier = null; if (this.isContextual(130) && this.isPotentialImportPhase(false)) { maybeDefaultIdentifier = this.parseMaybeImportPhase(nodeImportEquals, false); } else { nodeImportEquals.importKind = "value"; } const declaration = this.tsParseImportEqualsDeclaration(nodeImportEquals, maybeDefaultIdentifier, true); { return declaration; } } else if (this.eat(29)) { const assign = node; assign.expression = super.parseExpression(); this.semicolon(); this.sawUnambiguousESM = true; return this.finishNode(assign, "TSExportAssignment"); } else if (this.eatContextual(93)) { const decl = node; this.expectContextual(128); decl.id = this.parseIdentifier(); this.semicolon(); return this.finishNode(decl, "TSNamespaceExportDeclaration"); } else { return super.parseExport(node, decorators); } } isAbstractClass() { return this.isContextual(124) && this.isLookaheadContextual("class"); } parseExportDefaultExpression() { if (this.isAbstractClass()) { const cls = this.startNode(); this.next(); cls.abstract = true; return this.parseClass(cls, true, true); } if (this.match(129)) { const result = this.tsParseInterfaceDeclaration(this.startNode()); if (result) return result; } return super.parseExportDefaultExpression(); } parseVarStatement(node, kind, allowMissingInitializer = false) { const { isAmbientContext } = this.state; const declaration = super.parseVarStatement(node, kind, allowMissingInitializer || isAmbientContext); if (!isAmbientContext) return declaration; if (!node.declare && (kind === "using" || kind === "await using")) { this.raiseOverwrite(TSErrors.UsingDeclarationInAmbientContext, node, kind); return declaration; } for (const { id, init } of declaration.declarations) { if (!init) continue; if (kind === "var" || kind === "let" || !!id.typeAnnotation) { this.raise(TSErrors.InitializerNotAllowedInAmbientContext, init); } else if (!isValidAmbientConstInitializer(init, this.hasPlugin("estree"))) { this.raise(TSErrors.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference, init); } } return declaration; } parseStatementContent(flags, decorators) { if (this.match(75) && this.isLookaheadContextual("enum")) { const node = this.startNode(); this.expect(75); return this.tsParseEnumDeclaration(node, { const: true }); } if (this.isContextual(126)) { return this.tsParseEnumDeclaration(this.startNode()); } if (this.isContextual(129)) { const result = this.tsParseInterfaceDeclaration(this.startNode()); if (result) return result; } return super.parseStatementContent(flags, decorators); } parseAccessModifier() { return this.tsParseModifier(["public", "protected", "private"]); } tsHasSomeModifiers(member, modifiers) { return modifiers.some(modifier => { if (tsIsAccessModifier(modifier)) { return member.accessibility === modifier; } return !!member[modifier]; }); } tsIsStartOfStaticBlocks() { return this.isContextual(106) && this.lookaheadCharCode() === 123; } parseClassMember(classBody, member, state) { const modifiers = ["declare", "private", "public", "protected", "override", "abstract", "readonly", "static"]; this.tsParseModifiers({ allowedModifiers: modifiers, disallowedModifiers: ["in", "out"], stopOnStartOfClassStaticBlock: true, errorTemplate: TSErrors.InvalidModifierOnTypeParameterPositions }, member); const callParseClassMemberWithIsStatic = () => { if (this.tsIsStartOfStaticBlocks()) { this.next(); this.next(); if (this.tsHasSomeModifiers(member, modifiers)) { this.raise(TSErrors.StaticBlockCannotHaveModifier, this.state.curPosition()); } super.parseClassStaticBlock(classBody, member); } else { this.parseClassMemberWithIsStatic(classBody, member, state, !!member.static); } }; if (member.declare) { this.tsInAmbientContext(callParseClassMemberWithIsStatic); } else { callParseClassMemberWithIsStatic(); } } parseClassMemberWithIsStatic(classBody, member, state, isStatic) { const idx = this.tsTryParseIndexSignature(member); if (idx) { classBody.body.push(idx); if (member.abstract) { this.raise(TSErrors.IndexSignatureHasAbstract, member); } if (member.accessibility) { this.raise(TSErrors.IndexSignatureHasAccessibility, member, { modifier: member.accessibility }); } if (member.declare) { this.raise(TSErrors.IndexSignatureHasDeclare, member); } if (member.override) { this.raise(TSErrors.IndexSignatureHasOverride, member); } return; } if (!this.state.inAbstractClass && member.abstract) { this.raise(TSErrors.NonAbstractClassHasAbstractMethod, member); } if (member.override) { if (!state.hadSuperClass) { this.raise(TSErrors.OverrideNotInSubClass, member); } } super.parseClassMemberWithIsStatic(classBody, member, state, isStatic); } parsePostMemberNameModifiers(methodOrProp) { const optional = this.eat(17); if (optional) methodOrProp.optional = true; if (methodOrProp.readonly && this.match(10)) { this.raise(TSErrors.ClassMethodHasReadonly, methodOrProp); } if (methodOrProp.declare && this.match(10)) { this.raise(TSErrors.ClassMethodHasDeclare, methodOrProp); } } parseExpressionStatement(node, expr, decorators) { const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr, decorators) : undefined; return decl || super.parseExpressionStatement(node, expr, decorators); } shouldParseExportDeclaration() { if (this.tsIsDeclarationStart()) return true; return super.shouldParseExportDeclaration(); } parseConditional(expr, startLoc, refExpressionErrors) { if (!this.match(17)) return expr; if (this.state.maybeInArrowParameters) { const nextCh = this.lookaheadCharCode(); if (nextCh === 44 || nextCh === 61 || nextCh === 58 || nextCh === 41) { this.setOptionalParametersError(refExpressionErrors); return expr; } } return super.parseConditional(expr, startLoc, refExpressionErrors); } parseParenItem(node, startLoc) { const newNode = super.parseParenItem(node, startLoc); if (this.eat(17)) { newNode.optional = true; this.resetEndLocation(node); } if (this.match(14)) { const typeCastNode = this.startNodeAt(startLoc); typeCastNode.expression = node; typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); return this.finishNode(typeCastNode, "TSTypeCastExpression"); } return node; } parseExportDeclaration(node) { if (!this.state.isAmbientContext && this.isContextual(125)) { return this.tsInAmbientContext(() => this.parseExportDeclaration(node)); } const startLoc = this.state.startLoc; const isDeclare = this.eatContextual(125); if (isDeclare && (this.isContextual(125) || !this.shouldParseExportDeclaration())) { throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, this.state.startLoc); } const isIdentifier = tokenIsIdentifier(this.state.type); const declaration = isIdentifier && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node); if (!declaration) return null; if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) { node.exportKind = "type"; } if (isDeclare && declaration.type !== "TSImportEqualsDeclaration") { this.resetStartLocation(declaration, startLoc); declaration.declare = true; } return declaration; } parseClassId(node, isStatement, optionalId, bindingType) { if ((!isStatement || optionalId) && this.isContextual(113)) { return; } super.parseClassId(node, isStatement, optionalId, node.declare ? 1024 : 8331); const typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers); if (typeParameters) node.typeParameters = typeParameters; } parseClassPropertyAnnotation(node) { if (!node.optional) { if (this.eat(35)) { node.definite = true; } else if (this.eat(17)) { node.optional = true; } } const type = this.tsTryParseTypeAnnotation(); if (type) node.typeAnnotation = type; } parseClassProperty(node) { this.parseClassPropertyAnnotation(node); if (this.state.isAmbientContext && !(node.readonly && !node.typeAnnotation) && this.match(29)) { this.raise(TSErrors.DeclareClassFieldHasInitializer, this.state.startLoc); } if (node.abstract && this.match(29)) { const { key } = node; this.raise(TSErrors.AbstractPropertyHasInitializer, this.state.startLoc, { propertyName: key.type === "Identifier" && !node.computed ? key.name : `[${this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end))}]` }); } return super.parseClassProperty(node); } parseClassPrivateProperty(node) { if (node.abstract) { this.raise(TSErrors.PrivateElementHasAbstract, node); } if (node.accessibility) { this.raise(TSErrors.PrivateElementHasAccessibility, node, { modifier: node.accessibility }); } this.parseClassPropertyAnnotation(node); return super.parseClassPrivateProperty(node); } parseClassAccessorProperty(node) { this.parseClassPropertyAnnotation(node); if (node.optional) { this.raise(TSErrors.AccessorCannotBeOptional, node); } return super.parseClassAccessorProperty(node); } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters && isConstructor) { this.raise(TSErrors.ConstructorHasTypeParameters, typeParameters); } const { declare = false, kind } = method; if (declare && (kind === "get" || kind === "set")) { this.raise(TSErrors.DeclareAccessor, method, { kind }); } if (typeParameters) method.typeParameters = typeParameters; super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper); } pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters) method.typeParameters = typeParameters; super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync); } declareClassPrivateMethodInScope(node, kind) { if (node.type === "TSDeclareMethod") return; if (node.type === "MethodDefinition" && node.value.body == null) { return; } super.declareClassPrivateMethodInScope(node, kind); } parseClassSuper(node) { super.parseClassSuper(node); if (node.superClass && (this.match(47) || this.match(51))) { { node.superTypeParameters = this.tsParseTypeArgumentsInExpression(); } } if (this.eatContextual(113)) { node.implements = this.tsParseHeritageClause("implements"); } } parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters) prop.typeParameters = typeParameters; return super.parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors); } parseFunctionParams(node, isConstructor) { const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier); if (typeParameters) node.typeParameters = typeParameters; super.parseFunctionParams(node, isConstructor); } parseVarId(decl, kind) { super.parseVarId(decl, kind); if (decl.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.eat(35)) { decl.definite = true; } const type = this.tsTryParseTypeAnnotation(); if (type) { decl.id.typeAnnotation = type; this.resetEndLocation(decl.id); } } parseAsyncArrowFromCallExpression(node, call) { if (this.match(14)) { node.returnType = this.tsParseTypeAnnotation(); } return super.parseAsyncArrowFromCallExpression(node, call); } parseMaybeAssign(refExpressionErrors, afterLeftParse) { var _jsx, _jsx2, _typeCast, _jsx3, _typeCast2; let state; let jsx; let typeCast; if (this.hasPlugin("jsx") && (this.match(143) || this.match(47))) { state = this.state.clone(); jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); if (!jsx.error) return jsx.node; const { context } = this.state; const currentContext = context[context.length - 1]; if (currentContext === types.j_oTag || currentContext === types.j_expr) { context.pop(); } } if (!((_jsx = jsx) != null && _jsx.error) && !this.match(47)) { return super.parseMaybeAssign(refExpressionErrors, afterLeftParse); } if (!state || state === this.state) state = this.state.clone(); let typeParameters; const arrow = this.tryParse(abort => { var _expr$extra, _typeParameters; typeParameters = this.tsParseTypeParameters(this.tsParseConstModifier); const expr = super.parseMaybeAssign(refExpressionErrors, afterLeftParse); if (expr.type !== "ArrowFunctionExpression" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { abort(); } if (((_typeParameters = typeParameters) == null ? void 0 : _typeParameters.params.length) !== 0) { this.resetStartLocationFromNode(expr, typeParameters); } expr.typeParameters = typeParameters; return expr; }, state); if (!arrow.error && !arrow.aborted) { if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); return arrow.node; } if (!jsx) { assert(!this.hasPlugin("jsx")); typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state); if (!typeCast.error) return typeCast.node; } if ((_jsx2 = jsx) != null && _jsx2.node) { this.state = jsx.failState; return jsx.node; } if (arrow.node) { this.state = arrow.failState; if (typeParameters) this.reportReservedArrowTypeParam(typeParameters); return arrow.node; } if ((_typeCast = typeCast) != null && _typeCast.node) { this.state = typeCast.failState; return typeCast.node; } throw ((_jsx3 = jsx) == null ? void 0 : _jsx3.error) || arrow.error || ((_typeCast2 = typeCast) == null ? void 0 : _typeCast2.error); } reportReservedArrowTypeParam(node) { var _node$extra2; if (node.params.length === 1 && !node.params[0].constraint && !((_node$extra2 = node.extra) != null && _node$extra2.trailingComma) && this.getPluginOption("typescript", "disallowAmbiguousJSXLike")) { this.raise(TSErrors.ReservedArrowTypeParam, node); } } parseMaybeUnary(refExpressionErrors, sawUnary) { if (!this.hasPlugin("jsx") && this.match(47)) { return this.tsParseTypeAssertion(); } return super.parseMaybeUnary(refExpressionErrors, sawUnary); } parseArrow(node) { if (this.match(14)) { const result = this.tryParse(abort => { const returnType = this.tsParseTypeOrTypePredicateAnnotation(14); if (this.canInsertSemicolon() || !this.match(19)) abort(); return returnType; }); if (result.aborted) return; if (!result.thrown) { if (result.error) this.state = result.failState; node.returnType = result.node; } } return super.parseArrow(node); } parseFunctionParamType(param) { if (this.eat(17)) { param.optional = true; } const type = this.tsTryParseTypeAnnotation(); if (type) param.typeAnnotation = type; this.resetEndLocation(param); return param; } isAssignable(node, isBinding) { switch (node.type) { case "TSTypeCastExpression": return this.isAssignable(node.expression, isBinding); case "TSParameterProperty": return true; default: return super.isAssignable(node, isBinding); } } toAssignable(node, isLHS = false) { switch (node.type) { case "ParenthesizedExpression": this.toAssignableParenthesizedExpression(node, isLHS); break; case "TSAsExpression": case "TSSatisfiesExpression": case "TSNonNullExpression": case "TSTypeAssertion": if (isLHS) { this.expressionScope.recordArrowParameterBindingError(TSErrors.UnexpectedTypeCastInParameter, node); } else { this.raise(TSErrors.UnexpectedTypeCastInParameter, node); } this.toAssignable(node.expression, isLHS); break; case "AssignmentExpression": if (!isLHS && node.left.type === "TSTypeCastExpression") { node.left = this.typeCastToParameter(node.left); } default: super.toAssignable(node, isLHS); } } toAssignableParenthesizedExpression(node, isLHS) { switch (node.expression.type) { case "TSAsExpression": case "TSSatisfiesExpression": case "TSNonNullExpression": case "TSTypeAssertion": case "ParenthesizedExpression": this.toAssignable(node.expression, isLHS); break; default: super.toAssignable(node, isLHS); } } checkToRestConversion(node, allowPattern) { switch (node.type) { case "TSAsExpression": case "TSSatisfiesExpression": case "TSTypeAssertion": case "TSNonNullExpression": this.checkToRestConversion(node.expression, false); break; default: super.checkToRestConversion(node, allowPattern); } } isValidLVal(type, isUnparenthesizedInAssign, binding) { switch (type) { case "TSTypeCastExpression": return true; case "TSParameterProperty": return "parameter"; case "TSNonNullExpression": return "expression"; case "TSAsExpression": case "TSSatisfiesExpression": case "TSTypeAssertion": return (binding !== 64 || !isUnparenthesizedInAssign) && ["expression", true]; default: return super.isValidLVal(type, isUnparenthesizedInAssign, binding); } } parseBindingAtom() { if (this.state.type === 78) { return this.parseIdentifier(true); } return super.parseBindingAtom(); } parseMaybeDecoratorArguments(expr, startLoc) { if (this.match(47) || this.match(51)) { const typeArguments = this.tsParseTypeArgumentsInExpression(); if (this.match(10)) { const call = super.parseMaybeDecoratorArguments(expr, startLoc); { call.typeParameters = typeArguments; } return call; } this.unexpected(null, 10); } return super.parseMaybeDecoratorArguments(expr, startLoc); } checkCommaAfterRest(close) { if (this.state.isAmbientContext && this.match(12) && this.lookaheadCharCode() === close) { this.next(); return false; } return super.checkCommaAfterRest(close); } isClassMethod() { return this.match(47) || super.isClassMethod(); } isClassProperty() { return this.match(35) || this.match(14) || super.isClassProperty(); } parseMaybeDefault(startLoc, left) { const node = super.parseMaybeDefault(startLoc, left); if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) { this.raise(TSErrors.TypeAnnotationAfterAssign, node.typeAnnotation); } return node; } getTokenFromCode(code) { if (this.state.inType) { if (code === 62) { this.finishOp(48, 1); return; } if (code === 60) { this.finishOp(47, 1); return; } } super.getTokenFromCode(code); } reScan_lt_gt() { const { type } = this.state; if (type === 47) { this.state.pos -= 1; this.readToken_lt(); } else if (type === 48) { this.state.pos -= 1; this.readToken_gt(); } } reScan_lt() { const { type } = this.state; if (type === 51) { this.state.pos -= 2; this.finishOp(47, 1); return 47; } return type; } toAssignableListItem(exprList, index, isLHS) { const node = exprList[index]; if (node.type === "TSTypeCastExpression") { exprList[index] = this.typeCastToParameter(node); } super.toAssignableListItem(exprList, index, isLHS); } typeCastToParameter(node) { node.expression.typeAnnotation = node.typeAnnotation; this.resetEndLocation(node.expression, node.typeAnnotation.loc.end); return node.expression; } shouldParseArrow(params) { if (this.match(14)) { return params.every(expr => this.isAssignable(expr, true)); } return super.shouldParseArrow(params); } shouldParseAsyncArrow() { return this.match(14) || super.shouldParseAsyncArrow(); } canHaveLeadingDecorator() { return super.canHaveLeadingDecorator() || this.isAbstractClass(); } jsxParseOpeningElementAfterName(node) { if (this.match(47) || this.match(51)) { const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArgumentsInExpression()); if (typeArguments) { { node.typeParameters = typeArguments; } } } return super.jsxParseOpeningElementAfterName(node); } getGetterSetterExpectedParamCount(method) { const baseCount = super.getGetterSetterExpectedParamCount(method); const params = this.getObjectOrClassMethodParams(method); const firstParam = params[0]; const hasContextParam = firstParam && this.isThisParam(firstParam); return hasContextParam ? baseCount + 1 : baseCount; } parseCatchClauseParam() { const param = super.parseCatchClauseParam(); const type = this.tsTryParseTypeAnnotation(); if (type) { param.typeAnnotation = type; this.resetEndLocation(param); } return param; } tsInAmbientContext(cb) { const { isAmbientContext: oldIsAmbientContext, strict: oldStrict } = this.state; this.state.isAmbientContext = true; this.state.strict = false; try { return cb(); } finally { this.state.isAmbientContext = oldIsAmbientContext; this.state.strict = oldStrict; } } parseClass(node, isStatement, optionalId) { const oldInAbstractClass = this.state.inAbstractClass; this.state.inAbstractClass = !!node.abstract; try { return super.parseClass(node, isStatement, optionalId); } finally { this.state.inAbstractClass = oldInAbstractClass; } } tsParseAbstractDeclaration(node, decorators) { if (this.match(80)) { node.abstract = true; return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false)); } else if (this.isContextual(129)) { if (!this.hasFollowingLineBreak()) { node.abstract = true; this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifier, node); return this.tsParseInterfaceDeclaration(node); } } else { this.unexpected(null, 80); } } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope) { const method = super.parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope); if (method.abstract || method.type === "TSAbstractMethodDefinition") { const hasEstreePlugin = this.hasPlugin("estree"); const methodFn = hasEstreePlugin ? method.value : method; if (methodFn.body) { const { key } = method; this.raise(TSErrors.AbstractMethodHasImplementation, method, { methodName: key.type === "Identifier" && !method.computed ? key.name : `[${this.input.slice(this.offsetToSourcePos(key.start), this.offsetToSourcePos(key.end))}]` }); } } return method; } tsParseTypeParameterName() { const typeName = this.parseIdentifier(); return typeName.name; } shouldParseAsAmbientContext() { return !!this.getPluginOption("typescript", "dts"); } parse() { if (this.shouldParseAsAmbientContext()) { this.state.isAmbientContext = true; } return super.parse(); } getExpression() { if (this.shouldParseAsAmbientContext()) { this.state.isAmbientContext = true; } return super.getExpression(); } parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { if (!isString && isMaybeTypeOnly) { this.parseTypeOnlyImportExportSpecifier(node, false, isInTypeExport); return this.finishNode(node, "ExportSpecifier"); } node.exportKind = "value"; return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly); } parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { if (!importedIsString && isMaybeTypeOnly) { this.parseTypeOnlyImportExportSpecifier(specifier, true, isInTypeOnlyImport); return this.finishNode(specifier, "ImportSpecifier"); } specifier.importKind = "value"; return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, isInTypeOnlyImport ? 4098 : 4096); } parseTypeOnlyImportExportSpecifier(node, isImport, isInTypeOnlyImportExport) { const leftOfAsKey = isImport ? "imported" : "local"; const rightOfAsKey = isImport ? "local" : "exported"; let leftOfAs = node[leftOfAsKey]; let rightOfAs; let hasTypeSpecifier = false; let canParseAsKeyword = true; const loc = leftOfAs.loc.start; if (this.isContextual(93)) { const firstAs = this.parseIdentifier(); if (this.isContextual(93)) { const secondAs = this.parseIdentifier(); if (tokenIsKeywordOrIdentifier(this.state.type)) { hasTypeSpecifier = true; leftOfAs = firstAs; rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); canParseAsKeyword = false; } else { rightOfAs = secondAs; canParseAsKeyword = false; } } else if (tokenIsKeywordOrIdentifier(this.state.type)) { canParseAsKeyword = false; rightOfAs = isImport ? this.parseIdentifier() : this.parseModuleExportName(); } else { hasTypeSpecifier = true; leftOfAs = firstAs; } } else if (tokenIsKeywordOrIdentifier(this.state.type)) { hasTypeSpecifier = true; if (isImport) { leftOfAs = this.parseIdentifier(true); if (!this.isContextual(93)) { this.checkReservedWord(leftOfAs.name, leftOfAs.loc.start, true, true); } } else { leftOfAs = this.parseModuleExportName(); } } if (hasTypeSpecifier && isInTypeOnlyImportExport) { this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, loc); } node[leftOfAsKey] = leftOfAs; node[rightOfAsKey] = rightOfAs; const kindKey = isImport ? "importKind" : "exportKind"; node[kindKey] = hasTypeSpecifier ? "type" : "value"; if (canParseAsKeyword && this.eatContextual(93)) { node[rightOfAsKey] = isImport ? this.parseIdentifier() : this.parseModuleExportName(); } if (!node[rightOfAsKey]) { node[rightOfAsKey] = this.cloneIdentifier(node[leftOfAsKey]); } if (isImport) { this.checkIdentifier(node[rightOfAsKey], hasTypeSpecifier ? 4098 : 4096); } } fillOptionalPropertiesForTSESLint(node) { var _node$directive, _node$decorators, _node$optional, _node$typeAnnotation, _node$accessibility, _node$decorators2, _node$override, _node$readonly, _node$static, _node$declare, _node$returnType, _node$typeParameters, _node$optional2, _node$optional3, _node$accessibility2, _node$readonly2, _node$static2, _node$declare2, _node$definite, _node$readonly3, _node$typeAnnotation2, _node$accessibility3, _node$decorators3, _node$override2, _node$optional4, _node$id, _node$abstract, _node$declare3, _node$decorators4, _node$implements, _node$superTypeArgume, _node$typeParameters2, _node$declare4, _node$definite2, _node$const, _node$declare5, _node$computed, _node$qualifier, _node$options, _node$declare6, _node$extends, _node$declare7, _node$global, _node$const2, _node$in, _node$out; switch (node.type) { case "ExpressionStatement": (_node$directive = node.directive) != null ? _node$directive : node.directive = undefined; return; case "RestElement": node.value = undefined; case "Identifier": case "ArrayPattern": case "AssignmentPattern": case "ObjectPattern": (_node$decorators = node.decorators) != null ? _node$decorators : node.decorators = []; (_node$optional = node.optional) != null ? _node$optional : node.optional = false; (_node$typeAnnotation = node.typeAnnotation) != null ? _node$typeAnnotation : node.typeAnnotation = undefined; return; case "TSParameterProperty": (_node$accessibility = node.accessibility) != null ? _node$accessibility : node.accessibility = undefined; (_node$decorators2 = node.decorators) != null ? _node$decorators2 : node.decorators = []; (_node$override = node.override) != null ? _node$override : node.override = false; (_node$readonly = node.readonly) != null ? _node$readonly : node.readonly = false; (_node$static = node.static) != null ? _node$static : node.static = false; return; case "TSEmptyBodyFunctionExpression": node.body = null; case "TSDeclareFunction": case "FunctionDeclaration": case "FunctionExpression": case "ClassMethod": case "ClassPrivateMethod": (_node$declare = node.declare) != null ? _node$declare : node.declare = false; (_node$returnType = node.returnType) != null ? _node$returnType : node.returnType = undefined; (_node$typeParameters = node.typeParameters) != null ? _node$typeParameters : node.typeParameters = undefined; return; case "Property": (_node$optional2 = node.optional) != null ? _node$optional2 : node.optional = false; return; case "TSMethodSignature": case "TSPropertySignature": (_node$optional3 = node.optional) != null ? _node$optional3 : node.optional = false; case "TSIndexSignature": (_node$accessibility2 = node.accessibility) != null ? _node$accessibility2 : node.accessibility = undefined; (_node$readonly2 = node.readonly) != null ? _node$readonly2 : node.readonly = false; (_node$static2 = node.static) != null ? _node$static2 : node.static = false; return; case "TSAbstractPropertyDefinition": case "PropertyDefinition": case "TSAbstractAccessorProperty": case "AccessorProperty": (_node$declare2 = node.declare) != null ? _node$declare2 : node.declare = false; (_node$definite = node.definite) != null ? _node$definite : node.definite = false; (_node$readonly3 = node.readonly) != null ? _node$readonly3 : node.readonly = false; (_node$typeAnnotation2 = node.typeAnnotation) != null ? _node$typeAnnotation2 : node.typeAnnotation = undefined; case "TSAbstractMethodDefinition": case "MethodDefinition": (_node$accessibility3 = node.accessibility) != null ? _node$accessibility3 : node.accessibility = undefined; (_node$decorators3 = node.decorators) != null ? _node$decorators3 : node.decorators = []; (_node$override2 = node.override) != null ? _node$override2 : node.override = false; (_node$optional4 = node.optional) != null ? _node$optional4 : node.optional = false; return; case "ClassExpression": (_node$id = node.id) != null ? _node$id : node.id = null; case "ClassDeclaration": (_node$abstract = node.abstract) != null ? _node$abstract : node.abstract = false; (_node$declare3 = node.declare) != null ? _node$declare3 : node.declare = false; (_node$decorators4 = node.decorators) != null ? _node$decorators4 : node.decorators = []; (_node$implements = node.implements) != null ? _node$implements : node.implements = []; (_node$superTypeArgume = node.superTypeArguments) != null ? _node$superTypeArgume : node.superTypeArguments = undefined; (_node$typeParameters2 = node.typeParameters) != null ? _node$typeParameters2 : node.typeParameters = undefined; return; case "TSTypeAliasDeclaration": case "VariableDeclaration": (_node$declare4 = node.declare) != null ? _node$declare4 : node.declare = false; return; case "VariableDeclarator": (_node$definite2 = node.definite) != null ? _node$definite2 : node.definite = false; return; case "TSEnumDeclaration": (_node$const = node.const) != null ? _node$const : node.const = false; (_node$declare5 = node.declare) != null ? _node$declare5 : node.declare = false; return; case "TSEnumMember": (_node$computed = node.computed) != null ? _node$computed : node.computed = false; return; case "TSImportType": (_node$qualifier = node.qualifier) != null ? _node$qualifier : node.qualifier = null; (_node$options = node.options) != null ? _node$options : node.options = null; return; case "TSInterfaceDeclaration": (_node$declare6 = node.declare) != null ? _node$declare6 : node.declare = false; (_node$extends = node.extends) != null ? _node$extends : node.extends = []; return; case "TSModuleDeclaration": (_node$declare7 = node.declare) != null ? _node$declare7 : node.declare = false; (_node$global = node.global) != null ? _node$global : node.global = node.kind === "global"; return; case "TSTypeParameter": (_node$const2 = node.const) != null ? _node$const2 : node.const = false; (_node$in = node.in) != null ? _node$in : node.in = false; (_node$out = node.out) != null ? _node$out : node.out = false; return; } } }; function isPossiblyLiteralEnum(expression) { if (expression.type !== "MemberExpression") return false; const { computed, property } = expression; if (computed && property.type !== "StringLiteral" && (property.type !== "TemplateLiteral" || property.expressions.length > 0)) { return false; } return isUncomputedMemberExpressionChain(expression.object); } function isValidAmbientConstInitializer(expression, estree) { var _expression$extra; const { type } = expression; if ((_expression$extra = expression.extra) != null && _expression$extra.parenthesized) { return false; } if (estree) { if (type === "Literal") { const { value } = expression; if (typeof value === "string" || typeof value === "boolean") { return true; } } } else { if (type === "StringLiteral" || type === "BooleanLiteral") { return true; } } if (isNumber(expression, estree) || isNegativeNumber(expression, estree)) { return true; } if (type === "TemplateLiteral" && expression.expressions.length === 0) { return true; } if (isPossiblyLiteralEnum(expression)) { return true; } return false; } function isNumber(expression, estree) { if (estree) { return expression.type === "Literal" && (typeof expression.value === "number" || "bigint" in expression); } return expression.type === "NumericLiteral" || expression.type === "BigIntLiteral"; } function isNegativeNumber(expression, estree) { if (expression.type === "UnaryExpression") { const { operator, argument } = expression; if (operator === "-" && isNumber(argument, estree)) { return true; } } return false; } function isUncomputedMemberExpressionChain(expression) { if (expression.type === "Identifier") return true; if (expression.type !== "MemberExpression" || expression.computed) { return false; } return isUncomputedMemberExpressionChain(expression.object); } const PlaceholderErrors = ParseErrorEnum`placeholders`({ ClassNameIsRequired: "A class name is required.", UnexpectedSpace: "Unexpected space in placeholder." }); var placeholders = superClass => class PlaceholdersParserMixin extends superClass { parsePlaceholder(expectedNode) { if (this.match(133)) { const node = this.startNode(); this.next(); this.assertNoSpace(); node.name = super.parseIdentifier(true); this.assertNoSpace(); this.expect(133); return this.finishPlaceholder(node, expectedNode); } } finishPlaceholder(node, expectedNode) { let placeholder = node; if (!placeholder.expectedNode || !placeholder.type) { placeholder = this.finishNode(placeholder, "Placeholder"); } placeholder.expectedNode = expectedNode; return placeholder; } getTokenFromCode(code) { if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) { this.finishOp(133, 2); } else { super.getTokenFromCode(code); } } parseExprAtom(refExpressionErrors) { return this.parsePlaceholder("Expression") || super.parseExprAtom(refExpressionErrors); } parseIdentifier(liberal) { return this.parsePlaceholder("Identifier") || super.parseIdentifier(liberal); } checkReservedWord(word, startLoc, checkKeywords, isBinding) { if (word !== undefined) { super.checkReservedWord(word, startLoc, checkKeywords, isBinding); } } cloneIdentifier(node) { const cloned = super.cloneIdentifier(node); if (cloned.type === "Placeholder") { cloned.expectedNode = node.expectedNode; } return cloned; } cloneStringLiteral(node) { if (node.type === "Placeholder") { return this.cloneIdentifier(node); } return super.cloneStringLiteral(node); } parseBindingAtom() { return this.parsePlaceholder("Pattern") || super.parseBindingAtom(); } isValidLVal(type, isParenthesized, binding) { return type === "Placeholder" || super.isValidLVal(type, isParenthesized, binding); } toAssignable(node, isLHS) { if (node && node.type === "Placeholder" && node.expectedNode === "Expression") { node.expectedNode = "Pattern"; } else { super.toAssignable(node, isLHS); } } chStartsBindingIdentifier(ch, pos) { if (super.chStartsBindingIdentifier(ch, pos)) { return true; } const next = this.nextTokenStart(); if (this.input.charCodeAt(next) === 37 && this.input.charCodeAt(next + 1) === 37) { return true; } return false; } verifyBreakContinue(node, isBreak) { if (node.label && node.label.type === "Placeholder") return; super.verifyBreakContinue(node, isBreak); } parseExpressionStatement(node, expr) { var _expr$extra; if (expr.type !== "Placeholder" || (_expr$extra = expr.extra) != null && _expr$extra.parenthesized) { return super.parseExpressionStatement(node, expr); } if (this.match(14)) { const stmt = node; stmt.label = this.finishPlaceholder(expr, "Identifier"); this.next(); stmt.body = super.parseStatementOrSloppyAnnexBFunctionDeclaration(); return this.finishNode(stmt, "LabeledStatement"); } this.semicolon(); const stmtPlaceholder = node; stmtPlaceholder.name = expr.name; return this.finishPlaceholder(stmtPlaceholder, "Statement"); } parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse) { return this.parsePlaceholder("BlockStatement") || super.parseBlock(allowDirectives, createNewLexicalScope, afterBlockParse); } parseFunctionId(requireId) { return this.parsePlaceholder("Identifier") || super.parseFunctionId(requireId); } parseClass(node, isStatement, optionalId) { const type = isStatement ? "ClassDeclaration" : "ClassExpression"; this.next(); const oldStrict = this.state.strict; const placeholder = this.parsePlaceholder("Identifier"); if (placeholder) { if (this.match(81) || this.match(133) || this.match(5)) { node.id = placeholder; } else if (optionalId || !isStatement) { node.id = null; node.body = this.finishPlaceholder(placeholder, "ClassBody"); return this.finishNode(node, type); } else { throw this.raise(PlaceholderErrors.ClassNameIsRequired, this.state.startLoc); } } else { this.parseClassId(node, isStatement, optionalId); } super.parseClassSuper(node); node.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!node.superClass, oldStrict); return this.finishNode(node, type); } parseExport(node, decorators) { const placeholder = this.parsePlaceholder("Identifier"); if (!placeholder) return super.parseExport(node, decorators); const node2 = node; if (!this.isContextual(98) && !this.match(12)) { node2.specifiers = []; node2.source = null; node2.declaration = this.finishPlaceholder(placeholder, "Declaration"); return this.finishNode(node2, "ExportNamedDeclaration"); } this.expectPlugin("exportDefaultFrom"); const specifier = this.startNode(); specifier.exported = placeholder; node2.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; return super.parseExport(node2, decorators); } isExportDefaultSpecifier() { if (this.match(65)) { const next = this.nextTokenStart(); if (this.isUnparsedContextual(next, "from")) { if (this.input.startsWith(tokenLabelName(133), this.nextTokenStartSince(next + 4))) { return true; } } } return super.isExportDefaultSpecifier(); } maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { var _specifiers; if ((_specifiers = node.specifiers) != null && _specifiers.length) { return true; } return super.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); } checkExport(node) { const { specifiers } = node; if (specifiers != null && specifiers.length) { node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder"); } super.checkExport(node); node.specifiers = specifiers; } parseImport(node) { const placeholder = this.parsePlaceholder("Identifier"); if (!placeholder) return super.parseImport(node); node.specifiers = []; if (!this.isContextual(98) && !this.match(12)) { node.source = this.finishPlaceholder(placeholder, "StringLiteral"); this.semicolon(); return this.finishNode(node, "ImportDeclaration"); } const specifier = this.startNodeAtNode(placeholder); specifier.local = placeholder; node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier")); if (this.eat(12)) { const hasStarImport = this.maybeParseStarImportSpecifier(node); if (!hasStarImport) this.parseNamedImportSpecifiers(node); } this.expectContextual(98); node.source = this.parseImportSource(); this.semicolon(); return this.finishNode(node, "ImportDeclaration"); } parseImportSource() { return this.parsePlaceholder("StringLiteral") || super.parseImportSource(); } assertNoSpace() { if (this.state.start > this.offsetToSourcePos(this.state.lastTokEndLoc.index)) { this.raise(PlaceholderErrors.UnexpectedSpace, this.state.lastTokEndLoc); } } }; var v8intrinsic = superClass => class V8IntrinsicMixin extends superClass { parseV8Intrinsic() { if (this.match(54)) { const v8IntrinsicStartLoc = this.state.startLoc; const node = this.startNode(); this.next(); if (tokenIsIdentifier(this.state.type)) { const name = this.parseIdentifierName(); const identifier = this.createIdentifier(node, name); this.castNodeTo(identifier, "V8IntrinsicIdentifier"); if (this.match(10)) { return identifier; } } this.unexpected(v8IntrinsicStartLoc); } } parseExprAtom(refExpressionErrors) { return this.parseV8Intrinsic() || super.parseExprAtom(refExpressionErrors); } }; const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack", "smart"]; const TOPIC_TOKENS = ["^^", "@@", "^", "%", "#"]; function validatePlugins(pluginsMap) { if (pluginsMap.has("decorators")) { if (pluginsMap.has("decorators-legacy")) { throw new Error("Cannot use the decorators and decorators-legacy plugin together"); } const decoratorsBeforeExport = pluginsMap.get("decorators").decoratorsBeforeExport; if (decoratorsBeforeExport != null && typeof decoratorsBeforeExport !== "boolean") { throw new Error("'decoratorsBeforeExport' must be a boolean, if specified."); } const allowCallParenthesized = pluginsMap.get("decorators").allowCallParenthesized; if (allowCallParenthesized != null && typeof allowCallParenthesized !== "boolean") { throw new Error("'allowCallParenthesized' must be a boolean."); } } if (pluginsMap.has("flow") && pluginsMap.has("typescript")) { throw new Error("Cannot combine flow and typescript plugins."); } if (pluginsMap.has("placeholders") && pluginsMap.has("v8intrinsic")) { throw new Error("Cannot combine placeholders and v8intrinsic plugins."); } if (pluginsMap.has("pipelineOperator")) { var _pluginsMap$get2; const proposal = pluginsMap.get("pipelineOperator").proposal; if (!PIPELINE_PROPOSALS.includes(proposal)) { const proposalList = PIPELINE_PROPOSALS.map(p => `"${p}"`).join(", "); throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${proposalList}.`); } if (proposal === "hack") { if (pluginsMap.has("placeholders")) { throw new Error("Cannot combine placeholders plugin and Hack-style pipes."); } if (pluginsMap.has("v8intrinsic")) { throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes."); } const topicToken = pluginsMap.get("pipelineOperator").topicToken; if (!TOPIC_TOKENS.includes(topicToken)) { const tokenList = TOPIC_TOKENS.map(t => `"${t}"`).join(", "); throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${tokenList}.`); } { var _pluginsMap$get; if (topicToken === "#" && ((_pluginsMap$get = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get.syntaxType) === "hash") { throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`); } } } else if (proposal === "smart" && ((_pluginsMap$get2 = pluginsMap.get("recordAndTuple")) == null ? void 0 : _pluginsMap$get2.syntaxType) === "hash") { throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple", pluginsMap.get("recordAndTuple")])}\`.`); } } if (pluginsMap.has("moduleAttributes")) { { if (pluginsMap.has("deprecatedImportAssert") || pluginsMap.has("importAssertions")) { throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins."); } const moduleAttributesVersionPluginOption = pluginsMap.get("moduleAttributes").version; if (moduleAttributesVersionPluginOption !== "may-2020") { throw new Error("The 'moduleAttributes' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is 'may-2020'."); } } } if (pluginsMap.has("importAssertions")) { if (pluginsMap.has("deprecatedImportAssert")) { throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins."); } } if (!pluginsMap.has("deprecatedImportAssert") && pluginsMap.has("importAttributes") && pluginsMap.get("importAttributes").deprecatedAssertSyntax) { { pluginsMap.set("deprecatedImportAssert", {}); } } if (pluginsMap.has("recordAndTuple")) { { const syntaxType = pluginsMap.get("recordAndTuple").syntaxType; if (syntaxType != null) { const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"]; if (!RECORD_AND_TUPLE_SYNTAX_TYPES.includes(syntaxType)) { throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: " + RECORD_AND_TUPLE_SYNTAX_TYPES.map(p => `'${p}'`).join(", ")); } } } } if (pluginsMap.has("asyncDoExpressions") && !pluginsMap.has("doExpressions")) { const error = new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins."); error.missingPlugins = "doExpressions"; throw error; } if (pluginsMap.has("optionalChainingAssign") && pluginsMap.get("optionalChainingAssign").version !== "2023-07") { throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option," + " representing the last proposal update. Currently, the" + " only supported value is '2023-07'."); } if (pluginsMap.has("discardBinding") && pluginsMap.get("discardBinding").syntaxType !== "void") { throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'."); } } const mixinPlugins = { estree, jsx, flow, typescript, v8intrinsic, placeholders }; const mixinPluginNames = Object.keys(mixinPlugins); class ExpressionParser extends LValParser { checkProto(prop, isRecord, sawProto, refExpressionErrors) { if (prop.type === "SpreadElement" || this.isObjectMethod(prop) || prop.computed || prop.shorthand) { return sawProto; } const key = prop.key; const name = key.type === "Identifier" ? key.name : key.value; if (name === "__proto__") { if (isRecord) { this.raise(Errors.RecordNoProto, key); return true; } if (sawProto) { if (refExpressionErrors) { if (refExpressionErrors.doubleProtoLoc === null) { refExpressionErrors.doubleProtoLoc = key.loc.start; } } else { this.raise(Errors.DuplicateProto, key); } } return true; } return sawProto; } shouldExitDescending(expr, potentialArrowAt) { return expr.type === "ArrowFunctionExpression" && this.offsetToSourcePos(expr.start) === potentialArrowAt; } getExpression() { this.enterInitialScopes(); this.nextToken(); if (this.match(140)) { throw this.raise(Errors.ParseExpressionEmptyInput, this.state.startLoc); } const expr = this.parseExpression(); if (!this.match(140)) { throw this.raise(Errors.ParseExpressionExpectsEOF, this.state.startLoc, { unexpected: this.input.codePointAt(this.state.start) }); } this.finalizeRemainingComments(); expr.comments = this.comments; expr.errors = this.state.errors; if (this.optionFlags & 256) { expr.tokens = this.tokens; } return expr; } parseExpression(disallowIn, refExpressionErrors) { if (disallowIn) { return this.disallowInAnd(() => this.parseExpressionBase(refExpressionErrors)); } return this.allowInAnd(() => this.parseExpressionBase(refExpressionErrors)); } parseExpressionBase(refExpressionErrors) { const startLoc = this.state.startLoc; const expr = this.parseMaybeAssign(refExpressionErrors); if (this.match(12)) { const node = this.startNodeAt(startLoc); node.expressions = [expr]; while (this.eat(12)) { node.expressions.push(this.parseMaybeAssign(refExpressionErrors)); } this.toReferencedList(node.expressions); return this.finishNode(node, "SequenceExpression"); } return expr; } parseMaybeAssignDisallowIn(refExpressionErrors, afterLeftParse) { return this.disallowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); } parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse) { return this.allowInAnd(() => this.parseMaybeAssign(refExpressionErrors, afterLeftParse)); } setOptionalParametersError(refExpressionErrors) { refExpressionErrors.optionalParametersLoc = this.state.startLoc; } parseMaybeAssign(refExpressionErrors, afterLeftParse) { const startLoc = this.state.startLoc; const isYield = this.isContextual(108); if (isYield) { if (this.prodParam.hasYield) { this.next(); let left = this.parseYield(startLoc); if (afterLeftParse) { left = afterLeftParse.call(this, left, startLoc); } return left; } } let ownExpressionErrors; if (refExpressionErrors) { ownExpressionErrors = false; } else { refExpressionErrors = new ExpressionErrors(); ownExpressionErrors = true; } const { type } = this.state; if (type === 10 || tokenIsIdentifier(type)) { this.state.potentialArrowAt = this.state.start; } let left = this.parseMaybeConditional(refExpressionErrors); if (afterLeftParse) { left = afterLeftParse.call(this, left, startLoc); } if (tokenIsAssignment(this.state.type)) { const node = this.startNodeAt(startLoc); const operator = this.state.value; node.operator = operator; if (this.match(29)) { this.toAssignable(left, true); node.left = left; const startIndex = startLoc.index; if (refExpressionErrors.doubleProtoLoc != null && refExpressionErrors.doubleProtoLoc.index >= startIndex) { refExpressionErrors.doubleProtoLoc = null; } if (refExpressionErrors.shorthandAssignLoc != null && refExpressionErrors.shorthandAssignLoc.index >= startIndex) { refExpressionErrors.shorthandAssignLoc = null; } if (refExpressionErrors.privateKeyLoc != null && refExpressionErrors.privateKeyLoc.index >= startIndex) { this.checkDestructuringPrivate(refExpressionErrors); refExpressionErrors.privateKeyLoc = null; } if (refExpressionErrors.voidPatternLoc != null && refExpressionErrors.voidPatternLoc.index >= startIndex) { refExpressionErrors.voidPatternLoc = null; } } else { node.left = left; } this.next(); node.right = this.parseMaybeAssign(); this.checkLVal(left, this.finishNode(node, "AssignmentExpression")); return node; } else if (ownExpressionErrors) { this.checkExpressionErrors(refExpressionErrors, true); } if (isYield) { const { type } = this.state; const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54); if (startsExpr && !this.isAmbiguousPrefixOrIdentifier()) { this.raiseOverwrite(Errors.YieldNotInGeneratorFunction, startLoc); return this.parseYield(startLoc); } } return left; } parseMaybeConditional(refExpressionErrors) { const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; const expr = this.parseExprOps(refExpressionErrors); if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } return this.parseConditional(expr, startLoc, refExpressionErrors); } parseConditional(expr, startLoc, refExpressionErrors) { if (this.eat(17)) { const node = this.startNodeAt(startLoc); node.test = expr; node.consequent = this.parseMaybeAssignAllowIn(); this.expect(14); node.alternate = this.parseMaybeAssign(); return this.finishNode(node, "ConditionalExpression"); } return expr; } parseMaybeUnaryOrPrivate(refExpressionErrors) { return this.match(139) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors); } parseExprOps(refExpressionErrors) { const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors); if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } return this.parseExprOp(expr, startLoc, -1); } parseExprOp(left, leftStartLoc, minPrec) { if (this.isPrivateName(left)) { const value = this.getPrivateNameSV(left); if (minPrec >= tokenOperatorPrecedence(58) || !this.prodParam.hasIn || !this.match(58)) { this.raise(Errors.PrivateInExpectedIn, left, { identifierName: value }); } this.classScope.usePrivateName(value, left.loc.start); } const op = this.state.type; if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(58))) { let prec = tokenOperatorPrecedence(op); if (prec > minPrec) { if (op === 39) { this.expectPlugin("pipelineOperator"); if (this.state.inFSharpPipelineDirectBody) { return left; } this.checkPipelineAtInfixOperator(left, leftStartLoc); } const node = this.startNodeAt(leftStartLoc); node.left = left; node.operator = this.state.value; const logical = op === 41 || op === 42; const coalesce = op === 40; if (coalesce) { prec = tokenOperatorPrecedence(42); } this.next(); if (op === 39 && this.hasPlugin(["pipelineOperator", { proposal: "minimal" }])) { if (this.state.type === 96 && this.prodParam.hasAwait) { throw this.raise(Errors.UnexpectedAwaitAfterPipelineBody, this.state.startLoc); } } node.right = this.parseExprOpRightExpr(op, prec); const finishedNode = this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression"); const nextOp = this.state.type; if (coalesce && (nextOp === 41 || nextOp === 42) || logical && nextOp === 40) { throw this.raise(Errors.MixingCoalesceWithLogical, this.state.startLoc); } return this.parseExprOp(finishedNode, leftStartLoc, minPrec); } } return left; } parseExprOpRightExpr(op, prec) { const startLoc = this.state.startLoc; switch (op) { case 39: switch (this.getPluginOption("pipelineOperator", "proposal")) { case "hack": return this.withTopicBindingContext(() => { return this.parseHackPipeBody(); }); case "fsharp": return this.withSoloAwaitPermittingContext(() => { return this.parseFSharpPipelineBody(prec); }); } if (this.getPluginOption("pipelineOperator", "proposal") === "smart") { return this.withTopicBindingContext(() => { if (this.prodParam.hasYield && this.isContextual(108)) { throw this.raise(Errors.PipeBodyIsTighter, this.state.startLoc); } return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(op, prec), startLoc); }); } default: return this.parseExprOpBaseRightExpr(op, prec); } } parseExprOpBaseRightExpr(op, prec) { const startLoc = this.state.startLoc; return this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, tokenIsRightAssociative(op) ? prec - 1 : prec); } parseHackPipeBody() { var _body$extra; const { startLoc } = this.state; const body = this.parseMaybeAssign(); const requiredParentheses = UnparenthesizedPipeBodyDescriptions.has(body.type); if (requiredParentheses && !((_body$extra = body.extra) != null && _body$extra.parenthesized)) { this.raise(Errors.PipeUnparenthesizedBody, startLoc, { type: body.type }); } if (!this.topicReferenceWasUsedInCurrentContext()) { this.raise(Errors.PipeTopicUnused, startLoc); } return body; } checkExponentialAfterUnary(node) { if (this.match(57)) { this.raise(Errors.UnexpectedTokenUnaryExponentiation, node.argument); } } parseMaybeUnary(refExpressionErrors, sawUnary) { const startLoc = this.state.startLoc; const isAwait = this.isContextual(96); if (isAwait && this.recordAwaitIfAllowed()) { this.next(); const expr = this.parseAwait(startLoc); if (!sawUnary) this.checkExponentialAfterUnary(expr); return expr; } const update = this.match(34); const node = this.startNode(); if (tokenIsPrefix(this.state.type)) { node.operator = this.state.value; node.prefix = true; if (this.match(72)) { this.expectPlugin("throwExpressions"); } const isDelete = this.match(89); this.next(); node.argument = this.parseMaybeUnary(null, true); this.checkExpressionErrors(refExpressionErrors, true); if (this.state.strict && isDelete) { const arg = node.argument; if (arg.type === "Identifier") { this.raise(Errors.StrictDelete, node); } else if (this.hasPropertyAsPrivateName(arg)) { this.raise(Errors.DeletePrivateField, node); } } if (!update) { if (!sawUnary) { this.checkExponentialAfterUnary(node); } return this.finishNode(node, "UnaryExpression"); } } const expr = this.parseUpdate(node, update, refExpressionErrors); if (isAwait) { const { type } = this.state; const startsExpr = this.hasPlugin("v8intrinsic") ? tokenCanStartExpression(type) : tokenCanStartExpression(type) && !this.match(54); if (startsExpr && !this.isAmbiguousPrefixOrIdentifier()) { this.raiseOverwrite(Errors.AwaitNotInAsyncContext, startLoc); return this.parseAwait(startLoc); } } return expr; } parseUpdate(node, update, refExpressionErrors) { if (update) { const updateExpressionNode = node; this.checkLVal(updateExpressionNode.argument, this.finishNode(updateExpressionNode, "UpdateExpression")); return node; } const startLoc = this.state.startLoc; let expr = this.parseExprSubscripts(refExpressionErrors); if (this.checkExpressionErrors(refExpressionErrors, false)) return expr; while (tokenIsPostfix(this.state.type) && !this.canInsertSemicolon()) { const node = this.startNodeAt(startLoc); node.operator = this.state.value; node.prefix = false; node.argument = expr; this.next(); this.checkLVal(expr, expr = this.finishNode(node, "UpdateExpression")); } return expr; } parseExprSubscripts(refExpressionErrors) { const startLoc = this.state.startLoc; const potentialArrowAt = this.state.potentialArrowAt; const expr = this.parseExprAtom(refExpressionErrors); if (this.shouldExitDescending(expr, potentialArrowAt)) { return expr; } return this.parseSubscripts(expr, startLoc); } parseSubscripts(base, startLoc, noCalls) { const state = { optionalChainMember: false, maybeAsyncArrow: this.atPossibleAsyncArrow(base), stop: false }; do { base = this.parseSubscript(base, startLoc, noCalls, state); state.maybeAsyncArrow = false; } while (!state.stop); return base; } parseSubscript(base, startLoc, noCalls, state) { const { type } = this.state; if (!noCalls && type === 15) { return this.parseBind(base, startLoc, noCalls, state); } else if (tokenIsTemplate(type)) { return this.parseTaggedTemplateExpression(base, startLoc, state); } let optional = false; if (type === 18) { if (noCalls) { this.raise(Errors.OptionalChainingNoNew, this.state.startLoc); if (this.lookaheadCharCode() === 40) { return this.stopParseSubscript(base, state); } } state.optionalChainMember = optional = true; this.next(); } if (!noCalls && this.match(10)) { return this.parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional); } else { const computed = this.eat(0); if (computed || optional || this.eat(16)) { return this.parseMember(base, startLoc, state, computed, optional); } else { return this.stopParseSubscript(base, state); } } } stopParseSubscript(base, state) { state.stop = true; return base; } parseMember(base, startLoc, state, computed, optional) { const node = this.startNodeAt(startLoc); node.object = base; node.computed = computed; if (computed) { node.property = this.parseExpression(); this.expect(3); } else if (this.match(139)) { if (base.type === "Super") { this.raise(Errors.SuperPrivateField, startLoc); } this.classScope.usePrivateName(this.state.value, this.state.startLoc); node.property = this.parsePrivateName(); } else { node.property = this.parseIdentifier(true); } if (state.optionalChainMember) { node.optional = optional; return this.finishNode(node, "OptionalMemberExpression"); } else { return this.finishNode(node, "MemberExpression"); } } parseBind(base, startLoc, noCalls, state) { const node = this.startNodeAt(startLoc); node.object = base; this.next(); node.callee = this.parseNoCallExpr(); state.stop = true; return this.parseSubscripts(this.finishNode(node, "BindExpression"), startLoc, noCalls); } parseCoverCallAndAsyncArrowHead(base, startLoc, state, optional) { const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; let refExpressionErrors = null; this.state.maybeInArrowParameters = true; this.next(); const node = this.startNodeAt(startLoc); node.callee = base; const { maybeAsyncArrow, optionalChainMember } = state; if (maybeAsyncArrow) { this.expressionScope.enter(newAsyncArrowScope()); refExpressionErrors = new ExpressionErrors(); } if (optionalChainMember) { node.optional = optional; } if (optional) { node.arguments = this.parseCallExpressionArguments(); } else { node.arguments = this.parseCallExpressionArguments(base.type !== "Super", node, refExpressionErrors); } let finishedNode = this.finishCallExpression(node, optionalChainMember); if (maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) { state.stop = true; this.checkDestructuringPrivate(refExpressionErrors); this.expressionScope.validateAsPattern(); this.expressionScope.exit(); finishedNode = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startLoc), finishedNode); } else { if (maybeAsyncArrow) { this.checkExpressionErrors(refExpressionErrors, true); this.expressionScope.exit(); } this.toReferencedArguments(finishedNode); } this.state.maybeInArrowParameters = oldMaybeInArrowParameters; return finishedNode; } toReferencedArguments(node, isParenthesizedExpr) { this.toReferencedListDeep(node.arguments, isParenthesizedExpr); } parseTaggedTemplateExpression(base, startLoc, state) { const node = this.startNodeAt(startLoc); node.tag = base; node.quasi = this.parseTemplate(true); if (state.optionalChainMember) { this.raise(Errors.OptionalChainingNoTemplate, startLoc); } return this.finishNode(node, "TaggedTemplateExpression"); } atPossibleAsyncArrow(base) { return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.offsetToSourcePos(base.start) === this.state.potentialArrowAt; } finishCallExpression(node, optional) { if (node.callee.type === "Import") { if (node.arguments.length === 0 || node.arguments.length > 2) { this.raise(Errors.ImportCallArity, node); } else { for (const arg of node.arguments) { if (arg.type === "SpreadElement") { this.raise(Errors.ImportCallSpreadArgument, arg); } } } } return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression"); } parseCallExpressionArguments(allowPlaceholder, nodeForExtra, refExpressionErrors) { const elts = []; let first = true; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; while (!this.eat(11)) { if (first) { first = false; } else { this.expect(12); if (this.match(11)) { if (nodeForExtra) { this.addTrailingCommaExtraToNode(nodeForExtra); } this.next(); break; } } elts.push(this.parseExprListItem(11, false, refExpressionErrors, allowPlaceholder)); } this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return elts; } shouldParseAsyncArrow() { return this.match(19) && !this.canInsertSemicolon(); } parseAsyncArrowFromCallExpression(node, call) { var _call$extra; this.resetPreviousNodeTrailingComments(call); this.expect(19); this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingCommaLoc); if (call.innerComments) { setInnerComments(node, call.innerComments); } if (call.callee.trailingComments) { setInnerComments(node, call.callee.trailingComments); } return node; } parseNoCallExpr() { const startLoc = this.state.startLoc; return this.parseSubscripts(this.parseExprAtom(), startLoc, true); } parseExprAtom(refExpressionErrors) { let node; let decorators = null; const { type } = this.state; switch (type) { case 79: return this.parseSuper(); case 83: node = this.startNode(); this.next(); if (this.match(16)) { return this.parseImportMetaPropertyOrPhaseCall(node); } if (this.match(10)) { if (this.optionFlags & 512) { return this.parseImportCall(node); } else { return this.finishNode(node, "Import"); } } else { this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc); return this.finishNode(node, "Import"); } case 78: node = this.startNode(); this.next(); return this.finishNode(node, "ThisExpression"); case 90: { return this.parseDo(this.startNode(), false); } case 56: case 31: { this.readRegexp(); return this.parseRegExpLiteral(this.state.value); } case 135: return this.parseNumericLiteral(this.state.value); case 136: return this.parseBigIntLiteral(this.state.value); case 134: return this.parseStringLiteral(this.state.value); case 84: return this.parseNullLiteral(); case 85: return this.parseBooleanLiteral(true); case 86: return this.parseBooleanLiteral(false); case 10: { const canBeArrow = this.state.potentialArrowAt === this.state.start; return this.parseParenAndDistinguishExpression(canBeArrow); } case 0: { return this.parseArrayLike(3, true, false, refExpressionErrors); } case 5: { return this.parseObjectLike(8, false, false, refExpressionErrors); } case 68: return this.parseFunctionOrFunctionSent(); case 26: decorators = this.parseDecorators(); case 80: return this.parseClass(this.maybeTakeDecorators(decorators, this.startNode()), false); case 77: return this.parseNewOrNewTarget(); case 25: case 24: return this.parseTemplate(false); case 15: { node = this.startNode(); this.next(); node.object = null; const callee = node.callee = this.parseNoCallExpr(); if (callee.type === "MemberExpression") { return this.finishNode(node, "BindExpression"); } else { throw this.raise(Errors.UnsupportedBind, callee); } } case 139: { this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, { identifierName: this.state.value }); return this.parsePrivateName(); } case 33: { return this.parseTopicReferenceThenEqualsSign(54, "%"); } case 32: { return this.parseTopicReferenceThenEqualsSign(44, "^"); } case 37: case 38: { return this.parseTopicReference("hack"); } case 44: case 54: case 27: { const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); if (pipeProposal) { return this.parseTopicReference(pipeProposal); } this.unexpected(); break; } case 47: { const lookaheadCh = this.input.codePointAt(this.nextTokenStart()); if (isIdentifierStart(lookaheadCh) || lookaheadCh === 62) { this.expectOnePlugin(["jsx", "flow", "typescript"]); } else { this.unexpected(); } break; } default: { if (type === 137) { return this.parseDecimalLiteral(this.state.value); } else if (type === 2 || type === 1) { return this.parseArrayLike(this.state.type === 2 ? 4 : 3, false, true); } else if (type === 6 || type === 7) { return this.parseObjectLike(this.state.type === 6 ? 9 : 8, false, true); } } if (tokenIsIdentifier(type)) { if (this.isContextual(127) && this.lookaheadInLineCharCode() === 123) { return this.parseModuleExpression(); } const canBeArrow = this.state.potentialArrowAt === this.state.start; const containsEsc = this.state.containsEsc; const id = this.parseIdentifier(); if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) { const { type } = this.state; if (type === 68) { this.resetPreviousNodeTrailingComments(id); this.next(); return this.parseAsyncFunctionExpression(this.startNodeAtNode(id)); } else if (tokenIsIdentifier(type)) { if (this.lookaheadCharCode() === 61) { return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id)); } else { return id; } } else if (type === 90) { this.resetPreviousNodeTrailingComments(id); return this.parseDo(this.startNodeAtNode(id), true); } } if (canBeArrow && this.match(19) && !this.canInsertSemicolon()) { this.next(); return this.parseArrowExpression(this.startNodeAtNode(id), [id], false); } return id; } else { this.unexpected(); } } } parseTopicReferenceThenEqualsSign(topicTokenType, topicTokenValue) { const pipeProposal = this.getPluginOption("pipelineOperator", "proposal"); if (pipeProposal) { this.state.type = topicTokenType; this.state.value = topicTokenValue; this.state.pos--; this.state.end--; this.state.endLoc = createPositionWithColumnOffset(this.state.endLoc, -1); return this.parseTopicReference(pipeProposal); } else { this.unexpected(); } } parseTopicReference(pipeProposal) { const node = this.startNode(); const startLoc = this.state.startLoc; const tokenType = this.state.type; this.next(); return this.finishTopicReference(node, startLoc, pipeProposal, tokenType); } finishTopicReference(node, startLoc, pipeProposal, tokenType) { if (this.testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType)) { if (pipeProposal === "hack") { if (!this.topicReferenceIsAllowedInCurrentContext()) { this.raise(Errors.PipeTopicUnbound, startLoc); } this.registerTopicReference(); return this.finishNode(node, "TopicReference"); } else { if (!this.topicReferenceIsAllowedInCurrentContext()) { this.raise(Errors.PrimaryTopicNotAllowed, startLoc); } this.registerTopicReference(); return this.finishNode(node, "PipelinePrimaryTopicReference"); } } else { throw this.raise(Errors.PipeTopicUnconfiguredToken, startLoc, { token: tokenLabelName(tokenType) }); } } testTopicReferenceConfiguration(pipeProposal, startLoc, tokenType) { switch (pipeProposal) { case "hack": { return this.hasPlugin(["pipelineOperator", { topicToken: tokenLabelName(tokenType) }]); } case "smart": return tokenType === 27; default: throw this.raise(Errors.PipeTopicRequiresHackPipes, startLoc); } } parseAsyncArrowUnaryFunction(node) { this.prodParam.enter(functionFlags(true, this.prodParam.hasYield)); const params = [this.parseIdentifier()]; this.prodParam.exit(); if (this.hasPrecedingLineBreak()) { this.raise(Errors.LineTerminatorBeforeArrow, this.state.curPosition()); } this.expect(19); return this.parseArrowExpression(node, params, true); } parseDo(node, isAsync) { this.expectPlugin("doExpressions"); if (isAsync) { this.expectPlugin("asyncDoExpressions"); } node.async = isAsync; this.next(); const oldLabels = this.state.labels; this.state.labels = []; if (isAsync) { this.prodParam.enter(2); node.body = this.parseBlock(); this.prodParam.exit(); } else { node.body = this.parseBlock(); } this.state.labels = oldLabels; return this.finishNode(node, "DoExpression"); } parseSuper() { const node = this.startNode(); this.next(); if (this.match(10) && !this.scope.allowDirectSuper && !(this.optionFlags & 16)) { this.raise(Errors.SuperNotAllowed, node); } else if (!this.scope.allowSuper && !(this.optionFlags & 16)) { this.raise(Errors.UnexpectedSuper, node); } if (!this.match(10) && !this.match(0) && !this.match(16)) { this.raise(Errors.UnsupportedSuper, node); } return this.finishNode(node, "Super"); } parsePrivateName() { const node = this.startNode(); const id = this.startNodeAt(createPositionWithColumnOffset(this.state.startLoc, 1)); const name = this.state.value; this.next(); node.id = this.createIdentifier(id, name); return this.finishNode(node, "PrivateName"); } parseFunctionOrFunctionSent() { const node = this.startNode(); this.next(); if (this.prodParam.hasYield && this.match(16)) { const meta = this.createIdentifier(this.startNodeAtNode(node), "function"); this.next(); if (this.match(103)) { this.expectPlugin("functionSent"); } else if (!this.hasPlugin("functionSent")) { this.unexpected(); } return this.parseMetaProperty(node, meta, "sent"); } return this.parseFunction(node); } parseMetaProperty(node, meta, propertyName) { node.meta = meta; const containsEsc = this.state.containsEsc; node.property = this.parseIdentifier(true); if (node.property.name !== propertyName || containsEsc) { this.raise(Errors.UnsupportedMetaProperty, node.property, { target: meta.name, onlyValidPropertyName: propertyName }); } return this.finishNode(node, "MetaProperty"); } parseImportMetaPropertyOrPhaseCall(node) { this.next(); if (this.isContextual(105) || this.isContextual(97)) { const isSource = this.isContextual(105); this.expectPlugin(isSource ? "sourcePhaseImports" : "deferredImportEvaluation"); this.next(); node.phase = isSource ? "source" : "defer"; return this.parseImportCall(node); } else { const id = this.createIdentifierAt(this.startNodeAtNode(node), "import", this.state.lastTokStartLoc); if (this.isContextual(101)) { if (!this.inModule) { this.raise(Errors.ImportMetaOutsideModule, id); } this.sawUnambiguousESM = true; } return this.parseMetaProperty(node, id, "meta"); } } parseLiteralAtNode(value, type, node) { this.addExtra(node, "rawValue", value); this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)); node.value = value; this.next(); return this.finishNode(node, type); } parseLiteral(value, type) { const node = this.startNode(); return this.parseLiteralAtNode(value, type, node); } parseStringLiteral(value) { return this.parseLiteral(value, "StringLiteral"); } parseNumericLiteral(value) { return this.parseLiteral(value, "NumericLiteral"); } parseBigIntLiteral(value) { { return this.parseLiteral(value, "BigIntLiteral"); } } parseDecimalLiteral(value) { return this.parseLiteral(value, "DecimalLiteral"); } parseRegExpLiteral(value) { const node = this.startNode(); this.addExtra(node, "raw", this.input.slice(this.offsetToSourcePos(node.start), this.state.end)); node.pattern = value.pattern; node.flags = value.flags; this.next(); return this.finishNode(node, "RegExpLiteral"); } parseBooleanLiteral(value) { const node = this.startNode(); node.value = value; this.next(); return this.finishNode(node, "BooleanLiteral"); } parseNullLiteral() { const node = this.startNode(); this.next(); return this.finishNode(node, "NullLiteral"); } parseParenAndDistinguishExpression(canBeArrow) { const startLoc = this.state.startLoc; let val; this.next(); this.expressionScope.enter(newArrowHeadScope()); const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.maybeInArrowParameters = true; this.state.inFSharpPipelineDirectBody = false; const innerStartLoc = this.state.startLoc; const exprList = []; const refExpressionErrors = new ExpressionErrors(); let first = true; let spreadStartLoc; let optionalCommaStartLoc; while (!this.match(11)) { if (first) { first = false; } else { this.expect(12, refExpressionErrors.optionalParametersLoc === null ? null : refExpressionErrors.optionalParametersLoc); if (this.match(11)) { optionalCommaStartLoc = this.state.startLoc; break; } } if (this.match(21)) { const spreadNodeStartLoc = this.state.startLoc; spreadStartLoc = this.state.startLoc; exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartLoc)); if (!this.checkCommaAfterRest(41)) { break; } } else { exprList.push(this.parseMaybeAssignAllowInOrVoidPattern(11, refExpressionErrors, this.parseParenItem)); } } const innerEndLoc = this.state.lastTokEndLoc; this.expect(11); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; let arrowNode = this.startNodeAt(startLoc); if (canBeArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) { this.checkDestructuringPrivate(refExpressionErrors); this.expressionScope.validateAsPattern(); this.expressionScope.exit(); this.parseArrowExpression(arrowNode, exprList, false); return arrowNode; } this.expressionScope.exit(); if (!exprList.length) { this.unexpected(this.state.lastTokStartLoc); } if (optionalCommaStartLoc) this.unexpected(optionalCommaStartLoc); if (spreadStartLoc) this.unexpected(spreadStartLoc); this.checkExpressionErrors(refExpressionErrors, true); this.toReferencedListDeep(exprList, true); if (exprList.length > 1) { val = this.startNodeAt(innerStartLoc); val.expressions = exprList; this.finishNode(val, "SequenceExpression"); this.resetEndLocation(val, innerEndLoc); } else { val = exprList[0]; } return this.wrapParenthesis(startLoc, val); } wrapParenthesis(startLoc, expression) { if (!(this.optionFlags & 1024)) { this.addExtra(expression, "parenthesized", true); this.addExtra(expression, "parenStart", startLoc.index); this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index); return expression; } const parenExpression = this.startNodeAt(startLoc); parenExpression.expression = expression; return this.finishNode(parenExpression, "ParenthesizedExpression"); } shouldParseArrow(params) { return !this.canInsertSemicolon(); } parseArrow(node) { if (this.eat(19)) { return node; } } parseParenItem(node, startLoc) { return node; } parseNewOrNewTarget() { const node = this.startNode(); this.next(); if (this.match(16)) { const meta = this.createIdentifier(this.startNodeAtNode(node), "new"); this.next(); const metaProp = this.parseMetaProperty(node, meta, "target"); if (!this.scope.allowNewTarget) { this.raise(Errors.UnexpectedNewTarget, metaProp); } return metaProp; } return this.parseNew(node); } parseNew(node) { this.parseNewCallee(node); if (this.eat(10)) { const args = this.parseExprList(11); this.toReferencedList(args); node.arguments = args; } else { node.arguments = []; } return this.finishNode(node, "NewExpression"); } parseNewCallee(node) { const isImport = this.match(83); const callee = this.parseNoCallExpr(); node.callee = callee; if (isImport && (callee.type === "Import" || callee.type === "ImportExpression")) { this.raise(Errors.ImportCallNotNewExpression, callee); } } parseTemplateElement(isTagged) { const { start, startLoc, end, value } = this.state; const elemStart = start + 1; const elem = this.startNodeAt(createPositionWithColumnOffset(startLoc, 1)); if (value === null) { if (!isTagged) { this.raise(Errors.InvalidEscapeSequenceTemplate, createPositionWithColumnOffset(this.state.firstInvalidTemplateEscapePos, 1)); } } const isTail = this.match(24); const endOffset = isTail ? -1 : -2; const elemEnd = end + endOffset; elem.value = { raw: this.input.slice(elemStart, elemEnd).replace(/\r\n?/g, "\n"), cooked: value === null ? null : value.slice(1, endOffset) }; elem.tail = isTail; this.next(); const finishedNode = this.finishNode(elem, "TemplateElement"); this.resetEndLocation(finishedNode, createPositionWithColumnOffset(this.state.lastTokEndLoc, endOffset)); return finishedNode; } parseTemplate(isTagged) { const node = this.startNode(); let curElt = this.parseTemplateElement(isTagged); const quasis = [curElt]; const substitutions = []; while (!curElt.tail) { substitutions.push(this.parseTemplateSubstitution()); this.readTemplateContinuation(); quasis.push(curElt = this.parseTemplateElement(isTagged)); } node.expressions = substitutions; node.quasis = quasis; return this.finishNode(node, "TemplateLiteral"); } parseTemplateSubstitution() { return this.parseExpression(); } parseObjectLike(close, isPattern, isRecord, refExpressionErrors) { if (isRecord) { this.expectPlugin("recordAndTuple"); } const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; let sawProto = false; let first = true; const node = this.startNode(); node.properties = []; this.next(); while (!this.match(close)) { if (first) { first = false; } else { this.expect(12); if (this.match(close)) { this.addTrailingCommaExtraToNode(node); break; } } let prop; if (isPattern) { prop = this.parseBindingProperty(); } else { prop = this.parsePropertyDefinition(refExpressionErrors); sawProto = this.checkProto(prop, isRecord, sawProto, refExpressionErrors); } if (isRecord && !this.isObjectProperty(prop) && prop.type !== "SpreadElement") { this.raise(Errors.InvalidRecordProperty, prop); } { if (prop.shorthand) { this.addExtra(prop, "shorthand", true); } } node.properties.push(prop); } this.next(); this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; let type = "ObjectExpression"; if (isPattern) { type = "ObjectPattern"; } else if (isRecord) { type = "RecordExpression"; } return this.finishNode(node, type); } addTrailingCommaExtraToNode(node) { this.addExtra(node, "trailingComma", this.state.lastTokStartLoc.index); this.addExtra(node, "trailingCommaLoc", this.state.lastTokStartLoc, false); } maybeAsyncOrAccessorProp(prop) { return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(55)); } parsePropertyDefinition(refExpressionErrors) { let decorators = []; if (this.match(26)) { if (this.hasPlugin("decorators")) { this.raise(Errors.UnsupportedPropertyDecorator, this.state.startLoc); } while (this.match(26)) { decorators.push(this.parseDecorator()); } } const prop = this.startNode(); let isAsync = false; let isAccessor = false; let startLoc; if (this.match(21)) { if (decorators.length) this.unexpected(); return this.parseSpread(); } if (decorators.length) { prop.decorators = decorators; decorators = []; } prop.method = false; if (refExpressionErrors) { startLoc = this.state.startLoc; } let isGenerator = this.eat(55); this.parsePropertyNamePrefixOperator(prop); const containsEsc = this.state.containsEsc; this.parsePropertyName(prop, refExpressionErrors); if (!isGenerator && !containsEsc && this.maybeAsyncOrAccessorProp(prop)) { const { key } = prop; const keyName = key.name; if (keyName === "async" && !this.hasPrecedingLineBreak()) { isAsync = true; this.resetPreviousNodeTrailingComments(key); isGenerator = this.eat(55); this.parsePropertyName(prop); } if (keyName === "get" || keyName === "set") { isAccessor = true; this.resetPreviousNodeTrailingComments(key); prop.kind = keyName; if (this.match(55)) { isGenerator = true; this.raise(Errors.AccessorIsGenerator, this.state.curPosition(), { kind: keyName }); this.next(); } this.parsePropertyName(prop); } } return this.parseObjPropValue(prop, startLoc, isGenerator, isAsync, false, isAccessor, refExpressionErrors); } getGetterSetterExpectedParamCount(method) { return method.kind === "get" ? 0 : 1; } getObjectOrClassMethodParams(method) { return method.params; } checkGetterSetterParams(method) { var _params; const paramCount = this.getGetterSetterExpectedParamCount(method); const params = this.getObjectOrClassMethodParams(method); if (params.length !== paramCount) { this.raise(method.kind === "get" ? Errors.BadGetterArity : Errors.BadSetterArity, method); } if (method.kind === "set" && ((_params = params[params.length - 1]) == null ? void 0 : _params.type) === "RestElement") { this.raise(Errors.BadSetterRestParameter, method); } } parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) { if (isAccessor) { const finishedProp = this.parseMethod(prop, isGenerator, false, false, false, "ObjectMethod"); this.checkGetterSetterParams(finishedProp); return finishedProp; } if (isAsync || isGenerator || this.match(10)) { if (isPattern) this.unexpected(); prop.kind = "method"; prop.method = true; return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod"); } } parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors) { prop.shorthand = false; if (this.eat(14)) { prop.value = isPattern ? this.parseMaybeDefault(this.state.startLoc) : this.parseMaybeAssignAllowInOrVoidPattern(8, refExpressionErrors); return this.finishObjectProperty(prop); } if (!prop.computed && prop.key.type === "Identifier") { this.checkReservedWord(prop.key.name, prop.key.loc.start, true, false); if (isPattern) { prop.value = this.parseMaybeDefault(startLoc, this.cloneIdentifier(prop.key)); } else if (this.match(29)) { const shorthandAssignLoc = this.state.startLoc; if (refExpressionErrors != null) { if (refExpressionErrors.shorthandAssignLoc === null) { refExpressionErrors.shorthandAssignLoc = shorthandAssignLoc; } } else { this.raise(Errors.InvalidCoverInitializedName, shorthandAssignLoc); } prop.value = this.parseMaybeDefault(startLoc, this.cloneIdentifier(prop.key)); } else { prop.value = this.cloneIdentifier(prop.key); } prop.shorthand = true; return this.finishObjectProperty(prop); } } finishObjectProperty(node) { return this.finishNode(node, "ObjectProperty"); } parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) { const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) || this.parseObjectProperty(prop, startLoc, isPattern, refExpressionErrors); if (!node) this.unexpected(); return node; } parsePropertyName(prop, refExpressionErrors) { if (this.eat(0)) { prop.computed = true; prop.key = this.parseMaybeAssignAllowIn(); this.expect(3); } else { const { type, value } = this.state; let key; if (tokenIsKeywordOrIdentifier(type)) { key = this.parseIdentifier(true); } else { switch (type) { case 135: key = this.parseNumericLiteral(value); break; case 134: key = this.parseStringLiteral(value); break; case 136: key = this.parseBigIntLiteral(value); break; case 139: { const privateKeyLoc = this.state.startLoc; if (refExpressionErrors != null) { if (refExpressionErrors.privateKeyLoc === null) { refExpressionErrors.privateKeyLoc = privateKeyLoc; } } else { this.raise(Errors.UnexpectedPrivateField, privateKeyLoc); } key = this.parsePrivateName(); break; } default: if (type === 137) { key = this.parseDecimalLiteral(value); break; } this.unexpected(); } } prop.key = key; if (type !== 139) { prop.computed = false; } } } initFunction(node, isAsync) { node.id = null; node.generator = false; node.async = isAsync; } parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) { this.initFunction(node, isAsync); node.generator = isGenerator; this.scope.enter(514 | 16 | (inClassScope ? 576 : 0) | (allowDirectSuper ? 32 : 0)); this.prodParam.enter(functionFlags(isAsync, node.generator)); this.parseFunctionParams(node, isConstructor); const finishedNode = this.parseFunctionBodyAndFinish(node, type, true); this.prodParam.exit(); this.scope.exit(); return finishedNode; } parseArrayLike(close, canBePattern, isTuple, refExpressionErrors) { if (isTuple) { this.expectPlugin("recordAndTuple"); } const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = false; const node = this.startNode(); this.next(); node.elements = this.parseExprList(close, !isTuple, refExpressionErrors, node); this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return this.finishNode(node, isTuple ? "TupleExpression" : "ArrayExpression"); } parseArrowExpression(node, params, isAsync, trailingCommaLoc) { this.scope.enter(514 | 4); let flags = functionFlags(isAsync, false); if (!this.match(5) && this.prodParam.hasIn) { flags |= 8; } this.prodParam.enter(flags); this.initFunction(node, isAsync); const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; if (params) { this.state.maybeInArrowParameters = true; this.setArrowFunctionParameters(node, params, trailingCommaLoc); } this.state.maybeInArrowParameters = false; this.parseFunctionBody(node, true); this.prodParam.exit(); this.scope.exit(); this.state.maybeInArrowParameters = oldMaybeInArrowParameters; return this.finishNode(node, "ArrowFunctionExpression"); } setArrowFunctionParameters(node, params, trailingCommaLoc) { this.toAssignableList(params, trailingCommaLoc, false); node.params = params; } parseFunctionBodyAndFinish(node, type, isMethod = false) { this.parseFunctionBody(node, false, isMethod); return this.finishNode(node, type); } parseFunctionBody(node, allowExpression, isMethod = false) { const isExpression = allowExpression && !this.match(5); this.expressionScope.enter(newExpressionScope()); if (isExpression) { node.body = this.parseMaybeAssign(); this.checkParams(node, false, allowExpression, false); } else { const oldStrict = this.state.strict; const oldLabels = this.state.labels; this.state.labels = []; this.prodParam.enter(this.prodParam.currentFlags() | 4); node.body = this.parseBlock(true, false, hasStrictModeDirective => { const nonSimple = !this.isSimpleParamList(node.params); if (hasStrictModeDirective && nonSimple) { this.raise(Errors.IllegalLanguageModeDirective, (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node); } const strictModeChanged = !oldStrict && this.state.strict; this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged); if (this.state.strict && node.id) { this.checkIdentifier(node.id, 65, strictModeChanged); } }); this.prodParam.exit(); this.state.labels = oldLabels; } this.expressionScope.exit(); } isSimpleParameter(node) { return node.type === "Identifier"; } isSimpleParamList(params) { for (let i = 0, len = params.length; i < len; i++) { if (!this.isSimpleParameter(params[i])) return false; } return true; } checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) { const checkClashes = !allowDuplicates && new Set(); const formalParameters = { type: "FormalParameters" }; for (const param of node.params) { this.checkLVal(param, formalParameters, 5, checkClashes, strictModeChanged); } } parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) { const elts = []; let first = true; while (!this.eat(close)) { if (first) { first = false; } else { this.expect(12); if (this.match(close)) { if (nodeForExtra) { this.addTrailingCommaExtraToNode(nodeForExtra); } this.next(); break; } } elts.push(this.parseExprListItem(close, allowEmpty, refExpressionErrors)); } return elts; } parseExprListItem(close, allowEmpty, refExpressionErrors, allowPlaceholder) { let elt; if (this.match(12)) { if (!allowEmpty) { this.raise(Errors.UnexpectedToken, this.state.curPosition(), { unexpected: "," }); } elt = null; } else if (this.match(21)) { const spreadNodeStartLoc = this.state.startLoc; elt = this.parseParenItem(this.parseSpread(refExpressionErrors), spreadNodeStartLoc); } else if (this.match(17)) { this.expectPlugin("partialApplication"); if (!allowPlaceholder) { this.raise(Errors.UnexpectedArgumentPlaceholder, this.state.startLoc); } const node = this.startNode(); this.next(); elt = this.finishNode(node, "ArgumentPlaceholder"); } else { elt = this.parseMaybeAssignAllowInOrVoidPattern(close, refExpressionErrors, this.parseParenItem); } return elt; } parseIdentifier(liberal) { const node = this.startNode(); const name = this.parseIdentifierName(liberal); return this.createIdentifier(node, name); } createIdentifier(node, name) { node.name = name; node.loc.identifierName = name; return this.finishNode(node, "Identifier"); } createIdentifierAt(node, name, endLoc) { node.name = name; node.loc.identifierName = name; return this.finishNodeAt(node, "Identifier", endLoc); } parseIdentifierName(liberal) { let name; const { startLoc, type } = this.state; if (tokenIsKeywordOrIdentifier(type)) { name = this.state.value; } else { this.unexpected(); } const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type); if (liberal) { if (tokenIsKeyword) { this.replaceToken(132); } } else { this.checkReservedWord(name, startLoc, tokenIsKeyword, false); } this.next(); return name; } checkReservedWord(word, startLoc, checkKeywords, isBinding) { if (word.length > 10) { return; } if (!canBeReservedWord(word)) { return; } if (checkKeywords && isKeyword(word)) { this.raise(Errors.UnexpectedKeyword, startLoc, { keyword: word }); return; } const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord; if (reservedTest(word, this.inModule)) { this.raise(Errors.UnexpectedReservedWord, startLoc, { reservedWord: word }); return; } else if (word === "yield") { if (this.prodParam.hasYield) { this.raise(Errors.YieldBindingIdentifier, startLoc); return; } } else if (word === "await") { if (this.prodParam.hasAwait) { this.raise(Errors.AwaitBindingIdentifier, startLoc); return; } if (this.scope.inStaticBlock) { this.raise(Errors.AwaitBindingIdentifierInStaticBlock, startLoc); return; } this.expressionScope.recordAsyncArrowParametersError(startLoc); } else if (word === "arguments") { if (this.scope.inClassAndNotInNonArrowFunction) { this.raise(Errors.ArgumentsInClass, startLoc); return; } } } recordAwaitIfAllowed() { const isAwaitAllowed = this.prodParam.hasAwait; if (isAwaitAllowed && !this.scope.inFunction) { this.state.hasTopLevelAwait = true; } return isAwaitAllowed; } parseAwait(startLoc) { const node = this.startNodeAt(startLoc); this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, node); if (this.eat(55)) { this.raise(Errors.ObsoleteAwaitStar, node); } if (!this.scope.inFunction && !(this.optionFlags & 1)) { if (this.isAmbiguousPrefixOrIdentifier()) { this.ambiguousScriptDifferentAst = true; } else { this.sawUnambiguousESM = true; } } if (!this.state.soloAwait) { node.argument = this.parseMaybeUnary(null, true); } return this.finishNode(node, "AwaitExpression"); } isAmbiguousPrefixOrIdentifier() { if (this.hasPrecedingLineBreak()) return true; const { type } = this.state; return type === 53 || type === 10 || type === 0 || tokenIsTemplate(type) || type === 102 && !this.state.containsEsc || type === 138 || type === 56 || this.hasPlugin("v8intrinsic") && type === 54; } parseYield(startLoc) { const node = this.startNodeAt(startLoc); this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, node); let delegating = false; let argument = null; if (!this.hasPrecedingLineBreak()) { delegating = this.eat(55); switch (this.state.type) { case 13: case 140: case 8: case 11: case 3: case 9: case 14: case 12: if (!delegating) break; default: argument = this.parseMaybeAssign(); } } node.delegate = delegating; node.argument = argument; return this.finishNode(node, "YieldExpression"); } parseImportCall(node) { this.next(); node.source = this.parseMaybeAssignAllowIn(); node.options = null; if (this.eat(12)) { if (!this.match(11)) { node.options = this.parseMaybeAssignAllowIn(); if (this.eat(12)) { this.addTrailingCommaExtraToNode(node.options); if (!this.match(11)) { do { this.parseMaybeAssignAllowIn(); } while (this.eat(12) && !this.match(11)); this.raise(Errors.ImportCallArity, node); } } } else { this.addTrailingCommaExtraToNode(node.source); } } this.expect(11); return this.finishNode(node, "ImportExpression"); } checkPipelineAtInfixOperator(left, leftStartLoc) { if (this.hasPlugin(["pipelineOperator", { proposal: "smart" }])) { if (left.type === "SequenceExpression") { this.raise(Errors.PipelineHeadSequenceExpression, leftStartLoc); } } } parseSmartPipelineBodyInStyle(childExpr, startLoc) { if (this.isSimpleReference(childExpr)) { const bodyNode = this.startNodeAt(startLoc); bodyNode.callee = childExpr; return this.finishNode(bodyNode, "PipelineBareFunction"); } else { const bodyNode = this.startNodeAt(startLoc); this.checkSmartPipeTopicBodyEarlyErrors(startLoc); bodyNode.expression = childExpr; return this.finishNode(bodyNode, "PipelineTopicExpression"); } } isSimpleReference(expression) { switch (expression.type) { case "MemberExpression": return !expression.computed && this.isSimpleReference(expression.object); case "Identifier": return true; default: return false; } } checkSmartPipeTopicBodyEarlyErrors(startLoc) { if (this.match(19)) { throw this.raise(Errors.PipelineBodyNoArrow, this.state.startLoc); } if (!this.topicReferenceWasUsedInCurrentContext()) { this.raise(Errors.PipelineTopicUnused, startLoc); } } withTopicBindingContext(callback) { const outerContextTopicState = this.state.topicContext; this.state.topicContext = { maxNumOfResolvableTopics: 1, maxTopicIndex: null }; try { return callback(); } finally { this.state.topicContext = outerContextTopicState; } } withSmartMixTopicForbiddingContext(callback) { if (this.hasPlugin(["pipelineOperator", { proposal: "smart" }])) { const outerContextTopicState = this.state.topicContext; this.state.topicContext = { maxNumOfResolvableTopics: 0, maxTopicIndex: null }; try { return callback(); } finally { this.state.topicContext = outerContextTopicState; } } else { return callback(); } } withSoloAwaitPermittingContext(callback) { const outerContextSoloAwaitState = this.state.soloAwait; this.state.soloAwait = true; try { return callback(); } finally { this.state.soloAwait = outerContextSoloAwaitState; } } allowInAnd(callback) { const flags = this.prodParam.currentFlags(); const prodParamToSet = 8 & ~flags; if (prodParamToSet) { this.prodParam.enter(flags | 8); try { return callback(); } finally { this.prodParam.exit(); } } return callback(); } disallowInAnd(callback) { const flags = this.prodParam.currentFlags(); const prodParamToClear = 8 & flags; if (prodParamToClear) { this.prodParam.enter(flags & ~8); try { return callback(); } finally { this.prodParam.exit(); } } return callback(); } registerTopicReference() { this.state.topicContext.maxTopicIndex = 0; } topicReferenceIsAllowedInCurrentContext() { return this.state.topicContext.maxNumOfResolvableTopics >= 1; } topicReferenceWasUsedInCurrentContext() { return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0; } parseFSharpPipelineBody(prec) { const startLoc = this.state.startLoc; this.state.potentialArrowAt = this.state.start; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.inFSharpPipelineDirectBody = true; const ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec); this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody; return ret; } parseModuleExpression() { this.expectPlugin("moduleBlocks"); const node = this.startNode(); this.next(); if (!this.match(5)) { this.unexpected(null, 5); } const program = this.startNodeAt(this.state.endLoc); this.next(); const revertScopes = this.initializeScopes(true); this.enterInitialScopes(); try { node.body = this.parseProgram(program, 8, "module"); } finally { revertScopes(); } return this.finishNode(node, "ModuleExpression"); } parseVoidPattern(refExpressionErrors) { this.expectPlugin("discardBinding"); const node = this.startNode(); if (refExpressionErrors != null) { refExpressionErrors.voidPatternLoc = this.state.startLoc; } this.next(); return this.finishNode(node, "VoidPattern"); } parseMaybeAssignAllowInOrVoidPattern(close, refExpressionErrors, afterLeftParse) { if (refExpressionErrors != null && this.match(88)) { const nextCode = this.lookaheadCharCode(); if (nextCode === 44 || nextCode === (close === 3 ? 93 : close === 8 ? 125 : 41) || nextCode === 61) { return this.parseMaybeDefault(this.state.startLoc, this.parseVoidPattern(refExpressionErrors)); } } return this.parseMaybeAssignAllowIn(refExpressionErrors, afterLeftParse); } parsePropertyNamePrefixOperator(prop) {} } const loopLabel = { kind: 1 }, switchLabel = { kind: 2 }; const loneSurrogate = /[\uD800-\uDFFF]/u; const keywordRelationalOperator = /in(?:stanceof)?/y; function babel7CompatTokens(tokens, input, startIndex) { for (let i = 0; i < tokens.length; i++) { const token = tokens[i]; const { type } = token; if (typeof type === "number") { { if (type === 139) { const { loc, start, value, end } = token; const hashEndPos = start + 1; const hashEndLoc = createPositionWithColumnOffset(loc.start, 1); tokens.splice(i, 1, new Token({ type: getExportedToken(27), value: "#", start: start, end: hashEndPos, startLoc: loc.start, endLoc: hashEndLoc }), new Token({ type: getExportedToken(132), value: value, start: hashEndPos, end: end, startLoc: hashEndLoc, endLoc: loc.end })); i++; continue; } if (tokenIsTemplate(type)) { const { loc, start, value, end } = token; const backquoteEnd = start + 1; const backquoteEndLoc = createPositionWithColumnOffset(loc.start, 1); let startToken; if (input.charCodeAt(start - startIndex) === 96) { startToken = new Token({ type: getExportedToken(22), value: "`", start: start, end: backquoteEnd, startLoc: loc.start, endLoc: backquoteEndLoc }); } else { startToken = new Token({ type: getExportedToken(8), value: "}", start: start, end: backquoteEnd, startLoc: loc.start, endLoc: backquoteEndLoc }); } let templateValue, templateElementEnd, templateElementEndLoc, endToken; if (type === 24) { templateElementEnd = end - 1; templateElementEndLoc = createPositionWithColumnOffset(loc.end, -1); templateValue = value === null ? null : value.slice(1, -1); endToken = new Token({ type: getExportedToken(22), value: "`", start: templateElementEnd, end: end, startLoc: templateElementEndLoc, endLoc: loc.end }); } else { templateElementEnd = end - 2; templateElementEndLoc = createPositionWithColumnOffset(loc.end, -2); templateValue = value === null ? null : value.slice(1, -2); endToken = new Token({ type: getExportedToken(23), value: "${", start: templateElementEnd, end: end, startLoc: templateElementEndLoc, endLoc: loc.end }); } tokens.splice(i, 1, startToken, new Token({ type: getExportedToken(20), value: templateValue, start: backquoteEnd, end: templateElementEnd, startLoc: backquoteEndLoc, endLoc: templateElementEndLoc }), endToken); i += 2; continue; } } token.type = getExportedToken(type); } } return tokens; } class StatementParser extends ExpressionParser { parseTopLevel(file, program) { file.program = this.parseProgram(program, 140, this.options.sourceType === "module" ? "module" : "script"); file.comments = this.comments; if (this.optionFlags & 256) { file.tokens = babel7CompatTokens(this.tokens, this.input, this.startIndex); } return this.finishNode(file, "File"); } parseProgram(program, end, sourceType) { program.sourceType = sourceType; program.interpreter = this.parseInterpreterDirective(); this.parseBlockBody(program, true, true, end); if (this.inModule) { if (!(this.optionFlags & 64) && this.scope.undefinedExports.size > 0) { for (const [localName, at] of Array.from(this.scope.undefinedExports)) { this.raise(Errors.ModuleExportUndefined, at, { localName }); } } this.addExtra(program, "topLevelAwait", this.state.hasTopLevelAwait); } let finishedProgram; if (end === 140) { finishedProgram = this.finishNode(program, "Program"); } else { finishedProgram = this.finishNodeAt(program, "Program", createPositionWithColumnOffset(this.state.startLoc, -1)); } return finishedProgram; } stmtToDirective(stmt) { const directive = this.castNodeTo(stmt, "Directive"); const directiveLiteral = this.castNodeTo(stmt.expression, "DirectiveLiteral"); const expressionValue = directiveLiteral.value; const raw = this.input.slice(this.offsetToSourcePos(directiveLiteral.start), this.offsetToSourcePos(directiveLiteral.end)); const val = directiveLiteral.value = raw.slice(1, -1); this.addExtra(directiveLiteral, "raw", raw); this.addExtra(directiveLiteral, "rawValue", val); this.addExtra(directiveLiteral, "expressionValue", expressionValue); directive.value = directiveLiteral; delete stmt.expression; return directive; } parseInterpreterDirective() { if (!this.match(28)) { return null; } const node = this.startNode(); node.value = this.state.value; this.next(); return this.finishNode(node, "InterpreterDirective"); } isLet() { if (!this.isContextual(100)) { return false; } return this.hasFollowingBindingAtom(); } isUsing() { if (!this.isContextual(107)) { return false; } const next = this.nextTokenInLineStart(); const nextCh = this.codePointAtPos(next); return this.chStartsBindingIdentifier(nextCh, next); } isForUsing() { if (!this.isContextual(107)) { return false; } const next = this.nextTokenInLineStart(); const nextCh = this.codePointAtPos(next); if (this.isUnparsedContextual(next, "of")) { const nextCharAfterOf = this.lookaheadCharCodeSince(next + 2); if (nextCharAfterOf !== 61 && nextCharAfterOf !== 58 && nextCharAfterOf !== 59) { return false; } } if (this.chStartsBindingIdentifier(nextCh, next) || this.isUnparsedContextual(next, "void")) { return true; } return false; } isAwaitUsing() { if (!this.isContextual(96)) { return false; } let next = this.nextTokenInLineStart(); if (this.isUnparsedContextual(next, "using")) { next = this.nextTokenInLineStartSince(next + 5); const nextCh = this.codePointAtPos(next); if (this.chStartsBindingIdentifier(nextCh, next)) { return true; } } return false; } chStartsBindingIdentifier(ch, pos) { if (isIdentifierStart(ch)) { keywordRelationalOperator.lastIndex = pos; if (keywordRelationalOperator.test(this.input)) { const endCh = this.codePointAtPos(keywordRelationalOperator.lastIndex); if (!isIdentifierChar(endCh) && endCh !== 92) { return false; } } return true; } else if (ch === 92) { return true; } else { return false; } } chStartsBindingPattern(ch) { return ch === 91 || ch === 123; } hasFollowingBindingAtom() { const next = this.nextTokenStart(); const nextCh = this.codePointAtPos(next); return this.chStartsBindingPattern(nextCh) || this.chStartsBindingIdentifier(nextCh, next); } hasInLineFollowingBindingIdentifierOrBrace() { const next = this.nextTokenInLineStart(); const nextCh = this.codePointAtPos(next); return nextCh === 123 || this.chStartsBindingIdentifier(nextCh, next); } allowsUsing() { return (this.scope.inModule || !this.scope.inTopLevel) && !this.scope.inBareCaseStatement; } parseModuleItem() { return this.parseStatementLike(1 | 2 | 4 | 8); } parseStatementListItem() { return this.parseStatementLike(2 | 4 | (!this.options.annexB || this.state.strict ? 0 : 8)); } parseStatementOrSloppyAnnexBFunctionDeclaration(allowLabeledFunction = false) { let flags = 0; if (this.options.annexB && !this.state.strict) { flags |= 4; if (allowLabeledFunction) { flags |= 8; } } return this.parseStatementLike(flags); } parseStatement() { return this.parseStatementLike(0); } parseStatementLike(flags) { let decorators = null; if (this.match(26)) { decorators = this.parseDecorators(true); } return this.parseStatementContent(flags, decorators); } parseStatementContent(flags, decorators) { const startType = this.state.type; const node = this.startNode(); const allowDeclaration = !!(flags & 2); const allowFunctionDeclaration = !!(flags & 4); const topLevel = flags & 1; switch (startType) { case 60: return this.parseBreakContinueStatement(node, true); case 63: return this.parseBreakContinueStatement(node, false); case 64: return this.parseDebuggerStatement(node); case 90: return this.parseDoWhileStatement(node); case 91: return this.parseForStatement(node); case 68: if (this.lookaheadCharCode() === 46) break; if (!allowFunctionDeclaration) { this.raise(this.state.strict ? Errors.StrictFunction : this.options.annexB ? Errors.SloppyFunctionAnnexB : Errors.SloppyFunction, this.state.startLoc); } return this.parseFunctionStatement(node, false, !allowDeclaration && allowFunctionDeclaration); case 80: if (!allowDeclaration) this.unexpected(); return this.parseClass(this.maybeTakeDecorators(decorators, node), true); case 69: return this.parseIfStatement(node); case 70: return this.parseReturnStatement(node); case 71: return this.parseSwitchStatement(node); case 72: return this.parseThrowStatement(node); case 73: return this.parseTryStatement(node); case 96: if (this.isAwaitUsing()) { if (!this.allowsUsing()) { this.raise(Errors.UnexpectedUsingDeclaration, node); } else if (!allowDeclaration) { this.raise(Errors.UnexpectedLexicalDeclaration, node); } else if (!this.recordAwaitIfAllowed()) { this.raise(Errors.AwaitUsingNotInAsyncContext, node); } this.next(); return this.parseVarStatement(node, "await using"); } break; case 107: if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace()) { break; } if (!this.allowsUsing()) { this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc); } else if (!allowDeclaration) { this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc); } return this.parseVarStatement(node, "using"); case 100: { if (this.state.containsEsc) { break; } const next = this.nextTokenStart(); const nextCh = this.codePointAtPos(next); if (nextCh !== 91) { if (!allowDeclaration && this.hasFollowingLineBreak()) break; if (!this.chStartsBindingIdentifier(nextCh, next) && nextCh !== 123) { break; } } } case 75: { if (!allowDeclaration) { this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc); } } case 74: { const kind = this.state.value; return this.parseVarStatement(node, kind); } case 92: return this.parseWhileStatement(node); case 76: return this.parseWithStatement(node); case 5: return this.parseBlock(); case 13: return this.parseEmptyStatement(node); case 83: { const nextTokenCharCode = this.lookaheadCharCode(); if (nextTokenCharCode === 40 || nextTokenCharCode === 46) { break; } } case 82: { if (!(this.optionFlags & 8) && !topLevel) { this.raise(Errors.UnexpectedImportExport, this.state.startLoc); } this.next(); let result; if (startType === 83) { result = this.parseImport(node); } else { result = this.parseExport(node, decorators); } this.assertModuleNodeAllowed(result); return result; } default: { if (this.isAsyncFunction()) { if (!allowDeclaration) { this.raise(Errors.AsyncFunctionInSingleStatementContext, this.state.startLoc); } this.next(); return this.parseFunctionStatement(node, true, !allowDeclaration && allowFunctionDeclaration); } } } const maybeName = this.state.value; const expr = this.parseExpression(); if (tokenIsIdentifier(startType) && expr.type === "Identifier" && this.eat(14)) { return this.parseLabeledStatement(node, maybeName, expr, flags); } else { return this.parseExpressionStatement(node, expr, decorators); } } assertModuleNodeAllowed(node) { if (!(this.optionFlags & 8) && !this.inModule) { this.raise(Errors.ImportOutsideModule, node); } } decoratorsEnabledBeforeExport() { if (this.hasPlugin("decorators-legacy")) return true; return this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") !== false; } maybeTakeDecorators(maybeDecorators, classNode, exportNode) { if (maybeDecorators) { var _classNode$decorators; if ((_classNode$decorators = classNode.decorators) != null && _classNode$decorators.length) { if (typeof this.getPluginOption("decorators", "decoratorsBeforeExport") !== "boolean") { this.raise(Errors.DecoratorsBeforeAfterExport, classNode.decorators[0]); } classNode.decorators.unshift(...maybeDecorators); } else { classNode.decorators = maybeDecorators; } this.resetStartLocationFromNode(classNode, maybeDecorators[0]); if (exportNode) this.resetStartLocationFromNode(exportNode, classNode); } return classNode; } canHaveLeadingDecorator() { return this.match(80); } parseDecorators(allowExport) { const decorators = []; do { decorators.push(this.parseDecorator()); } while (this.match(26)); if (this.match(82)) { if (!allowExport) { this.unexpected(); } if (!this.decoratorsEnabledBeforeExport()) { this.raise(Errors.DecoratorExportClass, this.state.startLoc); } } else if (!this.canHaveLeadingDecorator()) { throw this.raise(Errors.UnexpectedLeadingDecorator, this.state.startLoc); } return decorators; } parseDecorator() { this.expectOnePlugin(["decorators", "decorators-legacy"]); const node = this.startNode(); this.next(); if (this.hasPlugin("decorators")) { const startLoc = this.state.startLoc; let expr; if (this.match(10)) { const startLoc = this.state.startLoc; this.next(); expr = this.parseExpression(); this.expect(11); expr = this.wrapParenthesis(startLoc, expr); const paramsStartLoc = this.state.startLoc; node.expression = this.parseMaybeDecoratorArguments(expr, startLoc); if (this.getPluginOption("decorators", "allowCallParenthesized") === false && node.expression !== expr) { this.raise(Errors.DecoratorArgumentsOutsideParentheses, paramsStartLoc); } } else { expr = this.parseIdentifier(false); while (this.eat(16)) { const node = this.startNodeAt(startLoc); node.object = expr; if (this.match(139)) { this.classScope.usePrivateName(this.state.value, this.state.startLoc); node.property = this.parsePrivateName(); } else { node.property = this.parseIdentifier(true); } node.computed = false; expr = this.finishNode(node, "MemberExpression"); } node.expression = this.parseMaybeDecoratorArguments(expr, startLoc); } } else { node.expression = this.parseExprSubscripts(); } return this.finishNode(node, "Decorator"); } parseMaybeDecoratorArguments(expr, startLoc) { if (this.eat(10)) { const node = this.startNodeAt(startLoc); node.callee = expr; node.arguments = this.parseCallExpressionArguments(); this.toReferencedList(node.arguments); return this.finishNode(node, "CallExpression"); } return expr; } parseBreakContinueStatement(node, isBreak) { this.next(); if (this.isLineTerminator()) { node.label = null; } else { node.label = this.parseIdentifier(); this.semicolon(); } this.verifyBreakContinue(node, isBreak); return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); } verifyBreakContinue(node, isBreak) { let i; for (i = 0; i < this.state.labels.length; ++i) { const lab = this.state.labels[i]; if (node.label == null || lab.name === node.label.name) { if (lab.kind != null && (isBreak || lab.kind === 1)) { break; } if (node.label && isBreak) break; } } if (i === this.state.labels.length) { const type = isBreak ? "BreakStatement" : "ContinueStatement"; this.raise(Errors.IllegalBreakContinue, node, { type }); } } parseDebuggerStatement(node) { this.next(); this.semicolon(); return this.finishNode(node, "DebuggerStatement"); } parseHeaderExpression() { this.expect(10); const val = this.parseExpression(); this.expect(11); return val; } parseDoWhileStatement(node) { this.next(); this.state.labels.push(loopLabel); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.state.labels.pop(); this.expect(92); node.test = this.parseHeaderExpression(); this.eat(13); return this.finishNode(node, "DoWhileStatement"); } parseForStatement(node) { this.next(); this.state.labels.push(loopLabel); let awaitAt = null; if (this.isContextual(96) && this.recordAwaitIfAllowed()) { awaitAt = this.state.startLoc; this.next(); } this.scope.enter(0); this.expect(10); if (this.match(13)) { if (awaitAt !== null) { this.unexpected(awaitAt); } return this.parseFor(node, null); } const startsWithLet = this.isContextual(100); { const startsWithAwaitUsing = this.isAwaitUsing(); const starsWithUsingDeclaration = startsWithAwaitUsing || this.isForUsing(); const isLetOrUsing = startsWithLet && this.hasFollowingBindingAtom() || starsWithUsingDeclaration; if (this.match(74) || this.match(75) || isLetOrUsing) { const initNode = this.startNode(); let kind; if (startsWithAwaitUsing) { kind = "await using"; if (!this.recordAwaitIfAllowed()) { this.raise(Errors.AwaitUsingNotInAsyncContext, this.state.startLoc); } this.next(); } else { kind = this.state.value; } this.next(); this.parseVar(initNode, true, kind); const init = this.finishNode(initNode, "VariableDeclaration"); const isForIn = this.match(58); if (isForIn && starsWithUsingDeclaration) { this.raise(Errors.ForInUsing, init); } if ((isForIn || this.isContextual(102)) && init.declarations.length === 1) { return this.parseForIn(node, init, awaitAt); } if (awaitAt !== null) { this.unexpected(awaitAt); } return this.parseFor(node, init); } } const startsWithAsync = this.isContextual(95); const refExpressionErrors = new ExpressionErrors(); const init = this.parseExpression(true, refExpressionErrors); const isForOf = this.isContextual(102); if (isForOf) { if (startsWithLet) { this.raise(Errors.ForOfLet, init); } if (awaitAt === null && startsWithAsync && init.type === "Identifier") { this.raise(Errors.ForOfAsync, init); } } if (isForOf || this.match(58)) { this.checkDestructuringPrivate(refExpressionErrors); this.toAssignable(init, true); const type = isForOf ? "ForOfStatement" : "ForInStatement"; this.checkLVal(init, { type }); return this.parseForIn(node, init, awaitAt); } else { this.checkExpressionErrors(refExpressionErrors, true); } if (awaitAt !== null) { this.unexpected(awaitAt); } return this.parseFor(node, init); } parseFunctionStatement(node, isAsync, isHangingDeclaration) { this.next(); return this.parseFunction(node, 1 | (isHangingDeclaration ? 2 : 0) | (isAsync ? 8 : 0)); } parseIfStatement(node) { this.next(); node.test = this.parseHeaderExpression(); node.consequent = this.parseStatementOrSloppyAnnexBFunctionDeclaration(); node.alternate = this.eat(66) ? this.parseStatementOrSloppyAnnexBFunctionDeclaration() : null; return this.finishNode(node, "IfStatement"); } parseReturnStatement(node) { if (!this.prodParam.hasReturn) { this.raise(Errors.IllegalReturn, this.state.startLoc); } this.next(); if (this.isLineTerminator()) { node.argument = null; } else { node.argument = this.parseExpression(); this.semicolon(); } return this.finishNode(node, "ReturnStatement"); } parseSwitchStatement(node) { this.next(); node.discriminant = this.parseHeaderExpression(); const cases = node.cases = []; this.expect(5); this.state.labels.push(switchLabel); this.scope.enter(256); let cur; for (let sawDefault; !this.match(8);) { if (this.match(61) || this.match(65)) { const isCase = this.match(61); if (cur) this.finishNode(cur, "SwitchCase"); cases.push(cur = this.startNode()); cur.consequent = []; this.next(); if (isCase) { cur.test = this.parseExpression(); } else { if (sawDefault) { this.raise(Errors.MultipleDefaultsInSwitch, this.state.lastTokStartLoc); } sawDefault = true; cur.test = null; } this.expect(14); } else { if (cur) { cur.consequent.push(this.parseStatementListItem()); } else { this.unexpected(); } } } this.scope.exit(); if (cur) this.finishNode(cur, "SwitchCase"); this.next(); this.state.labels.pop(); return this.finishNode(node, "SwitchStatement"); } parseThrowStatement(node) { this.next(); if (this.hasPrecedingLineBreak()) { this.raise(Errors.NewlineAfterThrow, this.state.lastTokEndLoc); } node.argument = this.parseExpression(); this.semicolon(); return this.finishNode(node, "ThrowStatement"); } parseCatchClauseParam() { const param = this.parseBindingAtom(); this.scope.enter(this.options.annexB && param.type === "Identifier" ? 8 : 0); this.checkLVal(param, { type: "CatchClause" }, 9); return param; } parseTryStatement(node) { this.next(); node.block = this.parseBlock(); node.handler = null; if (this.match(62)) { const clause = this.startNode(); this.next(); if (this.match(10)) { this.expect(10); clause.param = this.parseCatchClauseParam(); this.expect(11); } else { clause.param = null; this.scope.enter(0); } clause.body = this.withSmartMixTopicForbiddingContext(() => this.parseBlock(false, false)); this.scope.exit(); node.handler = this.finishNode(clause, "CatchClause"); } node.finalizer = this.eat(67) ? this.parseBlock() : null; if (!node.handler && !node.finalizer) { this.raise(Errors.NoCatchOrFinally, node); } return this.finishNode(node, "TryStatement"); } parseVarStatement(node, kind, allowMissingInitializer = false) { this.next(); this.parseVar(node, false, kind, allowMissingInitializer); this.semicolon(); return this.finishNode(node, "VariableDeclaration"); } parseWhileStatement(node) { this.next(); node.test = this.parseHeaderExpression(); this.state.labels.push(loopLabel); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.state.labels.pop(); return this.finishNode(node, "WhileStatement"); } parseWithStatement(node) { if (this.state.strict) { this.raise(Errors.StrictWith, this.state.startLoc); } this.next(); node.object = this.parseHeaderExpression(); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); return this.finishNode(node, "WithStatement"); } parseEmptyStatement(node) { this.next(); return this.finishNode(node, "EmptyStatement"); } parseLabeledStatement(node, maybeName, expr, flags) { for (const label of this.state.labels) { if (label.name === maybeName) { this.raise(Errors.LabelRedeclaration, expr, { labelName: maybeName }); } } const kind = tokenIsLoop(this.state.type) ? 1 : this.match(71) ? 2 : null; for (let i = this.state.labels.length - 1; i >= 0; i--) { const label = this.state.labels[i]; if (label.statementStart === node.start) { label.statementStart = this.sourceToOffsetPos(this.state.start); label.kind = kind; } else { break; } } this.state.labels.push({ name: maybeName, kind: kind, statementStart: this.sourceToOffsetPos(this.state.start) }); node.body = flags & 8 ? this.parseStatementOrSloppyAnnexBFunctionDeclaration(true) : this.parseStatement(); this.state.labels.pop(); node.label = expr; return this.finishNode(node, "LabeledStatement"); } parseExpressionStatement(node, expr, decorators) { node.expression = expr; this.semicolon(); return this.finishNode(node, "ExpressionStatement"); } parseBlock(allowDirectives = false, createNewLexicalScope = true, afterBlockParse) { const node = this.startNode(); if (allowDirectives) { this.state.strictErrors.clear(); } this.expect(5); if (createNewLexicalScope) { this.scope.enter(0); } this.parseBlockBody(node, allowDirectives, false, 8, afterBlockParse); if (createNewLexicalScope) { this.scope.exit(); } return this.finishNode(node, "BlockStatement"); } isValidDirective(stmt) { return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized; } parseBlockBody(node, allowDirectives, topLevel, end, afterBlockParse) { const body = node.body = []; const directives = node.directives = []; this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end, afterBlockParse); } parseBlockOrModuleBlockBody(body, directives, topLevel, end, afterBlockParse) { const oldStrict = this.state.strict; let hasStrictModeDirective = false; let parsedNonDirective = false; while (!this.match(end)) { const stmt = topLevel ? this.parseModuleItem() : this.parseStatementListItem(); if (directives && !parsedNonDirective) { if (this.isValidDirective(stmt)) { const directive = this.stmtToDirective(stmt); directives.push(directive); if (!hasStrictModeDirective && directive.value.value === "use strict") { hasStrictModeDirective = true; this.setStrict(true); } continue; } parsedNonDirective = true; this.state.strictErrors.clear(); } body.push(stmt); } afterBlockParse == null || afterBlockParse.call(this, hasStrictModeDirective); if (!oldStrict) { this.setStrict(false); } this.next(); } parseFor(node, init) { node.init = init; this.semicolon(false); node.test = this.match(13) ? null : this.parseExpression(); this.semicolon(false); node.update = this.match(11) ? null : this.parseExpression(); this.expect(11); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.scope.exit(); this.state.labels.pop(); return this.finishNode(node, "ForStatement"); } parseForIn(node, init, awaitAt) { const isForIn = this.match(58); this.next(); if (isForIn) { if (awaitAt !== null) this.unexpected(awaitAt); } else { node.await = awaitAt !== null; } if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || !this.options.annexB || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) { this.raise(Errors.ForInOfLoopInitializer, init, { type: isForIn ? "ForInStatement" : "ForOfStatement" }); } if (init.type === "AssignmentPattern") { this.raise(Errors.InvalidLhs, init, { ancestor: { type: "ForStatement" } }); } node.left = init; node.right = isForIn ? this.parseExpression() : this.parseMaybeAssignAllowIn(); this.expect(11); node.body = this.withSmartMixTopicForbiddingContext(() => this.parseStatement()); this.scope.exit(); this.state.labels.pop(); return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement"); } parseVar(node, isFor, kind, allowMissingInitializer = false) { const declarations = node.declarations = []; node.kind = kind; for (;;) { const decl = this.startNode(); this.parseVarId(decl, kind); decl.init = !this.eat(29) ? null : isFor ? this.parseMaybeAssignDisallowIn() : this.parseMaybeAssignAllowIn(); if (decl.init === null && !allowMissingInitializer) { if (decl.id.type !== "Identifier" && !(isFor && (this.match(58) || this.isContextual(102)))) { this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, { kind: "destructuring" }); } else if ((kind === "const" || kind === "using" || kind === "await using") && !(this.match(58) || this.isContextual(102))) { this.raise(Errors.DeclarationMissingInitializer, this.state.lastTokEndLoc, { kind }); } } declarations.push(this.finishNode(decl, "VariableDeclarator")); if (!this.eat(12)) break; } return node; } parseVarId(decl, kind) { const id = this.parseBindingAtom(); if (kind === "using" || kind === "await using") { if (id.type === "ArrayPattern" || id.type === "ObjectPattern") { this.raise(Errors.UsingDeclarationHasBindingPattern, id.loc.start); } } else { if (id.type === "VoidPattern") { this.raise(Errors.UnexpectedVoidPattern, id.loc.start); } } this.checkLVal(id, { type: "VariableDeclarator" }, kind === "var" ? 5 : 8201); decl.id = id; } parseAsyncFunctionExpression(node) { return this.parseFunction(node, 8); } parseFunction(node, flags = 0) { const hangingDeclaration = flags & 2; const isDeclaration = !!(flags & 1); const requireId = isDeclaration && !(flags & 4); const isAsync = !!(flags & 8); this.initFunction(node, isAsync); if (this.match(55)) { if (hangingDeclaration) { this.raise(Errors.GeneratorInSingleStatementContext, this.state.startLoc); } this.next(); node.generator = true; } if (isDeclaration) { node.id = this.parseFunctionId(requireId); } const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; this.state.maybeInArrowParameters = false; this.scope.enter(514); this.prodParam.enter(functionFlags(isAsync, node.generator)); if (!isDeclaration) { node.id = this.parseFunctionId(); } this.parseFunctionParams(node, false); this.withSmartMixTopicForbiddingContext(() => { this.parseFunctionBodyAndFinish(node, isDeclaration ? "FunctionDeclaration" : "FunctionExpression"); }); this.prodParam.exit(); this.scope.exit(); if (isDeclaration && !hangingDeclaration) { this.registerFunctionStatementId(node); } this.state.maybeInArrowParameters = oldMaybeInArrowParameters; return node; } parseFunctionId(requireId) { return requireId || tokenIsIdentifier(this.state.type) ? this.parseIdentifier() : null; } parseFunctionParams(node, isConstructor) { this.expect(10); this.expressionScope.enter(newParameterDeclarationScope()); node.params = this.parseBindingList(11, 41, 2 | (isConstructor ? 4 : 0)); this.expressionScope.exit(); } registerFunctionStatementId(node) { if (!node.id) return; this.scope.declareName(node.id.name, !this.options.annexB || this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? 5 : 8201 : 17, node.id.loc.start); } parseClass(node, isStatement, optionalId) { this.next(); const oldStrict = this.state.strict; this.state.strict = true; this.parseClassId(node, isStatement, optionalId); this.parseClassSuper(node); node.body = this.parseClassBody(!!node.superClass, oldStrict); return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); } isClassProperty() { return this.match(29) || this.match(13) || this.match(8); } isClassMethod() { return this.match(10); } nameIsConstructor(key) { return key.type === "Identifier" && key.name === "constructor" || key.type === "StringLiteral" && key.value === "constructor"; } isNonstaticConstructor(method) { return !method.computed && !method.static && this.nameIsConstructor(method.key); } parseClassBody(hadSuperClass, oldStrict) { this.classScope.enter(); const state = { hadConstructor: false, hadSuperClass }; let decorators = []; const classBody = this.startNode(); classBody.body = []; this.expect(5); this.withSmartMixTopicForbiddingContext(() => { while (!this.match(8)) { if (this.eat(13)) { if (decorators.length > 0) { throw this.raise(Errors.DecoratorSemicolon, this.state.lastTokEndLoc); } continue; } if (this.match(26)) { decorators.push(this.parseDecorator()); continue; } const member = this.startNode(); if (decorators.length) { member.decorators = decorators; this.resetStartLocationFromNode(member, decorators[0]); decorators = []; } this.parseClassMember(classBody, member, state); if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) { this.raise(Errors.DecoratorConstructor, member); } } }); this.state.strict = oldStrict; this.next(); if (decorators.length) { throw this.raise(Errors.TrailingDecorator, this.state.startLoc); } this.classScope.exit(); return this.finishNode(classBody, "ClassBody"); } parseClassMemberFromModifier(classBody, member) { const key = this.parseIdentifier(true); if (this.isClassMethod()) { const method = member; method.kind = "method"; method.computed = false; method.key = key; method.static = false; this.pushClassMethod(classBody, method, false, false, false, false); return true; } else if (this.isClassProperty()) { const prop = member; prop.computed = false; prop.key = key; prop.static = false; classBody.body.push(this.parseClassProperty(prop)); return true; } this.resetPreviousNodeTrailingComments(key); return false; } parseClassMember(classBody, member, state) { const isStatic = this.isContextual(106); if (isStatic) { if (this.parseClassMemberFromModifier(classBody, member)) { return; } if (this.eat(5)) { this.parseClassStaticBlock(classBody, member); return; } } this.parseClassMemberWithIsStatic(classBody, member, state, isStatic); } parseClassMemberWithIsStatic(classBody, member, state, isStatic) { const publicMethod = member; const privateMethod = member; const publicProp = member; const privateProp = member; const accessorProp = member; const method = publicMethod; const publicMember = publicMethod; member.static = isStatic; this.parsePropertyNamePrefixOperator(member); if (this.eat(55)) { method.kind = "method"; const isPrivateName = this.match(139); this.parseClassElementName(method); this.parsePostMemberNameModifiers(method); if (isPrivateName) { this.pushClassPrivateMethod(classBody, privateMethod, true, false); return; } if (this.isNonstaticConstructor(publicMethod)) { this.raise(Errors.ConstructorIsGenerator, publicMethod.key); } this.pushClassMethod(classBody, publicMethod, true, false, false, false); return; } const isContextual = !this.state.containsEsc && tokenIsIdentifier(this.state.type); const key = this.parseClassElementName(member); const maybeContextualKw = isContextual ? key.name : null; const isPrivate = this.isPrivateName(key); const maybeQuestionTokenStartLoc = this.state.startLoc; this.parsePostMemberNameModifiers(publicMember); if (this.isClassMethod()) { method.kind = "method"; if (isPrivate) { this.pushClassPrivateMethod(classBody, privateMethod, false, false); return; } const isConstructor = this.isNonstaticConstructor(publicMethod); let allowsDirectSuper = false; if (isConstructor) { publicMethod.kind = "constructor"; if (state.hadConstructor && !this.hasPlugin("typescript")) { this.raise(Errors.DuplicateConstructor, key); } if (isConstructor && this.hasPlugin("typescript") && member.override) { this.raise(Errors.OverrideOnConstructor, key); } state.hadConstructor = true; allowsDirectSuper = state.hadSuperClass; } this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper); } else if (this.isClassProperty()) { if (isPrivate) { this.pushClassPrivateProperty(classBody, privateProp); } else { this.pushClassProperty(classBody, publicProp); } } else if (maybeContextualKw === "async" && !this.isLineTerminator()) { this.resetPreviousNodeTrailingComments(key); const isGenerator = this.eat(55); if (publicMember.optional) { this.unexpected(maybeQuestionTokenStartLoc); } method.kind = "method"; const isPrivate = this.match(139); this.parseClassElementName(method); this.parsePostMemberNameModifiers(publicMember); if (isPrivate) { this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true); } else { if (this.isNonstaticConstructor(publicMethod)) { this.raise(Errors.ConstructorIsAsync, publicMethod.key); } this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false); } } else if ((maybeContextualKw === "get" || maybeContextualKw === "set") && !(this.match(55) && this.isLineTerminator())) { this.resetPreviousNodeTrailingComments(key); method.kind = maybeContextualKw; const isPrivate = this.match(139); this.parseClassElementName(publicMethod); if (isPrivate) { this.pushClassPrivateMethod(classBody, privateMethod, false, false); } else { if (this.isNonstaticConstructor(publicMethod)) { this.raise(Errors.ConstructorIsAccessor, publicMethod.key); } this.pushClassMethod(classBody, publicMethod, false, false, false, false); } this.checkGetterSetterParams(publicMethod); } else if (maybeContextualKw === "accessor" && !this.isLineTerminator()) { this.expectPlugin("decoratorAutoAccessors"); this.resetPreviousNodeTrailingComments(key); const isPrivate = this.match(139); this.parseClassElementName(publicProp); this.pushClassAccessorProperty(classBody, accessorProp, isPrivate); } else if (this.isLineTerminator()) { if (isPrivate) { this.pushClassPrivateProperty(classBody, privateProp); } else { this.pushClassProperty(classBody, publicProp); } } else { this.unexpected(); } } parseClassElementName(member) { const { type, value } = this.state; if ((type === 132 || type === 134) && member.static && value === "prototype") { this.raise(Errors.StaticPrototype, this.state.startLoc); } if (type === 139) { if (value === "constructor") { this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc); } const key = this.parsePrivateName(); member.key = key; return key; } this.parsePropertyName(member); return member.key; } parseClassStaticBlock(classBody, member) { var _member$decorators; this.scope.enter(576 | 128 | 16); const oldLabels = this.state.labels; this.state.labels = []; this.prodParam.enter(0); const body = member.body = []; this.parseBlockOrModuleBlockBody(body, undefined, false, 8); this.prodParam.exit(); this.scope.exit(); this.state.labels = oldLabels; classBody.body.push(this.finishNode(member, "StaticBlock")); if ((_member$decorators = member.decorators) != null && _member$decorators.length) { this.raise(Errors.DecoratorStaticBlock, member); } } pushClassProperty(classBody, prop) { if (!prop.computed && this.nameIsConstructor(prop.key)) { this.raise(Errors.ConstructorClassField, prop.key); } classBody.body.push(this.parseClassProperty(prop)); } pushClassPrivateProperty(classBody, prop) { const node = this.parseClassPrivateProperty(prop); classBody.body.push(node); this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start); } pushClassAccessorProperty(classBody, prop, isPrivate) { if (!isPrivate && !prop.computed && this.nameIsConstructor(prop.key)) { this.raise(Errors.ConstructorClassField, prop.key); } const node = this.parseClassAccessorProperty(prop); classBody.body.push(node); if (isPrivate) { this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.loc.start); } } pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) { classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true)); } pushClassPrivateMethod(classBody, method, isGenerator, isAsync) { const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true); classBody.body.push(node); const kind = node.kind === "get" ? node.static ? 6 : 2 : node.kind === "set" ? node.static ? 5 : 1 : 0; this.declareClassPrivateMethodInScope(node, kind); } declareClassPrivateMethodInScope(node, kind) { this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.loc.start); } parsePostMemberNameModifiers(methodOrProp) {} parseClassPrivateProperty(node) { this.parseInitializer(node); this.semicolon(); return this.finishNode(node, "ClassPrivateProperty"); } parseClassProperty(node) { this.parseInitializer(node); this.semicolon(); return this.finishNode(node, "ClassProperty"); } parseClassAccessorProperty(node) { this.parseInitializer(node); this.semicolon(); return this.finishNode(node, "ClassAccessorProperty"); } parseInitializer(node) { this.scope.enter(576 | 16); this.expressionScope.enter(newExpressionScope()); this.prodParam.enter(0); node.value = this.eat(29) ? this.parseMaybeAssignAllowIn() : null; this.expressionScope.exit(); this.prodParam.exit(); this.scope.exit(); } parseClassId(node, isStatement, optionalId, bindingType = 8331) { if (tokenIsIdentifier(this.state.type)) { node.id = this.parseIdentifier(); if (isStatement) { this.declareNameFromIdentifier(node.id, bindingType); } } else { if (optionalId || !isStatement) { node.id = null; } else { throw this.raise(Errors.MissingClassName, this.state.startLoc); } } } parseClassSuper(node) { node.superClass = this.eat(81) ? this.parseExprSubscripts() : null; } parseExport(node, decorators) { const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, true); const hasDefault = this.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier); const parseAfterDefault = !hasDefault || this.eat(12); const hasStar = parseAfterDefault && this.eatExportStar(node); const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node); const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(12)); const isFromRequired = hasDefault || hasStar; if (hasStar && !hasNamespace) { if (hasDefault) this.unexpected(); if (decorators) { throw this.raise(Errors.UnsupportedDecoratorExport, node); } this.parseExportFrom(node, true); this.sawUnambiguousESM = true; return this.finishNode(node, "ExportAllDeclaration"); } const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node); if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) { this.unexpected(null, 5); } if (hasNamespace && parseAfterNamespace) { this.unexpected(null, 98); } let hasDeclaration; if (isFromRequired || hasSpecifiers) { hasDeclaration = false; if (decorators) { throw this.raise(Errors.UnsupportedDecoratorExport, node); } this.parseExportFrom(node, isFromRequired); } else { hasDeclaration = this.maybeParseExportDeclaration(node); } if (isFromRequired || hasSpecifiers || hasDeclaration) { var _node2$declaration; const node2 = node; this.checkExport(node2, true, false, !!node2.source); if (((_node2$declaration = node2.declaration) == null ? void 0 : _node2$declaration.type) === "ClassDeclaration") { this.maybeTakeDecorators(decorators, node2.declaration, node2); } else if (decorators) { throw this.raise(Errors.UnsupportedDecoratorExport, node); } this.sawUnambiguousESM = true; return this.finishNode(node2, "ExportNamedDeclaration"); } if (this.eat(65)) { const node2 = node; const decl = this.parseExportDefaultExpression(); node2.declaration = decl; if (decl.type === "ClassDeclaration") { this.maybeTakeDecorators(decorators, decl, node2); } else if (decorators) { throw this.raise(Errors.UnsupportedDecoratorExport, node); } this.checkExport(node2, true, true); this.sawUnambiguousESM = true; return this.finishNode(node2, "ExportDefaultDeclaration"); } this.unexpected(null, 5); } eatExportStar(node) { return this.eat(55); } maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) { if (maybeDefaultIdentifier || this.isExportDefaultSpecifier()) { this.expectPlugin("exportDefaultFrom", maybeDefaultIdentifier == null ? void 0 : maybeDefaultIdentifier.loc.start); const id = maybeDefaultIdentifier || this.parseIdentifier(true); const specifier = this.startNodeAtNode(id); specifier.exported = id; node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; return true; } return false; } maybeParseExportNamespaceSpecifier(node) { if (this.isContextual(93)) { var _ref, _ref$specifiers; (_ref$specifiers = (_ref = node).specifiers) != null ? _ref$specifiers : _ref.specifiers = []; const specifier = this.startNodeAt(this.state.lastTokStartLoc); this.next(); specifier.exported = this.parseModuleExportName(); node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier")); return true; } return false; } maybeParseExportNamedSpecifiers(node) { if (this.match(5)) { const node2 = node; if (!node2.specifiers) node2.specifiers = []; const isTypeExport = node2.exportKind === "type"; node2.specifiers.push(...this.parseExportSpecifiers(isTypeExport)); node2.source = null; if (this.hasPlugin("importAssertions")) { node2.assertions = []; } else { node2.attributes = []; } node2.declaration = null; return true; } return false; } maybeParseExportDeclaration(node) { if (this.shouldParseExportDeclaration()) { node.specifiers = []; node.source = null; if (this.hasPlugin("importAssertions")) { node.assertions = []; } else { node.attributes = []; } node.declaration = this.parseExportDeclaration(node); return true; } return false; } isAsyncFunction() { if (!this.isContextual(95)) return false; const next = this.nextTokenInLineStart(); return this.isUnparsedContextual(next, "function"); } parseExportDefaultExpression() { const expr = this.startNode(); if (this.match(68)) { this.next(); return this.parseFunction(expr, 1 | 4); } else if (this.isAsyncFunction()) { this.next(); this.next(); return this.parseFunction(expr, 1 | 4 | 8); } if (this.match(80)) { return this.parseClass(expr, true, true); } if (this.match(26)) { if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { this.raise(Errors.DecoratorBeforeExport, this.state.startLoc); } return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true); } if (this.match(75) || this.match(74) || this.isLet() || this.isUsing() || this.isAwaitUsing()) { throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc); } const res = this.parseMaybeAssignAllowIn(); this.semicolon(); return res; } parseExportDeclaration(node) { if (this.match(80)) { const node = this.parseClass(this.startNode(), true, false); return node; } return this.parseStatementListItem(); } isExportDefaultSpecifier() { const { type } = this.state; if (tokenIsIdentifier(type)) { if (type === 95 && !this.state.containsEsc || type === 100) { return false; } if ((type === 130 || type === 129) && !this.state.containsEsc) { const next = this.nextTokenStart(); const nextChar = this.input.charCodeAt(next); if (nextChar === 123 || this.chStartsBindingIdentifier(nextChar, next) && !this.input.startsWith("from", next)) { this.expectOnePlugin(["flow", "typescript"]); return false; } } } else if (!this.match(65)) { return false; } const next = this.nextTokenStart(); const hasFrom = this.isUnparsedContextual(next, "from"); if (this.input.charCodeAt(next) === 44 || tokenIsIdentifier(this.state.type) && hasFrom) { return true; } if (this.match(65) && hasFrom) { const nextAfterFrom = this.input.charCodeAt(this.nextTokenStartSince(next + 4)); return nextAfterFrom === 34 || nextAfterFrom === 39; } return false; } parseExportFrom(node, expect) { if (this.eatContextual(98)) { node.source = this.parseImportSource(); this.checkExport(node); this.maybeParseImportAttributes(node); this.checkJSONModuleImport(node); } else if (expect) { this.unexpected(); } this.semicolon(); } shouldParseExportDeclaration() { const { type } = this.state; if (type === 26) { this.expectOnePlugin(["decorators", "decorators-legacy"]); if (this.hasPlugin("decorators")) { if (this.getPluginOption("decorators", "decoratorsBeforeExport") === true) { this.raise(Errors.DecoratorBeforeExport, this.state.startLoc); } return true; } } if (this.isUsing()) { this.raise(Errors.UsingDeclarationExport, this.state.startLoc); return true; } if (this.isAwaitUsing()) { this.raise(Errors.UsingDeclarationExport, this.state.startLoc); return true; } return type === 74 || type === 75 || type === 68 || type === 80 || this.isLet() || this.isAsyncFunction(); } checkExport(node, checkNames, isDefault, isFrom) { if (checkNames) { var _node$specifiers; if (isDefault) { this.checkDuplicateExports(node, "default"); if (this.hasPlugin("exportDefaultFrom")) { var _declaration$extra; const declaration = node.declaration; if (declaration.type === "Identifier" && declaration.name === "from" && declaration.end - declaration.start === 4 && !((_declaration$extra = declaration.extra) != null && _declaration$extra.parenthesized)) { this.raise(Errors.ExportDefaultFromAsIdentifier, declaration); } } } else if ((_node$specifiers = node.specifiers) != null && _node$specifiers.length) { for (const specifier of node.specifiers) { const { exported } = specifier; const exportName = exported.type === "Identifier" ? exported.name : exported.value; this.checkDuplicateExports(specifier, exportName); if (!isFrom && specifier.local) { const { local } = specifier; if (local.type !== "Identifier") { this.raise(Errors.ExportBindingIsString, specifier, { localName: local.value, exportName }); } else { this.checkReservedWord(local.name, local.loc.start, true, false); this.scope.checkLocalExport(local); } } } } else if (node.declaration) { const decl = node.declaration; if (decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration") { const { id } = decl; if (!id) throw new Error("Assertion failure"); this.checkDuplicateExports(node, id.name); } else if (decl.type === "VariableDeclaration") { for (const declaration of decl.declarations) { this.checkDeclaration(declaration.id); } } } } } checkDeclaration(node) { if (node.type === "Identifier") { this.checkDuplicateExports(node, node.name); } else if (node.type === "ObjectPattern") { for (const prop of node.properties) { this.checkDeclaration(prop); } } else if (node.type === "ArrayPattern") { for (const elem of node.elements) { if (elem) { this.checkDeclaration(elem); } } } else if (node.type === "ObjectProperty") { this.checkDeclaration(node.value); } else if (node.type === "RestElement") { this.checkDeclaration(node.argument); } else if (node.type === "AssignmentPattern") { this.checkDeclaration(node.left); } } checkDuplicateExports(node, exportName) { if (this.exportedIdentifiers.has(exportName)) { if (exportName === "default") { this.raise(Errors.DuplicateDefaultExport, node); } else { this.raise(Errors.DuplicateExport, node, { exportName }); } } this.exportedIdentifiers.add(exportName); } parseExportSpecifiers(isInTypeExport) { const nodes = []; let first = true; this.expect(5); while (!this.eat(8)) { if (first) { first = false; } else { this.expect(12); if (this.eat(8)) break; } const isMaybeTypeOnly = this.isContextual(130); const isString = this.match(134); const node = this.startNode(); node.local = this.parseModuleExportName(); nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly)); } return nodes; } parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly) { if (this.eatContextual(93)) { node.exported = this.parseModuleExportName(); } else if (isString) { node.exported = this.cloneStringLiteral(node.local); } else if (!node.exported) { node.exported = this.cloneIdentifier(node.local); } return this.finishNode(node, "ExportSpecifier"); } parseModuleExportName() { if (this.match(134)) { const result = this.parseStringLiteral(this.state.value); const surrogate = loneSurrogate.exec(result.value); if (surrogate) { this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, { surrogateCharCode: surrogate[0].charCodeAt(0) }); } return result; } return this.parseIdentifier(true); } isJSONModuleImport(node) { if (node.assertions != null) { return node.assertions.some(({ key, value }) => { return value.value === "json" && (key.type === "Identifier" ? key.name === "type" : key.value === "type"); }); } return false; } checkImportReflection(node) { const { specifiers } = node; const singleBindingType = specifiers.length === 1 ? specifiers[0].type : null; if (node.phase === "source") { if (singleBindingType !== "ImportDefaultSpecifier") { this.raise(Errors.SourcePhaseImportRequiresDefault, specifiers[0].loc.start); } } else if (node.phase === "defer") { if (singleBindingType !== "ImportNamespaceSpecifier") { this.raise(Errors.DeferImportRequiresNamespace, specifiers[0].loc.start); } } else if (node.module) { var _node$assertions; if (singleBindingType !== "ImportDefaultSpecifier") { this.raise(Errors.ImportReflectionNotBinding, specifiers[0].loc.start); } if (((_node$assertions = node.assertions) == null ? void 0 : _node$assertions.length) > 0) { this.raise(Errors.ImportReflectionHasAssertion, specifiers[0].loc.start); } } } checkJSONModuleImport(node) { if (this.isJSONModuleImport(node) && node.type !== "ExportAllDeclaration") { const { specifiers } = node; if (specifiers != null) { const nonDefaultNamedSpecifier = specifiers.find(specifier => { let imported; if (specifier.type === "ExportSpecifier") { imported = specifier.local; } else if (specifier.type === "ImportSpecifier") { imported = specifier.imported; } if (imported !== undefined) { return imported.type === "Identifier" ? imported.name !== "default" : imported.value !== "default"; } }); if (nonDefaultNamedSpecifier !== undefined) { this.raise(Errors.ImportJSONBindingNotDefault, nonDefaultNamedSpecifier.loc.start); } } } } isPotentialImportPhase(isExport) { if (isExport) return false; return this.isContextual(105) || this.isContextual(97) || this.isContextual(127); } applyImportPhase(node, isExport, phase, loc) { if (isExport) { return; } if (phase === "module") { this.expectPlugin("importReflection", loc); node.module = true; } else if (this.hasPlugin("importReflection")) { node.module = false; } if (phase === "source") { this.expectPlugin("sourcePhaseImports", loc); node.phase = "source"; } else if (phase === "defer") { this.expectPlugin("deferredImportEvaluation", loc); node.phase = "defer"; } else if (this.hasPlugin("sourcePhaseImports")) { node.phase = null; } } parseMaybeImportPhase(node, isExport) { if (!this.isPotentialImportPhase(isExport)) { this.applyImportPhase(node, isExport, null); return null; } const phaseIdentifier = this.startNode(); const phaseIdentifierName = this.parseIdentifierName(true); const { type } = this.state; const isImportPhase = tokenIsKeywordOrIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12; if (isImportPhase) { this.applyImportPhase(node, isExport, phaseIdentifierName, phaseIdentifier.loc.start); return null; } else { this.applyImportPhase(node, isExport, null); return this.createIdentifier(phaseIdentifier, phaseIdentifierName); } } isPrecedingIdImportPhase(phase) { const { type } = this.state; return tokenIsIdentifier(type) ? type !== 98 || this.lookaheadCharCode() === 102 : type !== 12; } parseImport(node) { if (this.match(134)) { return this.parseImportSourceAndAttributes(node); } return this.parseImportSpecifiersAndAfter(node, this.parseMaybeImportPhase(node, false)); } parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier) { node.specifiers = []; const hasDefault = this.maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier); const parseNext = !hasDefault || this.eat(12); const hasStar = parseNext && this.maybeParseStarImportSpecifier(node); if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node); this.expectContextual(98); return this.parseImportSourceAndAttributes(node); } parseImportSourceAndAttributes(node) { var _node$specifiers2; (_node$specifiers2 = node.specifiers) != null ? _node$specifiers2 : node.specifiers = []; node.source = this.parseImportSource(); this.maybeParseImportAttributes(node); this.checkImportReflection(node); this.checkJSONModuleImport(node); this.semicolon(); this.sawUnambiguousESM = true; return this.finishNode(node, "ImportDeclaration"); } parseImportSource() { if (!this.match(134)) this.unexpected(); return this.parseExprAtom(); } parseImportSpecifierLocal(node, specifier, type) { specifier.local = this.parseIdentifier(); node.specifiers.push(this.finishImportSpecifier(specifier, type)); } finishImportSpecifier(specifier, type, bindingType = 8201) { this.checkLVal(specifier.local, { type }, bindingType); return this.finishNode(specifier, type); } parseImportAttributes() { this.expect(5); const attrs = []; const attrNames = new Set(); do { if (this.match(8)) { break; } const node = this.startNode(); const keyName = this.state.value; if (attrNames.has(keyName)) { this.raise(Errors.ModuleAttributesWithDuplicateKeys, this.state.startLoc, { key: keyName }); } attrNames.add(keyName); if (this.match(134)) { node.key = this.parseStringLiteral(keyName); } else { node.key = this.parseIdentifier(true); } this.expect(14); if (!this.match(134)) { throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc); } node.value = this.parseStringLiteral(this.state.value); attrs.push(this.finishNode(node, "ImportAttribute")); } while (this.eat(12)); this.expect(8); return attrs; } parseModuleAttributes() { const attrs = []; const attributes = new Set(); do { const node = this.startNode(); node.key = this.parseIdentifier(true); if (node.key.name !== "type") { this.raise(Errors.ModuleAttributeDifferentFromType, node.key); } if (attributes.has(node.key.name)) { this.raise(Errors.ModuleAttributesWithDuplicateKeys, node.key, { key: node.key.name }); } attributes.add(node.key.name); this.expect(14); if (!this.match(134)) { throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc); } node.value = this.parseStringLiteral(this.state.value); attrs.push(this.finishNode(node, "ImportAttribute")); } while (this.eat(12)); return attrs; } maybeParseImportAttributes(node) { let attributes; { var useWith = false; } if (this.match(76)) { if (this.hasPrecedingLineBreak() && this.lookaheadCharCode() === 40) { return; } this.next(); if (this.hasPlugin("moduleAttributes")) { attributes = this.parseModuleAttributes(); this.addExtra(node, "deprecatedWithLegacySyntax", true); } else { attributes = this.parseImportAttributes(); } { useWith = true; } } else if (this.isContextual(94) && !this.hasPrecedingLineBreak()) { if (!this.hasPlugin("deprecatedImportAssert") && !this.hasPlugin("importAssertions")) { this.raise(Errors.ImportAttributesUseAssert, this.state.startLoc); } if (!this.hasPlugin("importAssertions")) { this.addExtra(node, "deprecatedAssertSyntax", true); } this.next(); attributes = this.parseImportAttributes(); } else { attributes = []; } if (!useWith && this.hasPlugin("importAssertions")) { node.assertions = attributes; } else { node.attributes = attributes; } } maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) { if (maybeDefaultIdentifier) { const specifier = this.startNodeAtNode(maybeDefaultIdentifier); specifier.local = maybeDefaultIdentifier; node.specifiers.push(this.finishImportSpecifier(specifier, "ImportDefaultSpecifier")); return true; } else if (tokenIsKeywordOrIdentifier(this.state.type)) { this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier"); return true; } return false; } maybeParseStarImportSpecifier(node) { if (this.match(55)) { const specifier = this.startNode(); this.next(); this.expectContextual(93); this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier"); return true; } return false; } parseNamedImportSpecifiers(node) { let first = true; this.expect(5); while (!this.eat(8)) { if (first) { first = false; } else { if (this.eat(14)) { throw this.raise(Errors.DestructureNamedImport, this.state.startLoc); } this.expect(12); if (this.eat(8)) break; } const specifier = this.startNode(); const importedIsString = this.match(134); const isMaybeTypeOnly = this.isContextual(130); specifier.imported = this.parseModuleExportName(); const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly, undefined); node.specifiers.push(importSpecifier); } } parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly, bindingType) { if (this.eatContextual(93)) { specifier.local = this.parseIdentifier(); } else { const { imported } = specifier; if (importedIsString) { throw this.raise(Errors.ImportBindingIsString, specifier, { importName: imported.value }); } this.checkReservedWord(imported.name, specifier.loc.start, true, true); if (!specifier.local) { specifier.local = this.cloneIdentifier(imported); } } return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType); } isThisParam(param) { return param.type === "Identifier" && param.name === "this"; } } class Parser extends StatementParser { constructor(options, input, pluginsMap) { options = getOptions(options); super(options, input); this.options = options; this.initializeScopes(); this.plugins = pluginsMap; this.filename = options.sourceFilename; this.startIndex = options.startIndex; let optionFlags = 0; if (options.allowAwaitOutsideFunction) { optionFlags |= 1; } if (options.allowReturnOutsideFunction) { optionFlags |= 2; } if (options.allowImportExportEverywhere) { optionFlags |= 8; } if (options.allowSuperOutsideMethod) { optionFlags |= 16; } if (options.allowUndeclaredExports) { optionFlags |= 64; } if (options.allowNewTargetOutsideFunction) { optionFlags |= 4; } if (options.allowYieldOutsideFunction) { optionFlags |= 32; } if (options.ranges) { optionFlags |= 128; } if (options.tokens) { optionFlags |= 256; } if (options.createImportExpressions) { optionFlags |= 512; } if (options.createParenthesizedExpressions) { optionFlags |= 1024; } if (options.errorRecovery) { optionFlags |= 2048; } if (options.attachComment) { optionFlags |= 4096; } if (options.annexB) { optionFlags |= 8192; } this.optionFlags = optionFlags; } getScopeHandler() { return ScopeHandler; } parse() { this.enterInitialScopes(); const file = this.startNode(); const program = this.startNode(); this.nextToken(); file.errors = null; this.parseTopLevel(file, program); file.errors = this.state.errors; file.comments.length = this.state.commentsLen; return file; } } function parse(input, options) { var _options; if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") { options = Object.assign({}, options); try { options.sourceType = "module"; const parser = getParser(options, input); const ast = parser.parse(); if (parser.sawUnambiguousESM) { return ast; } if (parser.ambiguousScriptDifferentAst) { try { options.sourceType = "script"; return getParser(options, input).parse(); } catch (_unused) {} } else { ast.program.sourceType = "script"; } return ast; } catch (moduleError) { try { options.sourceType = "script"; return getParser(options, input).parse(); } catch (_unused2) {} throw moduleError; } } else { return getParser(options, input).parse(); } } function parseExpression(input, options) { const parser = getParser(options, input); if (parser.options.strictMode) { parser.state.strict = true; } return parser.getExpression(); } function generateExportedTokenTypes(internalTokenTypes) { const tokenTypes = {}; for (const typeName of Object.keys(internalTokenTypes)) { tokenTypes[typeName] = getExportedToken(internalTokenTypes[typeName]); } return tokenTypes; } const tokTypes = generateExportedTokenTypes(tt); function getParser(options, input) { let cls = Parser; const pluginsMap = new Map(); if (options != null && options.plugins) { for (const plugin of options.plugins) { let name, opts; if (typeof plugin === "string") { name = plugin; } else { [name, opts] = plugin; } if (!pluginsMap.has(name)) { pluginsMap.set(name, opts || {}); } } validatePlugins(pluginsMap); cls = getParserClass(pluginsMap); } return new cls(options, input, pluginsMap); } const parserClassCache = new Map(); function getParserClass(pluginsMap) { const pluginList = []; for (const name of mixinPluginNames) { if (pluginsMap.has(name)) { pluginList.push(name); } } const key = pluginList.join("|"); let cls = parserClassCache.get(key); if (!cls) { cls = Parser; for (const plugin of pluginList) { cls = mixinPlugins[plugin](cls); } parserClassCache.set(key, cls); } return cls; } exports.parse = parse; exports.parseExpression = parseExpression; exports.tokTypes = tokTypes; //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/template/lib/builder.js": /*!*****************************************************!*\ !*** ./node_modules/@babel/template/lib/builder.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = createTemplateBuilder; var _options = __webpack_require__(/*! ./options.js */ "./node_modules/@babel/template/lib/options.js"); var _string = __webpack_require__(/*! ./string.js */ "./node_modules/@babel/template/lib/string.js"); var _literal = __webpack_require__(/*! ./literal.js */ "./node_modules/@babel/template/lib/literal.js"); const NO_PLACEHOLDER = (0, _options.validate)({ placeholderPattern: false }); function createTemplateBuilder(formatter, defaultOpts) { const templateFnCache = new WeakMap(); const templateAstCache = new WeakMap(); const cachedOpts = defaultOpts || (0, _options.validate)(null); return Object.assign((tpl, ...args) => { if (typeof tpl === "string") { if (args.length > 1) throw new Error("Unexpected extra params."); return extendedTrace((0, _string.default)(formatter, tpl, (0, _options.merge)(cachedOpts, (0, _options.validate)(args[0])))); } else if (Array.isArray(tpl)) { let builder = templateFnCache.get(tpl); if (!builder) { builder = (0, _literal.default)(formatter, tpl, cachedOpts); templateFnCache.set(tpl, builder); } return extendedTrace(builder(args)); } else if (typeof tpl === "object" && tpl) { if (args.length > 0) throw new Error("Unexpected extra params."); return createTemplateBuilder(formatter, (0, _options.merge)(cachedOpts, (0, _options.validate)(tpl))); } throw new Error(`Unexpected template param ${typeof tpl}`); }, { ast: (tpl, ...args) => { if (typeof tpl === "string") { if (args.length > 1) throw new Error("Unexpected extra params."); return (0, _string.default)(formatter, tpl, (0, _options.merge)((0, _options.merge)(cachedOpts, (0, _options.validate)(args[0])), NO_PLACEHOLDER))(); } else if (Array.isArray(tpl)) { let builder = templateAstCache.get(tpl); if (!builder) { builder = (0, _literal.default)(formatter, tpl, (0, _options.merge)(cachedOpts, NO_PLACEHOLDER)); templateAstCache.set(tpl, builder); } return builder(args)(); } throw new Error(`Unexpected template param ${typeof tpl}`); } }); } function extendedTrace(fn) { let rootStack = ""; try { throw new Error(); } catch (error) { if (error.stack) { rootStack = error.stack.split("\n").slice(3).join("\n"); } } return arg => { try { return fn(arg); } catch (err) { err.stack += `\n =============\n${rootStack}`; throw err; } }; } //# sourceMappingURL=builder.js.map /***/ }), /***/ "./node_modules/@babel/template/lib/formatters.js": /*!********************************************************!*\ !*** ./node_modules/@babel/template/lib/formatters.js ***! \********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.statements = exports.statement = exports.smart = exports.program = exports.expression = void 0; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { assertExpressionStatement } = _t; function makeStatementFormatter(fn) { return { code: str => `/* @babel/template */;\n${str}`, validate: () => {}, unwrap: ast => { return fn(ast.program.body.slice(1)); } }; } const smart = exports.smart = makeStatementFormatter(body => { if (body.length > 1) { return body; } else { return body[0]; } }); const statements = exports.statements = makeStatementFormatter(body => body); const statement = exports.statement = makeStatementFormatter(body => { if (body.length === 0) { throw new Error("Found nothing to return."); } if (body.length > 1) { throw new Error("Found multiple statements but wanted one"); } return body[0]; }); const expression = exports.expression = { code: str => `(\n${str}\n)`, validate: ast => { if (ast.program.body.length > 1) { throw new Error("Found multiple statements but wanted one"); } if (expression.unwrap(ast).start === 0) { throw new Error("Parse result included parens."); } }, unwrap: ({ program }) => { const [stmt] = program.body; assertExpressionStatement(stmt); return stmt.expression; } }; const program = exports.program = { code: str => str, validate: () => {}, unwrap: ast => ast.program }; //# sourceMappingURL=formatters.js.map /***/ }), /***/ "./node_modules/@babel/template/lib/index.js": /*!***************************************************!*\ !*** ./node_modules/@babel/template/lib/index.js ***! \***************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.statements = exports.statement = exports.smart = exports.program = exports.expression = exports["default"] = void 0; var formatters = __webpack_require__(/*! ./formatters.js */ "./node_modules/@babel/template/lib/formatters.js"); var _builder = __webpack_require__(/*! ./builder.js */ "./node_modules/@babel/template/lib/builder.js"); const smart = exports.smart = (0, _builder.default)(formatters.smart); const statement = exports.statement = (0, _builder.default)(formatters.statement); const statements = exports.statements = (0, _builder.default)(formatters.statements); const expression = exports.expression = (0, _builder.default)(formatters.expression); const program = exports.program = (0, _builder.default)(formatters.program); var _default = exports["default"] = Object.assign(smart.bind(undefined), { smart, statement, statements, expression, program, ast: smart.ast }); //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/template/lib/literal.js": /*!*****************************************************!*\ !*** ./node_modules/@babel/template/lib/literal.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = literalTemplate; var _options = __webpack_require__(/*! ./options.js */ "./node_modules/@babel/template/lib/options.js"); var _parse = __webpack_require__(/*! ./parse.js */ "./node_modules/@babel/template/lib/parse.js"); var _populate = __webpack_require__(/*! ./populate.js */ "./node_modules/@babel/template/lib/populate.js"); function literalTemplate(formatter, tpl, opts) { const { metadata, names } = buildLiteralData(formatter, tpl, opts); return arg => { const defaultReplacements = {}; arg.forEach((replacement, i) => { defaultReplacements[names[i]] = replacement; }); return arg => { const replacements = (0, _options.normalizeReplacements)(arg); if (replacements) { Object.keys(replacements).forEach(key => { if (hasOwnProperty.call(defaultReplacements, key)) { throw new Error("Unexpected replacement overlap."); } }); } return formatter.unwrap((0, _populate.default)(metadata, replacements ? Object.assign(replacements, defaultReplacements) : defaultReplacements)); }; }; } function buildLiteralData(formatter, tpl, opts) { let prefix = "BABEL_TPL$"; const raw = tpl.join(""); do { prefix = "$$" + prefix; } while (raw.includes(prefix)); const { names, code } = buildTemplateCode(tpl, prefix); const metadata = (0, _parse.default)(formatter, formatter.code(code), { parser: opts.parser, placeholderWhitelist: new Set(names.concat(opts.placeholderWhitelist ? Array.from(opts.placeholderWhitelist) : [])), placeholderPattern: opts.placeholderPattern, preserveComments: opts.preserveComments, syntacticPlaceholders: opts.syntacticPlaceholders }); return { metadata, names }; } function buildTemplateCode(tpl, prefix) { const names = []; let code = tpl[0]; for (let i = 1; i < tpl.length; i++) { const value = `${prefix}${i - 1}`; names.push(value); code += value + tpl[i]; } return { names, code }; } //# sourceMappingURL=literal.js.map /***/ }), /***/ "./node_modules/@babel/template/lib/options.js": /*!*****************************************************!*\ !*** ./node_modules/@babel/template/lib/options.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.merge = merge; exports.normalizeReplacements = normalizeReplacements; exports.validate = validate; const _excluded = ["placeholderWhitelist", "placeholderPattern", "preserveComments", "syntacticPlaceholders"]; function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; } function merge(a, b) { const { placeholderWhitelist = a.placeholderWhitelist, placeholderPattern = a.placeholderPattern, preserveComments = a.preserveComments, syntacticPlaceholders = a.syntacticPlaceholders } = b; return { parser: Object.assign({}, a.parser, b.parser), placeholderWhitelist, placeholderPattern, preserveComments, syntacticPlaceholders }; } function validate(opts) { if (opts != null && typeof opts !== "object") { throw new Error("Unknown template options."); } const _ref = opts || {}, { placeholderWhitelist, placeholderPattern, preserveComments, syntacticPlaceholders } = _ref, parser = _objectWithoutPropertiesLoose(_ref, _excluded); if (placeholderWhitelist != null && !(placeholderWhitelist instanceof Set)) { throw new Error("'.placeholderWhitelist' must be a Set, null, or undefined"); } if (placeholderPattern != null && !(placeholderPattern instanceof RegExp) && placeholderPattern !== false) { throw new Error("'.placeholderPattern' must be a RegExp, false, null, or undefined"); } if (preserveComments != null && typeof preserveComments !== "boolean") { throw new Error("'.preserveComments' must be a boolean, null, or undefined"); } if (syntacticPlaceholders != null && typeof syntacticPlaceholders !== "boolean") { throw new Error("'.syntacticPlaceholders' must be a boolean, null, or undefined"); } if (syntacticPlaceholders === true && (placeholderWhitelist != null || placeholderPattern != null)) { throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" + " with '.syntacticPlaceholders: true'"); } return { parser, placeholderWhitelist: placeholderWhitelist || undefined, placeholderPattern: placeholderPattern == null ? undefined : placeholderPattern, preserveComments: preserveComments == null ? undefined : preserveComments, syntacticPlaceholders: syntacticPlaceholders == null ? undefined : syntacticPlaceholders }; } function normalizeReplacements(replacements) { if (Array.isArray(replacements)) { return replacements.reduce((acc, replacement, i) => { acc["$" + i] = replacement; return acc; }, {}); } else if (typeof replacements === "object" || replacements == null) { return replacements || undefined; } throw new Error("Template replacements must be an array, object, null, or undefined"); } //# sourceMappingURL=options.js.map /***/ }), /***/ "./node_modules/@babel/template/lib/parse.js": /*!***************************************************!*\ !*** ./node_modules/@babel/template/lib/parse.js ***! \***************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = parseAndBuildMetadata; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _parser = __webpack_require__(/*! @babel/parser */ "./node_modules/@babel/parser/lib/index.js"); var _codeFrame = __webpack_require__(/*! @babel/code-frame */ "./node_modules/@babel/code-frame/lib/index.js"); const { isCallExpression, isExpressionStatement, isFunction, isIdentifier, isJSXIdentifier, isNewExpression, isPlaceholder, isStatement, isStringLiteral, removePropertiesDeep, traverse } = _t; const PATTERN = /^[_$A-Z0-9]+$/; function parseAndBuildMetadata(formatter, code, opts) { const { placeholderWhitelist, placeholderPattern, preserveComments, syntacticPlaceholders } = opts; const ast = parseWithCodeFrame(code, opts.parser, syntacticPlaceholders); removePropertiesDeep(ast, { preserveComments }); formatter.validate(ast); const state = { syntactic: { placeholders: [], placeholderNames: new Set() }, legacy: { placeholders: [], placeholderNames: new Set() }, placeholderWhitelist, placeholderPattern, syntacticPlaceholders }; traverse(ast, placeholderVisitorHandler, state); return Object.assign({ ast }, state.syntactic.placeholders.length ? state.syntactic : state.legacy); } function placeholderVisitorHandler(node, ancestors, state) { var _state$placeholderWhi; let name; let hasSyntacticPlaceholders = state.syntactic.placeholders.length > 0; if (isPlaceholder(node)) { if (state.syntacticPlaceholders === false) { throw new Error("%%foo%%-style placeholders can't be used when " + "'.syntacticPlaceholders' is false."); } name = node.name.name; hasSyntacticPlaceholders = true; } else if (hasSyntacticPlaceholders || state.syntacticPlaceholders) { return; } else if (isIdentifier(node) || isJSXIdentifier(node)) { name = node.name; } else if (isStringLiteral(node)) { name = node.value; } else { return; } if (hasSyntacticPlaceholders && (state.placeholderPattern != null || state.placeholderWhitelist != null)) { throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible" + " with '.syntacticPlaceholders: true'"); } if (!hasSyntacticPlaceholders && (state.placeholderPattern === false || !(state.placeholderPattern || PATTERN).test(name)) && !((_state$placeholderWhi = state.placeholderWhitelist) != null && _state$placeholderWhi.has(name))) { return; } ancestors = ancestors.slice(); const { node: parent, key } = ancestors[ancestors.length - 1]; let type; if (isStringLiteral(node) || isPlaceholder(node, { expectedNode: "StringLiteral" })) { type = "string"; } else if (isNewExpression(parent) && key === "arguments" || isCallExpression(parent) && key === "arguments" || isFunction(parent) && key === "params") { type = "param"; } else if (isExpressionStatement(parent) && !isPlaceholder(node)) { type = "statement"; ancestors = ancestors.slice(0, -1); } else if (isStatement(node) && isPlaceholder(node)) { type = "statement"; } else { type = "other"; } const { placeholders, placeholderNames } = !hasSyntacticPlaceholders ? state.legacy : state.syntactic; placeholders.push({ name, type, resolve: ast => resolveAncestors(ast, ancestors), isDuplicate: placeholderNames.has(name) }); placeholderNames.add(name); } function resolveAncestors(ast, ancestors) { let parent = ast; for (let i = 0; i < ancestors.length - 1; i++) { const { key, index } = ancestors[i]; if (index === undefined) { parent = parent[key]; } else { parent = parent[key][index]; } } const { key, index } = ancestors[ancestors.length - 1]; return { parent, key, index }; } function parseWithCodeFrame(code, parserOpts, syntacticPlaceholders) { const plugins = (parserOpts.plugins || []).slice(); if (syntacticPlaceholders !== false) { plugins.push("placeholders"); } parserOpts = Object.assign({ allowAwaitOutsideFunction: true, allowReturnOutsideFunction: true, allowNewTargetOutsideFunction: true, allowSuperOutsideMethod: true, allowYieldOutsideFunction: true, sourceType: "module" }, parserOpts, { plugins }); try { return (0, _parser.parse)(code, parserOpts); } catch (err) { const loc = err.loc; if (loc) { err.message += "\n" + (0, _codeFrame.codeFrameColumns)(code, { start: loc }); err.code = "BABEL_TEMPLATE_PARSE_ERROR"; } throw err; } } //# sourceMappingURL=parse.js.map /***/ }), /***/ "./node_modules/@babel/template/lib/populate.js": /*!******************************************************!*\ !*** ./node_modules/@babel/template/lib/populate.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = populatePlaceholders; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { blockStatement, cloneNode, emptyStatement, expressionStatement, identifier, isStatement, isStringLiteral, stringLiteral, validate } = _t; function populatePlaceholders(metadata, replacements) { const ast = cloneNode(metadata.ast); if (replacements) { metadata.placeholders.forEach(placeholder => { if (!hasOwnProperty.call(replacements, placeholder.name)) { const placeholderName = placeholder.name; throw new Error(`Error: No substitution given for "${placeholderName}". If this is not meant to be a placeholder you may want to consider passing one of the following options to @babel/template: - { placeholderPattern: false, placeholderWhitelist: new Set(['${placeholderName}'])} - { placeholderPattern: /^${placeholderName}$/ }`); } }); Object.keys(replacements).forEach(key => { if (!metadata.placeholderNames.has(key)) { throw new Error(`Unknown substitution "${key}" given`); } }); } metadata.placeholders.slice().reverse().forEach(placeholder => { try { var _ref; applyReplacement(placeholder, ast, (_ref = replacements && replacements[placeholder.name]) != null ? _ref : null); } catch (e) { e.message = `@babel/template placeholder "${placeholder.name}": ${e.message}`; throw e; } }); return ast; } function applyReplacement(placeholder, ast, replacement) { if (placeholder.isDuplicate) { if (Array.isArray(replacement)) { replacement = replacement.map(node => cloneNode(node)); } else if (typeof replacement === "object") { replacement = cloneNode(replacement); } } const { parent, key, index } = placeholder.resolve(ast); if (placeholder.type === "string") { if (typeof replacement === "string") { replacement = stringLiteral(replacement); } if (!replacement || !isStringLiteral(replacement)) { throw new Error("Expected string substitution"); } } else if (placeholder.type === "statement") { if (index === undefined) { if (!replacement) { replacement = emptyStatement(); } else if (Array.isArray(replacement)) { replacement = blockStatement(replacement); } else if (typeof replacement === "string") { replacement = expressionStatement(identifier(replacement)); } else if (!isStatement(replacement)) { replacement = expressionStatement(replacement); } } else { if (replacement && !Array.isArray(replacement)) { if (typeof replacement === "string") { replacement = identifier(replacement); } if (!isStatement(replacement)) { replacement = expressionStatement(replacement); } } } } else if (placeholder.type === "param") { if (typeof replacement === "string") { replacement = identifier(replacement); } if (index === undefined) throw new Error("Assertion failure."); } else { if (typeof replacement === "string") { replacement = identifier(replacement); } if (Array.isArray(replacement)) { throw new Error("Cannot replace single expression with an array."); } } function set(parent, key, value) { const node = parent[key]; parent[key] = value; if (node.type === "Identifier" || node.type === "Placeholder") { if (node.typeAnnotation) { value.typeAnnotation = node.typeAnnotation; } if (node.optional) { value.optional = node.optional; } if (node.decorators) { value.decorators = node.decorators; } } } if (index === undefined) { validate(parent, key, replacement); set(parent, key, replacement); } else { const items = parent[key].slice(); if (placeholder.type === "statement" || placeholder.type === "param") { if (replacement == null) { items.splice(index, 1); } else if (Array.isArray(replacement)) { items.splice(index, 1, ...replacement); } else { set(items, index, replacement); } } else { set(items, index, replacement); } validate(parent, key, items); parent[key] = items; } } //# sourceMappingURL=populate.js.map /***/ }), /***/ "./node_modules/@babel/template/lib/string.js": /*!****************************************************!*\ !*** ./node_modules/@babel/template/lib/string.js ***! \****************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = stringTemplate; var _options = __webpack_require__(/*! ./options.js */ "./node_modules/@babel/template/lib/options.js"); var _parse = __webpack_require__(/*! ./parse.js */ "./node_modules/@babel/template/lib/parse.js"); var _populate = __webpack_require__(/*! ./populate.js */ "./node_modules/@babel/template/lib/populate.js"); function stringTemplate(formatter, code, opts) { code = formatter.code(code); let metadata; return arg => { const replacements = (0, _options.normalizeReplacements)(arg); if (!metadata) metadata = (0, _parse.default)(formatter, code, opts); return formatter.unwrap((0, _populate.default)(metadata, replacements)); }; } //# sourceMappingURL=string.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/cache.js": /*!***************************************************!*\ !*** ./node_modules/@babel/traverse/lib/cache.js ***! \***************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.clear = clear; exports.clearPath = clearPath; exports.clearScope = clearScope; exports.getCachedPaths = getCachedPaths; exports.getOrCreateCachedPaths = getOrCreateCachedPaths; exports.scope = exports.path = void 0; let pathsCache = exports.path = new WeakMap(); let scope = exports.scope = new WeakMap(); function clear() { clearPath(); clearScope(); } function clearPath() { exports.path = pathsCache = new WeakMap(); } function clearScope() { exports.scope = scope = new WeakMap(); } function getCachedPaths(path) { const { parent, parentPath } = path; return pathsCache.get(parent); } function getOrCreateCachedPaths(node, parentPath) { ; let paths = pathsCache.get(node); if (!paths) pathsCache.set(node, paths = new Map()); return paths; } //# sourceMappingURL=cache.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/context.js": /*!*****************************************************!*\ !*** ./node_modules/@babel/traverse/lib/context.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _index = __webpack_require__(/*! ./path/index.js */ "./node_modules/@babel/traverse/lib/path/index.js"); var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _context = __webpack_require__(/*! ./path/context.js */ "./node_modules/@babel/traverse/lib/path/context.js"); const { VISITOR_KEYS } = _t; class TraversalContext { constructor(scope, opts, state, parentPath) { this.queue = null; this.priorityQueue = null; this.parentPath = parentPath; this.scope = scope; this.state = state; this.opts = opts; } shouldVisit(node) { const opts = this.opts; if (opts.enter || opts.exit) return true; if (opts[node.type]) return true; const keys = VISITOR_KEYS[node.type]; if (!(keys != null && keys.length)) return false; for (const key of keys) { if (node[key]) { return true; } } return false; } create(node, container, key, listKey) { return _index.default.get({ parentPath: this.parentPath, parent: node, container, key: key, listKey }); } maybeQueue(path, notPriority) { if (this.queue) { if (notPriority) { this.queue.push(path); } else { this.priorityQueue.push(path); } } } visitMultiple(container, parent, listKey) { if (container.length === 0) return false; const queue = []; for (let key = 0; key < container.length; key++) { const node = container[key]; if (node && this.shouldVisit(node)) { queue.push(this.create(parent, container, key, listKey)); } } return this.visitQueue(queue); } visitSingle(node, key) { if (this.shouldVisit(node[key])) { return this.visitQueue([this.create(node, node, key)]); } else { return false; } } visitQueue(queue) { this.queue = queue; this.priorityQueue = []; const visited = new WeakSet(); let stop = false; let visitIndex = 0; for (; visitIndex < queue.length;) { const path = queue[visitIndex]; visitIndex++; _context.resync.call(path); if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) { _context.pushContext.call(path, this); } if (path.key === null) continue; const { node } = path; if (visited.has(node)) continue; if (node) visited.add(node); if (path.visit()) { stop = true; break; } if (this.priorityQueue.length) { stop = this.visitQueue(this.priorityQueue); this.priorityQueue = []; this.queue = queue; if (stop) break; } } for (let i = 0; i < visitIndex; i++) { _context.popContext.call(queue[i]); } this.queue = null; return stop; } visit(node, key) { const nodes = node[key]; if (!nodes) return false; if (Array.isArray(nodes)) { return this.visitMultiple(nodes, node, key); } else { return this.visitSingle(node, key); } } } exports["default"] = TraversalContext; //# sourceMappingURL=context.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/hub.js": /*!*************************************************!*\ !*** ./node_modules/@babel/traverse/lib/hub.js ***! \*************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; class Hub { getCode() {} getScope() {} addHelper() { throw new Error("Helpers are not supported by the default hub."); } buildError(node, msg, Error = TypeError) { return new Error(msg); } } exports["default"] = Hub; //# sourceMappingURL=hub.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/index.js": /*!***************************************************!*\ !*** ./node_modules/@babel/traverse/lib/index.js ***! \***************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "Hub", ({ enumerable: true, get: function () { return _hub.default; } })); Object.defineProperty(exports, "NodePath", ({ enumerable: true, get: function () { return _index.default; } })); Object.defineProperty(exports, "Scope", ({ enumerable: true, get: function () { return _index2.default; } })); exports.visitors = exports["default"] = void 0; __webpack_require__(/*! ./path/context.js */ "./node_modules/@babel/traverse/lib/path/context.js"); var visitors = __webpack_require__(/*! ./visitors.js */ "./node_modules/@babel/traverse/lib/visitors.js"); exports.visitors = visitors; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var cache = __webpack_require__(/*! ./cache.js */ "./node_modules/@babel/traverse/lib/cache.js"); var _traverseNode = __webpack_require__(/*! ./traverse-node.js */ "./node_modules/@babel/traverse/lib/traverse-node.js"); var _index = __webpack_require__(/*! ./path/index.js */ "./node_modules/@babel/traverse/lib/path/index.js"); var _index2 = __webpack_require__(/*! ./scope/index.js */ "./node_modules/@babel/traverse/lib/scope/index.js"); var _hub = __webpack_require__(/*! ./hub.js */ "./node_modules/@babel/traverse/lib/hub.js"); const { VISITOR_KEYS, removeProperties, traverseFast } = _t; function traverse(parent, opts = {}, scope, state, parentPath, visitSelf) { if (!parent) return; if (!opts.noScope && !scope) { if (parent.type !== "Program" && parent.type !== "File") { throw new Error("You must pass a scope and parentPath unless traversing a Program/File. " + `Instead of that you tried to traverse a ${parent.type} node without ` + "passing scope and parentPath."); } } if (!parentPath && visitSelf) { throw new Error("visitSelf can only be used when providing a NodePath."); } if (!VISITOR_KEYS[parent.type]) { return; } visitors.explode(opts); (0, _traverseNode.traverseNode)(parent, opts, scope, state, parentPath, null, visitSelf); } var _default = exports["default"] = traverse; traverse.visitors = visitors; traverse.verify = visitors.verify; traverse.explode = visitors.explode; traverse.cheap = function (node, enter) { traverseFast(node, enter); return; }; traverse.node = function (node, opts, scope, state, path, skipKeys) { (0, _traverseNode.traverseNode)(node, opts, scope, state, path, skipKeys); }; traverse.clearNode = function (node, opts) { removeProperties(node, opts); }; traverse.removeProperties = function (tree, opts) { traverseFast(tree, traverse.clearNode, opts); return tree; }; traverse.hasType = function (tree, type, denylistTypes) { if (denylistTypes != null && denylistTypes.includes(tree.type)) return false; if (tree.type === type) return true; return traverseFast(tree, function (node) { if (denylistTypes != null && denylistTypes.includes(node.type)) { return traverseFast.skip; } if (node.type === type) { return traverseFast.stop; } }); }; traverse.cache = cache; //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/ancestry.js": /*!***********************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/ancestry.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.find = find; exports.findParent = findParent; exports.getAncestry = getAncestry; exports.getDeepestCommonAncestorFrom = getDeepestCommonAncestorFrom; exports.getEarliestCommonAncestorFrom = getEarliestCommonAncestorFrom; exports.getFunctionParent = getFunctionParent; exports.getStatementParent = getStatementParent; exports.inType = inType; exports.isAncestor = isAncestor; exports.isDescendant = isDescendant; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { VISITOR_KEYS } = _t; function findParent(callback) { let path = this; while (path = path.parentPath) { if (callback(path)) return path; } return null; } function find(callback) { let path = this; do { if (callback(path)) return path; } while (path = path.parentPath); return null; } function getFunctionParent() { return this.findParent(p => p.isFunction()); } function getStatementParent() { let path = this; do { if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) { break; } else { path = path.parentPath; } } while (path); if (path && (path.isProgram() || path.isFile())) { throw new Error("File/Program node, we can't possibly find a statement parent to this"); } return path; } function getEarliestCommonAncestorFrom(paths) { return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) { let earliest; const keys = VISITOR_KEYS[deepest.type]; for (const ancestry of ancestries) { const path = ancestry[i + 1]; if (!earliest) { earliest = path; continue; } if (path.listKey && earliest.listKey === path.listKey) { if (path.key < earliest.key) { earliest = path; continue; } } const earliestKeyIndex = keys.indexOf(earliest.parentKey); const currentKeyIndex = keys.indexOf(path.parentKey); if (earliestKeyIndex > currentKeyIndex) { earliest = path; } } return earliest; }); } function getDeepestCommonAncestorFrom(paths, filter) { if (!paths.length) { return this; } if (paths.length === 1) { return paths[0]; } let minDepth = Infinity; let lastCommonIndex, lastCommon; const ancestries = paths.map(path => { const ancestry = []; do { ancestry.unshift(path); } while ((path = path.parentPath) && path !== this); if (ancestry.length < minDepth) { minDepth = ancestry.length; } return ancestry; }); const first = ancestries[0]; depthLoop: for (let i = 0; i < minDepth; i++) { const shouldMatch = first[i]; for (const ancestry of ancestries) { if (ancestry[i] !== shouldMatch) { break depthLoop; } } lastCommonIndex = i; lastCommon = shouldMatch; } if (lastCommon) { if (filter) { return filter(lastCommon, lastCommonIndex, ancestries); } else { return lastCommon; } } else { throw new Error("Couldn't find intersection"); } } function getAncestry() { let path = this; const paths = []; do { paths.push(path); } while (path = path.parentPath); return paths; } function isAncestor(maybeDescendant) { return maybeDescendant.isDescendant(this); } function isDescendant(maybeAncestor) { return !!this.findParent(parent => parent === maybeAncestor); } function inType(...candidateTypes) { let path = this; while (path) { if (candidateTypes.includes(path.node.type)) return true; path = path.parentPath; } return false; } //# sourceMappingURL=ancestry.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/comments.js": /*!***********************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/comments.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.addComment = addComment; exports.addComments = addComments; exports.shareCommentsWithSiblings = shareCommentsWithSiblings; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { addComment: _addComment, addComments: _addComments } = _t; function shareCommentsWithSiblings() { if (typeof this.key === "string") return; const node = this.node; if (!node) return; const trailing = node.trailingComments; const leading = node.leadingComments; if (!trailing && !leading) return; const prev = this.getSibling(this.key - 1); const next = this.getSibling(this.key + 1); const hasPrev = Boolean(prev.node); const hasNext = Boolean(next.node); if (hasPrev) { if (leading) { prev.addComments("trailing", removeIfExisting(leading, prev.node.trailingComments)); } if (trailing && !hasNext) prev.addComments("trailing", trailing); } if (hasNext) { if (trailing) { next.addComments("leading", removeIfExisting(trailing, next.node.leadingComments)); } if (leading && !hasPrev) next.addComments("leading", leading); } } function removeIfExisting(list, toRemove) { if (!(toRemove != null && toRemove.length)) return list; const set = new Set(toRemove); return list.filter(el => { return !set.has(el); }); } function addComment(type, content, line) { _addComment(this.node, type, content, line); } function addComments(type, comments) { _addComments(this.node, type, comments); } //# sourceMappingURL=comments.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/context.js": /*!**********************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/context.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports._call = _call; exports._getQueueContexts = _getQueueContexts; exports._resyncKey = _resyncKey; exports._resyncList = _resyncList; exports._resyncParent = _resyncParent; exports._resyncRemoved = _resyncRemoved; exports.call = call; exports.isDenylisted = isDenylisted; exports.popContext = popContext; exports.pushContext = pushContext; exports.requeue = requeue; exports.requeueComputedKeyAndDecorators = requeueComputedKeyAndDecorators; exports.resync = resync; exports.setContext = setContext; exports.setKey = setKey; exports.setScope = setScope; exports.setup = setup; exports.skip = skip; exports.skipKey = skipKey; exports.stop = stop; exports.visit = visit; var _traverseNode = __webpack_require__(/*! ../traverse-node.js */ "./node_modules/@babel/traverse/lib/traverse-node.js"); var _index = __webpack_require__(/*! ./index.js */ "./node_modules/@babel/traverse/lib/path/index.js"); var _removal = __webpack_require__(/*! ./removal.js */ "./node_modules/@babel/traverse/lib/path/removal.js"); var t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); function call(key) { const opts = this.opts; this.debug(key); if (this.node) { if (_call.call(this, opts[key])) return true; } if (this.node) { var _opts$this$node$type; return _call.call(this, (_opts$this$node$type = opts[this.node.type]) == null ? void 0 : _opts$this$node$type[key]); } return false; } function _call(fns) { if (!fns) return false; for (const fn of fns) { if (!fn) continue; const node = this.node; if (!node) return true; const ret = fn.call(this.state, this, this.state); if (ret && typeof ret === "object" && typeof ret.then === "function") { throw new Error(`You appear to be using a plugin with an async traversal visitor, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`); } if (ret) { throw new Error(`Unexpected return value from visitor method ${fn}`); } if (this.node !== node) return true; if (this._traverseFlags > 0) return true; } return false; } function isDenylisted() { var _this$opts$denylist; const denylist = (_this$opts$denylist = this.opts.denylist) != null ? _this$opts$denylist : this.opts.blacklist; return denylist == null ? void 0 : denylist.includes(this.node.type); } { exports.isBlacklisted = isDenylisted; } function restoreContext(path, context) { if (path.context !== context) { path.context = context; path.state = context.state; path.opts = context.opts; } } function visit() { var _this$opts$shouldSkip, _this$opts; if (!this.node) { return false; } if (this.isDenylisted()) { return false; } if ((_this$opts$shouldSkip = (_this$opts = this.opts).shouldSkip) != null && _this$opts$shouldSkip.call(_this$opts, this)) { return false; } const currentContext = this.context; if (this.shouldSkip || call.call(this, "enter")) { this.debug("Skip..."); return this.shouldStop; } restoreContext(this, currentContext); this.debug("Recursing into..."); this.shouldStop = (0, _traverseNode.traverseNode)(this.node, this.opts, this.scope, this.state, this, this.skipKeys); restoreContext(this, currentContext); call.call(this, "exit"); return this.shouldStop; } function skip() { this.shouldSkip = true; } function skipKey(key) { if (this.skipKeys == null) { this.skipKeys = {}; } this.skipKeys[key] = true; } function stop() { this._traverseFlags |= _index.SHOULD_SKIP | _index.SHOULD_STOP; } function setScope() { var _this$opts2, _this$scope; if ((_this$opts2 = this.opts) != null && _this$opts2.noScope) return; let path = this.parentPath; if ((this.key === "key" || this.listKey === "decorators") && path.isMethod() || this.key === "discriminant" && path.isSwitchStatement()) { path = path.parentPath; } let target; while (path && !target) { var _path$opts; if ((_path$opts = path.opts) != null && _path$opts.noScope) return; target = path.scope; path = path.parentPath; } this.scope = this.getScope(target); (_this$scope = this.scope) == null || _this$scope.init(); } function setContext(context) { if (this.skipKeys != null) { this.skipKeys = {}; } this._traverseFlags = 0; if (context) { this.context = context; this.state = context.state; this.opts = context.opts; } setScope.call(this); return this; } function resync() { if (this.removed) return; _resyncParent.call(this); _resyncList.call(this); _resyncKey.call(this); } function _resyncParent() { if (this.parentPath) { this.parent = this.parentPath.node; } } function _resyncKey() { if (!this.container) return; if (this.node === this.container[this.key]) { return; } if (Array.isArray(this.container)) { for (let i = 0; i < this.container.length; i++) { if (this.container[i] === this.node) { setKey.call(this, i); return; } } } else { for (const key of Object.keys(this.container)) { if (this.container[key] === this.node) { setKey.call(this, key); return; } } } this.key = null; } function _resyncList() { if (!this.parent || !this.inList) return; const newContainer = this.parent[this.listKey]; if (this.container === newContainer) return; this.container = newContainer || null; } function _resyncRemoved() { if (this.key == null || !this.container || this.container[this.key] !== this.node) { _removal._markRemoved.call(this); } } function popContext() { this.contexts.pop(); if (this.contexts.length > 0) { this.setContext(this.contexts[this.contexts.length - 1]); } else { this.setContext(undefined); } } function pushContext(context) { this.contexts.push(context); this.setContext(context); } function setup(parentPath, container, listKey, key) { this.listKey = listKey; this.container = container; this.parentPath = parentPath || this.parentPath; setKey.call(this, key); } function setKey(key) { var _this$node; this.key = key; this.node = this.container[this.key]; this.type = (_this$node = this.node) == null ? void 0 : _this$node.type; } function requeue(pathToQueue = this) { if (pathToQueue.removed) return; ; const contexts = this.contexts; for (const context of contexts) { context.maybeQueue(pathToQueue); } } function requeueComputedKeyAndDecorators() { const { context, node } = this; if (!t.isPrivate(node) && node.computed) { context.maybeQueue(this.get("key")); } if (node.decorators) { for (const decorator of this.get("decorators")) { context.maybeQueue(decorator); } } } function _getQueueContexts() { let path = this; let contexts = this.contexts; while (!contexts.length) { path = path.parentPath; if (!path) break; contexts = path.contexts; } return contexts; } //# sourceMappingURL=context.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/conversion.js": /*!*************************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/conversion.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.arrowFunctionToExpression = arrowFunctionToExpression; exports.ensureBlock = ensureBlock; exports.ensureFunctionName = ensureFunctionName; exports.splitExportDeclaration = splitExportDeclaration; exports.toComputedKey = toComputedKey; exports.unwrapFunctionEnvironment = unwrapFunctionEnvironment; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _template = __webpack_require__(/*! @babel/template */ "./node_modules/@babel/template/lib/index.js"); var _visitors = __webpack_require__(/*! ../visitors.js */ "./node_modules/@babel/traverse/lib/visitors.js"); var _context = __webpack_require__(/*! ./context.js */ "./node_modules/@babel/traverse/lib/path/context.js"); const { arrowFunctionExpression, assignmentExpression, binaryExpression, blockStatement, callExpression, conditionalExpression, expressionStatement, identifier, isIdentifier, jsxIdentifier, logicalExpression, LOGICAL_OPERATORS, memberExpression, metaProperty, numericLiteral, objectExpression, restElement, returnStatement, sequenceExpression, spreadElement, stringLiteral, super: _super, thisExpression, toExpression, unaryExpression, toBindingIdentifierName, isFunction, isAssignmentPattern, isRestElement, getFunctionName, cloneNode, variableDeclaration, variableDeclarator, exportNamedDeclaration, exportSpecifier, inherits } = _t; function toComputedKey() { let key; if (this.isMemberExpression()) { key = this.node.property; } else if (this.isProperty() || this.isMethod()) { key = this.node.key; } else { throw new ReferenceError("todo"); } if (!this.node.computed) { if (isIdentifier(key)) key = stringLiteral(key.name); } return key; } function ensureBlock() { const body = this.get("body"); const bodyNode = body.node; if (Array.isArray(body)) { throw new Error("Can't convert array path to a block statement"); } if (!bodyNode) { throw new Error("Can't convert node without a body"); } if (body.isBlockStatement()) { return bodyNode; } const statements = []; let stringPath = "body"; let key; let listKey; if (body.isStatement()) { listKey = "body"; key = 0; statements.push(body.node); } else { stringPath += ".body.0"; if (this.isFunction()) { key = "argument"; statements.push(returnStatement(body.node)); } else { key = "expression"; statements.push(expressionStatement(body.node)); } } this.node.body = blockStatement(statements); const parentPath = this.get(stringPath); _context.setup.call(body, parentPath, listKey ? parentPath.node[listKey] : parentPath.node, listKey, key); return this.node; } { exports.arrowFunctionToShadowed = function () { if (!this.isArrowFunctionExpression()) return; this.arrowFunctionToExpression(); }; } function unwrapFunctionEnvironment() { if (!this.isArrowFunctionExpression() && !this.isFunctionExpression() && !this.isFunctionDeclaration()) { throw this.buildCodeFrameError("Can only unwrap the environment of a function."); } hoistFunctionEnvironment(this); } function setType(path, type) { path.node.type = type; } function arrowFunctionToExpression({ allowInsertArrow = true, allowInsertArrowWithRest = allowInsertArrow, noNewArrows = !(_arguments$ => (_arguments$ = arguments[0]) == null ? void 0 : _arguments$.specCompliant)() } = {}) { if (!this.isArrowFunctionExpression()) { throw this.buildCodeFrameError("Cannot convert non-arrow function to a function expression."); } let self = this; if (!noNewArrows) { var _self$ensureFunctionN; self = (_self$ensureFunctionN = self.ensureFunctionName(false)) != null ? _self$ensureFunctionN : self; } const { thisBinding, fnPath: fn } = hoistFunctionEnvironment(self, noNewArrows, allowInsertArrow, allowInsertArrowWithRest); fn.ensureBlock(); setType(fn, "FunctionExpression"); if (!noNewArrows) { const checkBinding = thisBinding ? null : fn.scope.generateUidIdentifier("arrowCheckId"); if (checkBinding) { fn.parentPath.scope.push({ id: checkBinding, init: objectExpression([]) }); } fn.get("body").unshiftContainer("body", expressionStatement(callExpression(this.hub.addHelper("newArrowCheck"), [thisExpression(), checkBinding ? identifier(checkBinding.name) : identifier(thisBinding)]))); fn.replaceWith(callExpression(memberExpression(fn.node, identifier("bind")), [checkBinding ? identifier(checkBinding.name) : thisExpression()])); return fn.get("callee.object"); } return fn; } const getSuperCallsVisitor = (0, _visitors.environmentVisitor)({ CallExpression(child, { allSuperCalls }) { if (!child.get("callee").isSuper()) return; allSuperCalls.push(child); } }); function hoistFunctionEnvironment(fnPath, noNewArrows = true, allowInsertArrow = true, allowInsertArrowWithRest = true) { let arrowParent; let thisEnvFn = fnPath.findParent(p => { if (p.isArrowFunctionExpression()) { arrowParent != null ? arrowParent : arrowParent = p; return false; } return p.isFunction() || p.isProgram() || p.isClassProperty({ static: false }) || p.isClassPrivateProperty({ static: false }); }); const inConstructor = thisEnvFn.isClassMethod({ kind: "constructor" }); if (thisEnvFn.isClassProperty() || thisEnvFn.isClassPrivateProperty()) { if (arrowParent) { thisEnvFn = arrowParent; } else if (allowInsertArrow) { fnPath.replaceWith(callExpression(arrowFunctionExpression([], toExpression(fnPath.node)), [])); thisEnvFn = fnPath.get("callee"); fnPath = thisEnvFn.get("body"); } else { throw fnPath.buildCodeFrameError("Unable to transform arrow inside class property"); } } const { thisPaths, argumentsPaths, newTargetPaths, superProps, superCalls } = getScopeInformation(fnPath); if (inConstructor && superCalls.length > 0) { if (!allowInsertArrow) { throw superCalls[0].buildCodeFrameError("When using '@babel/plugin-transform-arrow-functions', " + "it's not possible to compile `super()` in an arrow function without compiling classes.\n" + "Please add '@babel/plugin-transform-classes' to your Babel configuration."); } if (!allowInsertArrowWithRest) { throw superCalls[0].buildCodeFrameError("When using '@babel/plugin-transform-parameters', " + "it's not possible to compile `super()` in an arrow function with default or rest parameters without compiling classes.\n" + "Please add '@babel/plugin-transform-classes' to your Babel configuration."); } const allSuperCalls = []; thisEnvFn.traverse(getSuperCallsVisitor, { allSuperCalls }); const superBinding = getSuperBinding(thisEnvFn); allSuperCalls.forEach(superCall => { const callee = identifier(superBinding); callee.loc = superCall.node.callee.loc; superCall.get("callee").replaceWith(callee); }); } if (argumentsPaths.length > 0) { const argumentsBinding = getBinding(thisEnvFn, "arguments", () => { const args = () => identifier("arguments"); if (thisEnvFn.scope.path.isProgram()) { return conditionalExpression(binaryExpression("===", unaryExpression("typeof", args()), stringLiteral("undefined")), thisEnvFn.scope.buildUndefinedNode(), args()); } else { return args(); } }); argumentsPaths.forEach(argumentsChild => { const argsRef = identifier(argumentsBinding); argsRef.loc = argumentsChild.node.loc; argumentsChild.replaceWith(argsRef); }); } if (newTargetPaths.length > 0) { const newTargetBinding = getBinding(thisEnvFn, "newtarget", () => metaProperty(identifier("new"), identifier("target"))); newTargetPaths.forEach(targetChild => { const targetRef = identifier(newTargetBinding); targetRef.loc = targetChild.node.loc; targetChild.replaceWith(targetRef); }); } if (superProps.length > 0) { if (!allowInsertArrow) { throw superProps[0].buildCodeFrameError("When using '@babel/plugin-transform-arrow-functions', " + "it's not possible to compile `super.prop` in an arrow function without compiling classes.\n" + "Please add '@babel/plugin-transform-classes' to your Babel configuration."); } const flatSuperProps = superProps.reduce((acc, superProp) => acc.concat(standardizeSuperProperty(superProp)), []); flatSuperProps.forEach(superProp => { const key = superProp.node.computed ? "" : superProp.get("property").node.name; const superParentPath = superProp.parentPath; const isAssignment = superParentPath.isAssignmentExpression({ left: superProp.node }); const isCall = superParentPath.isCallExpression({ callee: superProp.node }); const isTaggedTemplate = superParentPath.isTaggedTemplateExpression({ tag: superProp.node }); const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key); const args = []; if (superProp.node.computed) { args.push(superProp.get("property").node); } if (isAssignment) { const value = superParentPath.node.right; args.push(value); } const call = callExpression(identifier(superBinding), args); if (isCall) { superParentPath.unshiftContainer("arguments", thisExpression()); superProp.replaceWith(memberExpression(call, identifier("call"))); thisPaths.push(superParentPath.get("arguments.0")); } else if (isAssignment) { superParentPath.replaceWith(call); } else if (isTaggedTemplate) { superProp.replaceWith(callExpression(memberExpression(call, identifier("bind"), false), [thisExpression()])); thisPaths.push(superProp.get("arguments.0")); } else { superProp.replaceWith(call); } }); } let thisBinding; if (thisPaths.length > 0 || !noNewArrows) { thisBinding = getThisBinding(thisEnvFn, inConstructor); if (noNewArrows || inConstructor && hasSuperClass(thisEnvFn)) { thisPaths.forEach(thisChild => { const thisRef = thisChild.isJSX() ? jsxIdentifier(thisBinding) : identifier(thisBinding); thisRef.loc = thisChild.node.loc; thisChild.replaceWith(thisRef); }); if (!noNewArrows) thisBinding = null; } } return { thisBinding, fnPath }; } function isLogicalOp(op) { return LOGICAL_OPERATORS.includes(op); } function standardizeSuperProperty(superProp) { if (superProp.parentPath.isAssignmentExpression() && superProp.parentPath.node.operator !== "=") { const assignmentPath = superProp.parentPath; const op = assignmentPath.node.operator.slice(0, -1); const value = assignmentPath.node.right; const isLogicalAssignment = isLogicalOp(op); if (superProp.node.computed) { const tmp = superProp.scope.generateDeclaredUidIdentifier("tmp"); const object = superProp.node.object; const property = superProp.node.property; assignmentPath.get("left").replaceWith(memberExpression(object, assignmentExpression("=", tmp, property), true)); assignmentPath.get("right").replaceWith(rightExpression(isLogicalAssignment ? "=" : op, memberExpression(object, identifier(tmp.name), true), value)); } else { const object = superProp.node.object; const property = superProp.node.property; assignmentPath.get("left").replaceWith(memberExpression(object, property)); assignmentPath.get("right").replaceWith(rightExpression(isLogicalAssignment ? "=" : op, memberExpression(object, identifier(property.name)), value)); } if (isLogicalAssignment) { assignmentPath.replaceWith(logicalExpression(op, assignmentPath.node.left, assignmentPath.node.right)); } else { assignmentPath.node.operator = "="; } return [assignmentPath.get("left"), assignmentPath.get("right").get("left")]; } else if (superProp.parentPath.isUpdateExpression()) { const updateExpr = superProp.parentPath; const tmp = superProp.scope.generateDeclaredUidIdentifier("tmp"); const computedKey = superProp.node.computed ? superProp.scope.generateDeclaredUidIdentifier("prop") : null; const parts = [assignmentExpression("=", tmp, memberExpression(superProp.node.object, computedKey ? assignmentExpression("=", computedKey, superProp.node.property) : superProp.node.property, superProp.node.computed)), assignmentExpression("=", memberExpression(superProp.node.object, computedKey ? identifier(computedKey.name) : superProp.node.property, superProp.node.computed), binaryExpression(superProp.parentPath.node.operator[0], identifier(tmp.name), numericLiteral(1)))]; if (!superProp.parentPath.node.prefix) { parts.push(identifier(tmp.name)); } updateExpr.replaceWith(sequenceExpression(parts)); const left = updateExpr.get("expressions.0.right"); const right = updateExpr.get("expressions.1.left"); return [left, right]; } return [superProp]; function rightExpression(op, left, right) { if (op === "=") { return assignmentExpression("=", left, right); } else { return binaryExpression(op, left, right); } } } function hasSuperClass(thisEnvFn) { return thisEnvFn.isClassMethod() && !!thisEnvFn.parentPath.parentPath.node.superClass; } const assignSuperThisVisitor = (0, _visitors.environmentVisitor)({ CallExpression(child, { supers, thisBinding }) { if (!child.get("callee").isSuper()) return; if (supers.has(child.node)) return; supers.add(child.node); child.replaceWithMultiple([child.node, assignmentExpression("=", identifier(thisBinding), identifier("this"))]); } }); function getThisBinding(thisEnvFn, inConstructor) { return getBinding(thisEnvFn, "this", thisBinding => { if (!inConstructor || !hasSuperClass(thisEnvFn)) return thisExpression(); thisEnvFn.traverse(assignSuperThisVisitor, { supers: new WeakSet(), thisBinding }); }); } function getSuperBinding(thisEnvFn) { return getBinding(thisEnvFn, "supercall", () => { const argsBinding = thisEnvFn.scope.generateUidIdentifier("args"); return arrowFunctionExpression([restElement(argsBinding)], callExpression(_super(), [spreadElement(identifier(argsBinding.name))])); }); } function getSuperPropBinding(thisEnvFn, isAssignment, propName) { const op = isAssignment ? "set" : "get"; return getBinding(thisEnvFn, `superprop_${op}:${propName || ""}`, () => { const argsList = []; let fnBody; if (propName) { fnBody = memberExpression(_super(), identifier(propName)); } else { const method = thisEnvFn.scope.generateUidIdentifier("prop"); argsList.unshift(method); fnBody = memberExpression(_super(), identifier(method.name), true); } if (isAssignment) { const valueIdent = thisEnvFn.scope.generateUidIdentifier("value"); argsList.push(valueIdent); fnBody = assignmentExpression("=", fnBody, identifier(valueIdent.name)); } return arrowFunctionExpression(argsList, fnBody); }); } function getBinding(thisEnvFn, key, init) { const cacheKey = "binding:" + key; let data = thisEnvFn.getData(cacheKey); if (!data) { const id = thisEnvFn.scope.generateUidIdentifier(key); data = id.name; thisEnvFn.setData(cacheKey, data); thisEnvFn.scope.push({ id: id, init: init(data) }); } return data; } const getScopeInformationVisitor = (0, _visitors.environmentVisitor)({ ThisExpression(child, { thisPaths }) { thisPaths.push(child); }, JSXIdentifier(child, { thisPaths }) { if (child.node.name !== "this") return; if (!child.parentPath.isJSXMemberExpression({ object: child.node }) && !child.parentPath.isJSXOpeningElement({ name: child.node })) { return; } thisPaths.push(child); }, CallExpression(child, { superCalls }) { if (child.get("callee").isSuper()) superCalls.push(child); }, MemberExpression(child, { superProps }) { if (child.get("object").isSuper()) superProps.push(child); }, Identifier(child, { argumentsPaths }) { if (!child.isReferencedIdentifier({ name: "arguments" })) return; let curr = child.scope; do { if (curr.hasOwnBinding("arguments")) { curr.rename("arguments"); return; } if (curr.path.isFunction() && !curr.path.isArrowFunctionExpression()) { break; } } while (curr = curr.parent); argumentsPaths.push(child); }, MetaProperty(child, { newTargetPaths }) { if (!child.get("meta").isIdentifier({ name: "new" })) return; if (!child.get("property").isIdentifier({ name: "target" })) return; newTargetPaths.push(child); } }); function getScopeInformation(fnPath) { const thisPaths = []; const argumentsPaths = []; const newTargetPaths = []; const superProps = []; const superCalls = []; fnPath.traverse(getScopeInformationVisitor, { thisPaths, argumentsPaths, newTargetPaths, superProps, superCalls }); return { thisPaths, argumentsPaths, newTargetPaths, superProps, superCalls }; } function splitExportDeclaration() { if (!this.isExportDeclaration() || this.isExportAllDeclaration()) { throw new Error("Only default and named export declarations can be split."); } if (this.isExportNamedDeclaration() && this.get("specifiers").length > 0) { throw new Error("It doesn't make sense to split exported specifiers."); } const declaration = this.get("declaration"); if (this.isExportDefaultDeclaration()) { const standaloneDeclaration = declaration.isFunctionDeclaration() || declaration.isClassDeclaration(); const exportExpr = declaration.isFunctionExpression() || declaration.isClassExpression(); const scope = declaration.isScope() ? declaration.scope.parent : declaration.scope; let id = declaration.node.id; let needBindingRegistration = false; if (!id) { needBindingRegistration = true; id = scope.generateUidIdentifier("default"); if (standaloneDeclaration || exportExpr) { declaration.node.id = cloneNode(id); } } else if (exportExpr && scope.hasBinding(id.name)) { needBindingRegistration = true; id = scope.generateUidIdentifier(id.name); } const updatedDeclaration = standaloneDeclaration ? declaration.node : variableDeclaration("var", [variableDeclarator(cloneNode(id), declaration.node)]); const updatedExportDeclaration = exportNamedDeclaration(null, [exportSpecifier(cloneNode(id), identifier("default"))]); this.insertAfter(updatedExportDeclaration); this.replaceWith(updatedDeclaration); if (needBindingRegistration) { scope.registerDeclaration(this); } return this; } else if (this.get("specifiers").length > 0) { throw new Error("It doesn't make sense to split exported specifiers."); } const bindingIdentifiers = declaration.getOuterBindingIdentifiers(); const specifiers = Object.keys(bindingIdentifiers).map(name => { return exportSpecifier(identifier(name), identifier(name)); }); const aliasDeclar = exportNamedDeclaration(null, specifiers); this.insertAfter(aliasDeclar); this.replaceWith(declaration.node); return this; } const refersOuterBindingVisitor = { "ReferencedIdentifier|BindingIdentifier"(path, state) { if (path.node.name !== state.name) return; state.needsRename = true; path.stop(); }, Scope(path, state) { if (path.scope.hasOwnBinding(state.name)) { path.skip(); } } }; function ensureFunctionName(supportUnicodeId) { if (this.node.id) return this; const res = getFunctionName(this.node, this.parent); if (res == null) return this; let { name } = res; if (!supportUnicodeId && /[\uD800-\uDFFF]/.test(name)) { return null; } if (name.startsWith("get ") || name.startsWith("set ")) { return null; } name = toBindingIdentifierName(name.replace(/[/ ]/g, "_")); const id = identifier(name); inherits(id, res.originalNode); const state = { needsRename: false, name }; const { scope } = this; const binding = scope.getOwnBinding(name); if (binding) { if (binding.kind === "param") { state.needsRename = true; } else {} } else if (scope.parent.hasBinding(name) || scope.hasGlobal(name)) { this.traverse(refersOuterBindingVisitor, state); } if (!state.needsRename) { this.node.id = id; { scope.getProgramParent().references[id.name] = true; } return this; } if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) { scope.rename(id.name); this.node.id = id; { scope.getProgramParent().references[id.name] = true; } return this; } if (!isFunction(this.node)) return null; const key = scope.generateUidIdentifier(id.name); const params = []; for (let i = 0, len = getFunctionArity(this.node); i < len; i++) { params.push(scope.generateUidIdentifier("x")); } const call = _template.default.expression.ast` (function (${key}) { function ${id}(${params}) { return ${cloneNode(key)}.apply(this, arguments); } ${cloneNode(id)}.toString = function () { return ${cloneNode(key)}.toString(); } return ${cloneNode(id)}; })(${toExpression(this.node)}) `; return this.replaceWith(call)[0].get("arguments.0"); } function getFunctionArity(node) { const count = node.params.findIndex(param => isAssignmentPattern(param) || isRestElement(param)); return count === -1 ? node.params.length : count; } //# sourceMappingURL=conversion.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/evaluation.js": /*!*************************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/evaluation.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.evaluate = evaluate; exports.evaluateTruthy = evaluateTruthy; const VALID_OBJECT_CALLEES = ["Number", "String", "Math"]; const VALID_IDENTIFIER_CALLEES = ["isFinite", "isNaN", "parseFloat", "parseInt", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", null, null]; const INVALID_METHODS = ["random"]; function isValidObjectCallee(val) { return VALID_OBJECT_CALLEES.includes(val); } function isValidIdentifierCallee(val) { return VALID_IDENTIFIER_CALLEES.includes(val); } function isInvalidMethod(val) { return INVALID_METHODS.includes(val); } function evaluateTruthy() { const res = this.evaluate(); if (res.confident) return !!res.value; } function deopt(path, state) { if (!state.confident) return; state.deoptPath = path; state.confident = false; } const Globals = new Map([["undefined", undefined], ["Infinity", Infinity], ["NaN", NaN]]); function evaluateCached(path, state) { const { node } = path; const { seen } = state; if (seen.has(node)) { const existing = seen.get(node); if (existing.resolved) { return existing.value; } else { deopt(path, state); return; } } else { const item = { resolved: false }; seen.set(node, item); const val = _evaluate(path, state); if (state.confident) { item.resolved = true; item.value = val; } return val; } } function _evaluate(path, state) { if (!state.confident) return; if (path.isSequenceExpression()) { const exprs = path.get("expressions"); return evaluateCached(exprs[exprs.length - 1], state); } if (path.isStringLiteral() || path.isNumericLiteral() || path.isBooleanLiteral()) { return path.node.value; } if (path.isNullLiteral()) { return null; } if (path.isTemplateLiteral()) { return evaluateQuasis(path, path.node.quasis, state); } if (path.isTaggedTemplateExpression() && path.get("tag").isMemberExpression()) { const object = path.get("tag.object"); const { node: { name } } = object; const property = path.get("tag.property"); if (object.isIdentifier() && name === "String" && !path.scope.getBinding(name) && property.isIdentifier() && property.node.name === "raw") { return evaluateQuasis(path, path.node.quasi.quasis, state, true); } } if (path.isConditionalExpression()) { const testResult = evaluateCached(path.get("test"), state); if (!state.confident) return; if (testResult) { return evaluateCached(path.get("consequent"), state); } else { return evaluateCached(path.get("alternate"), state); } } if (path.isExpressionWrapper()) { return evaluateCached(path.get("expression"), state); } if (path.isMemberExpression() && !path.parentPath.isCallExpression({ callee: path.node })) { const property = path.get("property"); const object = path.get("object"); if (object.isLiteral()) { const value = object.node.value; const type = typeof value; let key = null; if (path.node.computed) { key = evaluateCached(property, state); if (!state.confident) return; } else if (property.isIdentifier()) { key = property.node.name; } if ((type === "number" || type === "string") && key != null && (typeof key === "number" || typeof key === "string")) { return value[key]; } } } if (path.isReferencedIdentifier()) { const binding = path.scope.getBinding(path.node.name); if (binding) { if (binding.constantViolations.length > 0 || path.node.start < binding.path.node.end) { deopt(binding.path, state); return; } const bindingPathScope = binding.path.scope; if (binding.kind === "var" && bindingPathScope !== binding.scope) { let hasUnsafeBlock = !bindingPathScope.path.parentPath.isBlockStatement(); for (let scope = bindingPathScope.parent; scope; scope = scope.parent) { var _scope$path$parentPat; if (scope === path.scope) { if (hasUnsafeBlock) { deopt(binding.path, state); return; } break; } if ((_scope$path$parentPat = scope.path.parentPath) != null && _scope$path$parentPat.isBlockStatement()) { hasUnsafeBlock = true; } } } if (binding.hasValue) { return binding.value; } } const name = path.node.name; if (Globals.has(name)) { if (!binding) { return Globals.get(name); } deopt(binding.path, state); return; } const resolved = path.resolve(); if (resolved === path) { deopt(path, state); return; } const value = evaluateCached(resolved, state); if (typeof value === "object" && value !== null && binding.references > 1) { deopt(resolved, state); return; } return value; } if (path.isUnaryExpression({ prefix: true })) { if (path.node.operator === "void") { return undefined; } const argument = path.get("argument"); if (path.node.operator === "typeof" && (argument.isFunction() || argument.isClass())) { return "function"; } const arg = evaluateCached(argument, state); if (!state.confident) return; switch (path.node.operator) { case "!": return !arg; case "+": return +arg; case "-": return -arg; case "~": return ~arg; case "typeof": return typeof arg; } } if (path.isArrayExpression()) { const arr = []; const elems = path.get("elements"); for (const elem of elems) { const elemValue = elem.evaluate(); if (elemValue.confident) { arr.push(elemValue.value); } else { deopt(elemValue.deopt, state); return; } } return arr; } if (path.isObjectExpression()) { const obj = {}; const props = path.get("properties"); for (const prop of props) { if (prop.isObjectMethod() || prop.isSpreadElement()) { deopt(prop, state); return; } const keyPath = prop.get("key"); let key; if (prop.node.computed) { key = keyPath.evaluate(); if (!key.confident) { deopt(key.deopt, state); return; } key = key.value; } else if (keyPath.isIdentifier()) { key = keyPath.node.name; } else { key = keyPath.node.value; } const valuePath = prop.get("value"); let value = valuePath.evaluate(); if (!value.confident) { deopt(value.deopt, state); return; } value = value.value; obj[key] = value; } return obj; } if (path.isLogicalExpression()) { const wasConfident = state.confident; const left = evaluateCached(path.get("left"), state); const leftConfident = state.confident; state.confident = wasConfident; const right = evaluateCached(path.get("right"), state); const rightConfident = state.confident; switch (path.node.operator) { case "||": state.confident = leftConfident && (!!left || rightConfident); if (!state.confident) return; return left || right; case "&&": state.confident = leftConfident && (!left || rightConfident); if (!state.confident) return; return left && right; case "??": state.confident = leftConfident && (left != null || rightConfident); if (!state.confident) return; return left != null ? left : right; } } if (path.isBinaryExpression()) { const left = evaluateCached(path.get("left"), state); if (!state.confident) return; const right = evaluateCached(path.get("right"), state); if (!state.confident) return; switch (path.node.operator) { case "-": return left - right; case "+": return left + right; case "/": return left / right; case "*": return left * right; case "%": return left % right; case "**": return Math.pow(left, right); case "<": return left < right; case ">": return left > right; case "<=": return left <= right; case ">=": return left >= right; case "==": return left == right; case "!=": return left != right; case "===": return left === right; case "!==": return left !== right; case "|": return left | right; case "&": return left & right; case "^": return left ^ right; case "<<": return left << right; case ">>": return left >> right; case ">>>": return left >>> right; } } if (path.isCallExpression()) { const callee = path.get("callee"); let context; let func; if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name) && (isValidObjectCallee(callee.node.name) || isValidIdentifierCallee(callee.node.name))) { func = __webpack_require__.g[callee.node.name]; } if (callee.isMemberExpression()) { const object = callee.get("object"); const property = callee.get("property"); if (object.isIdentifier() && property.isIdentifier() && isValidObjectCallee(object.node.name) && !isInvalidMethod(property.node.name)) { context = __webpack_require__.g[object.node.name]; const key = property.node.name; if (hasOwnProperty.call(context, key)) { func = context[key]; } } if (object.isLiteral() && property.isIdentifier()) { const type = typeof object.node.value; if (type === "string" || type === "number") { context = object.node.value; func = context[property.node.name]; } } } if (func) { const args = path.get("arguments").map(arg => evaluateCached(arg, state)); if (!state.confident) return; return func.apply(context, args); } } deopt(path, state); } function evaluateQuasis(path, quasis, state, raw = false) { let str = ""; let i = 0; const exprs = path.isTemplateLiteral() ? path.get("expressions") : path.get("quasi.expressions"); for (const elem of quasis) { if (!state.confident) break; str += raw ? elem.value.raw : elem.value.cooked; const expr = exprs[i++]; if (expr) str += String(evaluateCached(expr, state)); } if (!state.confident) return; return str; } function evaluate() { const state = { confident: true, deoptPath: null, seen: new Map() }; let value = evaluateCached(this, state); if (!state.confident) value = undefined; return { confident: state.confident, deopt: state.deoptPath, value: value }; } //# sourceMappingURL=evaluation.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/family.js": /*!*********************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/family.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports._getKey = _getKey; exports._getPattern = _getPattern; exports.get = get; exports.getAllNextSiblings = getAllNextSiblings; exports.getAllPrevSiblings = getAllPrevSiblings; exports.getAssignmentIdentifiers = getAssignmentIdentifiers; exports.getBindingIdentifierPaths = getBindingIdentifierPaths; exports.getBindingIdentifiers = getBindingIdentifiers; exports.getCompletionRecords = getCompletionRecords; exports.getNextSibling = getNextSibling; exports.getOpposite = getOpposite; exports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths; exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers; exports.getPrevSibling = getPrevSibling; exports.getSibling = getSibling; var _index = __webpack_require__(/*! ./index.js */ "./node_modules/@babel/traverse/lib/path/index.js"); var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { getAssignmentIdentifiers: _getAssignmentIdentifiers, getBindingIdentifiers: _getBindingIdentifiers, getOuterBindingIdentifiers: _getOuterBindingIdentifiers, numericLiteral, unaryExpression } = _t; const NORMAL_COMPLETION = 0; const BREAK_COMPLETION = 1; function NormalCompletion(path) { return { type: NORMAL_COMPLETION, path }; } function BreakCompletion(path) { return { type: BREAK_COMPLETION, path }; } function getOpposite() { if (this.key === "left") { return this.getSibling("right"); } else if (this.key === "right") { return this.getSibling("left"); } return null; } function addCompletionRecords(path, records, context) { if (path) { records.push(..._getCompletionRecords(path, context)); } return records; } function completionRecordForSwitch(cases, records, context) { let lastNormalCompletions = []; for (let i = 0; i < cases.length; i++) { const casePath = cases[i]; const caseCompletions = _getCompletionRecords(casePath, context); const normalCompletions = []; const breakCompletions = []; for (const c of caseCompletions) { if (c.type === NORMAL_COMPLETION) { normalCompletions.push(c); } if (c.type === BREAK_COMPLETION) { breakCompletions.push(c); } } if (normalCompletions.length) { lastNormalCompletions = normalCompletions; } records.push(...breakCompletions); } records.push(...lastNormalCompletions); return records; } function normalCompletionToBreak(completions) { completions.forEach(c => { c.type = BREAK_COMPLETION; }); } function replaceBreakStatementInBreakCompletion(completions, reachable) { completions.forEach(c => { if (c.path.isBreakStatement({ label: null })) { if (reachable) { c.path.replaceWith(unaryExpression("void", numericLiteral(0))); } else { c.path.remove(); } } }); } function getStatementListCompletion(paths, context) { const completions = []; if (context.canHaveBreak) { let lastNormalCompletions = []; for (let i = 0; i < paths.length; i++) { const path = paths[i]; const newContext = Object.assign({}, context, { inCaseClause: false }); if (path.isBlockStatement() && (context.inCaseClause || context.shouldPopulateBreak)) { newContext.shouldPopulateBreak = true; } else { newContext.shouldPopulateBreak = false; } const statementCompletions = _getCompletionRecords(path, newContext); if (statementCompletions.length > 0 && statementCompletions.every(c => c.type === BREAK_COMPLETION)) { if (lastNormalCompletions.length > 0 && statementCompletions.every(c => c.path.isBreakStatement({ label: null }))) { normalCompletionToBreak(lastNormalCompletions); completions.push(...lastNormalCompletions); if (lastNormalCompletions.some(c => c.path.isDeclaration())) { completions.push(...statementCompletions); if (!context.shouldPreserveBreak) { replaceBreakStatementInBreakCompletion(statementCompletions, true); } } if (!context.shouldPreserveBreak) { replaceBreakStatementInBreakCompletion(statementCompletions, false); } } else { completions.push(...statementCompletions); if (!context.shouldPopulateBreak && !context.shouldPreserveBreak) { replaceBreakStatementInBreakCompletion(statementCompletions, true); } } break; } if (i === paths.length - 1) { completions.push(...statementCompletions); } else { lastNormalCompletions = []; for (let i = 0; i < statementCompletions.length; i++) { const c = statementCompletions[i]; if (c.type === BREAK_COMPLETION) { completions.push(c); } if (c.type === NORMAL_COMPLETION) { lastNormalCompletions.push(c); } } } } } else if (paths.length) { for (let i = paths.length - 1; i >= 0; i--) { const pathCompletions = _getCompletionRecords(paths[i], context); if (pathCompletions.length > 1 || pathCompletions.length === 1 && !pathCompletions[0].path.isVariableDeclaration() && !pathCompletions[0].path.isEmptyStatement()) { completions.push(...pathCompletions); break; } } } return completions; } function _getCompletionRecords(path, context) { let records = []; if (path.isIfStatement()) { records = addCompletionRecords(path.get("consequent"), records, context); records = addCompletionRecords(path.get("alternate"), records, context); } else if (path.isDoExpression() || path.isFor() || path.isWhile() || path.isLabeledStatement()) { return addCompletionRecords(path.get("body"), records, context); } else if (path.isProgram() || path.isBlockStatement()) { return getStatementListCompletion(path.get("body"), context); } else if (path.isFunction()) { return _getCompletionRecords(path.get("body"), context); } else if (path.isTryStatement()) { records = addCompletionRecords(path.get("block"), records, context); records = addCompletionRecords(path.get("handler"), records, context); } else if (path.isCatchClause()) { return addCompletionRecords(path.get("body"), records, context); } else if (path.isSwitchStatement()) { return completionRecordForSwitch(path.get("cases"), records, context); } else if (path.isSwitchCase()) { return getStatementListCompletion(path.get("consequent"), { canHaveBreak: true, shouldPopulateBreak: false, inCaseClause: true, shouldPreserveBreak: context.shouldPreserveBreak }); } else if (path.isBreakStatement()) { records.push(BreakCompletion(path)); } else { records.push(NormalCompletion(path)); } return records; } function getCompletionRecords(shouldPreserveBreak = false) { const records = _getCompletionRecords(this, { canHaveBreak: false, shouldPopulateBreak: false, inCaseClause: false, shouldPreserveBreak }); return records.map(r => r.path); } function getSibling(key) { return _index.default.get({ parentPath: this.parentPath, parent: this.parent, container: this.container, listKey: this.listKey, key: key }).setContext(this.context); } function getPrevSibling() { return this.getSibling(this.key - 1); } function getNextSibling() { return this.getSibling(this.key + 1); } function getAllNextSiblings() { let _key = this.key; let sibling = this.getSibling(++_key); const siblings = []; while (sibling.node) { siblings.push(sibling); sibling = this.getSibling(++_key); } return siblings; } function getAllPrevSiblings() { let _key = this.key; let sibling = this.getSibling(--_key); const siblings = []; while (sibling.node) { siblings.push(sibling); sibling = this.getSibling(--_key); } return siblings; } function get(key, context = true) { if (context === true) context = this.context; const parts = key.split("."); if (parts.length === 1) { return _getKey.call(this, key, context); } else { return _getPattern.call(this, parts, context); } } function _getKey(key, context) { const node = this.node; const container = node[key]; if (Array.isArray(container)) { return container.map((_, i) => { return _index.default.get({ listKey: key, parentPath: this, parent: node, container: container, key: i }).setContext(context); }); } else { return _index.default.get({ parentPath: this, parent: node, container: node, key: key }).setContext(context); } } function _getPattern(parts, context) { let path = this; for (const part of parts) { if (part === ".") { path = path.parentPath; } else { if (Array.isArray(path)) { path = path[part]; } else { path = path.get(part, context); } } } return path; } function getAssignmentIdentifiers() { return _getAssignmentIdentifiers(this.node); } function getBindingIdentifiers(duplicates) { return _getBindingIdentifiers(this.node, duplicates); } function getOuterBindingIdentifiers(duplicates) { return _getOuterBindingIdentifiers(this.node, duplicates); } function getBindingIdentifierPaths(duplicates = false, outerOnly = false) { const path = this; const search = [path]; const ids = Object.create(null); while (search.length) { const id = search.shift(); if (!id) continue; if (!id.node) continue; const keys = _getBindingIdentifiers.keys[id.node.type]; if (id.isIdentifier()) { if (duplicates) { const _ids = ids[id.node.name] = ids[id.node.name] || []; _ids.push(id); } else { ids[id.node.name] = id; } continue; } if (id.isExportDeclaration()) { const declaration = id.get("declaration"); if (declaration.isDeclaration()) { search.push(declaration); } continue; } if (outerOnly) { if (id.isFunctionDeclaration()) { search.push(id.get("id")); continue; } if (id.isFunctionExpression()) { continue; } } if (keys) { for (let i = 0; i < keys.length; i++) { const key = keys[i]; const child = id.get(key); if (Array.isArray(child)) { search.push(...child); } else if (child.node) { search.push(child); } } } } return ids; } function getOuterBindingIdentifierPaths(duplicates = false) { return this.getBindingIdentifierPaths(duplicates, true); } //# sourceMappingURL=family.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/index.js": /*!********************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/index.js ***! \********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = exports.SHOULD_STOP = exports.SHOULD_SKIP = exports.REMOVED = void 0; var virtualTypes = __webpack_require__(/*! ./lib/virtual-types.js */ "./node_modules/@babel/traverse/lib/path/lib/virtual-types.js"); var _debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js"); var _index = __webpack_require__(/*! ../index.js */ "./node_modules/@babel/traverse/lib/index.js"); var _index2 = __webpack_require__(/*! ../scope/index.js */ "./node_modules/@babel/traverse/lib/scope/index.js"); var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var t = _t; var cache = __webpack_require__(/*! ../cache.js */ "./node_modules/@babel/traverse/lib/cache.js"); var _generator = __webpack_require__(/*! @babel/generator */ "./node_modules/@babel/generator/lib/index.js"); var NodePath_ancestry = __webpack_require__(/*! ./ancestry.js */ "./node_modules/@babel/traverse/lib/path/ancestry.js"); var NodePath_inference = __webpack_require__(/*! ./inference/index.js */ "./node_modules/@babel/traverse/lib/path/inference/index.js"); var NodePath_replacement = __webpack_require__(/*! ./replacement.js */ "./node_modules/@babel/traverse/lib/path/replacement.js"); var NodePath_evaluation = __webpack_require__(/*! ./evaluation.js */ "./node_modules/@babel/traverse/lib/path/evaluation.js"); var NodePath_conversion = __webpack_require__(/*! ./conversion.js */ "./node_modules/@babel/traverse/lib/path/conversion.js"); var NodePath_introspection = __webpack_require__(/*! ./introspection.js */ "./node_modules/@babel/traverse/lib/path/introspection.js"); var _context = __webpack_require__(/*! ./context.js */ "./node_modules/@babel/traverse/lib/path/context.js"); var NodePath_context = _context; var NodePath_removal = __webpack_require__(/*! ./removal.js */ "./node_modules/@babel/traverse/lib/path/removal.js"); var NodePath_modification = __webpack_require__(/*! ./modification.js */ "./node_modules/@babel/traverse/lib/path/modification.js"); var NodePath_family = __webpack_require__(/*! ./family.js */ "./node_modules/@babel/traverse/lib/path/family.js"); var NodePath_comments = __webpack_require__(/*! ./comments.js */ "./node_modules/@babel/traverse/lib/path/comments.js"); var NodePath_virtual_types_validator = __webpack_require__(/*! ./lib/virtual-types-validator.js */ "./node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js"); const { validate } = _t; const debug = _debug("babel"); const REMOVED = exports.REMOVED = 1 << 0; const SHOULD_STOP = exports.SHOULD_STOP = 1 << 1; const SHOULD_SKIP = exports.SHOULD_SKIP = 1 << 2; const NodePath_Final = exports["default"] = class NodePath { constructor(hub, parent) { this.contexts = []; this.state = null; this.opts = null; this._traverseFlags = 0; this.skipKeys = null; this.parentPath = null; this.container = null; this.listKey = null; this.key = null; this.node = null; this.type = null; this._store = null; this.parent = parent; this.hub = hub; this.data = null; this.context = null; this.scope = null; } get removed() { return (this._traverseFlags & 1) > 0; } set removed(v) { if (v) this._traverseFlags |= 1;else this._traverseFlags &= -2; } get shouldStop() { return (this._traverseFlags & 2) > 0; } set shouldStop(v) { if (v) this._traverseFlags |= 2;else this._traverseFlags &= -3; } get shouldSkip() { return (this._traverseFlags & 4) > 0; } set shouldSkip(v) { if (v) this._traverseFlags |= 4;else this._traverseFlags &= -5; } static get({ hub, parentPath, parent, container, listKey, key }) { if (!hub && parentPath) { hub = parentPath.hub; } if (!parent) { throw new Error("To get a node path the parent needs to exist"); } const targetNode = container[key]; const paths = cache.getOrCreateCachedPaths(parent, parentPath); let path = paths.get(targetNode); if (!path) { path = new NodePath(hub, parent); if (targetNode) paths.set(targetNode, path); } _context.setup.call(path, parentPath, container, listKey, key); return path; } getScope(scope) { return this.isScope() ? new _index2.default(this) : scope; } setData(key, val) { if (this.data == null) { this.data = Object.create(null); } return this.data[key] = val; } getData(key, def) { if (this.data == null) { this.data = Object.create(null); } let val = this.data[key]; if (val === undefined && def !== undefined) val = this.data[key] = def; return val; } hasNode() { return this.node != null; } buildCodeFrameError(msg, Error = SyntaxError) { return this.hub.buildError(this.node, msg, Error); } traverse(visitor, state) { (0, _index.default)(this.node, visitor, this.scope, state, this); } set(key, node) { validate(this.node, key, node); this.node[key] = node; } getPathLocation() { const parts = []; let path = this; do { let key = path.key; if (path.inList) key = `${path.listKey}[${key}]`; parts.unshift(key); } while (path = path.parentPath); return parts.join("."); } debug(message) { if (!debug.enabled) return; debug(`${this.getPathLocation()} ${this.type}: ${message}`); } toString() { return (0, _generator.default)(this.node).code; } get inList() { return !!this.listKey; } set inList(inList) { if (!inList) { this.listKey = null; } } get parentKey() { return this.listKey || this.key; } }; const methods = { findParent: NodePath_ancestry.findParent, find: NodePath_ancestry.find, getFunctionParent: NodePath_ancestry.getFunctionParent, getStatementParent: NodePath_ancestry.getStatementParent, getEarliestCommonAncestorFrom: NodePath_ancestry.getEarliestCommonAncestorFrom, getDeepestCommonAncestorFrom: NodePath_ancestry.getDeepestCommonAncestorFrom, getAncestry: NodePath_ancestry.getAncestry, isAncestor: NodePath_ancestry.isAncestor, isDescendant: NodePath_ancestry.isDescendant, inType: NodePath_ancestry.inType, getTypeAnnotation: NodePath_inference.getTypeAnnotation, isBaseType: NodePath_inference.isBaseType, couldBeBaseType: NodePath_inference.couldBeBaseType, baseTypeStrictlyMatches: NodePath_inference.baseTypeStrictlyMatches, isGenericType: NodePath_inference.isGenericType, replaceWithMultiple: NodePath_replacement.replaceWithMultiple, replaceWithSourceString: NodePath_replacement.replaceWithSourceString, replaceWith: NodePath_replacement.replaceWith, replaceExpressionWithStatements: NodePath_replacement.replaceExpressionWithStatements, replaceInline: NodePath_replacement.replaceInline, evaluateTruthy: NodePath_evaluation.evaluateTruthy, evaluate: NodePath_evaluation.evaluate, toComputedKey: NodePath_conversion.toComputedKey, ensureBlock: NodePath_conversion.ensureBlock, unwrapFunctionEnvironment: NodePath_conversion.unwrapFunctionEnvironment, arrowFunctionToExpression: NodePath_conversion.arrowFunctionToExpression, splitExportDeclaration: NodePath_conversion.splitExportDeclaration, ensureFunctionName: NodePath_conversion.ensureFunctionName, matchesPattern: NodePath_introspection.matchesPattern, isStatic: NodePath_introspection.isStatic, isNodeType: NodePath_introspection.isNodeType, canHaveVariableDeclarationOrExpression: NodePath_introspection.canHaveVariableDeclarationOrExpression, canSwapBetweenExpressionAndStatement: NodePath_introspection.canSwapBetweenExpressionAndStatement, isCompletionRecord: NodePath_introspection.isCompletionRecord, isStatementOrBlock: NodePath_introspection.isStatementOrBlock, referencesImport: NodePath_introspection.referencesImport, getSource: NodePath_introspection.getSource, willIMaybeExecuteBefore: NodePath_introspection.willIMaybeExecuteBefore, _guessExecutionStatusRelativeTo: NodePath_introspection._guessExecutionStatusRelativeTo, resolve: NodePath_introspection.resolve, isConstantExpression: NodePath_introspection.isConstantExpression, isInStrictMode: NodePath_introspection.isInStrictMode, isDenylisted: NodePath_context.isDenylisted, visit: NodePath_context.visit, skip: NodePath_context.skip, skipKey: NodePath_context.skipKey, stop: NodePath_context.stop, setContext: NodePath_context.setContext, requeue: NodePath_context.requeue, requeueComputedKeyAndDecorators: NodePath_context.requeueComputedKeyAndDecorators, remove: NodePath_removal.remove, insertBefore: NodePath_modification.insertBefore, insertAfter: NodePath_modification.insertAfter, unshiftContainer: NodePath_modification.unshiftContainer, pushContainer: NodePath_modification.pushContainer, getOpposite: NodePath_family.getOpposite, getCompletionRecords: NodePath_family.getCompletionRecords, getSibling: NodePath_family.getSibling, getPrevSibling: NodePath_family.getPrevSibling, getNextSibling: NodePath_family.getNextSibling, getAllNextSiblings: NodePath_family.getAllNextSiblings, getAllPrevSiblings: NodePath_family.getAllPrevSiblings, get: NodePath_family.get, getAssignmentIdentifiers: NodePath_family.getAssignmentIdentifiers, getBindingIdentifiers: NodePath_family.getBindingIdentifiers, getOuterBindingIdentifiers: NodePath_family.getOuterBindingIdentifiers, getBindingIdentifierPaths: NodePath_family.getBindingIdentifierPaths, getOuterBindingIdentifierPaths: NodePath_family.getOuterBindingIdentifierPaths, shareCommentsWithSiblings: NodePath_comments.shareCommentsWithSiblings, addComment: NodePath_comments.addComment, addComments: NodePath_comments.addComments }; Object.assign(NodePath_Final.prototype, methods); { NodePath_Final.prototype.arrowFunctionToShadowed = NodePath_conversion[String("arrowFunctionToShadowed")]; Object.assign(NodePath_Final.prototype, { has: NodePath_introspection[String("has")], is: NodePath_introspection[String("is")], isnt: NodePath_introspection[String("isnt")], equals: NodePath_introspection[String("equals")], hoist: NodePath_modification[String("hoist")], updateSiblingKeys: NodePath_modification.updateSiblingKeys, call: NodePath_context.call, isBlacklisted: NodePath_context[String("isBlacklisted")], setScope: NodePath_context.setScope, resync: NodePath_context.resync, popContext: NodePath_context.popContext, pushContext: NodePath_context.pushContext, setup: NodePath_context.setup, setKey: NodePath_context.setKey }); } { NodePath_Final.prototype._guessExecutionStatusRelativeToDifferentFunctions = NodePath_introspection._guessExecutionStatusRelativeTo; NodePath_Final.prototype._guessExecutionStatusRelativeToDifferentFunctions = NodePath_introspection._guessExecutionStatusRelativeTo; Object.assign(NodePath_Final.prototype, { _getTypeAnnotation: NodePath_inference._getTypeAnnotation, _replaceWith: NodePath_replacement._replaceWith, _resolve: NodePath_introspection._resolve, _call: NodePath_context._call, _resyncParent: NodePath_context._resyncParent, _resyncKey: NodePath_context._resyncKey, _resyncList: NodePath_context._resyncList, _resyncRemoved: NodePath_context._resyncRemoved, _getQueueContexts: NodePath_context._getQueueContexts, _removeFromScope: NodePath_removal._removeFromScope, _callRemovalHooks: NodePath_removal._callRemovalHooks, _remove: NodePath_removal._remove, _markRemoved: NodePath_removal._markRemoved, _assertUnremoved: NodePath_removal._assertUnremoved, _containerInsert: NodePath_modification._containerInsert, _containerInsertBefore: NodePath_modification._containerInsertBefore, _containerInsertAfter: NodePath_modification._containerInsertAfter, _verifyNodeList: NodePath_modification._verifyNodeList, _getKey: NodePath_family._getKey, _getPattern: NodePath_family._getPattern }); } for (const type of t.TYPES) { const typeKey = `is${type}`; const fn = t[typeKey]; NodePath_Final.prototype[typeKey] = function (opts) { return fn(this.node, opts); }; NodePath_Final.prototype[`assert${type}`] = function (opts) { if (!fn(this.node, opts)) { throw new TypeError(`Expected node path of type ${type}`); } }; } Object.assign(NodePath_Final.prototype, NodePath_virtual_types_validator); for (const type of Object.keys(virtualTypes)) { if (type[0] === "_") continue; if (!t.TYPES.includes(type)) t.TYPES.push(type); } //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/inference/index.js": /*!******************************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/inference/index.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports._getTypeAnnotation = _getTypeAnnotation; exports.baseTypeStrictlyMatches = baseTypeStrictlyMatches; exports.couldBeBaseType = couldBeBaseType; exports.getTypeAnnotation = getTypeAnnotation; exports.isBaseType = isBaseType; exports.isGenericType = isGenericType; var inferers = __webpack_require__(/*! ./inferers.js */ "./node_modules/@babel/traverse/lib/path/inference/inferers.js"); var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { anyTypeAnnotation, isAnyTypeAnnotation, isArrayTypeAnnotation, isBooleanTypeAnnotation, isEmptyTypeAnnotation, isFlowBaseAnnotation, isGenericTypeAnnotation, isIdentifier, isMixedTypeAnnotation, isNumberTypeAnnotation, isStringTypeAnnotation, isTSArrayType, isTSTypeAnnotation, isTSTypeReference, isTupleTypeAnnotation, isTypeAnnotation, isUnionTypeAnnotation, isVoidTypeAnnotation, stringTypeAnnotation, voidTypeAnnotation } = _t; function getTypeAnnotation() { let type = this.getData("typeAnnotation"); if (type != null) { return type; } type = _getTypeAnnotation.call(this) || anyTypeAnnotation(); if (isTypeAnnotation(type) || isTSTypeAnnotation(type)) { type = type.typeAnnotation; } this.setData("typeAnnotation", type); return type; } const typeAnnotationInferringNodes = new WeakSet(); function _getTypeAnnotation() { const node = this.node; if (!node) { if (this.key === "init" && this.parentPath.isVariableDeclarator()) { const declar = this.parentPath.parentPath; const declarParent = declar.parentPath; if (declar.key === "left" && declarParent.isForInStatement()) { return stringTypeAnnotation(); } if (declar.key === "left" && declarParent.isForOfStatement()) { return anyTypeAnnotation(); } return voidTypeAnnotation(); } else { return; } } if (node.typeAnnotation) { return node.typeAnnotation; } if (typeAnnotationInferringNodes.has(node)) { return; } typeAnnotationInferringNodes.add(node); try { var _inferer; let inferer = inferers[node.type]; if (inferer) { return inferer.call(this, node); } inferer = inferers[this.parentPath.type]; if ((_inferer = inferer) != null && _inferer.validParent) { return this.parentPath.getTypeAnnotation(); } } finally { typeAnnotationInferringNodes.delete(node); } } function isBaseType(baseName, soft) { return _isBaseType(baseName, this.getTypeAnnotation(), soft); } function _isBaseType(baseName, type, soft) { if (baseName === "string") { return isStringTypeAnnotation(type); } else if (baseName === "number") { return isNumberTypeAnnotation(type); } else if (baseName === "boolean") { return isBooleanTypeAnnotation(type); } else if (baseName === "any") { return isAnyTypeAnnotation(type); } else if (baseName === "mixed") { return isMixedTypeAnnotation(type); } else if (baseName === "empty") { return isEmptyTypeAnnotation(type); } else if (baseName === "void") { return isVoidTypeAnnotation(type); } else { if (soft) { return false; } else { throw new Error(`Unknown base type ${baseName}`); } } } function couldBeBaseType(name) { const type = this.getTypeAnnotation(); if (isAnyTypeAnnotation(type)) return true; if (isUnionTypeAnnotation(type)) { for (const type2 of type.types) { if (isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) { return true; } } return false; } else { return _isBaseType(name, type, true); } } function baseTypeStrictlyMatches(rightArg) { const left = this.getTypeAnnotation(); const right = rightArg.getTypeAnnotation(); if (!isAnyTypeAnnotation(left) && isFlowBaseAnnotation(left)) { return right.type === left.type; } return false; } function isGenericType(genericName) { const type = this.getTypeAnnotation(); if (genericName === "Array") { if (isTSArrayType(type) || isArrayTypeAnnotation(type) || isTupleTypeAnnotation(type)) { return true; } } return isGenericTypeAnnotation(type) && isIdentifier(type.id, { name: genericName }) || isTSTypeReference(type) && isIdentifier(type.typeName, { name: genericName }); } //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/inference/inferer-reference.js": /*!******************************************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/inference/inferer-reference.js ***! \******************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = _default; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _util = __webpack_require__(/*! ./util.js */ "./node_modules/@babel/traverse/lib/path/inference/util.js"); const { BOOLEAN_NUMBER_BINARY_OPERATORS, createTypeAnnotationBasedOnTypeof, numberTypeAnnotation, voidTypeAnnotation } = _t; function _default(node) { if (!this.isReferenced()) return; const binding = this.scope.getBinding(node.name); if (binding) { if (binding.identifier.typeAnnotation) { return binding.identifier.typeAnnotation; } else { return getTypeAnnotationBindingConstantViolations(binding, this, node.name); } } if (node.name === "undefined") { return voidTypeAnnotation(); } else if (node.name === "NaN" || node.name === "Infinity") { return numberTypeAnnotation(); } else if (node.name === "arguments") {} } function getTypeAnnotationBindingConstantViolations(binding, path, name) { const types = []; const functionConstantViolations = []; let constantViolations = getConstantViolationsBefore(binding, path, functionConstantViolations); const testType = getConditionalAnnotation(binding, path, name); if (testType) { const testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement); constantViolations = constantViolations.filter(path => !testConstantViolations.includes(path)); types.push(testType.typeAnnotation); } if (constantViolations.length) { constantViolations.push(...functionConstantViolations); for (const violation of constantViolations) { types.push(violation.getTypeAnnotation()); } } if (!types.length) { return; } return (0, _util.createUnionType)(types); } function getConstantViolationsBefore(binding, path, functions) { const violations = binding.constantViolations.slice(); violations.unshift(binding.path); return violations.filter(violation => { violation = violation.resolve(); const status = violation._guessExecutionStatusRelativeTo(path); if (functions && status === "unknown") functions.push(violation); return status === "before"; }); } function inferAnnotationFromBinaryExpression(name, path) { const operator = path.node.operator; const right = path.get("right").resolve(); const left = path.get("left").resolve(); let target; if (left.isIdentifier({ name })) { target = right; } else if (right.isIdentifier({ name })) { target = left; } if (target) { if (operator === "===") { return target.getTypeAnnotation(); } if (BOOLEAN_NUMBER_BINARY_OPERATORS.includes(operator)) { return numberTypeAnnotation(); } return; } if (operator !== "===" && operator !== "==") return; let typeofPath; let typePath; if (left.isUnaryExpression({ operator: "typeof" })) { typeofPath = left; typePath = right; } else if (right.isUnaryExpression({ operator: "typeof" })) { typeofPath = right; typePath = left; } if (!typeofPath) return; if (!typeofPath.get("argument").isIdentifier({ name })) return; typePath = typePath.resolve(); if (!typePath.isLiteral()) return; const typeValue = typePath.node.value; if (typeof typeValue !== "string") return; return createTypeAnnotationBasedOnTypeof(typeValue); } function getParentConditionalPath(binding, path, name) { let parentPath; while (parentPath = path.parentPath) { if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) { if (path.key === "test") { return; } return parentPath; } if (parentPath.isFunction()) { if (parentPath.parentPath.scope.getBinding(name) !== binding) return; } path = parentPath; } } function getConditionalAnnotation(binding, path, name) { const ifStatement = getParentConditionalPath(binding, path, name); if (!ifStatement) return; const test = ifStatement.get("test"); const paths = [test]; const types = []; for (let i = 0; i < paths.length; i++) { const path = paths[i]; if (path.isLogicalExpression()) { if (path.node.operator === "&&") { paths.push(path.get("left")); paths.push(path.get("right")); } } else if (path.isBinaryExpression()) { const type = inferAnnotationFromBinaryExpression(name, path); if (type) types.push(type); } } if (types.length) { return { typeAnnotation: (0, _util.createUnionType)(types), ifStatement }; } return getConditionalAnnotation(binding, ifStatement, name); } //# sourceMappingURL=inferer-reference.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/inference/inferers.js": /*!*********************************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/inference/inferers.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ArrayExpression = ArrayExpression; exports.AssignmentExpression = AssignmentExpression; exports.BinaryExpression = BinaryExpression; exports.BooleanLiteral = BooleanLiteral; exports.CallExpression = CallExpression; exports.ConditionalExpression = ConditionalExpression; exports.ClassDeclaration = exports.ClassExpression = exports.FunctionDeclaration = exports.ArrowFunctionExpression = exports.FunctionExpression = Func; Object.defineProperty(exports, "Identifier", ({ enumerable: true, get: function () { return _infererReference.default; } })); exports.LogicalExpression = LogicalExpression; exports.NewExpression = NewExpression; exports.NullLiteral = NullLiteral; exports.NumericLiteral = NumericLiteral; exports.ObjectExpression = ObjectExpression; exports.ParenthesizedExpression = ParenthesizedExpression; exports.RegExpLiteral = RegExpLiteral; exports.RestElement = RestElement; exports.SequenceExpression = SequenceExpression; exports.StringLiteral = StringLiteral; exports.TSAsExpression = TSAsExpression; exports.TSNonNullExpression = TSNonNullExpression; exports.TaggedTemplateExpression = TaggedTemplateExpression; exports.TemplateLiteral = TemplateLiteral; exports.TypeCastExpression = TypeCastExpression; exports.UnaryExpression = UnaryExpression; exports.UpdateExpression = UpdateExpression; exports.VariableDeclarator = VariableDeclarator; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _infererReference = __webpack_require__(/*! ./inferer-reference.js */ "./node_modules/@babel/traverse/lib/path/inference/inferer-reference.js"); var _util = __webpack_require__(/*! ./util.js */ "./node_modules/@babel/traverse/lib/path/inference/util.js"); const { BOOLEAN_BINARY_OPERATORS, BOOLEAN_UNARY_OPERATORS, NUMBER_BINARY_OPERATORS, NUMBER_UNARY_OPERATORS, STRING_UNARY_OPERATORS, anyTypeAnnotation, arrayTypeAnnotation, booleanTypeAnnotation, buildMatchMemberExpression, genericTypeAnnotation, identifier, nullLiteralTypeAnnotation, numberTypeAnnotation, stringTypeAnnotation, tupleTypeAnnotation, unionTypeAnnotation, voidTypeAnnotation, isIdentifier } = _t; function VariableDeclarator() { if (!this.get("id").isIdentifier()) return; return this.get("init").getTypeAnnotation(); } function TypeCastExpression(node) { return node.typeAnnotation; } TypeCastExpression.validParent = true; function TSAsExpression(node) { return node.typeAnnotation; } TSAsExpression.validParent = true; function TSNonNullExpression() { return this.get("expression").getTypeAnnotation(); } function NewExpression(node) { if (node.callee.type === "Identifier") { return genericTypeAnnotation(node.callee); } } function TemplateLiteral() { return stringTypeAnnotation(); } function UnaryExpression(node) { const operator = node.operator; if (operator === "void") { return voidTypeAnnotation(); } else if (NUMBER_UNARY_OPERATORS.includes(operator)) { return numberTypeAnnotation(); } else if (STRING_UNARY_OPERATORS.includes(operator)) { return stringTypeAnnotation(); } else if (BOOLEAN_UNARY_OPERATORS.includes(operator)) { return booleanTypeAnnotation(); } } function BinaryExpression(node) { const operator = node.operator; if (NUMBER_BINARY_OPERATORS.includes(operator)) { return numberTypeAnnotation(); } else if (BOOLEAN_BINARY_OPERATORS.includes(operator)) { return booleanTypeAnnotation(); } else if (operator === "+") { const right = this.get("right"); const left = this.get("left"); if (left.isBaseType("number") && right.isBaseType("number")) { return numberTypeAnnotation(); } else if (left.isBaseType("string") || right.isBaseType("string")) { return stringTypeAnnotation(); } return unionTypeAnnotation([stringTypeAnnotation(), numberTypeAnnotation()]); } } function LogicalExpression() { const argumentTypes = [this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()]; return (0, _util.createUnionType)(argumentTypes); } function ConditionalExpression() { const argumentTypes = [this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()]; return (0, _util.createUnionType)(argumentTypes); } function SequenceExpression() { return this.get("expressions").pop().getTypeAnnotation(); } function ParenthesizedExpression() { return this.get("expression").getTypeAnnotation(); } function AssignmentExpression() { return this.get("right").getTypeAnnotation(); } function UpdateExpression(node) { const operator = node.operator; if (operator === "++" || operator === "--") { return numberTypeAnnotation(); } } function StringLiteral() { return stringTypeAnnotation(); } function NumericLiteral() { return numberTypeAnnotation(); } function BooleanLiteral() { return booleanTypeAnnotation(); } function NullLiteral() { return nullLiteralTypeAnnotation(); } function RegExpLiteral() { return genericTypeAnnotation(identifier("RegExp")); } function ObjectExpression() { return genericTypeAnnotation(identifier("Object")); } function ArrayExpression() { return genericTypeAnnotation(identifier("Array")); } function RestElement() { return ArrayExpression(); } RestElement.validParent = true; function Func() { return genericTypeAnnotation(identifier("Function")); } const isArrayFrom = buildMatchMemberExpression("Array.from"); const isObjectKeys = buildMatchMemberExpression("Object.keys"); const isObjectValues = buildMatchMemberExpression("Object.values"); const isObjectEntries = buildMatchMemberExpression("Object.entries"); function CallExpression() { const { callee } = this.node; if (isObjectKeys(callee)) { return arrayTypeAnnotation(stringTypeAnnotation()); } else if (isArrayFrom(callee) || isObjectValues(callee) || isIdentifier(callee, { name: "Array" })) { return arrayTypeAnnotation(anyTypeAnnotation()); } else if (isObjectEntries(callee)) { return arrayTypeAnnotation(tupleTypeAnnotation([stringTypeAnnotation(), anyTypeAnnotation()])); } return resolveCall(this.get("callee")); } function TaggedTemplateExpression() { return resolveCall(this.get("tag")); } function resolveCall(callee) { callee = callee.resolve(); if (callee.isFunction()) { const { node } = callee; if (node.async) { if (node.generator) { return genericTypeAnnotation(identifier("AsyncIterator")); } else { return genericTypeAnnotation(identifier("Promise")); } } else { if (node.generator) { return genericTypeAnnotation(identifier("Iterator")); } else if (callee.node.returnType) { return callee.node.returnType; } else {} } } } //# sourceMappingURL=inferers.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/inference/util.js": /*!*****************************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/inference/util.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createUnionType = createUnionType; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { createFlowUnionType, createTSUnionType, createUnionTypeAnnotation, isFlowType, isTSType } = _t; function createUnionType(types) { { if (types.every(v => isFlowType(v))) { if (createFlowUnionType) { return createFlowUnionType(types); } return createUnionTypeAnnotation(types); } else if (types.every(v => isTSType(v))) { if (createTSUnionType) { return createTSUnionType(types); } } } } //# sourceMappingURL=util.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/introspection.js": /*!****************************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/introspection.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo; exports._resolve = _resolve; exports.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression; exports.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement; exports.getSource = getSource; exports.isCompletionRecord = isCompletionRecord; exports.isConstantExpression = isConstantExpression; exports.isInStrictMode = isInStrictMode; exports.isNodeType = isNodeType; exports.isStatementOrBlock = isStatementOrBlock; exports.isStatic = isStatic; exports.matchesPattern = matchesPattern; exports.referencesImport = referencesImport; exports.resolve = resolve; exports.willIMaybeExecuteBefore = willIMaybeExecuteBefore; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { STATEMENT_OR_BLOCK_KEYS, VISITOR_KEYS, isBlockStatement, isExpression, isIdentifier, isLiteral, isStringLiteral, isType, matchesPattern: _matchesPattern } = _t; function matchesPattern(pattern, allowPartial) { return _matchesPattern(this.node, pattern, allowPartial); } { exports.has = function has(key) { var _this$node; const val = (_this$node = this.node) == null ? void 0 : _this$node[key]; if (val && Array.isArray(val)) { return !!val.length; } else { return !!val; } }; } function isStatic() { return this.scope.isStatic(this.node); } { exports.is = exports.has; exports.isnt = function isnt(key) { return !this.has(key); }; exports.equals = function equals(key, value) { return this.node[key] === value; }; } function isNodeType(type) { return isType(this.type, type); } function canHaveVariableDeclarationOrExpression() { return (this.key === "init" || this.key === "left") && this.parentPath.isFor(); } function canSwapBetweenExpressionAndStatement(replacement) { if (this.key !== "body" || !this.parentPath.isArrowFunctionExpression()) { return false; } if (this.isExpression()) { return isBlockStatement(replacement); } else if (this.isBlockStatement()) { return isExpression(replacement); } return false; } function isCompletionRecord(allowInsideFunction) { let path = this; let first = true; do { const { type, container } = path; if (!first && (path.isFunction() || type === "StaticBlock")) { return !!allowInsideFunction; } first = false; if (Array.isArray(container) && path.key !== container.length - 1) { return false; } } while ((path = path.parentPath) && !path.isProgram() && !path.isDoExpression()); return true; } function isStatementOrBlock() { if (this.parentPath.isLabeledStatement() || isBlockStatement(this.container)) { return false; } else { return STATEMENT_OR_BLOCK_KEYS.includes(this.key); } } function referencesImport(moduleSource, importName) { if (!this.isReferencedIdentifier()) { if (this.isJSXMemberExpression() && this.node.property.name === importName || (this.isMemberExpression() || this.isOptionalMemberExpression()) && (this.node.computed ? isStringLiteral(this.node.property, { value: importName }) : this.node.property.name === importName)) { const object = this.get("object"); return object.isReferencedIdentifier() && object.referencesImport(moduleSource, "*"); } return false; } const binding = this.scope.getBinding(this.node.name); if (!binding || binding.kind !== "module") return false; const path = binding.path; const parent = path.parentPath; if (!parent.isImportDeclaration()) return false; if (parent.node.source.value === moduleSource) { if (!importName) return true; } else { return false; } if (path.isImportDefaultSpecifier() && importName === "default") { return true; } if (path.isImportNamespaceSpecifier() && importName === "*") { return true; } if (path.isImportSpecifier() && isIdentifier(path.node.imported, { name: importName })) { return true; } return false; } function getSource() { const node = this.node; if (node.end) { const code = this.hub.getCode(); if (code) return code.slice(node.start, node.end); } return ""; } function willIMaybeExecuteBefore(target) { return this._guessExecutionStatusRelativeTo(target) !== "after"; } function getOuterFunction(path) { return path.isProgram() ? path : (path.parentPath.scope.getFunctionParent() || path.parentPath.scope.getProgramParent()).path; } function isExecutionUncertain(type, key) { switch (type) { case "LogicalExpression": return key === "right"; case "ConditionalExpression": case "IfStatement": return key === "consequent" || key === "alternate"; case "WhileStatement": case "DoWhileStatement": case "ForInStatement": case "ForOfStatement": return key === "body"; case "ForStatement": return key === "body" || key === "update"; case "SwitchStatement": return key === "cases"; case "TryStatement": return key === "handler"; case "AssignmentPattern": return key === "right"; case "OptionalMemberExpression": return key === "property"; case "OptionalCallExpression": return key === "arguments"; default: return false; } } function isExecutionUncertainInList(paths, maxIndex) { for (let i = 0; i < maxIndex; i++) { const path = paths[i]; if (isExecutionUncertain(path.parent.type, path.parentKey)) { return true; } } return false; } const SYMBOL_CHECKING = Symbol(); function _guessExecutionStatusRelativeTo(target) { return _guessExecutionStatusRelativeToCached(this, target, new Map()); } function _guessExecutionStatusRelativeToCached(base, target, cache) { const funcParent = { this: getOuterFunction(base), target: getOuterFunction(target) }; if (funcParent.target.node !== funcParent.this.node) { return _guessExecutionStatusRelativeToDifferentFunctionsCached(base, funcParent.target, cache); } const paths = { target: target.getAncestry(), this: base.getAncestry() }; if (paths.target.includes(base)) return "after"; if (paths.this.includes(target)) return "before"; let commonPath; const commonIndex = { target: 0, this: 0 }; while (!commonPath && commonIndex.this < paths.this.length) { const path = paths.this[commonIndex.this]; commonIndex.target = paths.target.indexOf(path); if (commonIndex.target >= 0) { commonPath = path; } else { commonIndex.this++; } } if (!commonPath) { throw new Error("Internal Babel error - The two compared nodes" + " don't appear to belong to the same program."); } if (isExecutionUncertainInList(paths.this, commonIndex.this - 1) || isExecutionUncertainInList(paths.target, commonIndex.target - 1)) { return "unknown"; } const divergence = { this: paths.this[commonIndex.this - 1], target: paths.target[commonIndex.target - 1] }; if (divergence.target.listKey && divergence.this.listKey && divergence.target.container === divergence.this.container) { return divergence.target.key > divergence.this.key ? "before" : "after"; } const keys = VISITOR_KEYS[commonPath.type]; const keyPosition = { this: keys.indexOf(divergence.this.parentKey), target: keys.indexOf(divergence.target.parentKey) }; return keyPosition.target > keyPosition.this ? "before" : "after"; } function _guessExecutionStatusRelativeToDifferentFunctionsInternal(base, target, cache) { if (!target.isFunctionDeclaration()) { if (_guessExecutionStatusRelativeToCached(base, target, cache) === "before") { return "before"; } return "unknown"; } else if (target.parentPath.isExportDeclaration()) { return "unknown"; } const binding = target.scope.getBinding(target.node.id.name); if (!binding.references) return "before"; const referencePaths = binding.referencePaths; let allStatus; for (const path of referencePaths) { const childOfFunction = !!path.find(path => path.node === target.node); if (childOfFunction) continue; if (path.key !== "callee" || !path.parentPath.isCallExpression()) { return "unknown"; } const status = _guessExecutionStatusRelativeToCached(base, path, cache); if (allStatus && allStatus !== status) { return "unknown"; } else { allStatus = status; } } return allStatus; } function _guessExecutionStatusRelativeToDifferentFunctionsCached(base, target, cache) { let nodeMap = cache.get(base.node); let cached; if (!nodeMap) { cache.set(base.node, nodeMap = new Map()); } else if (cached = nodeMap.get(target.node)) { if (cached === SYMBOL_CHECKING) { return "unknown"; } return cached; } nodeMap.set(target.node, SYMBOL_CHECKING); const result = _guessExecutionStatusRelativeToDifferentFunctionsInternal(base, target, cache); nodeMap.set(target.node, result); return result; } function resolve(dangerous, resolved) { return _resolve.call(this, dangerous, resolved) || this; } function _resolve(dangerous, resolved) { var _resolved; if ((_resolved = resolved) != null && _resolved.includes(this)) return; resolved = resolved || []; resolved.push(this); if (this.isVariableDeclarator()) { if (this.get("id").isIdentifier()) { return this.get("init").resolve(dangerous, resolved); } else {} } else if (this.isReferencedIdentifier()) { const binding = this.scope.getBinding(this.node.name); if (!binding) return; if (!binding.constant) return; if (binding.kind === "module") return; if (binding.path !== this) { const ret = binding.path.resolve(dangerous, resolved); if (this.find(parent => parent.node === ret.node)) return; return ret; } } else if (this.isTypeCastExpression()) { return this.get("expression").resolve(dangerous, resolved); } else if (dangerous && this.isMemberExpression()) { const targetKey = this.toComputedKey(); if (!isLiteral(targetKey)) return; const targetName = targetKey.value; const target = this.get("object").resolve(dangerous, resolved); if (target.isObjectExpression()) { const props = target.get("properties"); for (const prop of props) { if (!prop.isProperty()) continue; const key = prop.get("key"); let match = prop.isnt("computed") && key.isIdentifier({ name: targetName }); match = match || key.isLiteral({ value: targetName }); if (match) return prop.get("value").resolve(dangerous, resolved); } } else if (target.isArrayExpression() && !isNaN(+targetName)) { const elems = target.get("elements"); const elem = elems[targetName]; if (elem) return elem.resolve(dangerous, resolved); } } } function isConstantExpression() { if (this.isIdentifier()) { const binding = this.scope.getBinding(this.node.name); if (!binding) return false; return binding.constant; } if (this.isLiteral()) { if (this.isRegExpLiteral()) { return false; } if (this.isTemplateLiteral()) { return this.get("expressions").every(expression => expression.isConstantExpression()); } return true; } if (this.isUnaryExpression()) { if (this.node.operator !== "void") { return false; } return this.get("argument").isConstantExpression(); } if (this.isBinaryExpression()) { const { operator } = this.node; return operator !== "in" && operator !== "instanceof" && this.get("left").isConstantExpression() && this.get("right").isConstantExpression(); } if (this.isMemberExpression()) { return !this.node.computed && this.get("object").isIdentifier({ name: "Symbol" }) && !this.scope.hasBinding("Symbol", { noGlobals: true }); } if (this.isCallExpression()) { return this.node.arguments.length === 1 && this.get("callee").matchesPattern("Symbol.for") && !this.scope.hasBinding("Symbol", { noGlobals: true }) && this.get("arguments")[0].isStringLiteral(); } return false; } function isInStrictMode() { const start = this.isProgram() ? this : this.parentPath; const strictParent = start.find(path => { if (path.isProgram({ sourceType: "module" })) return true; if (path.isClass()) return true; if (path.isArrowFunctionExpression() && !path.get("body").isBlockStatement()) { return false; } let body; if (path.isFunction()) { body = path.node.body; } else if (path.isProgram()) { body = path.node; } else { return false; } for (const directive of body.directives) { if (directive.value.value === "use strict") { return true; } } }); return !!strictParent; } //# sourceMappingURL=introspection.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/lib/hoister.js": /*!**************************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/lib/hoister.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _t2 = _t; const { react } = _t; const { cloneNode, jsxExpressionContainer, variableDeclaration, variableDeclarator } = _t2; const referenceVisitor = { ReferencedIdentifier(path, state) { if (path.isJSXIdentifier() && react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) { return; } if (path.node.name === "this") { let scope = path.scope; do { if (scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) { break; } } while (scope = scope.parent); if (scope) state.breakOnScopePaths.push(scope.path); } const binding = path.scope.getBinding(path.node.name); if (!binding) return; for (const violation of binding.constantViolations) { if (violation.scope !== binding.path.scope) { state.mutableBinding = true; path.stop(); return; } } if (binding !== state.scope.getBinding(path.node.name)) return; state.bindings[path.node.name] = binding; } }; class PathHoister { constructor(path, scope) { this.breakOnScopePaths = void 0; this.bindings = void 0; this.mutableBinding = void 0; this.scopes = void 0; this.scope = void 0; this.path = void 0; this.attachAfter = void 0; this.breakOnScopePaths = []; this.bindings = {}; this.mutableBinding = false; this.scopes = []; this.scope = scope; this.path = path; this.attachAfter = false; } isCompatibleScope(scope) { for (const key of Object.keys(this.bindings)) { const binding = this.bindings[key]; if (!scope.bindingIdentifierEquals(key, binding.identifier)) { return false; } } return true; } getCompatibleScopes() { let scope = this.path.scope; do { if (this.isCompatibleScope(scope)) { this.scopes.push(scope); } else { break; } if (this.breakOnScopePaths.includes(scope.path)) { break; } } while (scope = scope.parent); } getAttachmentPath() { let path = this._getAttachmentPath(); if (!path) return; let targetScope = path.scope; if (targetScope.path === path) { targetScope = path.scope.parent; } if (targetScope.path.isProgram() || targetScope.path.isFunction()) { for (const name of Object.keys(this.bindings)) { if (!targetScope.hasOwnBinding(name)) continue; const binding = this.bindings[name]; if (binding.kind === "param" || binding.path.parentKey === "params") { continue; } const bindingParentPath = this.getAttachmentParentForPath(binding.path); if (bindingParentPath.key >= path.key) { this.attachAfter = true; path = binding.path; for (const violationPath of binding.constantViolations) { if (this.getAttachmentParentForPath(violationPath).key > path.key) { path = violationPath; } } } } } return path; } _getAttachmentPath() { const scopes = this.scopes; const scope = scopes.pop(); if (!scope) return; if (scope.path.isFunction()) { if (this.hasOwnParamBindings(scope)) { if (this.scope === scope) return; const bodies = scope.path.get("body").get("body"); for (let i = 0; i < bodies.length; i++) { if (bodies[i].node._blockHoist) continue; return bodies[i]; } } else { return this.getNextScopeAttachmentParent(); } } else if (scope.path.isProgram()) { return this.getNextScopeAttachmentParent(); } } getNextScopeAttachmentParent() { const scope = this.scopes.pop(); if (scope) return this.getAttachmentParentForPath(scope.path); } getAttachmentParentForPath(path) { do { if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) { return path; } } while (path = path.parentPath); } hasOwnParamBindings(scope) { for (const name of Object.keys(this.bindings)) { if (!scope.hasOwnBinding(name)) continue; const binding = this.bindings[name]; if (binding.kind === "param" && binding.constant) return true; } return false; } run() { this.path.traverse(referenceVisitor, this); if (this.mutableBinding) return; this.getCompatibleScopes(); const attachTo = this.getAttachmentPath(); if (!attachTo) return; if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return; let uid = attachTo.scope.generateUidIdentifier("ref"); const declarator = variableDeclarator(uid, this.path.node); const insertFn = this.attachAfter ? "insertAfter" : "insertBefore"; const [attached] = attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : variableDeclaration("var", [declarator])]); const parent = this.path.parentPath; if (parent.isJSXElement() && this.path.container === parent.node.children) { uid = jsxExpressionContainer(uid); } this.path.replaceWith(cloneNode(uid)); return attachTo.isVariableDeclarator() ? attached.get("init") : attached.get("declarations.0.init"); } } exports["default"] = PathHoister; //# sourceMappingURL=hoister.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/lib/removal-hooks.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/lib/removal-hooks.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.hooks = void 0; const hooks = exports.hooks = [function (self, parent) { const removeParent = self.key === "test" && (parent.isWhile() || parent.isSwitchCase()) || self.key === "declaration" && parent.isExportDeclaration() || self.key === "body" && parent.isLabeledStatement() || self.listKey === "declarations" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self.key === "expression" && parent.isExpressionStatement(); if (removeParent) { parent.remove(); return true; } }, function (self, parent) { if (parent.isSequenceExpression() && parent.node.expressions.length === 1) { parent.replaceWith(parent.node.expressions[0]); return true; } }, function (self, parent) { if (parent.isBinary()) { if (self.key === "left") { parent.replaceWith(parent.node.right); } else { parent.replaceWith(parent.node.left); } return true; } }, function (self, parent) { if (parent.isIfStatement() && self.key === "consequent" || self.key === "body" && (parent.isLoop() || parent.isArrowFunctionExpression())) { self.replaceWith({ type: "BlockStatement", body: [] }); return true; } }]; //# sourceMappingURL=removal-hooks.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js": /*!******************************************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js ***! \******************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isBindingIdentifier = isBindingIdentifier; exports.isBlockScoped = isBlockScoped; exports.isExpression = isExpression; exports.isFlow = isFlow; exports.isForAwaitStatement = isForAwaitStatement; exports.isGenerated = isGenerated; exports.isPure = isPure; exports.isReferenced = isReferenced; exports.isReferencedIdentifier = isReferencedIdentifier; exports.isReferencedMemberExpression = isReferencedMemberExpression; exports.isRestProperty = isRestProperty; exports.isScope = isScope; exports.isSpreadProperty = isSpreadProperty; exports.isStatement = isStatement; exports.isUser = isUser; exports.isVar = isVar; var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); const { isBinding, isBlockScoped: nodeIsBlockScoped, isExportDeclaration, isExpression: nodeIsExpression, isFlow: nodeIsFlow, isForStatement, isForXStatement, isIdentifier, isImportDeclaration, isImportSpecifier, isJSXIdentifier, isJSXMemberExpression, isMemberExpression, isRestElement: nodeIsRestElement, isReferenced: nodeIsReferenced, isScope: nodeIsScope, isStatement: nodeIsStatement, isVar: nodeIsVar, isVariableDeclaration, react, isForOfStatement } = _t; const { isCompatTag } = react; function isReferencedIdentifier(opts) { const { node, parent } = this; if (!isIdentifier(node, opts) && !isJSXMemberExpression(parent, opts)) { if (isJSXIdentifier(node, opts)) { if (isCompatTag(node.name)) return false; } else { return false; } } return nodeIsReferenced(node, parent, this.parentPath.parent); } function isReferencedMemberExpression() { const { node, parent } = this; return isMemberExpression(node) && nodeIsReferenced(node, parent); } function isBindingIdentifier() { const { node, parent } = this; const grandparent = this.parentPath.parent; return isIdentifier(node) && isBinding(node, parent, grandparent); } function isStatement() { const { node, parent } = this; if (nodeIsStatement(node)) { if (isVariableDeclaration(node)) { if (isForXStatement(parent, { left: node })) return false; if (isForStatement(parent, { init: node })) return false; } return true; } else { return false; } } function isExpression() { if (this.isIdentifier()) { return this.isReferencedIdentifier(); } else { return nodeIsExpression(this.node); } } function isScope() { return nodeIsScope(this.node, this.parent); } function isReferenced() { return nodeIsReferenced(this.node, this.parent); } function isBlockScoped() { return nodeIsBlockScoped(this.node); } function isVar() { return nodeIsVar(this.node); } function isUser() { return this.node && !!this.node.loc; } function isGenerated() { return !this.isUser(); } function isPure(constantsOnly) { return this.scope.isPure(this.node, constantsOnly); } function isFlow() { const { node } = this; if (nodeIsFlow(node)) { return true; } else if (isImportDeclaration(node)) { return node.importKind === "type" || node.importKind === "typeof"; } else if (isExportDeclaration(node)) { return node.exportKind === "type"; } else if (isImportSpecifier(node)) { return node.importKind === "type" || node.importKind === "typeof"; } else { return false; } } function isRestProperty() { var _this$parentPath; return nodeIsRestElement(this.node) && ((_this$parentPath = this.parentPath) == null ? void 0 : _this$parentPath.isObjectPattern()); } function isSpreadProperty() { var _this$parentPath2; return nodeIsRestElement(this.node) && ((_this$parentPath2 = this.parentPath) == null ? void 0 : _this$parentPath2.isObjectExpression()); } function isForAwaitStatement() { return isForOfStatement(this.node, { await: true }); } { exports.isExistentialTypeParam = function isExistentialTypeParam() { throw new Error("`path.isExistentialTypeParam` has been renamed to `path.isExistsTypeAnnotation()` in Babel 7."); }; exports.isNumericLiteralTypeAnnotation = function isNumericLiteralTypeAnnotation() { throw new Error("`path.isNumericLiteralTypeAnnotation()` has been renamed to `path.isNumberLiteralTypeAnnotation()` in Babel 7."); }; } //# sourceMappingURL=virtual-types-validator.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/lib/virtual-types.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/lib/virtual-types.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Var = exports.User = exports.Statement = exports.SpreadProperty = exports.Scope = exports.RestProperty = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = exports.Referenced = exports.Pure = exports.NumericLiteralTypeAnnotation = exports.Generated = exports.ForAwaitStatement = exports.Flow = exports.Expression = exports.ExistentialTypeParam = exports.BlockScoped = exports.BindingIdentifier = void 0; const ReferencedIdentifier = exports.ReferencedIdentifier = ["Identifier", "JSXIdentifier"]; const ReferencedMemberExpression = exports.ReferencedMemberExpression = ["MemberExpression"]; const BindingIdentifier = exports.BindingIdentifier = ["Identifier"]; const Statement = exports.Statement = ["Statement"]; const Expression = exports.Expression = ["Expression"]; const Scope = exports.Scope = ["Scopable", "Pattern"]; const Referenced = exports.Referenced = null; const BlockScoped = exports.BlockScoped = null; const Var = exports.Var = ["VariableDeclaration"]; const User = exports.User = null; const Generated = exports.Generated = null; const Pure = exports.Pure = null; const Flow = exports.Flow = ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"]; const RestProperty = exports.RestProperty = ["RestElement"]; const SpreadProperty = exports.SpreadProperty = ["RestElement"]; const ExistentialTypeParam = exports.ExistentialTypeParam = ["ExistsTypeAnnotation"]; const NumericLiteralTypeAnnotation = exports.NumericLiteralTypeAnnotation = ["NumberLiteralTypeAnnotation"]; const ForAwaitStatement = exports.ForAwaitStatement = ["ForOfStatement"]; //# sourceMappingURL=virtual-types.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/modification.js": /*!***************************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/modification.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports._containerInsert = _containerInsert; exports._containerInsertAfter = _containerInsertAfter; exports._containerInsertBefore = _containerInsertBefore; exports._verifyNodeList = _verifyNodeList; exports.insertAfter = insertAfter; exports.insertBefore = insertBefore; exports.pushContainer = pushContainer; exports.unshiftContainer = unshiftContainer; exports.updateSiblingKeys = updateSiblingKeys; var _cache = __webpack_require__(/*! ../cache.js */ "./node_modules/@babel/traverse/lib/cache.js"); var _index = __webpack_require__(/*! ./index.js */ "./node_modules/@babel/traverse/lib/path/index.js"); var _context = __webpack_require__(/*! ./context.js */ "./node_modules/@babel/traverse/lib/path/context.js"); var _removal = __webpack_require__(/*! ./removal.js */ "./node_modules/@babel/traverse/lib/path/removal.js"); var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _hoister = __webpack_require__(/*! ./lib/hoister.js */ "./node_modules/@babel/traverse/lib/path/lib/hoister.js"); const { arrowFunctionExpression, assertExpression, assignmentExpression, blockStatement, callExpression, cloneNode, expressionStatement, isAssignmentExpression, isCallExpression, isExportNamedDeclaration, isExpression, isIdentifier, isSequenceExpression, isSuper, thisExpression } = _t; function insertBefore(nodes_) { _removal._assertUnremoved.call(this); const nodes = _verifyNodeList.call(this, nodes_); const { parentPath, parent } = this; if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || isExportNamedDeclaration(parent) || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) { return parentPath.insertBefore(nodes); } else if (this.isNodeType("Expression") && !this.isJSXElement() || parentPath.isForStatement() && this.key === "init") { if (this.node) nodes.push(this.node); return this.replaceExpressionWithStatements(nodes); } else if (Array.isArray(this.container)) { return _containerInsertBefore.call(this, nodes); } else if (this.isStatementOrBlock()) { const node = this.node; const shouldInsertCurrentNode = node && (!this.isExpressionStatement() || node.expression != null); this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : [])); return this.unshiftContainer("body", nodes); } else { throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?"); } } function _containerInsert(from, nodes) { updateSiblingKeys.call(this, from, nodes.length); const paths = []; this.container.splice(from, 0, ...nodes); for (let i = 0; i < nodes.length; i++) { var _this$context; const to = from + i; const path = this.getSibling(to); paths.push(path); if ((_this$context = this.context) != null && _this$context.queue) { _context.pushContext.call(path, this.context); } } const contexts = _context._getQueueContexts.call(this); for (const path of paths) { _context.setScope.call(path); path.debug("Inserted."); for (const context of contexts) { context.maybeQueue(path, true); } } return paths; } function _containerInsertBefore(nodes) { return _containerInsert.call(this, this.key, nodes); } function _containerInsertAfter(nodes) { return _containerInsert.call(this, this.key + 1, nodes); } const last = arr => arr[arr.length - 1]; function isHiddenInSequenceExpression(path) { return isSequenceExpression(path.parent) && (last(path.parent.expressions) !== path.node || isHiddenInSequenceExpression(path.parentPath)); } function isAlmostConstantAssignment(node, scope) { if (!isAssignmentExpression(node) || !isIdentifier(node.left)) { return false; } const blockScope = scope.getBlockParent(); return blockScope.hasOwnBinding(node.left.name) && blockScope.getOwnBinding(node.left.name).constantViolations.length <= 1; } function insertAfter(nodes_) { _removal._assertUnremoved.call(this); if (this.isSequenceExpression()) { return last(this.get("expressions")).insertAfter(nodes_); } const nodes = _verifyNodeList.call(this, nodes_); const { parentPath, parent } = this; if (parentPath.isExpressionStatement() || parentPath.isLabeledStatement() || isExportNamedDeclaration(parent) || parentPath.isExportDefaultDeclaration() && this.isDeclaration()) { return parentPath.insertAfter(nodes.map(node => { return isExpression(node) ? expressionStatement(node) : node; })); } else if (this.isNodeType("Expression") && !this.isJSXElement() && !parentPath.isJSXElement() || parentPath.isForStatement() && this.key === "init") { const self = this; if (self.node) { const node = self.node; let { scope } = this; if (scope.path.isPattern()) { assertExpression(node); self.replaceWith(callExpression(arrowFunctionExpression([], node), [])); self.get("callee.body").insertAfter(nodes); return [self]; } if (isHiddenInSequenceExpression(self)) { nodes.unshift(node); } else if (isCallExpression(node) && isSuper(node.callee)) { nodes.unshift(node); nodes.push(thisExpression()); } else if (isAlmostConstantAssignment(node, scope)) { nodes.unshift(node); nodes.push(cloneNode(node.left)); } else if (scope.isPure(node, true)) { nodes.push(node); } else { if (parentPath.isMethod({ computed: true, key: node })) { scope = scope.parent; } const temp = scope.generateDeclaredUidIdentifier(); nodes.unshift(expressionStatement(assignmentExpression("=", cloneNode(temp), node))); nodes.push(expressionStatement(cloneNode(temp))); } } return this.replaceExpressionWithStatements(nodes); } else if (Array.isArray(this.container)) { return _containerInsertAfter.call(this, nodes); } else if (this.isStatementOrBlock()) { const node = this.node; const shouldInsertCurrentNode = node && (!this.isExpressionStatement() || node.expression != null); this.replaceWith(blockStatement(shouldInsertCurrentNode ? [node] : [])); return this.pushContainer("body", nodes); } else { throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?"); } } function updateSiblingKeys(fromIndex, incrementBy) { if (!this.parent) return; const paths = (0, _cache.getCachedPaths)(this); if (!paths) return; for (const [, path] of paths) { if (typeof path.key === "number" && path.container === this.container && path.key >= fromIndex) { path.key += incrementBy; } } } function _verifyNodeList(nodes) { if (!nodes) { return []; } if (!Array.isArray(nodes)) { nodes = [nodes]; } for (let i = 0; i < nodes.length; i++) { const node = nodes[i]; let msg; if (!node) { msg = "has falsy node"; } else if (typeof node !== "object") { msg = "contains a non-object node"; } else if (!node.type) { msg = "without a type"; } else if (node instanceof _index.default) { msg = "has a NodePath when it expected a raw object"; } if (msg) { const type = Array.isArray(node) ? "array" : typeof node; throw new Error(`Node list ${msg} with the index of ${i} and type of ${type}`); } } return nodes; } function unshiftContainer(listKey, nodes) { _removal._assertUnremoved.call(this); nodes = _verifyNodeList.call(this, nodes); const path = _index.default.get({ parentPath: this, parent: this.node, container: this.node[listKey], listKey, key: 0 }).setContext(this.context); return _containerInsertBefore.call(path, nodes); } function pushContainer(listKey, nodes) { _removal._assertUnremoved.call(this); const verifiedNodes = _verifyNodeList.call(this, nodes); const container = this.node[listKey]; const path = _index.default.get({ parentPath: this, parent: this.node, container: container, listKey, key: container.length }).setContext(this.context); return path.replaceWithMultiple(verifiedNodes); } { exports.hoist = function hoist(scope = this.scope) { const hoister = new _hoister.default(this, scope); return hoister.run(); }; } //# sourceMappingURL=modification.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/removal.js": /*!**********************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/removal.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports._assertUnremoved = _assertUnremoved; exports._callRemovalHooks = _callRemovalHooks; exports._markRemoved = _markRemoved; exports._remove = _remove; exports._removeFromScope = _removeFromScope; exports.remove = remove; var _removalHooks = __webpack_require__(/*! ./lib/removal-hooks.js */ "./node_modules/@babel/traverse/lib/path/lib/removal-hooks.js"); var _cache = __webpack_require__(/*! ../cache.js */ "./node_modules/@babel/traverse/lib/cache.js"); var _replacement = __webpack_require__(/*! ./replacement.js */ "./node_modules/@babel/traverse/lib/path/replacement.js"); var _index = __webpack_require__(/*! ./index.js */ "./node_modules/@babel/traverse/lib/path/index.js"); var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _modification = __webpack_require__(/*! ./modification.js */ "./node_modules/@babel/traverse/lib/path/modification.js"); var _context = __webpack_require__(/*! ./context.js */ "./node_modules/@babel/traverse/lib/path/context.js"); const { getBindingIdentifiers } = _t; function remove() { var _this$opts; _assertUnremoved.call(this); _context.resync.call(this); if (_callRemovalHooks.call(this)) { _markRemoved.call(this); return; } if (!((_this$opts = this.opts) != null && _this$opts.noScope)) { _removeFromScope.call(this); } this.shareCommentsWithSiblings(); _remove.call(this); _markRemoved.call(this); } function _removeFromScope() { const bindings = getBindingIdentifiers(this.node, false, false, true); Object.keys(bindings).forEach(name => this.scope.removeBinding(name)); } function _callRemovalHooks() { if (this.parentPath) { for (const fn of _removalHooks.hooks) { if (fn(this, this.parentPath)) return true; } } } function _remove() { if (Array.isArray(this.container)) { this.container.splice(this.key, 1); _modification.updateSiblingKeys.call(this, this.key, -1); } else { _replacement._replaceWith.call(this, null); } } function _markRemoved() { this._traverseFlags |= _index.SHOULD_SKIP | _index.REMOVED; if (this.parent) { var _getCachedPaths; (_getCachedPaths = (0, _cache.getCachedPaths)(this)) == null || _getCachedPaths.delete(this.node); } this.node = null; } function _assertUnremoved() { if (this.removed) { throw this.buildCodeFrameError("NodePath has been removed so is read-only."); } } //# sourceMappingURL=removal.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/path/replacement.js": /*!**************************************************************!*\ !*** ./node_modules/@babel/traverse/lib/path/replacement.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports._replaceWith = _replaceWith; exports.replaceExpressionWithStatements = replaceExpressionWithStatements; exports.replaceInline = replaceInline; exports.replaceWith = replaceWith; exports.replaceWithMultiple = replaceWithMultiple; exports.replaceWithSourceString = replaceWithSourceString; var _codeFrame = __webpack_require__(/*! @babel/code-frame */ "./node_modules/@babel/code-frame/lib/index.js"); var _index = __webpack_require__(/*! ../index.js */ "./node_modules/@babel/traverse/lib/index.js"); var _index2 = __webpack_require__(/*! ./index.js */ "./node_modules/@babel/traverse/lib/path/index.js"); var _cache = __webpack_require__(/*! ../cache.js */ "./node_modules/@babel/traverse/lib/cache.js"); var _modification = __webpack_require__(/*! ./modification.js */ "./node_modules/@babel/traverse/lib/path/modification.js"); var _parser = __webpack_require__(/*! @babel/parser */ "./node_modules/@babel/parser/lib/index.js"); var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _context = __webpack_require__(/*! ./context.js */ "./node_modules/@babel/traverse/lib/path/context.js"); const { FUNCTION_TYPES, arrowFunctionExpression, assignmentExpression, awaitExpression, blockStatement, buildUndefinedNode, callExpression, cloneNode, conditionalExpression, expressionStatement, getBindingIdentifiers, identifier, inheritLeadingComments, inheritTrailingComments, inheritsComments, isBlockStatement, isEmptyStatement, isExpression, isExpressionStatement, isIfStatement, isProgram, isStatement, isVariableDeclaration, removeComments, returnStatement, sequenceExpression, validate, yieldExpression } = _t; function replaceWithMultiple(nodes) { var _getCachedPaths; _context.resync.call(this); nodes = _modification._verifyNodeList.call(this, nodes); inheritLeadingComments(nodes[0], this.node); inheritTrailingComments(nodes[nodes.length - 1], this.node); (_getCachedPaths = (0, _cache.getCachedPaths)(this)) == null || _getCachedPaths.delete(this.node); this.node = this.container[this.key] = null; const paths = this.insertAfter(nodes); if (this.node) { this.requeue(); } else { this.remove(); } return paths; } function replaceWithSourceString(replacement) { _context.resync.call(this); let ast; try { replacement = `(${replacement})`; ast = (0, _parser.parse)(replacement); } catch (err) { const loc = err.loc; if (loc) { err.message += " - make sure this is an expression.\n" + (0, _codeFrame.codeFrameColumns)(replacement, { start: { line: loc.line, column: loc.column + 1 } }); err.code = "BABEL_REPLACE_SOURCE_ERROR"; } throw err; } const expressionAST = ast.program.body[0].expression; _index.default.removeProperties(expressionAST); return this.replaceWith(expressionAST); } function replaceWith(replacementPath) { _context.resync.call(this); if (this.removed) { throw new Error("You can't replace this node, we've already removed it"); } let replacement = replacementPath instanceof _index2.default ? replacementPath.node : replacementPath; if (!replacement) { throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead"); } if (this.node === replacement) { return [this]; } if (this.isProgram() && !isProgram(replacement)) { throw new Error("You can only replace a Program root node with another Program node"); } if (Array.isArray(replacement)) { throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`"); } if (typeof replacement === "string") { throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`"); } let nodePath = ""; if (this.isNodeType("Statement") && isExpression(replacement)) { if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement) && !this.parentPath.isExportDefaultDeclaration()) { replacement = expressionStatement(replacement); nodePath = "expression"; } } if (this.isNodeType("Expression") && isStatement(replacement)) { if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) { return this.replaceExpressionWithStatements([replacement]); } } const oldNode = this.node; if (oldNode) { inheritsComments(replacement, oldNode); removeComments(oldNode); } _replaceWith.call(this, replacement); this.type = replacement.type; _context.setScope.call(this); this.requeue(); return [nodePath ? this.get(nodePath) : this]; } function _replaceWith(node) { var _getCachedPaths2; if (!this.container) { throw new ReferenceError("Container is falsy"); } if (this.inList) { validate(this.parent, this.key, [node]); } else { validate(this.parent, this.key, node); } this.debug(`Replace with ${node == null ? void 0 : node.type}`); (_getCachedPaths2 = (0, _cache.getCachedPaths)(this)) == null || _getCachedPaths2.set(node, this).delete(this.node); this.node = this.container[this.key] = node; } function replaceExpressionWithStatements(nodes) { _context.resync.call(this); const declars = []; const nodesAsSingleExpression = gatherSequenceExpressions(nodes, declars); if (nodesAsSingleExpression) { for (const id of declars) this.scope.push({ id }); return this.replaceWith(nodesAsSingleExpression)[0].get("expressions"); } const functionParent = this.getFunctionParent(); const isParentAsync = functionParent == null ? void 0 : functionParent.node.async; const isParentGenerator = functionParent == null ? void 0 : functionParent.node.generator; const container = arrowFunctionExpression([], blockStatement(nodes)); this.replaceWith(callExpression(container, [])); const callee = this.get("callee"); callee.get("body").scope.hoistVariables(id => this.scope.push({ id })); const completionRecords = callee.getCompletionRecords(); for (const path of completionRecords) { if (!path.isExpressionStatement()) continue; const loop = path.findParent(path => path.isLoop()); if (loop) { let uid = loop.getData("expressionReplacementReturnUid"); if (!uid) { uid = callee.scope.generateDeclaredUidIdentifier("ret"); callee.get("body").pushContainer("body", returnStatement(cloneNode(uid))); loop.setData("expressionReplacementReturnUid", uid); } else { uid = identifier(uid.name); } path.get("expression").replaceWith(assignmentExpression("=", cloneNode(uid), path.node.expression)); } else { path.replaceWith(returnStatement(path.node.expression)); } } callee.arrowFunctionToExpression(); const newCallee = callee; const needToAwaitFunction = isParentAsync && _index.default.hasType(this.get("callee.body").node, "AwaitExpression", FUNCTION_TYPES); const needToYieldFunction = isParentGenerator && _index.default.hasType(this.get("callee.body").node, "YieldExpression", FUNCTION_TYPES); if (needToAwaitFunction) { newCallee.set("async", true); if (!needToYieldFunction) { this.replaceWith(awaitExpression(this.node)); } } if (needToYieldFunction) { newCallee.set("generator", true); this.replaceWith(yieldExpression(this.node, true)); } return newCallee.get("body.body"); } function gatherSequenceExpressions(nodes, declars) { const exprs = []; let ensureLastUndefined = true; for (const node of nodes) { if (!isEmptyStatement(node)) { ensureLastUndefined = false; } if (isExpression(node)) { exprs.push(node); } else if (isExpressionStatement(node)) { exprs.push(node.expression); } else if (isVariableDeclaration(node)) { if (node.kind !== "var") return; for (const declar of node.declarations) { const bindings = getBindingIdentifiers(declar); for (const key of Object.keys(bindings)) { declars.push(cloneNode(bindings[key])); } if (declar.init) { exprs.push(assignmentExpression("=", declar.id, declar.init)); } } ensureLastUndefined = true; } else if (isIfStatement(node)) { const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], declars) : buildUndefinedNode(); const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], declars) : buildUndefinedNode(); if (!consequent || !alternate) return; exprs.push(conditionalExpression(node.test, consequent, alternate)); } else if (isBlockStatement(node)) { const body = gatherSequenceExpressions(node.body, declars); if (!body) return; exprs.push(body); } else if (isEmptyStatement(node)) { if (nodes.indexOf(node) === 0) { ensureLastUndefined = true; } } else { return; } } if (ensureLastUndefined) exprs.push(buildUndefinedNode()); if (exprs.length === 1) { return exprs[0]; } else { return sequenceExpression(exprs); } } function replaceInline(nodes) { _context.resync.call(this); if (Array.isArray(nodes)) { if (Array.isArray(this.container)) { nodes = _modification._verifyNodeList.call(this, nodes); const paths = _modification._containerInsertAfter.call(this, nodes); this.remove(); return paths; } else { return this.replaceWithMultiple(nodes); } } else { return this.replaceWith(nodes); } } //# sourceMappingURL=replacement.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/scope/binding.js": /*!***********************************************************!*\ !*** ./node_modules/@babel/traverse/lib/scope/binding.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; class Binding { constructor({ identifier, scope, path, kind }) { this.identifier = void 0; this.scope = void 0; this.path = void 0; this.kind = void 0; this.constantViolations = []; this.constant = true; this.referencePaths = []; this.referenced = false; this.references = 0; this.identifier = identifier; this.scope = scope; this.path = path; this.kind = kind; if ((kind === "var" || kind === "hoisted") && isInitInLoop(path)) { this.reassign(path); } this.clearValue(); } deoptValue() { this.clearValue(); this.hasDeoptedValue = true; } setValue(value) { if (this.hasDeoptedValue) return; this.hasValue = true; this.value = value; } clearValue() { this.hasDeoptedValue = false; this.hasValue = false; this.value = null; } reassign(path) { this.constant = false; if (this.constantViolations.includes(path)) { return; } this.constantViolations.push(path); } reference(path) { if (this.referencePaths.includes(path)) { return; } this.referenced = true; this.references++; this.referencePaths.push(path); } dereference() { this.references--; this.referenced = !!this.references; } } exports["default"] = Binding; function isInitInLoop(path) { const isFunctionDeclarationOrHasInit = !path.isVariableDeclarator() || path.node.init; for (let { parentPath, key } = path; parentPath; { parentPath, key } = parentPath) { if (parentPath.isFunctionParent()) return false; if (key === "left" && parentPath.isForXStatement() || isFunctionDeclarationOrHasInit && key === "body" && parentPath.isLoop()) { return true; } } return false; } //# sourceMappingURL=binding.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/scope/index.js": /*!*********************************************************!*\ !*** ./node_modules/@babel/traverse/lib/scope/index.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _renamer = __webpack_require__(/*! ./lib/renamer.js */ "./node_modules/@babel/traverse/lib/scope/lib/renamer.js"); var _index = __webpack_require__(/*! ../index.js */ "./node_modules/@babel/traverse/lib/index.js"); var _binding = __webpack_require__(/*! ./binding.js */ "./node_modules/@babel/traverse/lib/scope/binding.js"); var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var t = _t; var _cache = __webpack_require__(/*! ../cache.js */ "./node_modules/@babel/traverse/lib/cache.js"); const globalsBuiltinLower = __webpack_require__(/*! @babel/helper-globals/data/builtin-lower.json */ "./node_modules/@babel/helper-globals/data/builtin-lower.json"), globalsBuiltinUpper = __webpack_require__(/*! @babel/helper-globals/data/builtin-upper.json */ "./node_modules/@babel/helper-globals/data/builtin-upper.json"); const { assignmentExpression, callExpression, cloneNode, getBindingIdentifiers, identifier, isArrayExpression, isBinary, isCallExpression, isClass, isClassBody, isClassDeclaration, isExportAllDeclaration, isExportDefaultDeclaration, isExportNamedDeclaration, isFunctionDeclaration, isIdentifier, isImportDeclaration, isLiteral, isMemberExpression, isMethod, isModuleSpecifier, isNullLiteral, isObjectExpression, isProperty, isPureish, isRegExpLiteral, isSuper, isTaggedTemplateExpression, isTemplateLiteral, isThisExpression, isUnaryExpression, isVariableDeclaration, expressionStatement, matchesPattern, memberExpression, numericLiteral, toIdentifier, variableDeclaration, variableDeclarator, isRecordExpression, isTupleExpression, isObjectProperty, isTopicReference, isMetaProperty, isPrivateName, isExportDeclaration, buildUndefinedNode, sequenceExpression } = _t; function gatherNodeParts(node, parts) { switch (node == null ? void 0 : node.type) { default: if (isImportDeclaration(node) || isExportDeclaration(node)) { var _node$specifiers; if ((isExportAllDeclaration(node) || isExportNamedDeclaration(node) || isImportDeclaration(node)) && node.source) { gatherNodeParts(node.source, parts); } else if ((isExportNamedDeclaration(node) || isImportDeclaration(node)) && (_node$specifiers = node.specifiers) != null && _node$specifiers.length) { for (const e of node.specifiers) gatherNodeParts(e, parts); } else if ((isExportDefaultDeclaration(node) || isExportNamedDeclaration(node)) && node.declaration) { gatherNodeParts(node.declaration, parts); } } else if (isModuleSpecifier(node)) { gatherNodeParts(node.local, parts); } else if (isLiteral(node) && !isNullLiteral(node) && !isRegExpLiteral(node) && !isTemplateLiteral(node)) { parts.push(node.value); } break; case "MemberExpression": case "OptionalMemberExpression": case "JSXMemberExpression": gatherNodeParts(node.object, parts); gatherNodeParts(node.property, parts); break; case "Identifier": case "JSXIdentifier": parts.push(node.name); break; case "CallExpression": case "OptionalCallExpression": case "NewExpression": gatherNodeParts(node.callee, parts); break; case "ObjectExpression": case "ObjectPattern": for (const e of node.properties) { gatherNodeParts(e, parts); } break; case "SpreadElement": case "RestElement": gatherNodeParts(node.argument, parts); break; case "ObjectProperty": case "ObjectMethod": case "ClassProperty": case "ClassMethod": case "ClassPrivateProperty": case "ClassPrivateMethod": gatherNodeParts(node.key, parts); break; case "ThisExpression": parts.push("this"); break; case "Super": parts.push("super"); break; case "Import": case "ImportExpression": parts.push("import"); break; case "DoExpression": parts.push("do"); break; case "YieldExpression": parts.push("yield"); gatherNodeParts(node.argument, parts); break; case "AwaitExpression": parts.push("await"); gatherNodeParts(node.argument, parts); break; case "AssignmentExpression": gatherNodeParts(node.left, parts); break; case "VariableDeclarator": gatherNodeParts(node.id, parts); break; case "FunctionExpression": case "FunctionDeclaration": case "ClassExpression": case "ClassDeclaration": gatherNodeParts(node.id, parts); break; case "PrivateName": gatherNodeParts(node.id, parts); break; case "ParenthesizedExpression": gatherNodeParts(node.expression, parts); break; case "UnaryExpression": case "UpdateExpression": gatherNodeParts(node.argument, parts); break; case "MetaProperty": gatherNodeParts(node.meta, parts); gatherNodeParts(node.property, parts); break; case "JSXElement": gatherNodeParts(node.openingElement, parts); break; case "JSXOpeningElement": gatherNodeParts(node.name, parts); break; case "JSXFragment": gatherNodeParts(node.openingFragment, parts); break; case "JSXOpeningFragment": parts.push("Fragment"); break; case "JSXNamespacedName": gatherNodeParts(node.namespace, parts); gatherNodeParts(node.name, parts); break; } } function resetScope(scope) { { scope.references = Object.create(null); scope.uids = Object.create(null); } scope.bindings = Object.create(null); scope.globals = Object.create(null); } { var NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding"); } const collectorVisitor = { ForStatement(path) { const declar = path.get("init"); if (declar.isVar()) { const { scope } = path; const parentScope = scope.getFunctionParent() || scope.getProgramParent(); parentScope.registerBinding("var", declar); } }, Declaration(path) { if (path.isBlockScoped()) return; if (path.isImportDeclaration()) return; if (path.isExportDeclaration()) return; const parent = path.scope.getFunctionParent() || path.scope.getProgramParent(); parent.registerDeclaration(path); }, ImportDeclaration(path) { const parent = path.scope.getBlockParent(); parent.registerDeclaration(path); }, TSImportEqualsDeclaration(path) { const parent = path.scope.getBlockParent(); parent.registerDeclaration(path); }, ReferencedIdentifier(path, state) { if (t.isTSQualifiedName(path.parent) && path.parent.right === path.node) { return; } if (path.parentPath.isTSImportEqualsDeclaration()) return; state.references.push(path); }, ForXStatement(path, state) { const left = path.get("left"); if (left.isPattern() || left.isIdentifier()) { state.constantViolations.push(path); } else if (left.isVar()) { const { scope } = path; const parentScope = scope.getFunctionParent() || scope.getProgramParent(); parentScope.registerBinding("var", left); } }, ExportDeclaration: { exit(path) { const { node, scope } = path; if (isExportAllDeclaration(node)) return; const declar = node.declaration; if (isClassDeclaration(declar) || isFunctionDeclaration(declar)) { const id = declar.id; if (!id) return; const binding = scope.getBinding(id.name); binding == null || binding.reference(path); } else if (isVariableDeclaration(declar)) { for (const decl of declar.declarations) { for (const name of Object.keys(getBindingIdentifiers(decl))) { const binding = scope.getBinding(name); binding == null || binding.reference(path); } } } } }, LabeledStatement(path) { path.scope.getBlockParent().registerDeclaration(path); }, AssignmentExpression(path, state) { state.assignments.push(path); }, UpdateExpression(path, state) { state.constantViolations.push(path); }, UnaryExpression(path, state) { if (path.node.operator === "delete") { state.constantViolations.push(path); } }, BlockScoped(path) { let scope = path.scope; if (scope.path === path) scope = scope.parent; const parent = scope.getBlockParent(); parent.registerDeclaration(path); if (path.isClassDeclaration() && path.node.id) { const id = path.node.id; const name = id.name; path.scope.bindings[name] = path.scope.parent.getBinding(name); } }, CatchClause(path) { path.scope.registerBinding("let", path); }, Function(path) { const params = path.get("params"); for (const param of params) { path.scope.registerBinding("param", param); } if (path.isFunctionExpression() && path.node.id && !path.node.id[NOT_LOCAL_BINDING]) { path.scope.registerBinding("local", path.get("id"), path); } }, ClassExpression(path) { if (path.node.id && !path.node.id[NOT_LOCAL_BINDING]) { path.scope.registerBinding("local", path.get("id"), path); } }, TSTypeAnnotation(path) { path.skip(); } }; let scopeVisitor; let uid = 0; class Scope { constructor(path) { this.uid = void 0; this.path = void 0; this.block = void 0; this.inited = void 0; this.labels = void 0; this.bindings = void 0; this.referencesSet = void 0; this.globals = void 0; this.uidsSet = void 0; this.data = void 0; this.crawling = void 0; const { node } = path; const cached = _cache.scope.get(node); if ((cached == null ? void 0 : cached.path) === path) { return cached; } _cache.scope.set(node, this); this.uid = uid++; this.block = node; this.path = path; this.labels = new Map(); this.inited = false; { Object.defineProperties(this, { references: { enumerable: true, configurable: true, writable: true, value: Object.create(null) }, uids: { enumerable: true, configurable: true, writable: true, value: Object.create(null) } }); } } get parent() { var _parent; let parent, path = this.path; do { var _path; const shouldSkip = path.key === "key" || path.listKey === "decorators"; path = path.parentPath; if (shouldSkip && path.isMethod()) path = path.parentPath; if ((_path = path) != null && _path.isScope()) parent = path; } while (path && !parent); return (_parent = parent) == null ? void 0 : _parent.scope; } get references() { throw new Error("Scope#references is not available in Babel 8. Use Scope#referencesSet instead."); } get uids() { throw new Error("Scope#uids is not available in Babel 8. Use Scope#uidsSet instead."); } generateDeclaredUidIdentifier(name) { const id = this.generateUidIdentifier(name); this.push({ id }); return cloneNode(id); } generateUidIdentifier(name) { return identifier(this.generateUid(name)); } generateUid(name = "temp") { name = toIdentifier(name).replace(/^_+/, "").replace(/\d+$/g, ""); let uid; let i = 0; do { uid = `_${name}`; if (i >= 11) uid += i - 1;else if (i >= 9) uid += i - 9;else if (i >= 1) uid += i + 1; i++; } while (this.hasLabel(uid) || this.hasBinding(uid) || this.hasGlobal(uid) || this.hasReference(uid)); const program = this.getProgramParent(); { program.references[uid] = true; program.uids[uid] = true; } return uid; } generateUidBasedOnNode(node, defaultName) { const parts = []; gatherNodeParts(node, parts); let id = parts.join("$"); id = id.replace(/^_/, "") || defaultName || "ref"; return this.generateUid(id.slice(0, 20)); } generateUidIdentifierBasedOnNode(node, defaultName) { return identifier(this.generateUidBasedOnNode(node, defaultName)); } isStatic(node) { if (isThisExpression(node) || isSuper(node) || isTopicReference(node)) { return true; } if (isIdentifier(node)) { const binding = this.getBinding(node.name); if (binding) { return binding.constant; } else { return this.hasBinding(node.name); } } return false; } maybeGenerateMemoised(node, dontPush) { if (this.isStatic(node)) { return null; } else { const id = this.generateUidIdentifierBasedOnNode(node); if (!dontPush) { this.push({ id }); return cloneNode(id); } return id; } } checkBlockScopedCollisions(local, kind, name, id) { if (kind === "param") return; if (local.kind === "local") return; const duplicate = kind === "let" || local.kind === "let" || local.kind === "const" || local.kind === "module" || local.kind === "param" && kind === "const"; if (duplicate) { throw this.path.hub.buildError(id, `Duplicate declaration "${name}"`, TypeError); } } rename(oldName, newName) { const binding = this.getBinding(oldName); if (binding) { newName || (newName = this.generateUidIdentifier(oldName).name); const renamer = new _renamer.default(binding, oldName, newName); { renamer.rename(arguments[2]); } } } dump() { const sep = "-".repeat(60); console.log(sep); let scope = this; do { console.log("#", scope.block.type); for (const name of Object.keys(scope.bindings)) { const binding = scope.bindings[name]; console.log(" -", name, { constant: binding.constant, references: binding.references, violations: binding.constantViolations.length, kind: binding.kind }); } } while (scope = scope.parent); console.log(sep); } hasLabel(name) { return !!this.getLabel(name); } getLabel(name) { return this.labels.get(name); } registerLabel(path) { this.labels.set(path.node.label.name, path); } registerDeclaration(path) { if (path.isLabeledStatement()) { this.registerLabel(path); } else if (path.isFunctionDeclaration()) { this.registerBinding("hoisted", path.get("id"), path); } else if (path.isVariableDeclaration()) { const declarations = path.get("declarations"); const { kind } = path.node; for (const declar of declarations) { this.registerBinding(kind === "using" || kind === "await using" ? "const" : kind, declar); } } else if (path.isClassDeclaration()) { if (path.node.declare) return; this.registerBinding("let", path); } else if (path.isImportDeclaration()) { const isTypeDeclaration = path.node.importKind === "type" || path.node.importKind === "typeof"; const specifiers = path.get("specifiers"); for (const specifier of specifiers) { const isTypeSpecifier = isTypeDeclaration || specifier.isImportSpecifier() && (specifier.node.importKind === "type" || specifier.node.importKind === "typeof"); this.registerBinding(isTypeSpecifier ? "unknown" : "module", specifier); } } else if (path.isExportDeclaration()) { const declar = path.get("declaration"); if (declar.isClassDeclaration() || declar.isFunctionDeclaration() || declar.isVariableDeclaration()) { this.registerDeclaration(declar); } } else { this.registerBinding("unknown", path); } } buildUndefinedNode() { return buildUndefinedNode(); } registerConstantViolation(path) { const ids = path.getAssignmentIdentifiers(); for (const name of Object.keys(ids)) { var _this$getBinding; (_this$getBinding = this.getBinding(name)) == null || _this$getBinding.reassign(path); } } registerBinding(kind, path, bindingPath = path) { if (!kind) throw new ReferenceError("no `kind`"); if (path.isVariableDeclaration()) { const declarators = path.get("declarations"); for (const declar of declarators) { this.registerBinding(kind, declar); } return; } const parent = this.getProgramParent(); const ids = path.getOuterBindingIdentifiers(true); for (const name of Object.keys(ids)) { { parent.references[name] = true; } for (const id of ids[name]) { const local = this.getOwnBinding(name); if (local) { if (local.identifier === id) continue; this.checkBlockScopedCollisions(local, kind, name, id); } if (local) { local.reassign(bindingPath); } else { this.bindings[name] = new _binding.default({ identifier: id, scope: this, path: bindingPath, kind: kind }); } } } } addGlobal(node) { this.globals[node.name] = node; } hasUid(name) { { let scope = this; do { if (scope.uids[name]) return true; } while (scope = scope.parent); return false; } } hasGlobal(name) { let scope = this; do { if (scope.globals[name]) return true; } while (scope = scope.parent); return false; } hasReference(name) { { return !!this.getProgramParent().references[name]; } } isPure(node, constantsOnly) { if (isIdentifier(node)) { const binding = this.getBinding(node.name); if (!binding) return false; if (constantsOnly) return binding.constant; return true; } else if (isThisExpression(node) || isMetaProperty(node) || isTopicReference(node) || isPrivateName(node)) { return true; } else if (isClass(node)) { var _node$decorators; if (node.superClass && !this.isPure(node.superClass, constantsOnly)) { return false; } if (((_node$decorators = node.decorators) == null ? void 0 : _node$decorators.length) > 0) { return false; } return this.isPure(node.body, constantsOnly); } else if (isClassBody(node)) { for (const method of node.body) { if (!this.isPure(method, constantsOnly)) return false; } return true; } else if (isBinary(node)) { return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly); } else if (isArrayExpression(node) || isTupleExpression(node)) { for (const elem of node.elements) { if (elem !== null && !this.isPure(elem, constantsOnly)) return false; } return true; } else if (isObjectExpression(node) || isRecordExpression(node)) { for (const prop of node.properties) { if (!this.isPure(prop, constantsOnly)) return false; } return true; } else if (isMethod(node)) { var _node$decorators2; if (node.computed && !this.isPure(node.key, constantsOnly)) return false; if (((_node$decorators2 = node.decorators) == null ? void 0 : _node$decorators2.length) > 0) { return false; } return true; } else if (isProperty(node)) { var _node$decorators3; if (node.computed && !this.isPure(node.key, constantsOnly)) return false; if (((_node$decorators3 = node.decorators) == null ? void 0 : _node$decorators3.length) > 0) { return false; } if (isObjectProperty(node) || node.static) { if (node.value !== null && !this.isPure(node.value, constantsOnly)) { return false; } } return true; } else if (isUnaryExpression(node)) { return this.isPure(node.argument, constantsOnly); } else if (isTemplateLiteral(node)) { for (const expression of node.expressions) { if (!this.isPure(expression, constantsOnly)) return false; } return true; } else if (isTaggedTemplateExpression(node)) { return matchesPattern(node.tag, "String.raw") && !this.hasBinding("String", { noGlobals: true }) && this.isPure(node.quasi, constantsOnly); } else if (isMemberExpression(node)) { return !node.computed && isIdentifier(node.object) && node.object.name === "Symbol" && isIdentifier(node.property) && node.property.name !== "for" && !this.hasBinding("Symbol", { noGlobals: true }); } else if (isCallExpression(node)) { return matchesPattern(node.callee, "Symbol.for") && !this.hasBinding("Symbol", { noGlobals: true }) && node.arguments.length === 1 && t.isStringLiteral(node.arguments[0]); } else { return isPureish(node); } } setData(key, val) { return this.data[key] = val; } getData(key) { let scope = this; do { const data = scope.data[key]; if (data != null) return data; } while (scope = scope.parent); } removeData(key) { let scope = this; do { const data = scope.data[key]; if (data != null) scope.data[key] = null; } while (scope = scope.parent); } init() { if (!this.inited) { this.inited = true; this.crawl(); } } crawl() { const path = this.path; resetScope(this); this.data = Object.create(null); let scope = this; do { if (scope.crawling) return; if (scope.path.isProgram()) { break; } } while (scope = scope.parent); const programParent = scope; const state = { references: [], constantViolations: [], assignments: [] }; this.crawling = true; scopeVisitor || (scopeVisitor = _index.default.visitors.merge([{ Scope(path) { resetScope(path.scope); } }, collectorVisitor])); if (path.type !== "Program") { for (const visit of scopeVisitor.enter) { visit.call(state, path, state); } const typeVisitors = scopeVisitor[path.type]; if (typeVisitors) { for (const visit of typeVisitors.enter) { visit.call(state, path, state); } } } path.traverse(scopeVisitor, state); this.crawling = false; for (const path of state.assignments) { const ids = path.getAssignmentIdentifiers(); for (const name of Object.keys(ids)) { if (path.scope.getBinding(name)) continue; programParent.addGlobal(ids[name]); } path.scope.registerConstantViolation(path); } for (const ref of state.references) { const binding = ref.scope.getBinding(ref.node.name); if (binding) { binding.reference(ref); } else { programParent.addGlobal(ref.node); } } for (const path of state.constantViolations) { path.scope.registerConstantViolation(path); } } push(opts) { let path = this.path; if (path.isPattern()) { path = this.getPatternParent().path; } else if (!path.isBlockStatement() && !path.isProgram()) { path = this.getBlockParent().path; } if (path.isSwitchStatement()) { path = (this.getFunctionParent() || this.getProgramParent()).path; } const { init, unique, kind = "var", id } = opts; if (!init && !unique && (kind === "var" || kind === "let") && path.isFunction() && !path.node.name && isCallExpression(path.parent, { callee: path.node }) && path.parent.arguments.length <= path.node.params.length && isIdentifier(id)) { path.pushContainer("params", id); path.scope.registerBinding("param", path.get("params")[path.node.params.length - 1]); return; } if (path.isLoop() || path.isCatchClause() || path.isFunction()) { path.ensureBlock(); path = path.get("body"); } const blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist; const dataKey = `declaration:${kind}:${blockHoist}`; let declarPath = !unique && path.getData(dataKey); if (!declarPath) { const declar = variableDeclaration(kind, []); declar._blockHoist = blockHoist; [declarPath] = path.unshiftContainer("body", [declar]); if (!unique) path.setData(dataKey, declarPath); } const declarator = variableDeclarator(id, init); const len = declarPath.node.declarations.push(declarator); path.scope.registerBinding(kind, declarPath.get("declarations")[len - 1]); } getProgramParent() { let scope = this; do { if (scope.path.isProgram()) { return scope; } } while (scope = scope.parent); throw new Error("Couldn't find a Program"); } getFunctionParent() { let scope = this; do { if (scope.path.isFunctionParent()) { return scope; } } while (scope = scope.parent); return null; } getBlockParent() { let scope = this; do { if (scope.path.isBlockParent()) { return scope; } } while (scope = scope.parent); throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program..."); } getPatternParent() { let scope = this; do { if (!scope.path.isPattern()) { return scope.getBlockParent(); } } while (scope = scope.parent.parent); throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program..."); } getAllBindings() { const ids = Object.create(null); let scope = this; do { for (const key of Object.keys(scope.bindings)) { if (key in ids === false) { ids[key] = scope.bindings[key]; } } scope = scope.parent; } while (scope); return ids; } bindingIdentifierEquals(name, node) { return this.getBindingIdentifier(name) === node; } getBinding(name) { let scope = this; let previousPath; do { const binding = scope.getOwnBinding(name); if (binding) { var _previousPath; if ((_previousPath = previousPath) != null && _previousPath.isPattern() && binding.kind !== "param" && binding.kind !== "local") {} else { return binding; } } else if (!binding && name === "arguments" && scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) { break; } previousPath = scope.path; } while (scope = scope.parent); } getOwnBinding(name) { return this.bindings[name]; } getBindingIdentifier(name) { var _this$getBinding2; return (_this$getBinding2 = this.getBinding(name)) == null ? void 0 : _this$getBinding2.identifier; } getOwnBindingIdentifier(name) { const binding = this.bindings[name]; return binding == null ? void 0 : binding.identifier; } hasOwnBinding(name) { return !!this.getOwnBinding(name); } hasBinding(name, opts) { if (!name) return false; let noGlobals; let noUids; let upToScope; if (typeof opts === "object") { noGlobals = opts.noGlobals; noUids = opts.noUids; upToScope = opts.upToScope; } else if (typeof opts === "boolean") { noGlobals = opts; } let scope = this; do { if (upToScope === scope) { break; } if (scope.hasOwnBinding(name)) { return true; } } while (scope = scope.parent); if (!noUids && this.hasUid(name)) return true; if (!noGlobals && Scope.globals.includes(name)) return true; if (!noGlobals && Scope.contextVariables.includes(name)) return true; return false; } parentHasBinding(name, opts) { var _this$parent; return (_this$parent = this.parent) == null ? void 0 : _this$parent.hasBinding(name, opts); } moveBindingTo(name, scope) { const info = this.getBinding(name); if (info) { info.scope.removeOwnBinding(name); info.scope = scope; scope.bindings[name] = info; } } removeOwnBinding(name) { delete this.bindings[name]; } removeBinding(name) { var _this$getBinding3; (_this$getBinding3 = this.getBinding(name)) == null || _this$getBinding3.scope.removeOwnBinding(name); { let scope = this; do { if (scope.uids[name]) { scope.uids[name] = false; } } while (scope = scope.parent); } } hoistVariables(emit = id => this.push({ id })) { this.crawl(); const seen = new Set(); for (const name of Object.keys(this.bindings)) { const binding = this.bindings[name]; if (!binding) continue; const { path } = binding; if (!path.isVariableDeclarator()) continue; const { parent, parentPath } = path; if (parent.kind !== "var" || seen.has(parent)) continue; seen.add(path.parent); let firstId; const init = []; for (const decl of parent.declarations) { firstId != null ? firstId : firstId = decl.id; if (decl.init) { init.push(assignmentExpression("=", decl.id, decl.init)); } const ids = Object.keys(getBindingIdentifiers(decl, false, true, true)); for (const name of ids) { emit(identifier(name), decl.init != null); } } if (parentPath.parentPath.isFor({ left: parent })) { parentPath.replaceWith(firstId); } else if (init.length === 0) { parentPath.remove(); } else { const expr = init.length === 1 ? init[0] : sequenceExpression(init); if (parentPath.parentPath.isForStatement({ init: parent })) { parentPath.replaceWith(expr); } else { parentPath.replaceWith(expressionStatement(expr)); } } } } } exports["default"] = Scope; Scope.globals = [...globalsBuiltinLower, ...globalsBuiltinUpper]; Scope.contextVariables = ["arguments", "undefined", "Infinity", "NaN"]; { Scope.prototype._renameFromMap = function _renameFromMap(map, oldName, newName, value) { if (map[oldName]) { map[newName] = value; map[oldName] = null; } }; Scope.prototype.traverse = function (node, opts, state) { (0, _index.default)(node, opts, this, state, this.path); }; Scope.prototype._generateUid = function _generateUid(name, i) { let id = name; if (i > 1) id += i; return `_${id}`; }; Scope.prototype.toArray = function toArray(node, i, arrayLikeIsIterable) { if (isIdentifier(node)) { const binding = this.getBinding(node.name); if (binding != null && binding.constant && binding.path.isGenericType("Array")) { return node; } } if (isArrayExpression(node)) { return node; } if (isIdentifier(node, { name: "arguments" })) { return callExpression(memberExpression(memberExpression(memberExpression(identifier("Array"), identifier("prototype")), identifier("slice")), identifier("call")), [node]); } let helperName; const args = [node]; if (i === true) { helperName = "toConsumableArray"; } else if (typeof i === "number") { args.push(numericLiteral(i)); helperName = "slicedToArray"; } else { helperName = "toArray"; } if (arrayLikeIsIterable) { args.unshift(this.path.hub.addHelper(helperName)); helperName = "maybeArrayLike"; } return callExpression(this.path.hub.addHelper(helperName), args); }; Scope.prototype.getAllBindingsOfKind = function getAllBindingsOfKind(...kinds) { const ids = Object.create(null); for (const kind of kinds) { let scope = this; do { for (const name of Object.keys(scope.bindings)) { const binding = scope.bindings[name]; if (binding.kind === kind) ids[name] = binding; } scope = scope.parent; } while (scope); } return ids; }; Object.defineProperties(Scope.prototype, { parentBlock: { configurable: true, enumerable: true, get() { return this.path.parent; } }, hub: { configurable: true, enumerable: true, get() { return this.path.hub; } } }); } //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/scope/lib/renamer.js": /*!***************************************************************!*\ !*** ./node_modules/@babel/traverse/lib/scope/lib/renamer.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _t = t; var _traverseNode = __webpack_require__(/*! ../../traverse-node.js */ "./node_modules/@babel/traverse/lib/traverse-node.js"); var _visitors = __webpack_require__(/*! ../../visitors.js */ "./node_modules/@babel/traverse/lib/visitors.js"); var _context = __webpack_require__(/*! ../../path/context.js */ "./node_modules/@babel/traverse/lib/path/context.js"); const { getAssignmentIdentifiers } = _t; const renameVisitor = { ReferencedIdentifier({ node }, state) { if (node.name === state.oldName) { node.name = state.newName; } }, Scope(path, state) { if (!path.scope.bindingIdentifierEquals(state.oldName, state.binding.identifier)) { path.skip(); if (path.isMethod()) { if (!path.requeueComputedKeyAndDecorators) { _context.requeueComputedKeyAndDecorators.call(path); } else { path.requeueComputedKeyAndDecorators(); } } } }, ObjectProperty({ node, scope }, state) { const { name } = node.key; if (node.shorthand && (name === state.oldName || name === state.newName) && scope.getBindingIdentifier(name) === state.binding.identifier) { node.shorthand = false; { var _node$extra; if ((_node$extra = node.extra) != null && _node$extra.shorthand) node.extra.shorthand = false; } } }, "AssignmentExpression|Declaration|VariableDeclarator"(path, state) { if (path.isVariableDeclaration()) return; const ids = path.isAssignmentExpression() ? getAssignmentIdentifiers(path.node) : path.getOuterBindingIdentifiers(); for (const name in ids) { if (name === state.oldName) ids[name].name = state.newName; } } }; class Renamer { constructor(binding, oldName, newName) { this.newName = newName; this.oldName = oldName; this.binding = binding; } maybeConvertFromExportDeclaration(parentDeclar) { const maybeExportDeclar = parentDeclar.parentPath; if (!maybeExportDeclar.isExportDeclaration()) { return; } if (maybeExportDeclar.isExportDefaultDeclaration()) { const { declaration } = maybeExportDeclar.node; if (t.isDeclaration(declaration) && !declaration.id) { return; } } if (maybeExportDeclar.isExportAllDeclaration()) { return; } maybeExportDeclar.splitExportDeclaration(); } maybeConvertFromClassFunctionDeclaration(path) { return path; } maybeConvertFromClassFunctionExpression(path) { return path; } rename() { const { binding, oldName, newName } = this; const { scope, path } = binding; const parentDeclar = path.find(path => path.isDeclaration() || path.isFunctionExpression() || path.isClassExpression()); if (parentDeclar) { const bindingIds = parentDeclar.getOuterBindingIdentifiers(); if (bindingIds[oldName] === binding.identifier) { this.maybeConvertFromExportDeclaration(parentDeclar); } } const blockToTraverse = arguments[0] || scope.block; const skipKeys = { discriminant: true }; if (t.isMethod(blockToTraverse)) { if (blockToTraverse.computed) { skipKeys.key = true; } if (!t.isObjectMethod(blockToTraverse)) { skipKeys.decorators = true; } } (0, _traverseNode.traverseNode)(blockToTraverse, (0, _visitors.explode)(renameVisitor), scope, this, scope.path, skipKeys); if (!arguments[0]) { scope.removeOwnBinding(oldName); scope.bindings[newName] = binding; this.binding.identifier.name = newName; } if (parentDeclar) { this.maybeConvertFromClassFunctionDeclaration(path); this.maybeConvertFromClassFunctionExpression(path); } } } exports["default"] = Renamer; //# sourceMappingURL=renamer.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/traverse-node.js": /*!***********************************************************!*\ !*** ./node_modules/@babel/traverse/lib/traverse-node.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.traverseNode = traverseNode; var _context = __webpack_require__(/*! ./context.js */ "./node_modules/@babel/traverse/lib/context.js"); var _index = __webpack_require__(/*! ./path/index.js */ "./node_modules/@babel/traverse/lib/path/index.js"); var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _context2 = __webpack_require__(/*! ./path/context.js */ "./node_modules/@babel/traverse/lib/path/context.js"); const { VISITOR_KEYS } = _t; function _visitPaths(ctx, paths) { ctx.queue = paths; ctx.priorityQueue = []; const visited = new Set(); let stop = false; let visitIndex = 0; for (; visitIndex < paths.length;) { const path = paths[visitIndex]; visitIndex++; _context2.resync.call(path); if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== ctx) { _context2.pushContext.call(path, ctx); } if (path.key === null) continue; const { node } = path; if (visited.has(node)) continue; if (node) visited.add(node); if (_visit(ctx, path)) { stop = true; break; } if (ctx.priorityQueue.length) { stop = _visitPaths(ctx, ctx.priorityQueue); ctx.priorityQueue = []; ctx.queue = paths; if (stop) break; } } for (let i = 0; i < visitIndex; i++) { _context2.popContext.call(paths[i]); } ctx.queue = null; return stop; } function _visit(ctx, path) { var _opts$denylist; const node = path.node; if (!node) { return false; } const opts = ctx.opts; const denylist = (_opts$denylist = opts.denylist) != null ? _opts$denylist : opts.blacklist; if (denylist != null && denylist.includes(node.type)) { return false; } if (opts.shouldSkip != null && opts.shouldSkip(path)) { return false; } if (path.shouldSkip) return path.shouldStop; if (_context2._call.call(path, opts.enter)) return path.shouldStop; if (path.node) { var _opts$node$type; if (_context2._call.call(path, (_opts$node$type = opts[node.type]) == null ? void 0 : _opts$node$type.enter)) return path.shouldStop; } path.shouldStop = _traverse(path.node, opts, path.scope, ctx.state, path, path.skipKeys); if (path.node) { if (_context2._call.call(path, opts.exit)) return true; } if (path.node) { var _opts$node$type2; _context2._call.call(path, (_opts$node$type2 = opts[node.type]) == null ? void 0 : _opts$node$type2.exit); } return path.shouldStop; } function _traverse(node, opts, scope, state, path, skipKeys, visitSelf) { const keys = VISITOR_KEYS[node.type]; if (!(keys != null && keys.length)) return false; const ctx = new _context.default(scope, opts, state, path); if (visitSelf) { if (skipKeys != null && skipKeys[path.parentKey]) return false; return _visitPaths(ctx, [path]); } for (const key of keys) { if (skipKeys != null && skipKeys[key]) continue; const prop = node[key]; if (!prop) continue; if (Array.isArray(prop)) { if (!prop.length) continue; const paths = []; for (let i = 0; i < prop.length; i++) { const childPath = _index.default.get({ parentPath: path, parent: node, container: prop, key: i, listKey: key }); paths.push(childPath); } if (_visitPaths(ctx, paths)) return true; } else { if (_visitPaths(ctx, [_index.default.get({ parentPath: path, parent: node, container: node, key, listKey: null })])) { return true; } } } return false; } function traverseNode(node, opts, scope, state, path, skipKeys, visitSelf) { ; const keys = VISITOR_KEYS[node.type]; if (!keys) return false; const context = new _context.default(scope, opts, state, path); if (visitSelf) { if (skipKeys != null && skipKeys[path.parentKey]) return false; return context.visitQueue([path]); } for (const key of keys) { if (skipKeys != null && skipKeys[key]) continue; if (context.visit(node, key)) { return true; } } return false; } //# sourceMappingURL=traverse-node.js.map /***/ }), /***/ "./node_modules/@babel/traverse/lib/visitors.js": /*!******************************************************!*\ !*** ./node_modules/@babel/traverse/lib/visitors.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.environmentVisitor = environmentVisitor; exports.explode = explode$1; exports.isExplodedVisitor = isExplodedVisitor; exports.merge = merge; exports.verify = verify$1; var virtualTypes = __webpack_require__(/*! ./path/lib/virtual-types.js */ "./node_modules/@babel/traverse/lib/path/lib/virtual-types.js"); var virtualTypesValidators = __webpack_require__(/*! ./path/lib/virtual-types-validator.js */ "./node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js"); var _t = __webpack_require__(/*! @babel/types */ "./node_modules/@babel/types/lib/index.js"); var _context = __webpack_require__(/*! ./path/context.js */ "./node_modules/@babel/traverse/lib/path/context.js"); const { DEPRECATED_KEYS, DEPRECATED_ALIASES, FLIPPED_ALIAS_KEYS, TYPES, __internal__deprecationWarning: deprecationWarning } = _t; function isVirtualType(type) { return type in virtualTypes; } function isExplodedVisitor(visitor) { return visitor == null ? void 0 : visitor._exploded; } function explode$1(visitor) { if (isExplodedVisitor(visitor)) return visitor; visitor._exploded = true; for (const nodeType of Object.keys(visitor)) { if (shouldIgnoreKey(nodeType)) continue; const parts = nodeType.split("|"); if (parts.length === 1) continue; const fns = visitor[nodeType]; delete visitor[nodeType]; for (const part of parts) { visitor[part] = fns; } } verify$1(visitor); delete visitor.__esModule; ensureEntranceObjects(visitor); ensureCallbackArrays(visitor); for (const nodeType of Object.keys(visitor)) { if (shouldIgnoreKey(nodeType)) continue; if (!isVirtualType(nodeType)) continue; const fns = visitor[nodeType]; for (const type of Object.keys(fns)) { fns[type] = wrapCheck(nodeType, fns[type]); } delete visitor[nodeType]; const types = virtualTypes[nodeType]; if (types !== null) { for (const type of types) { if (visitor[type]) { mergePair(visitor[type], fns); } else { visitor[type] = fns; } } } else { mergePair(visitor, fns); } } for (const nodeType of Object.keys(visitor)) { if (shouldIgnoreKey(nodeType)) continue; let aliases = FLIPPED_ALIAS_KEYS[nodeType]; if (nodeType in DEPRECATED_KEYS) { const deprecatedKey = DEPRECATED_KEYS[nodeType]; deprecationWarning(nodeType, deprecatedKey, "Visitor "); aliases = [deprecatedKey]; } else if (nodeType in DEPRECATED_ALIASES) { const deprecatedAlias = DEPRECATED_ALIASES[nodeType]; deprecationWarning(nodeType, deprecatedAlias, "Visitor "); aliases = FLIPPED_ALIAS_KEYS[deprecatedAlias]; } if (!aliases) continue; const fns = visitor[nodeType]; delete visitor[nodeType]; for (const alias of aliases) { const existing = visitor[alias]; if (existing) { mergePair(existing, fns); } else { visitor[alias] = Object.assign({}, fns); } } } for (const nodeType of Object.keys(visitor)) { if (shouldIgnoreKey(nodeType)) continue; ensureCallbackArrays(visitor[nodeType]); } return visitor; } function verify$1(visitor) { if (visitor._verified) return; if (typeof visitor === "function") { throw new Error("You passed `traverse()` a function when it expected a visitor object, " + "are you sure you didn't mean `{ enter: Function }`?"); } for (const nodeType of Object.keys(visitor)) { if (nodeType === "enter" || nodeType === "exit") { validateVisitorMethods(nodeType, visitor[nodeType]); } if (shouldIgnoreKey(nodeType)) continue; if (!TYPES.includes(nodeType)) { throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse ${"7.28.3"}`); } const visitors = visitor[nodeType]; if (typeof visitors === "object") { for (const visitorKey of Object.keys(visitors)) { if (visitorKey === "enter" || visitorKey === "exit") { validateVisitorMethods(`${nodeType}.${visitorKey}`, visitors[visitorKey]); } else { throw new Error("You passed `traverse()` a visitor object with the property " + `${nodeType} that has the invalid property ${visitorKey}`); } } } } visitor._verified = true; } function validateVisitorMethods(path, val) { const fns = [].concat(val); for (const fn of fns) { if (typeof fn !== "function") { throw new TypeError(`Non-function found defined in ${path} with type ${typeof fn}`); } } } function merge(visitors, states = [], wrapper) { const mergedVisitor = { _verified: true, _exploded: true }; { Object.defineProperty(mergedVisitor, "_exploded", { enumerable: false }); Object.defineProperty(mergedVisitor, "_verified", { enumerable: false }); } for (let i = 0; i < visitors.length; i++) { const visitor = explode$1(visitors[i]); const state = states[i]; let topVisitor = visitor; if (state || wrapper) { topVisitor = wrapWithStateOrWrapper(topVisitor, state, wrapper); } mergePair(mergedVisitor, topVisitor); for (const key of Object.keys(visitor)) { if (shouldIgnoreKey(key)) continue; let typeVisitor = visitor[key]; if (state || wrapper) { typeVisitor = wrapWithStateOrWrapper(typeVisitor, state, wrapper); } const nodeVisitor = mergedVisitor[key] || (mergedVisitor[key] = {}); mergePair(nodeVisitor, typeVisitor); } } return mergedVisitor; } function wrapWithStateOrWrapper(oldVisitor, state, wrapper) { const newVisitor = {}; for (const phase of ["enter", "exit"]) { let fns = oldVisitor[phase]; if (!Array.isArray(fns)) continue; fns = fns.map(function (fn) { let newFn = fn; if (state) { newFn = function (path) { fn.call(state, path, state); }; } if (wrapper) { newFn = wrapper(state == null ? void 0 : state.key, phase, newFn); } if (newFn !== fn) { newFn.toString = () => fn.toString(); } return newFn; }); newVisitor[phase] = fns; } return newVisitor; } function ensureEntranceObjects(obj) { for (const key of Object.keys(obj)) { if (shouldIgnoreKey(key)) continue; const fns = obj[key]; if (typeof fns === "function") { obj[key] = { enter: fns }; } } } function ensureCallbackArrays(obj) { if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter]; if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit]; } function wrapCheck(nodeType, fn) { const fnKey = `is${nodeType}`; const validator = virtualTypesValidators[fnKey]; const newFn = function (path) { if (validator.call(path)) { return fn.apply(this, arguments); } }; newFn.toString = () => fn.toString(); return newFn; } function shouldIgnoreKey(key) { if (key[0] === "_") return true; if (key === "enter" || key === "exit" || key === "shouldSkip") return true; if (key === "denylist" || key === "noScope" || key === "skipKeys") { return true; } { if (key === "blacklist") { return true; } } return false; } function mergePair(dest, src) { for (const phase of ["enter", "exit"]) { if (!src[phase]) continue; dest[phase] = [].concat(dest[phase] || [], src[phase]); } } const _environmentVisitor = { FunctionParent(path) { if (path.isArrowFunctionExpression()) return; path.skip(); if (path.isMethod()) { if (!path.requeueComputedKeyAndDecorators) { _context.requeueComputedKeyAndDecorators.call(path); } else { path.requeueComputedKeyAndDecorators(); } } }, Property(path) { if (path.isObjectProperty()) return; path.skip(); if (!path.requeueComputedKeyAndDecorators) { _context.requeueComputedKeyAndDecorators.call(path); } else { path.requeueComputedKeyAndDecorators(); } } }; function environmentVisitor(visitor) { return merge([_environmentVisitor, visitor]); } //# sourceMappingURL=visitors.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/asserts/assertNode.js": /*!*************************************************************!*\ !*** ./node_modules/@babel/types/lib/asserts/assertNode.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = assertNode; var _isNode = __webpack_require__(/*! ../validators/isNode.js */ "./node_modules/@babel/types/lib/validators/isNode.js"); function assertNode(node) { if (!(0, _isNode.default)(node)) { var _node$type; const type = (_node$type = node == null ? void 0 : node.type) != null ? _node$type : JSON.stringify(node); throw new TypeError(`Not a valid node of type "${type}"`); } } //# sourceMappingURL=assertNode.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/asserts/generated/index.js": /*!******************************************************************!*\ !*** ./node_modules/@babel/types/lib/asserts/generated/index.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.assertAccessor = assertAccessor; exports.assertAnyTypeAnnotation = assertAnyTypeAnnotation; exports.assertArgumentPlaceholder = assertArgumentPlaceholder; exports.assertArrayExpression = assertArrayExpression; exports.assertArrayPattern = assertArrayPattern; exports.assertArrayTypeAnnotation = assertArrayTypeAnnotation; exports.assertArrowFunctionExpression = assertArrowFunctionExpression; exports.assertAssignmentExpression = assertAssignmentExpression; exports.assertAssignmentPattern = assertAssignmentPattern; exports.assertAwaitExpression = assertAwaitExpression; exports.assertBigIntLiteral = assertBigIntLiteral; exports.assertBinary = assertBinary; exports.assertBinaryExpression = assertBinaryExpression; exports.assertBindExpression = assertBindExpression; exports.assertBlock = assertBlock; exports.assertBlockParent = assertBlockParent; exports.assertBlockStatement = assertBlockStatement; exports.assertBooleanLiteral = assertBooleanLiteral; exports.assertBooleanLiteralTypeAnnotation = assertBooleanLiteralTypeAnnotation; exports.assertBooleanTypeAnnotation = assertBooleanTypeAnnotation; exports.assertBreakStatement = assertBreakStatement; exports.assertCallExpression = assertCallExpression; exports.assertCatchClause = assertCatchClause; exports.assertClass = assertClass; exports.assertClassAccessorProperty = assertClassAccessorProperty; exports.assertClassBody = assertClassBody; exports.assertClassDeclaration = assertClassDeclaration; exports.assertClassExpression = assertClassExpression; exports.assertClassImplements = assertClassImplements; exports.assertClassMethod = assertClassMethod; exports.assertClassPrivateMethod = assertClassPrivateMethod; exports.assertClassPrivateProperty = assertClassPrivateProperty; exports.assertClassProperty = assertClassProperty; exports.assertCompletionStatement = assertCompletionStatement; exports.assertConditional = assertConditional; exports.assertConditionalExpression = assertConditionalExpression; exports.assertContinueStatement = assertContinueStatement; exports.assertDebuggerStatement = assertDebuggerStatement; exports.assertDecimalLiteral = assertDecimalLiteral; exports.assertDeclaration = assertDeclaration; exports.assertDeclareClass = assertDeclareClass; exports.assertDeclareExportAllDeclaration = assertDeclareExportAllDeclaration; exports.assertDeclareExportDeclaration = assertDeclareExportDeclaration; exports.assertDeclareFunction = assertDeclareFunction; exports.assertDeclareInterface = assertDeclareInterface; exports.assertDeclareModule = assertDeclareModule; exports.assertDeclareModuleExports = assertDeclareModuleExports; exports.assertDeclareOpaqueType = assertDeclareOpaqueType; exports.assertDeclareTypeAlias = assertDeclareTypeAlias; exports.assertDeclareVariable = assertDeclareVariable; exports.assertDeclaredPredicate = assertDeclaredPredicate; exports.assertDecorator = assertDecorator; exports.assertDirective = assertDirective; exports.assertDirectiveLiteral = assertDirectiveLiteral; exports.assertDoExpression = assertDoExpression; exports.assertDoWhileStatement = assertDoWhileStatement; exports.assertEmptyStatement = assertEmptyStatement; exports.assertEmptyTypeAnnotation = assertEmptyTypeAnnotation; exports.assertEnumBody = assertEnumBody; exports.assertEnumBooleanBody = assertEnumBooleanBody; exports.assertEnumBooleanMember = assertEnumBooleanMember; exports.assertEnumDeclaration = assertEnumDeclaration; exports.assertEnumDefaultedMember = assertEnumDefaultedMember; exports.assertEnumMember = assertEnumMember; exports.assertEnumNumberBody = assertEnumNumberBody; exports.assertEnumNumberMember = assertEnumNumberMember; exports.assertEnumStringBody = assertEnumStringBody; exports.assertEnumStringMember = assertEnumStringMember; exports.assertEnumSymbolBody = assertEnumSymbolBody; exports.assertExistsTypeAnnotation = assertExistsTypeAnnotation; exports.assertExportAllDeclaration = assertExportAllDeclaration; exports.assertExportDeclaration = assertExportDeclaration; exports.assertExportDefaultDeclaration = assertExportDefaultDeclaration; exports.assertExportDefaultSpecifier = assertExportDefaultSpecifier; exports.assertExportNamedDeclaration = assertExportNamedDeclaration; exports.assertExportNamespaceSpecifier = assertExportNamespaceSpecifier; exports.assertExportSpecifier = assertExportSpecifier; exports.assertExpression = assertExpression; exports.assertExpressionStatement = assertExpressionStatement; exports.assertExpressionWrapper = assertExpressionWrapper; exports.assertFile = assertFile; exports.assertFlow = assertFlow; exports.assertFlowBaseAnnotation = assertFlowBaseAnnotation; exports.assertFlowDeclaration = assertFlowDeclaration; exports.assertFlowPredicate = assertFlowPredicate; exports.assertFlowType = assertFlowType; exports.assertFor = assertFor; exports.assertForInStatement = assertForInStatement; exports.assertForOfStatement = assertForOfStatement; exports.assertForStatement = assertForStatement; exports.assertForXStatement = assertForXStatement; exports.assertFunction = assertFunction; exports.assertFunctionDeclaration = assertFunctionDeclaration; exports.assertFunctionExpression = assertFunctionExpression; exports.assertFunctionParameter = assertFunctionParameter; exports.assertFunctionParent = assertFunctionParent; exports.assertFunctionTypeAnnotation = assertFunctionTypeAnnotation; exports.assertFunctionTypeParam = assertFunctionTypeParam; exports.assertGenericTypeAnnotation = assertGenericTypeAnnotation; exports.assertIdentifier = assertIdentifier; exports.assertIfStatement = assertIfStatement; exports.assertImmutable = assertImmutable; exports.assertImport = assertImport; exports.assertImportAttribute = assertImportAttribute; exports.assertImportDeclaration = assertImportDeclaration; exports.assertImportDefaultSpecifier = assertImportDefaultSpecifier; exports.assertImportExpression = assertImportExpression; exports.assertImportNamespaceSpecifier = assertImportNamespaceSpecifier; exports.assertImportOrExportDeclaration = assertImportOrExportDeclaration; exports.assertImportSpecifier = assertImportSpecifier; exports.assertIndexedAccessType = assertIndexedAccessType; exports.assertInferredPredicate = assertInferredPredicate; exports.assertInterfaceDeclaration = assertInterfaceDeclaration; exports.assertInterfaceExtends = assertInterfaceExtends; exports.assertInterfaceTypeAnnotation = assertInterfaceTypeAnnotation; exports.assertInterpreterDirective = assertInterpreterDirective; exports.assertIntersectionTypeAnnotation = assertIntersectionTypeAnnotation; exports.assertJSX = assertJSX; exports.assertJSXAttribute = assertJSXAttribute; exports.assertJSXClosingElement = assertJSXClosingElement; exports.assertJSXClosingFragment = assertJSXClosingFragment; exports.assertJSXElement = assertJSXElement; exports.assertJSXEmptyExpression = assertJSXEmptyExpression; exports.assertJSXExpressionContainer = assertJSXExpressionContainer; exports.assertJSXFragment = assertJSXFragment; exports.assertJSXIdentifier = assertJSXIdentifier; exports.assertJSXMemberExpression = assertJSXMemberExpression; exports.assertJSXNamespacedName = assertJSXNamespacedName; exports.assertJSXOpeningElement = assertJSXOpeningElement; exports.assertJSXOpeningFragment = assertJSXOpeningFragment; exports.assertJSXSpreadAttribute = assertJSXSpreadAttribute; exports.assertJSXSpreadChild = assertJSXSpreadChild; exports.assertJSXText = assertJSXText; exports.assertLVal = assertLVal; exports.assertLabeledStatement = assertLabeledStatement; exports.assertLiteral = assertLiteral; exports.assertLogicalExpression = assertLogicalExpression; exports.assertLoop = assertLoop; exports.assertMemberExpression = assertMemberExpression; exports.assertMetaProperty = assertMetaProperty; exports.assertMethod = assertMethod; exports.assertMiscellaneous = assertMiscellaneous; exports.assertMixedTypeAnnotation = assertMixedTypeAnnotation; exports.assertModuleDeclaration = assertModuleDeclaration; exports.assertModuleExpression = assertModuleExpression; exports.assertModuleSpecifier = assertModuleSpecifier; exports.assertNewExpression = assertNewExpression; exports.assertNoop = assertNoop; exports.assertNullLiteral = assertNullLiteral; exports.assertNullLiteralTypeAnnotation = assertNullLiteralTypeAnnotation; exports.assertNullableTypeAnnotation = assertNullableTypeAnnotation; exports.assertNumberLiteral = assertNumberLiteral; exports.assertNumberLiteralTypeAnnotation = assertNumberLiteralTypeAnnotation; exports.assertNumberTypeAnnotation = assertNumberTypeAnnotation; exports.assertNumericLiteral = assertNumericLiteral; exports.assertObjectExpression = assertObjectExpression; exports.assertObjectMember = assertObjectMember; exports.assertObjectMethod = assertObjectMethod; exports.assertObjectPattern = assertObjectPattern; exports.assertObjectProperty = assertObjectProperty; exports.assertObjectTypeAnnotation = assertObjectTypeAnnotation; exports.assertObjectTypeCallProperty = assertObjectTypeCallProperty; exports.assertObjectTypeIndexer = assertObjectTypeIndexer; exports.assertObjectTypeInternalSlot = assertObjectTypeInternalSlot; exports.assertObjectTypeProperty = assertObjectTypeProperty; exports.assertObjectTypeSpreadProperty = assertObjectTypeSpreadProperty; exports.assertOpaqueType = assertOpaqueType; exports.assertOptionalCallExpression = assertOptionalCallExpression; exports.assertOptionalIndexedAccessType = assertOptionalIndexedAccessType; exports.assertOptionalMemberExpression = assertOptionalMemberExpression; exports.assertParenthesizedExpression = assertParenthesizedExpression; exports.assertPattern = assertPattern; exports.assertPatternLike = assertPatternLike; exports.assertPipelineBareFunction = assertPipelineBareFunction; exports.assertPipelinePrimaryTopicReference = assertPipelinePrimaryTopicReference; exports.assertPipelineTopicExpression = assertPipelineTopicExpression; exports.assertPlaceholder = assertPlaceholder; exports.assertPrivate = assertPrivate; exports.assertPrivateName = assertPrivateName; exports.assertProgram = assertProgram; exports.assertProperty = assertProperty; exports.assertPureish = assertPureish; exports.assertQualifiedTypeIdentifier = assertQualifiedTypeIdentifier; exports.assertRecordExpression = assertRecordExpression; exports.assertRegExpLiteral = assertRegExpLiteral; exports.assertRegexLiteral = assertRegexLiteral; exports.assertRestElement = assertRestElement; exports.assertRestProperty = assertRestProperty; exports.assertReturnStatement = assertReturnStatement; exports.assertScopable = assertScopable; exports.assertSequenceExpression = assertSequenceExpression; exports.assertSpreadElement = assertSpreadElement; exports.assertSpreadProperty = assertSpreadProperty; exports.assertStandardized = assertStandardized; exports.assertStatement = assertStatement; exports.assertStaticBlock = assertStaticBlock; exports.assertStringLiteral = assertStringLiteral; exports.assertStringLiteralTypeAnnotation = assertStringLiteralTypeAnnotation; exports.assertStringTypeAnnotation = assertStringTypeAnnotation; exports.assertSuper = assertSuper; exports.assertSwitchCase = assertSwitchCase; exports.assertSwitchStatement = assertSwitchStatement; exports.assertSymbolTypeAnnotation = assertSymbolTypeAnnotation; exports.assertTSAnyKeyword = assertTSAnyKeyword; exports.assertTSArrayType = assertTSArrayType; exports.assertTSAsExpression = assertTSAsExpression; exports.assertTSBaseType = assertTSBaseType; exports.assertTSBigIntKeyword = assertTSBigIntKeyword; exports.assertTSBooleanKeyword = assertTSBooleanKeyword; exports.assertTSCallSignatureDeclaration = assertTSCallSignatureDeclaration; exports.assertTSConditionalType = assertTSConditionalType; exports.assertTSConstructSignatureDeclaration = assertTSConstructSignatureDeclaration; exports.assertTSConstructorType = assertTSConstructorType; exports.assertTSDeclareFunction = assertTSDeclareFunction; exports.assertTSDeclareMethod = assertTSDeclareMethod; exports.assertTSEntityName = assertTSEntityName; exports.assertTSEnumBody = assertTSEnumBody; exports.assertTSEnumDeclaration = assertTSEnumDeclaration; exports.assertTSEnumMember = assertTSEnumMember; exports.assertTSExportAssignment = assertTSExportAssignment; exports.assertTSExpressionWithTypeArguments = assertTSExpressionWithTypeArguments; exports.assertTSExternalModuleReference = assertTSExternalModuleReference; exports.assertTSFunctionType = assertTSFunctionType; exports.assertTSImportEqualsDeclaration = assertTSImportEqualsDeclaration; exports.assertTSImportType = assertTSImportType; exports.assertTSIndexSignature = assertTSIndexSignature; exports.assertTSIndexedAccessType = assertTSIndexedAccessType; exports.assertTSInferType = assertTSInferType; exports.assertTSInstantiationExpression = assertTSInstantiationExpression; exports.assertTSInterfaceBody = assertTSInterfaceBody; exports.assertTSInterfaceDeclaration = assertTSInterfaceDeclaration; exports.assertTSIntersectionType = assertTSIntersectionType; exports.assertTSIntrinsicKeyword = assertTSIntrinsicKeyword; exports.assertTSLiteralType = assertTSLiteralType; exports.assertTSMappedType = assertTSMappedType; exports.assertTSMethodSignature = assertTSMethodSignature; exports.assertTSModuleBlock = assertTSModuleBlock; exports.assertTSModuleDeclaration = assertTSModuleDeclaration; exports.assertTSNamedTupleMember = assertTSNamedTupleMember; exports.assertTSNamespaceExportDeclaration = assertTSNamespaceExportDeclaration; exports.assertTSNeverKeyword = assertTSNeverKeyword; exports.assertTSNonNullExpression = assertTSNonNullExpression; exports.assertTSNullKeyword = assertTSNullKeyword; exports.assertTSNumberKeyword = assertTSNumberKeyword; exports.assertTSObjectKeyword = assertTSObjectKeyword; exports.assertTSOptionalType = assertTSOptionalType; exports.assertTSParameterProperty = assertTSParameterProperty; exports.assertTSParenthesizedType = assertTSParenthesizedType; exports.assertTSPropertySignature = assertTSPropertySignature; exports.assertTSQualifiedName = assertTSQualifiedName; exports.assertTSRestType = assertTSRestType; exports.assertTSSatisfiesExpression = assertTSSatisfiesExpression; exports.assertTSStringKeyword = assertTSStringKeyword; exports.assertTSSymbolKeyword = assertTSSymbolKeyword; exports.assertTSTemplateLiteralType = assertTSTemplateLiteralType; exports.assertTSThisType = assertTSThisType; exports.assertTSTupleType = assertTSTupleType; exports.assertTSType = assertTSType; exports.assertTSTypeAliasDeclaration = assertTSTypeAliasDeclaration; exports.assertTSTypeAnnotation = assertTSTypeAnnotation; exports.assertTSTypeAssertion = assertTSTypeAssertion; exports.assertTSTypeElement = assertTSTypeElement; exports.assertTSTypeLiteral = assertTSTypeLiteral; exports.assertTSTypeOperator = assertTSTypeOperator; exports.assertTSTypeParameter = assertTSTypeParameter; exports.assertTSTypeParameterDeclaration = assertTSTypeParameterDeclaration; exports.assertTSTypeParameterInstantiation = assertTSTypeParameterInstantiation; exports.assertTSTypePredicate = assertTSTypePredicate; exports.assertTSTypeQuery = assertTSTypeQuery; exports.assertTSTypeReference = assertTSTypeReference; exports.assertTSUndefinedKeyword = assertTSUndefinedKeyword; exports.assertTSUnionType = assertTSUnionType; exports.assertTSUnknownKeyword = assertTSUnknownKeyword; exports.assertTSVoidKeyword = assertTSVoidKeyword; exports.assertTaggedTemplateExpression = assertTaggedTemplateExpression; exports.assertTemplateElement = assertTemplateElement; exports.assertTemplateLiteral = assertTemplateLiteral; exports.assertTerminatorless = assertTerminatorless; exports.assertThisExpression = assertThisExpression; exports.assertThisTypeAnnotation = assertThisTypeAnnotation; exports.assertThrowStatement = assertThrowStatement; exports.assertTopicReference = assertTopicReference; exports.assertTryStatement = assertTryStatement; exports.assertTupleExpression = assertTupleExpression; exports.assertTupleTypeAnnotation = assertTupleTypeAnnotation; exports.assertTypeAlias = assertTypeAlias; exports.assertTypeAnnotation = assertTypeAnnotation; exports.assertTypeCastExpression = assertTypeCastExpression; exports.assertTypeParameter = assertTypeParameter; exports.assertTypeParameterDeclaration = assertTypeParameterDeclaration; exports.assertTypeParameterInstantiation = assertTypeParameterInstantiation; exports.assertTypeScript = assertTypeScript; exports.assertTypeofTypeAnnotation = assertTypeofTypeAnnotation; exports.assertUnaryExpression = assertUnaryExpression; exports.assertUnaryLike = assertUnaryLike; exports.assertUnionTypeAnnotation = assertUnionTypeAnnotation; exports.assertUpdateExpression = assertUpdateExpression; exports.assertUserWhitespacable = assertUserWhitespacable; exports.assertV8IntrinsicIdentifier = assertV8IntrinsicIdentifier; exports.assertVariableDeclaration = assertVariableDeclaration; exports.assertVariableDeclarator = assertVariableDeclarator; exports.assertVariance = assertVariance; exports.assertVoidPattern = assertVoidPattern; exports.assertVoidTypeAnnotation = assertVoidTypeAnnotation; exports.assertWhile = assertWhile; exports.assertWhileStatement = assertWhileStatement; exports.assertWithStatement = assertWithStatement; exports.assertYieldExpression = assertYieldExpression; var _is = __webpack_require__(/*! ../../validators/is.js */ "./node_modules/@babel/types/lib/validators/is.js"); var _deprecationWarning = __webpack_require__(/*! ../../utils/deprecationWarning.js */ "./node_modules/@babel/types/lib/utils/deprecationWarning.js"); function assert(type, node, opts) { if (!(0, _is.default)(type, node, opts)) { throw new Error(`Expected type "${type}" with option ${JSON.stringify(opts)}, ` + `but instead got "${node.type}".`); } } function assertArrayExpression(node, opts) { assert("ArrayExpression", node, opts); } function assertAssignmentExpression(node, opts) { assert("AssignmentExpression", node, opts); } function assertBinaryExpression(node, opts) { assert("BinaryExpression", node, opts); } function assertInterpreterDirective(node, opts) { assert("InterpreterDirective", node, opts); } function assertDirective(node, opts) { assert("Directive", node, opts); } function assertDirectiveLiteral(node, opts) { assert("DirectiveLiteral", node, opts); } function assertBlockStatement(node, opts) { assert("BlockStatement", node, opts); } function assertBreakStatement(node, opts) { assert("BreakStatement", node, opts); } function assertCallExpression(node, opts) { assert("CallExpression", node, opts); } function assertCatchClause(node, opts) { assert("CatchClause", node, opts); } function assertConditionalExpression(node, opts) { assert("ConditionalExpression", node, opts); } function assertContinueStatement(node, opts) { assert("ContinueStatement", node, opts); } function assertDebuggerStatement(node, opts) { assert("DebuggerStatement", node, opts); } function assertDoWhileStatement(node, opts) { assert("DoWhileStatement", node, opts); } function assertEmptyStatement(node, opts) { assert("EmptyStatement", node, opts); } function assertExpressionStatement(node, opts) { assert("ExpressionStatement", node, opts); } function assertFile(node, opts) { assert("File", node, opts); } function assertForInStatement(node, opts) { assert("ForInStatement", node, opts); } function assertForStatement(node, opts) { assert("ForStatement", node, opts); } function assertFunctionDeclaration(node, opts) { assert("FunctionDeclaration", node, opts); } function assertFunctionExpression(node, opts) { assert("FunctionExpression", node, opts); } function assertIdentifier(node, opts) { assert("Identifier", node, opts); } function assertIfStatement(node, opts) { assert("IfStatement", node, opts); } function assertLabeledStatement(node, opts) { assert("LabeledStatement", node, opts); } function assertStringLiteral(node, opts) { assert("StringLiteral", node, opts); } function assertNumericLiteral(node, opts) { assert("NumericLiteral", node, opts); } function assertNullLiteral(node, opts) { assert("NullLiteral", node, opts); } function assertBooleanLiteral(node, opts) { assert("BooleanLiteral", node, opts); } function assertRegExpLiteral(node, opts) { assert("RegExpLiteral", node, opts); } function assertLogicalExpression(node, opts) { assert("LogicalExpression", node, opts); } function assertMemberExpression(node, opts) { assert("MemberExpression", node, opts); } function assertNewExpression(node, opts) { assert("NewExpression", node, opts); } function assertProgram(node, opts) { assert("Program", node, opts); } function assertObjectExpression(node, opts) { assert("ObjectExpression", node, opts); } function assertObjectMethod(node, opts) { assert("ObjectMethod", node, opts); } function assertObjectProperty(node, opts) { assert("ObjectProperty", node, opts); } function assertRestElement(node, opts) { assert("RestElement", node, opts); } function assertReturnStatement(node, opts) { assert("ReturnStatement", node, opts); } function assertSequenceExpression(node, opts) { assert("SequenceExpression", node, opts); } function assertParenthesizedExpression(node, opts) { assert("ParenthesizedExpression", node, opts); } function assertSwitchCase(node, opts) { assert("SwitchCase", node, opts); } function assertSwitchStatement(node, opts) { assert("SwitchStatement", node, opts); } function assertThisExpression(node, opts) { assert("ThisExpression", node, opts); } function assertThrowStatement(node, opts) { assert("ThrowStatement", node, opts); } function assertTryStatement(node, opts) { assert("TryStatement", node, opts); } function assertUnaryExpression(node, opts) { assert("UnaryExpression", node, opts); } function assertUpdateExpression(node, opts) { assert("UpdateExpression", node, opts); } function assertVariableDeclaration(node, opts) { assert("VariableDeclaration", node, opts); } function assertVariableDeclarator(node, opts) { assert("VariableDeclarator", node, opts); } function assertWhileStatement(node, opts) { assert("WhileStatement", node, opts); } function assertWithStatement(node, opts) { assert("WithStatement", node, opts); } function assertAssignmentPattern(node, opts) { assert("AssignmentPattern", node, opts); } function assertArrayPattern(node, opts) { assert("ArrayPattern", node, opts); } function assertArrowFunctionExpression(node, opts) { assert("ArrowFunctionExpression", node, opts); } function assertClassBody(node, opts) { assert("ClassBody", node, opts); } function assertClassExpression(node, opts) { assert("ClassExpression", node, opts); } function assertClassDeclaration(node, opts) { assert("ClassDeclaration", node, opts); } function assertExportAllDeclaration(node, opts) { assert("ExportAllDeclaration", node, opts); } function assertExportDefaultDeclaration(node, opts) { assert("ExportDefaultDeclaration", node, opts); } function assertExportNamedDeclaration(node, opts) { assert("ExportNamedDeclaration", node, opts); } function assertExportSpecifier(node, opts) { assert("ExportSpecifier", node, opts); } function assertForOfStatement(node, opts) { assert("ForOfStatement", node, opts); } function assertImportDeclaration(node, opts) { assert("ImportDeclaration", node, opts); } function assertImportDefaultSpecifier(node, opts) { assert("ImportDefaultSpecifier", node, opts); } function assertImportNamespaceSpecifier(node, opts) { assert("ImportNamespaceSpecifier", node, opts); } function assertImportSpecifier(node, opts) { assert("ImportSpecifier", node, opts); } function assertImportExpression(node, opts) { assert("ImportExpression", node, opts); } function assertMetaProperty(node, opts) { assert("MetaProperty", node, opts); } function assertClassMethod(node, opts) { assert("ClassMethod", node, opts); } function assertObjectPattern(node, opts) { assert("ObjectPattern", node, opts); } function assertSpreadElement(node, opts) { assert("SpreadElement", node, opts); } function assertSuper(node, opts) { assert("Super", node, opts); } function assertTaggedTemplateExpression(node, opts) { assert("TaggedTemplateExpression", node, opts); } function assertTemplateElement(node, opts) { assert("TemplateElement", node, opts); } function assertTemplateLiteral(node, opts) { assert("TemplateLiteral", node, opts); } function assertYieldExpression(node, opts) { assert("YieldExpression", node, opts); } function assertAwaitExpression(node, opts) { assert("AwaitExpression", node, opts); } function assertImport(node, opts) { assert("Import", node, opts); } function assertBigIntLiteral(node, opts) { assert("BigIntLiteral", node, opts); } function assertExportNamespaceSpecifier(node, opts) { assert("ExportNamespaceSpecifier", node, opts); } function assertOptionalMemberExpression(node, opts) { assert("OptionalMemberExpression", node, opts); } function assertOptionalCallExpression(node, opts) { assert("OptionalCallExpression", node, opts); } function assertClassProperty(node, opts) { assert("ClassProperty", node, opts); } function assertClassAccessorProperty(node, opts) { assert("ClassAccessorProperty", node, opts); } function assertClassPrivateProperty(node, opts) { assert("ClassPrivateProperty", node, opts); } function assertClassPrivateMethod(node, opts) { assert("ClassPrivateMethod", node, opts); } function assertPrivateName(node, opts) { assert("PrivateName", node, opts); } function assertStaticBlock(node, opts) { assert("StaticBlock", node, opts); } function assertImportAttribute(node, opts) { assert("ImportAttribute", node, opts); } function assertAnyTypeAnnotation(node, opts) { assert("AnyTypeAnnotation", node, opts); } function assertArrayTypeAnnotation(node, opts) { assert("ArrayTypeAnnotation", node, opts); } function assertBooleanTypeAnnotation(node, opts) { assert("BooleanTypeAnnotation", node, opts); } function assertBooleanLiteralTypeAnnotation(node, opts) { assert("BooleanLiteralTypeAnnotation", node, opts); } function assertNullLiteralTypeAnnotation(node, opts) { assert("NullLiteralTypeAnnotation", node, opts); } function assertClassImplements(node, opts) { assert("ClassImplements", node, opts); } function assertDeclareClass(node, opts) { assert("DeclareClass", node, opts); } function assertDeclareFunction(node, opts) { assert("DeclareFunction", node, opts); } function assertDeclareInterface(node, opts) { assert("DeclareInterface", node, opts); } function assertDeclareModule(node, opts) { assert("DeclareModule", node, opts); } function assertDeclareModuleExports(node, opts) { assert("DeclareModuleExports", node, opts); } function assertDeclareTypeAlias(node, opts) { assert("DeclareTypeAlias", node, opts); } function assertDeclareOpaqueType(node, opts) { assert("DeclareOpaqueType", node, opts); } function assertDeclareVariable(node, opts) { assert("DeclareVariable", node, opts); } function assertDeclareExportDeclaration(node, opts) { assert("DeclareExportDeclaration", node, opts); } function assertDeclareExportAllDeclaration(node, opts) { assert("DeclareExportAllDeclaration", node, opts); } function assertDeclaredPredicate(node, opts) { assert("DeclaredPredicate", node, opts); } function assertExistsTypeAnnotation(node, opts) { assert("ExistsTypeAnnotation", node, opts); } function assertFunctionTypeAnnotation(node, opts) { assert("FunctionTypeAnnotation", node, opts); } function assertFunctionTypeParam(node, opts) { assert("FunctionTypeParam", node, opts); } function assertGenericTypeAnnotation(node, opts) { assert("GenericTypeAnnotation", node, opts); } function assertInferredPredicate(node, opts) { assert("InferredPredicate", node, opts); } function assertInterfaceExtends(node, opts) { assert("InterfaceExtends", node, opts); } function assertInterfaceDeclaration(node, opts) { assert("InterfaceDeclaration", node, opts); } function assertInterfaceTypeAnnotation(node, opts) { assert("InterfaceTypeAnnotation", node, opts); } function assertIntersectionTypeAnnotation(node, opts) { assert("IntersectionTypeAnnotation", node, opts); } function assertMixedTypeAnnotation(node, opts) { assert("MixedTypeAnnotation", node, opts); } function assertEmptyTypeAnnotation(node, opts) { assert("EmptyTypeAnnotation", node, opts); } function assertNullableTypeAnnotation(node, opts) { assert("NullableTypeAnnotation", node, opts); } function assertNumberLiteralTypeAnnotation(node, opts) { assert("NumberLiteralTypeAnnotation", node, opts); } function assertNumberTypeAnnotation(node, opts) { assert("NumberTypeAnnotation", node, opts); } function assertObjectTypeAnnotation(node, opts) { assert("ObjectTypeAnnotation", node, opts); } function assertObjectTypeInternalSlot(node, opts) { assert("ObjectTypeInternalSlot", node, opts); } function assertObjectTypeCallProperty(node, opts) { assert("ObjectTypeCallProperty", node, opts); } function assertObjectTypeIndexer(node, opts) { assert("ObjectTypeIndexer", node, opts); } function assertObjectTypeProperty(node, opts) { assert("ObjectTypeProperty", node, opts); } function assertObjectTypeSpreadProperty(node, opts) { assert("ObjectTypeSpreadProperty", node, opts); } function assertOpaqueType(node, opts) { assert("OpaqueType", node, opts); } function assertQualifiedTypeIdentifier(node, opts) { assert("QualifiedTypeIdentifier", node, opts); } function assertStringLiteralTypeAnnotation(node, opts) { assert("StringLiteralTypeAnnotation", node, opts); } function assertStringTypeAnnotation(node, opts) { assert("StringTypeAnnotation", node, opts); } function assertSymbolTypeAnnotation(node, opts) { assert("SymbolTypeAnnotation", node, opts); } function assertThisTypeAnnotation(node, opts) { assert("ThisTypeAnnotation", node, opts); } function assertTupleTypeAnnotation(node, opts) { assert("TupleTypeAnnotation", node, opts); } function assertTypeofTypeAnnotation(node, opts) { assert("TypeofTypeAnnotation", node, opts); } function assertTypeAlias(node, opts) { assert("TypeAlias", node, opts); } function assertTypeAnnotation(node, opts) { assert("TypeAnnotation", node, opts); } function assertTypeCastExpression(node, opts) { assert("TypeCastExpression", node, opts); } function assertTypeParameter(node, opts) { assert("TypeParameter", node, opts); } function assertTypeParameterDeclaration(node, opts) { assert("TypeParameterDeclaration", node, opts); } function assertTypeParameterInstantiation(node, opts) { assert("TypeParameterInstantiation", node, opts); } function assertUnionTypeAnnotation(node, opts) { assert("UnionTypeAnnotation", node, opts); } function assertVariance(node, opts) { assert("Variance", node, opts); } function assertVoidTypeAnnotation(node, opts) { assert("VoidTypeAnnotation", node, opts); } function assertEnumDeclaration(node, opts) { assert("EnumDeclaration", node, opts); } function assertEnumBooleanBody(node, opts) { assert("EnumBooleanBody", node, opts); } function assertEnumNumberBody(node, opts) { assert("EnumNumberBody", node, opts); } function assertEnumStringBody(node, opts) { assert("EnumStringBody", node, opts); } function assertEnumSymbolBody(node, opts) { assert("EnumSymbolBody", node, opts); } function assertEnumBooleanMember(node, opts) { assert("EnumBooleanMember", node, opts); } function assertEnumNumberMember(node, opts) { assert("EnumNumberMember", node, opts); } function assertEnumStringMember(node, opts) { assert("EnumStringMember", node, opts); } function assertEnumDefaultedMember(node, opts) { assert("EnumDefaultedMember", node, opts); } function assertIndexedAccessType(node, opts) { assert("IndexedAccessType", node, opts); } function assertOptionalIndexedAccessType(node, opts) { assert("OptionalIndexedAccessType", node, opts); } function assertJSXAttribute(node, opts) { assert("JSXAttribute", node, opts); } function assertJSXClosingElement(node, opts) { assert("JSXClosingElement", node, opts); } function assertJSXElement(node, opts) { assert("JSXElement", node, opts); } function assertJSXEmptyExpression(node, opts) { assert("JSXEmptyExpression", node, opts); } function assertJSXExpressionContainer(node, opts) { assert("JSXExpressionContainer", node, opts); } function assertJSXSpreadChild(node, opts) { assert("JSXSpreadChild", node, opts); } function assertJSXIdentifier(node, opts) { assert("JSXIdentifier", node, opts); } function assertJSXMemberExpression(node, opts) { assert("JSXMemberExpression", node, opts); } function assertJSXNamespacedName(node, opts) { assert("JSXNamespacedName", node, opts); } function assertJSXOpeningElement(node, opts) { assert("JSXOpeningElement", node, opts); } function assertJSXSpreadAttribute(node, opts) { assert("JSXSpreadAttribute", node, opts); } function assertJSXText(node, opts) { assert("JSXText", node, opts); } function assertJSXFragment(node, opts) { assert("JSXFragment", node, opts); } function assertJSXOpeningFragment(node, opts) { assert("JSXOpeningFragment", node, opts); } function assertJSXClosingFragment(node, opts) { assert("JSXClosingFragment", node, opts); } function assertNoop(node, opts) { assert("Noop", node, opts); } function assertPlaceholder(node, opts) { assert("Placeholder", node, opts); } function assertV8IntrinsicIdentifier(node, opts) { assert("V8IntrinsicIdentifier", node, opts); } function assertArgumentPlaceholder(node, opts) { assert("ArgumentPlaceholder", node, opts); } function assertBindExpression(node, opts) { assert("BindExpression", node, opts); } function assertDecorator(node, opts) { assert("Decorator", node, opts); } function assertDoExpression(node, opts) { assert("DoExpression", node, opts); } function assertExportDefaultSpecifier(node, opts) { assert("ExportDefaultSpecifier", node, opts); } function assertRecordExpression(node, opts) { assert("RecordExpression", node, opts); } function assertTupleExpression(node, opts) { assert("TupleExpression", node, opts); } function assertDecimalLiteral(node, opts) { assert("DecimalLiteral", node, opts); } function assertModuleExpression(node, opts) { assert("ModuleExpression", node, opts); } function assertTopicReference(node, opts) { assert("TopicReference", node, opts); } function assertPipelineTopicExpression(node, opts) { assert("PipelineTopicExpression", node, opts); } function assertPipelineBareFunction(node, opts) { assert("PipelineBareFunction", node, opts); } function assertPipelinePrimaryTopicReference(node, opts) { assert("PipelinePrimaryTopicReference", node, opts); } function assertVoidPattern(node, opts) { assert("VoidPattern", node, opts); } function assertTSParameterProperty(node, opts) { assert("TSParameterProperty", node, opts); } function assertTSDeclareFunction(node, opts) { assert("TSDeclareFunction", node, opts); } function assertTSDeclareMethod(node, opts) { assert("TSDeclareMethod", node, opts); } function assertTSQualifiedName(node, opts) { assert("TSQualifiedName", node, opts); } function assertTSCallSignatureDeclaration(node, opts) { assert("TSCallSignatureDeclaration", node, opts); } function assertTSConstructSignatureDeclaration(node, opts) { assert("TSConstructSignatureDeclaration", node, opts); } function assertTSPropertySignature(node, opts) { assert("TSPropertySignature", node, opts); } function assertTSMethodSignature(node, opts) { assert("TSMethodSignature", node, opts); } function assertTSIndexSignature(node, opts) { assert("TSIndexSignature", node, opts); } function assertTSAnyKeyword(node, opts) { assert("TSAnyKeyword", node, opts); } function assertTSBooleanKeyword(node, opts) { assert("TSBooleanKeyword", node, opts); } function assertTSBigIntKeyword(node, opts) { assert("TSBigIntKeyword", node, opts); } function assertTSIntrinsicKeyword(node, opts) { assert("TSIntrinsicKeyword", node, opts); } function assertTSNeverKeyword(node, opts) { assert("TSNeverKeyword", node, opts); } function assertTSNullKeyword(node, opts) { assert("TSNullKeyword", node, opts); } function assertTSNumberKeyword(node, opts) { assert("TSNumberKeyword", node, opts); } function assertTSObjectKeyword(node, opts) { assert("TSObjectKeyword", node, opts); } function assertTSStringKeyword(node, opts) { assert("TSStringKeyword", node, opts); } function assertTSSymbolKeyword(node, opts) { assert("TSSymbolKeyword", node, opts); } function assertTSUndefinedKeyword(node, opts) { assert("TSUndefinedKeyword", node, opts); } function assertTSUnknownKeyword(node, opts) { assert("TSUnknownKeyword", node, opts); } function assertTSVoidKeyword(node, opts) { assert("TSVoidKeyword", node, opts); } function assertTSThisType(node, opts) { assert("TSThisType", node, opts); } function assertTSFunctionType(node, opts) { assert("TSFunctionType", node, opts); } function assertTSConstructorType(node, opts) { assert("TSConstructorType", node, opts); } function assertTSTypeReference(node, opts) { assert("TSTypeReference", node, opts); } function assertTSTypePredicate(node, opts) { assert("TSTypePredicate", node, opts); } function assertTSTypeQuery(node, opts) { assert("TSTypeQuery", node, opts); } function assertTSTypeLiteral(node, opts) { assert("TSTypeLiteral", node, opts); } function assertTSArrayType(node, opts) { assert("TSArrayType", node, opts); } function assertTSTupleType(node, opts) { assert("TSTupleType", node, opts); } function assertTSOptionalType(node, opts) { assert("TSOptionalType", node, opts); } function assertTSRestType(node, opts) { assert("TSRestType", node, opts); } function assertTSNamedTupleMember(node, opts) { assert("TSNamedTupleMember", node, opts); } function assertTSUnionType(node, opts) { assert("TSUnionType", node, opts); } function assertTSIntersectionType(node, opts) { assert("TSIntersectionType", node, opts); } function assertTSConditionalType(node, opts) { assert("TSConditionalType", node, opts); } function assertTSInferType(node, opts) { assert("TSInferType", node, opts); } function assertTSParenthesizedType(node, opts) { assert("TSParenthesizedType", node, opts); } function assertTSTypeOperator(node, opts) { assert("TSTypeOperator", node, opts); } function assertTSIndexedAccessType(node, opts) { assert("TSIndexedAccessType", node, opts); } function assertTSMappedType(node, opts) { assert("TSMappedType", node, opts); } function assertTSTemplateLiteralType(node, opts) { assert("TSTemplateLiteralType", node, opts); } function assertTSLiteralType(node, opts) { assert("TSLiteralType", node, opts); } function assertTSExpressionWithTypeArguments(node, opts) { assert("TSExpressionWithTypeArguments", node, opts); } function assertTSInterfaceDeclaration(node, opts) { assert("TSInterfaceDeclaration", node, opts); } function assertTSInterfaceBody(node, opts) { assert("TSInterfaceBody", node, opts); } function assertTSTypeAliasDeclaration(node, opts) { assert("TSTypeAliasDeclaration", node, opts); } function assertTSInstantiationExpression(node, opts) { assert("TSInstantiationExpression", node, opts); } function assertTSAsExpression(node, opts) { assert("TSAsExpression", node, opts); } function assertTSSatisfiesExpression(node, opts) { assert("TSSatisfiesExpression", node, opts); } function assertTSTypeAssertion(node, opts) { assert("TSTypeAssertion", node, opts); } function assertTSEnumBody(node, opts) { assert("TSEnumBody", node, opts); } function assertTSEnumDeclaration(node, opts) { assert("TSEnumDeclaration", node, opts); } function assertTSEnumMember(node, opts) { assert("TSEnumMember", node, opts); } function assertTSModuleDeclaration(node, opts) { assert("TSModuleDeclaration", node, opts); } function assertTSModuleBlock(node, opts) { assert("TSModuleBlock", node, opts); } function assertTSImportType(node, opts) { assert("TSImportType", node, opts); } function assertTSImportEqualsDeclaration(node, opts) { assert("TSImportEqualsDeclaration", node, opts); } function assertTSExternalModuleReference(node, opts) { assert("TSExternalModuleReference", node, opts); } function assertTSNonNullExpression(node, opts) { assert("TSNonNullExpression", node, opts); } function assertTSExportAssignment(node, opts) { assert("TSExportAssignment", node, opts); } function assertTSNamespaceExportDeclaration(node, opts) { assert("TSNamespaceExportDeclaration", node, opts); } function assertTSTypeAnnotation(node, opts) { assert("TSTypeAnnotation", node, opts); } function assertTSTypeParameterInstantiation(node, opts) { assert("TSTypeParameterInstantiation", node, opts); } function assertTSTypeParameterDeclaration(node, opts) { assert("TSTypeParameterDeclaration", node, opts); } function assertTSTypeParameter(node, opts) { assert("TSTypeParameter", node, opts); } function assertStandardized(node, opts) { assert("Standardized", node, opts); } function assertExpression(node, opts) { assert("Expression", node, opts); } function assertBinary(node, opts) { assert("Binary", node, opts); } function assertScopable(node, opts) { assert("Scopable", node, opts); } function assertBlockParent(node, opts) { assert("BlockParent", node, opts); } function assertBlock(node, opts) { assert("Block", node, opts); } function assertStatement(node, opts) { assert("Statement", node, opts); } function assertTerminatorless(node, opts) { assert("Terminatorless", node, opts); } function assertCompletionStatement(node, opts) { assert("CompletionStatement", node, opts); } function assertConditional(node, opts) { assert("Conditional", node, opts); } function assertLoop(node, opts) { assert("Loop", node, opts); } function assertWhile(node, opts) { assert("While", node, opts); } function assertExpressionWrapper(node, opts) { assert("ExpressionWrapper", node, opts); } function assertFor(node, opts) { assert("For", node, opts); } function assertForXStatement(node, opts) { assert("ForXStatement", node, opts); } function assertFunction(node, opts) { assert("Function", node, opts); } function assertFunctionParent(node, opts) { assert("FunctionParent", node, opts); } function assertPureish(node, opts) { assert("Pureish", node, opts); } function assertDeclaration(node, opts) { assert("Declaration", node, opts); } function assertFunctionParameter(node, opts) { assert("FunctionParameter", node, opts); } function assertPatternLike(node, opts) { assert("PatternLike", node, opts); } function assertLVal(node, opts) { assert("LVal", node, opts); } function assertTSEntityName(node, opts) { assert("TSEntityName", node, opts); } function assertLiteral(node, opts) { assert("Literal", node, opts); } function assertImmutable(node, opts) { assert("Immutable", node, opts); } function assertUserWhitespacable(node, opts) { assert("UserWhitespacable", node, opts); } function assertMethod(node, opts) { assert("Method", node, opts); } function assertObjectMember(node, opts) { assert("ObjectMember", node, opts); } function assertProperty(node, opts) { assert("Property", node, opts); } function assertUnaryLike(node, opts) { assert("UnaryLike", node, opts); } function assertPattern(node, opts) { assert("Pattern", node, opts); } function assertClass(node, opts) { assert("Class", node, opts); } function assertImportOrExportDeclaration(node, opts) { assert("ImportOrExportDeclaration", node, opts); } function assertExportDeclaration(node, opts) { assert("ExportDeclaration", node, opts); } function assertModuleSpecifier(node, opts) { assert("ModuleSpecifier", node, opts); } function assertAccessor(node, opts) { assert("Accessor", node, opts); } function assertPrivate(node, opts) { assert("Private", node, opts); } function assertFlow(node, opts) { assert("Flow", node, opts); } function assertFlowType(node, opts) { assert("FlowType", node, opts); } function assertFlowBaseAnnotation(node, opts) { assert("FlowBaseAnnotation", node, opts); } function assertFlowDeclaration(node, opts) { assert("FlowDeclaration", node, opts); } function assertFlowPredicate(node, opts) { assert("FlowPredicate", node, opts); } function assertEnumBody(node, opts) { assert("EnumBody", node, opts); } function assertEnumMember(node, opts) { assert("EnumMember", node, opts); } function assertJSX(node, opts) { assert("JSX", node, opts); } function assertMiscellaneous(node, opts) { assert("Miscellaneous", node, opts); } function assertTypeScript(node, opts) { assert("TypeScript", node, opts); } function assertTSTypeElement(node, opts) { assert("TSTypeElement", node, opts); } function assertTSType(node, opts) { assert("TSType", node, opts); } function assertTSBaseType(node, opts) { assert("TSBaseType", node, opts); } function assertNumberLiteral(node, opts) { (0, _deprecationWarning.default)("assertNumberLiteral", "assertNumericLiteral"); assert("NumberLiteral", node, opts); } function assertRegexLiteral(node, opts) { (0, _deprecationWarning.default)("assertRegexLiteral", "assertRegExpLiteral"); assert("RegexLiteral", node, opts); } function assertRestProperty(node, opts) { (0, _deprecationWarning.default)("assertRestProperty", "assertRestElement"); assert("RestProperty", node, opts); } function assertSpreadProperty(node, opts) { (0, _deprecationWarning.default)("assertSpreadProperty", "assertSpreadElement"); assert("SpreadProperty", node, opts); } function assertModuleDeclaration(node, opts) { (0, _deprecationWarning.default)("assertModuleDeclaration", "assertImportOrExportDeclaration"); assert("ModuleDeclaration", node, opts); } //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js": /*!****************************************************************************!*\ !*** ./node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js ***! \****************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = createFlowUnionType; var _index = __webpack_require__(/*! ../generated/index.js */ "./node_modules/@babel/types/lib/builders/generated/index.js"); var _removeTypeDuplicates = __webpack_require__(/*! ../../modifications/flow/removeTypeDuplicates.js */ "./node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js"); function createFlowUnionType(types) { const flattened = (0, _removeTypeDuplicates.default)(types); if (flattened.length === 1) { return flattened[0]; } else { return (0, _index.unionTypeAnnotation)(flattened); } } //# sourceMappingURL=createFlowUnionType.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js": /*!******************************************************************************************!*\ !*** ./node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js ***! \******************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _index = __webpack_require__(/*! ../generated/index.js */ "./node_modules/@babel/types/lib/builders/generated/index.js"); var _default = exports["default"] = createTypeAnnotationBasedOnTypeof; function createTypeAnnotationBasedOnTypeof(type) { switch (type) { case "string": return (0, _index.stringTypeAnnotation)(); case "number": return (0, _index.numberTypeAnnotation)(); case "undefined": return (0, _index.voidTypeAnnotation)(); case "boolean": return (0, _index.booleanTypeAnnotation)(); case "function": return (0, _index.genericTypeAnnotation)((0, _index.identifier)("Function")); case "object": return (0, _index.genericTypeAnnotation)((0, _index.identifier)("Object")); case "symbol": return (0, _index.genericTypeAnnotation)((0, _index.identifier)("Symbol")); case "bigint": return (0, _index.anyTypeAnnotation)(); } throw new Error("Invalid typeof value: " + type); } //# sourceMappingURL=createTypeAnnotationBasedOnTypeof.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/builders/generated/index.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/types/lib/builders/generated/index.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); var _lowercase = __webpack_require__(/*! ./lowercase.js */ "./node_modules/@babel/types/lib/builders/generated/lowercase.js"); Object.keys(_lowercase).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _lowercase[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _lowercase[key]; } }); }); var _uppercase = __webpack_require__(/*! ./uppercase.js */ "./node_modules/@babel/types/lib/builders/generated/uppercase.js"); Object.keys(_uppercase).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _uppercase[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _uppercase[key]; } }); }); //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/builders/generated/lowercase.js": /*!***********************************************************************!*\ !*** ./node_modules/@babel/types/lib/builders/generated/lowercase.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.anyTypeAnnotation = anyTypeAnnotation; exports.argumentPlaceholder = argumentPlaceholder; exports.arrayExpression = arrayExpression; exports.arrayPattern = arrayPattern; exports.arrayTypeAnnotation = arrayTypeAnnotation; exports.arrowFunctionExpression = arrowFunctionExpression; exports.assignmentExpression = assignmentExpression; exports.assignmentPattern = assignmentPattern; exports.awaitExpression = awaitExpression; exports.bigIntLiteral = bigIntLiteral; exports.binaryExpression = binaryExpression; exports.bindExpression = bindExpression; exports.blockStatement = blockStatement; exports.booleanLiteral = booleanLiteral; exports.booleanLiteralTypeAnnotation = booleanLiteralTypeAnnotation; exports.booleanTypeAnnotation = booleanTypeAnnotation; exports.breakStatement = breakStatement; exports.callExpression = callExpression; exports.catchClause = catchClause; exports.classAccessorProperty = classAccessorProperty; exports.classBody = classBody; exports.classDeclaration = classDeclaration; exports.classExpression = classExpression; exports.classImplements = classImplements; exports.classMethod = classMethod; exports.classPrivateMethod = classPrivateMethod; exports.classPrivateProperty = classPrivateProperty; exports.classProperty = classProperty; exports.conditionalExpression = conditionalExpression; exports.continueStatement = continueStatement; exports.debuggerStatement = debuggerStatement; exports.decimalLiteral = decimalLiteral; exports.declareClass = declareClass; exports.declareExportAllDeclaration = declareExportAllDeclaration; exports.declareExportDeclaration = declareExportDeclaration; exports.declareFunction = declareFunction; exports.declareInterface = declareInterface; exports.declareModule = declareModule; exports.declareModuleExports = declareModuleExports; exports.declareOpaqueType = declareOpaqueType; exports.declareTypeAlias = declareTypeAlias; exports.declareVariable = declareVariable; exports.declaredPredicate = declaredPredicate; exports.decorator = decorator; exports.directive = directive; exports.directiveLiteral = directiveLiteral; exports.doExpression = doExpression; exports.doWhileStatement = doWhileStatement; exports.emptyStatement = emptyStatement; exports.emptyTypeAnnotation = emptyTypeAnnotation; exports.enumBooleanBody = enumBooleanBody; exports.enumBooleanMember = enumBooleanMember; exports.enumDeclaration = enumDeclaration; exports.enumDefaultedMember = enumDefaultedMember; exports.enumNumberBody = enumNumberBody; exports.enumNumberMember = enumNumberMember; exports.enumStringBody = enumStringBody; exports.enumStringMember = enumStringMember; exports.enumSymbolBody = enumSymbolBody; exports.existsTypeAnnotation = existsTypeAnnotation; exports.exportAllDeclaration = exportAllDeclaration; exports.exportDefaultDeclaration = exportDefaultDeclaration; exports.exportDefaultSpecifier = exportDefaultSpecifier; exports.exportNamedDeclaration = exportNamedDeclaration; exports.exportNamespaceSpecifier = exportNamespaceSpecifier; exports.exportSpecifier = exportSpecifier; exports.expressionStatement = expressionStatement; exports.file = file; exports.forInStatement = forInStatement; exports.forOfStatement = forOfStatement; exports.forStatement = forStatement; exports.functionDeclaration = functionDeclaration; exports.functionExpression = functionExpression; exports.functionTypeAnnotation = functionTypeAnnotation; exports.functionTypeParam = functionTypeParam; exports.genericTypeAnnotation = genericTypeAnnotation; exports.identifier = identifier; exports.ifStatement = ifStatement; exports["import"] = _import; exports.importAttribute = importAttribute; exports.importDeclaration = importDeclaration; exports.importDefaultSpecifier = importDefaultSpecifier; exports.importExpression = importExpression; exports.importNamespaceSpecifier = importNamespaceSpecifier; exports.importSpecifier = importSpecifier; exports.indexedAccessType = indexedAccessType; exports.inferredPredicate = inferredPredicate; exports.interfaceDeclaration = interfaceDeclaration; exports.interfaceExtends = interfaceExtends; exports.interfaceTypeAnnotation = interfaceTypeAnnotation; exports.interpreterDirective = interpreterDirective; exports.intersectionTypeAnnotation = intersectionTypeAnnotation; exports.jSXAttribute = exports.jsxAttribute = jsxAttribute; exports.jSXClosingElement = exports.jsxClosingElement = jsxClosingElement; exports.jSXClosingFragment = exports.jsxClosingFragment = jsxClosingFragment; exports.jSXElement = exports.jsxElement = jsxElement; exports.jSXEmptyExpression = exports.jsxEmptyExpression = jsxEmptyExpression; exports.jSXExpressionContainer = exports.jsxExpressionContainer = jsxExpressionContainer; exports.jSXFragment = exports.jsxFragment = jsxFragment; exports.jSXIdentifier = exports.jsxIdentifier = jsxIdentifier; exports.jSXMemberExpression = exports.jsxMemberExpression = jsxMemberExpression; exports.jSXNamespacedName = exports.jsxNamespacedName = jsxNamespacedName; exports.jSXOpeningElement = exports.jsxOpeningElement = jsxOpeningElement; exports.jSXOpeningFragment = exports.jsxOpeningFragment = jsxOpeningFragment; exports.jSXSpreadAttribute = exports.jsxSpreadAttribute = jsxSpreadAttribute; exports.jSXSpreadChild = exports.jsxSpreadChild = jsxSpreadChild; exports.jSXText = exports.jsxText = jsxText; exports.labeledStatement = labeledStatement; exports.logicalExpression = logicalExpression; exports.memberExpression = memberExpression; exports.metaProperty = metaProperty; exports.mixedTypeAnnotation = mixedTypeAnnotation; exports.moduleExpression = moduleExpression; exports.newExpression = newExpression; exports.noop = noop; exports.nullLiteral = nullLiteral; exports.nullLiteralTypeAnnotation = nullLiteralTypeAnnotation; exports.nullableTypeAnnotation = nullableTypeAnnotation; exports.numberLiteral = NumberLiteral; exports.numberLiteralTypeAnnotation = numberLiteralTypeAnnotation; exports.numberTypeAnnotation = numberTypeAnnotation; exports.numericLiteral = numericLiteral; exports.objectExpression = objectExpression; exports.objectMethod = objectMethod; exports.objectPattern = objectPattern; exports.objectProperty = objectProperty; exports.objectTypeAnnotation = objectTypeAnnotation; exports.objectTypeCallProperty = objectTypeCallProperty; exports.objectTypeIndexer = objectTypeIndexer; exports.objectTypeInternalSlot = objectTypeInternalSlot; exports.objectTypeProperty = objectTypeProperty; exports.objectTypeSpreadProperty = objectTypeSpreadProperty; exports.opaqueType = opaqueType; exports.optionalCallExpression = optionalCallExpression; exports.optionalIndexedAccessType = optionalIndexedAccessType; exports.optionalMemberExpression = optionalMemberExpression; exports.parenthesizedExpression = parenthesizedExpression; exports.pipelineBareFunction = pipelineBareFunction; exports.pipelinePrimaryTopicReference = pipelinePrimaryTopicReference; exports.pipelineTopicExpression = pipelineTopicExpression; exports.placeholder = placeholder; exports.privateName = privateName; exports.program = program; exports.qualifiedTypeIdentifier = qualifiedTypeIdentifier; exports.recordExpression = recordExpression; exports.regExpLiteral = regExpLiteral; exports.regexLiteral = RegexLiteral; exports.restElement = restElement; exports.restProperty = RestProperty; exports.returnStatement = returnStatement; exports.sequenceExpression = sequenceExpression; exports.spreadElement = spreadElement; exports.spreadProperty = SpreadProperty; exports.staticBlock = staticBlock; exports.stringLiteral = stringLiteral; exports.stringLiteralTypeAnnotation = stringLiteralTypeAnnotation; exports.stringTypeAnnotation = stringTypeAnnotation; exports["super"] = _super; exports.switchCase = switchCase; exports.switchStatement = switchStatement; exports.symbolTypeAnnotation = symbolTypeAnnotation; exports.taggedTemplateExpression = taggedTemplateExpression; exports.templateElement = templateElement; exports.templateLiteral = templateLiteral; exports.thisExpression = thisExpression; exports.thisTypeAnnotation = thisTypeAnnotation; exports.throwStatement = throwStatement; exports.topicReference = topicReference; exports.tryStatement = tryStatement; exports.tSAnyKeyword = exports.tsAnyKeyword = tsAnyKeyword; exports.tSArrayType = exports.tsArrayType = tsArrayType; exports.tSAsExpression = exports.tsAsExpression = tsAsExpression; exports.tSBigIntKeyword = exports.tsBigIntKeyword = tsBigIntKeyword; exports.tSBooleanKeyword = exports.tsBooleanKeyword = tsBooleanKeyword; exports.tSCallSignatureDeclaration = exports.tsCallSignatureDeclaration = tsCallSignatureDeclaration; exports.tSConditionalType = exports.tsConditionalType = tsConditionalType; exports.tSConstructSignatureDeclaration = exports.tsConstructSignatureDeclaration = tsConstructSignatureDeclaration; exports.tSConstructorType = exports.tsConstructorType = tsConstructorType; exports.tSDeclareFunction = exports.tsDeclareFunction = tsDeclareFunction; exports.tSDeclareMethod = exports.tsDeclareMethod = tsDeclareMethod; exports.tSEnumBody = exports.tsEnumBody = tsEnumBody; exports.tSEnumDeclaration = exports.tsEnumDeclaration = tsEnumDeclaration; exports.tSEnumMember = exports.tsEnumMember = tsEnumMember; exports.tSExportAssignment = exports.tsExportAssignment = tsExportAssignment; exports.tSExpressionWithTypeArguments = exports.tsExpressionWithTypeArguments = tsExpressionWithTypeArguments; exports.tSExternalModuleReference = exports.tsExternalModuleReference = tsExternalModuleReference; exports.tSFunctionType = exports.tsFunctionType = tsFunctionType; exports.tSImportEqualsDeclaration = exports.tsImportEqualsDeclaration = tsImportEqualsDeclaration; exports.tSImportType = exports.tsImportType = tsImportType; exports.tSIndexSignature = exports.tsIndexSignature = tsIndexSignature; exports.tSIndexedAccessType = exports.tsIndexedAccessType = tsIndexedAccessType; exports.tSInferType = exports.tsInferType = tsInferType; exports.tSInstantiationExpression = exports.tsInstantiationExpression = tsInstantiationExpression; exports.tSInterfaceBody = exports.tsInterfaceBody = tsInterfaceBody; exports.tSInterfaceDeclaration = exports.tsInterfaceDeclaration = tsInterfaceDeclaration; exports.tSIntersectionType = exports.tsIntersectionType = tsIntersectionType; exports.tSIntrinsicKeyword = exports.tsIntrinsicKeyword = tsIntrinsicKeyword; exports.tSLiteralType = exports.tsLiteralType = tsLiteralType; exports.tSMappedType = exports.tsMappedType = tsMappedType; exports.tSMethodSignature = exports.tsMethodSignature = tsMethodSignature; exports.tSModuleBlock = exports.tsModuleBlock = tsModuleBlock; exports.tSModuleDeclaration = exports.tsModuleDeclaration = tsModuleDeclaration; exports.tSNamedTupleMember = exports.tsNamedTupleMember = tsNamedTupleMember; exports.tSNamespaceExportDeclaration = exports.tsNamespaceExportDeclaration = tsNamespaceExportDeclaration; exports.tSNeverKeyword = exports.tsNeverKeyword = tsNeverKeyword; exports.tSNonNullExpression = exports.tsNonNullExpression = tsNonNullExpression; exports.tSNullKeyword = exports.tsNullKeyword = tsNullKeyword; exports.tSNumberKeyword = exports.tsNumberKeyword = tsNumberKeyword; exports.tSObjectKeyword = exports.tsObjectKeyword = tsObjectKeyword; exports.tSOptionalType = exports.tsOptionalType = tsOptionalType; exports.tSParameterProperty = exports.tsParameterProperty = tsParameterProperty; exports.tSParenthesizedType = exports.tsParenthesizedType = tsParenthesizedType; exports.tSPropertySignature = exports.tsPropertySignature = tsPropertySignature; exports.tSQualifiedName = exports.tsQualifiedName = tsQualifiedName; exports.tSRestType = exports.tsRestType = tsRestType; exports.tSSatisfiesExpression = exports.tsSatisfiesExpression = tsSatisfiesExpression; exports.tSStringKeyword = exports.tsStringKeyword = tsStringKeyword; exports.tSSymbolKeyword = exports.tsSymbolKeyword = tsSymbolKeyword; exports.tSTemplateLiteralType = exports.tsTemplateLiteralType = tsTemplateLiteralType; exports.tSThisType = exports.tsThisType = tsThisType; exports.tSTupleType = exports.tsTupleType = tsTupleType; exports.tSTypeAliasDeclaration = exports.tsTypeAliasDeclaration = tsTypeAliasDeclaration; exports.tSTypeAnnotation = exports.tsTypeAnnotation = tsTypeAnnotation; exports.tSTypeAssertion = exports.tsTypeAssertion = tsTypeAssertion; exports.tSTypeLiteral = exports.tsTypeLiteral = tsTypeLiteral; exports.tSTypeOperator = exports.tsTypeOperator = tsTypeOperator; exports.tSTypeParameter = exports.tsTypeParameter = tsTypeParameter; exports.tSTypeParameterDeclaration = exports.tsTypeParameterDeclaration = tsTypeParameterDeclaration; exports.tSTypeParameterInstantiation = exports.tsTypeParameterInstantiation = tsTypeParameterInstantiation; exports.tSTypePredicate = exports.tsTypePredicate = tsTypePredicate; exports.tSTypeQuery = exports.tsTypeQuery = tsTypeQuery; exports.tSTypeReference = exports.tsTypeReference = tsTypeReference; exports.tSUndefinedKeyword = exports.tsUndefinedKeyword = tsUndefinedKeyword; exports.tSUnionType = exports.tsUnionType = tsUnionType; exports.tSUnknownKeyword = exports.tsUnknownKeyword = tsUnknownKeyword; exports.tSVoidKeyword = exports.tsVoidKeyword = tsVoidKeyword; exports.tupleExpression = tupleExpression; exports.tupleTypeAnnotation = tupleTypeAnnotation; exports.typeAlias = typeAlias; exports.typeAnnotation = typeAnnotation; exports.typeCastExpression = typeCastExpression; exports.typeParameter = typeParameter; exports.typeParameterDeclaration = typeParameterDeclaration; exports.typeParameterInstantiation = typeParameterInstantiation; exports.typeofTypeAnnotation = typeofTypeAnnotation; exports.unaryExpression = unaryExpression; exports.unionTypeAnnotation = unionTypeAnnotation; exports.updateExpression = updateExpression; exports.v8IntrinsicIdentifier = v8IntrinsicIdentifier; exports.variableDeclaration = variableDeclaration; exports.variableDeclarator = variableDeclarator; exports.variance = variance; exports.voidPattern = voidPattern; exports.voidTypeAnnotation = voidTypeAnnotation; exports.whileStatement = whileStatement; exports.withStatement = withStatement; exports.yieldExpression = yieldExpression; var _validate = __webpack_require__(/*! ../../validators/validate.js */ "./node_modules/@babel/types/lib/validators/validate.js"); var _deprecationWarning = __webpack_require__(/*! ../../utils/deprecationWarning.js */ "./node_modules/@babel/types/lib/utils/deprecationWarning.js"); var utils = __webpack_require__(/*! ../../definitions/utils.js */ "./node_modules/@babel/types/lib/definitions/utils.js"); const { validateInternal: validate } = _validate; const { NODE_FIELDS } = utils; function bigIntLiteral(value) { if (typeof value === "bigint") { value = value.toString(); } const node = { type: "BigIntLiteral", value }; const defs = NODE_FIELDS.BigIntLiteral; validate(defs.value, node, "value", value); return node; } function arrayExpression(elements = []) { const node = { type: "ArrayExpression", elements }; const defs = NODE_FIELDS.ArrayExpression; validate(defs.elements, node, "elements", elements, 1); return node; } function assignmentExpression(operator, left, right) { const node = { type: "AssignmentExpression", operator, left, right }; const defs = NODE_FIELDS.AssignmentExpression; validate(defs.operator, node, "operator", operator); validate(defs.left, node, "left", left, 1); validate(defs.right, node, "right", right, 1); return node; } function binaryExpression(operator, left, right) { const node = { type: "BinaryExpression", operator, left, right }; const defs = NODE_FIELDS.BinaryExpression; validate(defs.operator, node, "operator", operator); validate(defs.left, node, "left", left, 1); validate(defs.right, node, "right", right, 1); return node; } function interpreterDirective(value) { const node = { type: "InterpreterDirective", value }; const defs = NODE_FIELDS.InterpreterDirective; validate(defs.value, node, "value", value); return node; } function directive(value) { const node = { type: "Directive", value }; const defs = NODE_FIELDS.Directive; validate(defs.value, node, "value", value, 1); return node; } function directiveLiteral(value) { const node = { type: "DirectiveLiteral", value }; const defs = NODE_FIELDS.DirectiveLiteral; validate(defs.value, node, "value", value); return node; } function blockStatement(body, directives = []) { const node = { type: "BlockStatement", body, directives }; const defs = NODE_FIELDS.BlockStatement; validate(defs.body, node, "body", body, 1); validate(defs.directives, node, "directives", directives, 1); return node; } function breakStatement(label = null) { const node = { type: "BreakStatement", label }; const defs = NODE_FIELDS.BreakStatement; validate(defs.label, node, "label", label, 1); return node; } function callExpression(callee, _arguments) { const node = { type: "CallExpression", callee, arguments: _arguments }; const defs = NODE_FIELDS.CallExpression; validate(defs.callee, node, "callee", callee, 1); validate(defs.arguments, node, "arguments", _arguments, 1); return node; } function catchClause(param = null, body) { const node = { type: "CatchClause", param, body }; const defs = NODE_FIELDS.CatchClause; validate(defs.param, node, "param", param, 1); validate(defs.body, node, "body", body, 1); return node; } function conditionalExpression(test, consequent, alternate) { const node = { type: "ConditionalExpression", test, consequent, alternate }; const defs = NODE_FIELDS.ConditionalExpression; validate(defs.test, node, "test", test, 1); validate(defs.consequent, node, "consequent", consequent, 1); validate(defs.alternate, node, "alternate", alternate, 1); return node; } function continueStatement(label = null) { const node = { type: "ContinueStatement", label }; const defs = NODE_FIELDS.ContinueStatement; validate(defs.label, node, "label", label, 1); return node; } function debuggerStatement() { return { type: "DebuggerStatement" }; } function doWhileStatement(test, body) { const node = { type: "DoWhileStatement", test, body }; const defs = NODE_FIELDS.DoWhileStatement; validate(defs.test, node, "test", test, 1); validate(defs.body, node, "body", body, 1); return node; } function emptyStatement() { return { type: "EmptyStatement" }; } function expressionStatement(expression) { const node = { type: "ExpressionStatement", expression }; const defs = NODE_FIELDS.ExpressionStatement; validate(defs.expression, node, "expression", expression, 1); return node; } function file(program, comments = null, tokens = null) { const node = { type: "File", program, comments, tokens }; const defs = NODE_FIELDS.File; validate(defs.program, node, "program", program, 1); validate(defs.comments, node, "comments", comments, 1); validate(defs.tokens, node, "tokens", tokens); return node; } function forInStatement(left, right, body) { const node = { type: "ForInStatement", left, right, body }; const defs = NODE_FIELDS.ForInStatement; validate(defs.left, node, "left", left, 1); validate(defs.right, node, "right", right, 1); validate(defs.body, node, "body", body, 1); return node; } function forStatement(init = null, test = null, update = null, body) { const node = { type: "ForStatement", init, test, update, body }; const defs = NODE_FIELDS.ForStatement; validate(defs.init, node, "init", init, 1); validate(defs.test, node, "test", test, 1); validate(defs.update, node, "update", update, 1); validate(defs.body, node, "body", body, 1); return node; } function functionDeclaration(id = null, params, body, generator = false, async = false) { const node = { type: "FunctionDeclaration", id, params, body, generator, async }; const defs = NODE_FIELDS.FunctionDeclaration; validate(defs.id, node, "id", id, 1); validate(defs.params, node, "params", params, 1); validate(defs.body, node, "body", body, 1); validate(defs.generator, node, "generator", generator); validate(defs.async, node, "async", async); return node; } function functionExpression(id = null, params, body, generator = false, async = false) { const node = { type: "FunctionExpression", id, params, body, generator, async }; const defs = NODE_FIELDS.FunctionExpression; validate(defs.id, node, "id", id, 1); validate(defs.params, node, "params", params, 1); validate(defs.body, node, "body", body, 1); validate(defs.generator, node, "generator", generator); validate(defs.async, node, "async", async); return node; } function identifier(name) { const node = { type: "Identifier", name }; const defs = NODE_FIELDS.Identifier; validate(defs.name, node, "name", name); return node; } function ifStatement(test, consequent, alternate = null) { const node = { type: "IfStatement", test, consequent, alternate }; const defs = NODE_FIELDS.IfStatement; validate(defs.test, node, "test", test, 1); validate(defs.consequent, node, "consequent", consequent, 1); validate(defs.alternate, node, "alternate", alternate, 1); return node; } function labeledStatement(label, body) { const node = { type: "LabeledStatement", label, body }; const defs = NODE_FIELDS.LabeledStatement; validate(defs.label, node, "label", label, 1); validate(defs.body, node, "body", body, 1); return node; } function stringLiteral(value) { const node = { type: "StringLiteral", value }; const defs = NODE_FIELDS.StringLiteral; validate(defs.value, node, "value", value); return node; } function numericLiteral(value) { const node = { type: "NumericLiteral", value }; const defs = NODE_FIELDS.NumericLiteral; validate(defs.value, node, "value", value); return node; } function nullLiteral() { return { type: "NullLiteral" }; } function booleanLiteral(value) { const node = { type: "BooleanLiteral", value }; const defs = NODE_FIELDS.BooleanLiteral; validate(defs.value, node, "value", value); return node; } function regExpLiteral(pattern, flags = "") { const node = { type: "RegExpLiteral", pattern, flags }; const defs = NODE_FIELDS.RegExpLiteral; validate(defs.pattern, node, "pattern", pattern); validate(defs.flags, node, "flags", flags); return node; } function logicalExpression(operator, left, right) { const node = { type: "LogicalExpression", operator, left, right }; const defs = NODE_FIELDS.LogicalExpression; validate(defs.operator, node, "operator", operator); validate(defs.left, node, "left", left, 1); validate(defs.right, node, "right", right, 1); return node; } function memberExpression(object, property, computed = false, optional = null) { const node = { type: "MemberExpression", object, property, computed, optional }; const defs = NODE_FIELDS.MemberExpression; validate(defs.object, node, "object", object, 1); validate(defs.property, node, "property", property, 1); validate(defs.computed, node, "computed", computed); validate(defs.optional, node, "optional", optional); return node; } function newExpression(callee, _arguments) { const node = { type: "NewExpression", callee, arguments: _arguments }; const defs = NODE_FIELDS.NewExpression; validate(defs.callee, node, "callee", callee, 1); validate(defs.arguments, node, "arguments", _arguments, 1); return node; } function program(body, directives = [], sourceType = "script", interpreter = null) { const node = { type: "Program", body, directives, sourceType, interpreter }; const defs = NODE_FIELDS.Program; validate(defs.body, node, "body", body, 1); validate(defs.directives, node, "directives", directives, 1); validate(defs.sourceType, node, "sourceType", sourceType); validate(defs.interpreter, node, "interpreter", interpreter, 1); return node; } function objectExpression(properties) { const node = { type: "ObjectExpression", properties }; const defs = NODE_FIELDS.ObjectExpression; validate(defs.properties, node, "properties", properties, 1); return node; } function objectMethod(kind = "method", key, params, body, computed = false, generator = false, async = false) { const node = { type: "ObjectMethod", kind, key, params, body, computed, generator, async }; const defs = NODE_FIELDS.ObjectMethod; validate(defs.kind, node, "kind", kind); validate(defs.key, node, "key", key, 1); validate(defs.params, node, "params", params, 1); validate(defs.body, node, "body", body, 1); validate(defs.computed, node, "computed", computed); validate(defs.generator, node, "generator", generator); validate(defs.async, node, "async", async); return node; } function objectProperty(key, value, computed = false, shorthand = false, decorators = null) { const node = { type: "ObjectProperty", key, value, computed, shorthand, decorators }; const defs = NODE_FIELDS.ObjectProperty; validate(defs.key, node, "key", key, 1); validate(defs.value, node, "value", value, 1); validate(defs.computed, node, "computed", computed); validate(defs.shorthand, node, "shorthand", shorthand); validate(defs.decorators, node, "decorators", decorators, 1); return node; } function restElement(argument) { const node = { type: "RestElement", argument }; const defs = NODE_FIELDS.RestElement; validate(defs.argument, node, "argument", argument, 1); return node; } function returnStatement(argument = null) { const node = { type: "ReturnStatement", argument }; const defs = NODE_FIELDS.ReturnStatement; validate(defs.argument, node, "argument", argument, 1); return node; } function sequenceExpression(expressions) { const node = { type: "SequenceExpression", expressions }; const defs = NODE_FIELDS.SequenceExpression; validate(defs.expressions, node, "expressions", expressions, 1); return node; } function parenthesizedExpression(expression) { const node = { type: "ParenthesizedExpression", expression }; const defs = NODE_FIELDS.ParenthesizedExpression; validate(defs.expression, node, "expression", expression, 1); return node; } function switchCase(test = null, consequent) { const node = { type: "SwitchCase", test, consequent }; const defs = NODE_FIELDS.SwitchCase; validate(defs.test, node, "test", test, 1); validate(defs.consequent, node, "consequent", consequent, 1); return node; } function switchStatement(discriminant, cases) { const node = { type: "SwitchStatement", discriminant, cases }; const defs = NODE_FIELDS.SwitchStatement; validate(defs.discriminant, node, "discriminant", discriminant, 1); validate(defs.cases, node, "cases", cases, 1); return node; } function thisExpression() { return { type: "ThisExpression" }; } function throwStatement(argument) { const node = { type: "ThrowStatement", argument }; const defs = NODE_FIELDS.ThrowStatement; validate(defs.argument, node, "argument", argument, 1); return node; } function tryStatement(block, handler = null, finalizer = null) { const node = { type: "TryStatement", block, handler, finalizer }; const defs = NODE_FIELDS.TryStatement; validate(defs.block, node, "block", block, 1); validate(defs.handler, node, "handler", handler, 1); validate(defs.finalizer, node, "finalizer", finalizer, 1); return node; } function unaryExpression(operator, argument, prefix = true) { const node = { type: "UnaryExpression", operator, argument, prefix }; const defs = NODE_FIELDS.UnaryExpression; validate(defs.operator, node, "operator", operator); validate(defs.argument, node, "argument", argument, 1); validate(defs.prefix, node, "prefix", prefix); return node; } function updateExpression(operator, argument, prefix = false) { const node = { type: "UpdateExpression", operator, argument, prefix }; const defs = NODE_FIELDS.UpdateExpression; validate(defs.operator, node, "operator", operator); validate(defs.argument, node, "argument", argument, 1); validate(defs.prefix, node, "prefix", prefix); return node; } function variableDeclaration(kind, declarations) { const node = { type: "VariableDeclaration", kind, declarations }; const defs = NODE_FIELDS.VariableDeclaration; validate(defs.kind, node, "kind", kind); validate(defs.declarations, node, "declarations", declarations, 1); return node; } function variableDeclarator(id, init = null) { const node = { type: "VariableDeclarator", id, init }; const defs = NODE_FIELDS.VariableDeclarator; validate(defs.id, node, "id", id, 1); validate(defs.init, node, "init", init, 1); return node; } function whileStatement(test, body) { const node = { type: "WhileStatement", test, body }; const defs = NODE_FIELDS.WhileStatement; validate(defs.test, node, "test", test, 1); validate(defs.body, node, "body", body, 1); return node; } function withStatement(object, body) { const node = { type: "WithStatement", object, body }; const defs = NODE_FIELDS.WithStatement; validate(defs.object, node, "object", object, 1); validate(defs.body, node, "body", body, 1); return node; } function assignmentPattern(left, right) { const node = { type: "AssignmentPattern", left, right }; const defs = NODE_FIELDS.AssignmentPattern; validate(defs.left, node, "left", left, 1); validate(defs.right, node, "right", right, 1); return node; } function arrayPattern(elements) { const node = { type: "ArrayPattern", elements }; const defs = NODE_FIELDS.ArrayPattern; validate(defs.elements, node, "elements", elements, 1); return node; } function arrowFunctionExpression(params, body, async = false) { const node = { type: "ArrowFunctionExpression", params, body, async, expression: null }; const defs = NODE_FIELDS.ArrowFunctionExpression; validate(defs.params, node, "params", params, 1); validate(defs.body, node, "body", body, 1); validate(defs.async, node, "async", async); return node; } function classBody(body) { const node = { type: "ClassBody", body }; const defs = NODE_FIELDS.ClassBody; validate(defs.body, node, "body", body, 1); return node; } function classExpression(id = null, superClass = null, body, decorators = null) { const node = { type: "ClassExpression", id, superClass, body, decorators }; const defs = NODE_FIELDS.ClassExpression; validate(defs.id, node, "id", id, 1); validate(defs.superClass, node, "superClass", superClass, 1); validate(defs.body, node, "body", body, 1); validate(defs.decorators, node, "decorators", decorators, 1); return node; } function classDeclaration(id = null, superClass = null, body, decorators = null) { const node = { type: "ClassDeclaration", id, superClass, body, decorators }; const defs = NODE_FIELDS.ClassDeclaration; validate(defs.id, node, "id", id, 1); validate(defs.superClass, node, "superClass", superClass, 1); validate(defs.body, node, "body", body, 1); validate(defs.decorators, node, "decorators", decorators, 1); return node; } function exportAllDeclaration(source) { const node = { type: "ExportAllDeclaration", source }; const defs = NODE_FIELDS.ExportAllDeclaration; validate(defs.source, node, "source", source, 1); return node; } function exportDefaultDeclaration(declaration) { const node = { type: "ExportDefaultDeclaration", declaration }; const defs = NODE_FIELDS.ExportDefaultDeclaration; validate(defs.declaration, node, "declaration", declaration, 1); return node; } function exportNamedDeclaration(declaration = null, specifiers = [], source = null) { const node = { type: "ExportNamedDeclaration", declaration, specifiers, source }; const defs = NODE_FIELDS.ExportNamedDeclaration; validate(defs.declaration, node, "declaration", declaration, 1); validate(defs.specifiers, node, "specifiers", specifiers, 1); validate(defs.source, node, "source", source, 1); return node; } function exportSpecifier(local, exported) { const node = { type: "ExportSpecifier", local, exported }; const defs = NODE_FIELDS.ExportSpecifier; validate(defs.local, node, "local", local, 1); validate(defs.exported, node, "exported", exported, 1); return node; } function forOfStatement(left, right, body, _await = false) { const node = { type: "ForOfStatement", left, right, body, await: _await }; const defs = NODE_FIELDS.ForOfStatement; validate(defs.left, node, "left", left, 1); validate(defs.right, node, "right", right, 1); validate(defs.body, node, "body", body, 1); validate(defs.await, node, "await", _await); return node; } function importDeclaration(specifiers, source) { const node = { type: "ImportDeclaration", specifiers, source }; const defs = NODE_FIELDS.ImportDeclaration; validate(defs.specifiers, node, "specifiers", specifiers, 1); validate(defs.source, node, "source", source, 1); return node; } function importDefaultSpecifier(local) { const node = { type: "ImportDefaultSpecifier", local }; const defs = NODE_FIELDS.ImportDefaultSpecifier; validate(defs.local, node, "local", local, 1); return node; } function importNamespaceSpecifier(local) { const node = { type: "ImportNamespaceSpecifier", local }; const defs = NODE_FIELDS.ImportNamespaceSpecifier; validate(defs.local, node, "local", local, 1); return node; } function importSpecifier(local, imported) { const node = { type: "ImportSpecifier", local, imported }; const defs = NODE_FIELDS.ImportSpecifier; validate(defs.local, node, "local", local, 1); validate(defs.imported, node, "imported", imported, 1); return node; } function importExpression(source, options = null) { const node = { type: "ImportExpression", source, options }; const defs = NODE_FIELDS.ImportExpression; validate(defs.source, node, "source", source, 1); validate(defs.options, node, "options", options, 1); return node; } function metaProperty(meta, property) { const node = { type: "MetaProperty", meta, property }; const defs = NODE_FIELDS.MetaProperty; validate(defs.meta, node, "meta", meta, 1); validate(defs.property, node, "property", property, 1); return node; } function classMethod(kind = "method", key, params, body, computed = false, _static = false, generator = false, async = false) { const node = { type: "ClassMethod", kind, key, params, body, computed, static: _static, generator, async }; const defs = NODE_FIELDS.ClassMethod; validate(defs.kind, node, "kind", kind); validate(defs.key, node, "key", key, 1); validate(defs.params, node, "params", params, 1); validate(defs.body, node, "body", body, 1); validate(defs.computed, node, "computed", computed); validate(defs.static, node, "static", _static); validate(defs.generator, node, "generator", generator); validate(defs.async, node, "async", async); return node; } function objectPattern(properties) { const node = { type: "ObjectPattern", properties }; const defs = NODE_FIELDS.ObjectPattern; validate(defs.properties, node, "properties", properties, 1); return node; } function spreadElement(argument) { const node = { type: "SpreadElement", argument }; const defs = NODE_FIELDS.SpreadElement; validate(defs.argument, node, "argument", argument, 1); return node; } function _super() { return { type: "Super" }; } function taggedTemplateExpression(tag, quasi) { const node = { type: "TaggedTemplateExpression", tag, quasi }; const defs = NODE_FIELDS.TaggedTemplateExpression; validate(defs.tag, node, "tag", tag, 1); validate(defs.quasi, node, "quasi", quasi, 1); return node; } function templateElement(value, tail = false) { const node = { type: "TemplateElement", value, tail }; const defs = NODE_FIELDS.TemplateElement; validate(defs.value, node, "value", value); validate(defs.tail, node, "tail", tail); return node; } function templateLiteral(quasis, expressions) { const node = { type: "TemplateLiteral", quasis, expressions }; const defs = NODE_FIELDS.TemplateLiteral; validate(defs.quasis, node, "quasis", quasis, 1); validate(defs.expressions, node, "expressions", expressions, 1); return node; } function yieldExpression(argument = null, delegate = false) { const node = { type: "YieldExpression", argument, delegate }; const defs = NODE_FIELDS.YieldExpression; validate(defs.argument, node, "argument", argument, 1); validate(defs.delegate, node, "delegate", delegate); return node; } function awaitExpression(argument) { const node = { type: "AwaitExpression", argument }; const defs = NODE_FIELDS.AwaitExpression; validate(defs.argument, node, "argument", argument, 1); return node; } function _import() { return { type: "Import" }; } function exportNamespaceSpecifier(exported) { const node = { type: "ExportNamespaceSpecifier", exported }; const defs = NODE_FIELDS.ExportNamespaceSpecifier; validate(defs.exported, node, "exported", exported, 1); return node; } function optionalMemberExpression(object, property, computed = false, optional) { const node = { type: "OptionalMemberExpression", object, property, computed, optional }; const defs = NODE_FIELDS.OptionalMemberExpression; validate(defs.object, node, "object", object, 1); validate(defs.property, node, "property", property, 1); validate(defs.computed, node, "computed", computed); validate(defs.optional, node, "optional", optional); return node; } function optionalCallExpression(callee, _arguments, optional) { const node = { type: "OptionalCallExpression", callee, arguments: _arguments, optional }; const defs = NODE_FIELDS.OptionalCallExpression; validate(defs.callee, node, "callee", callee, 1); validate(defs.arguments, node, "arguments", _arguments, 1); validate(defs.optional, node, "optional", optional); return node; } function classProperty(key, value = null, typeAnnotation = null, decorators = null, computed = false, _static = false) { const node = { type: "ClassProperty", key, value, typeAnnotation, decorators, computed, static: _static }; const defs = NODE_FIELDS.ClassProperty; validate(defs.key, node, "key", key, 1); validate(defs.value, node, "value", value, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); validate(defs.decorators, node, "decorators", decorators, 1); validate(defs.computed, node, "computed", computed); validate(defs.static, node, "static", _static); return node; } function classAccessorProperty(key, value = null, typeAnnotation = null, decorators = null, computed = false, _static = false) { const node = { type: "ClassAccessorProperty", key, value, typeAnnotation, decorators, computed, static: _static }; const defs = NODE_FIELDS.ClassAccessorProperty; validate(defs.key, node, "key", key, 1); validate(defs.value, node, "value", value, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); validate(defs.decorators, node, "decorators", decorators, 1); validate(defs.computed, node, "computed", computed); validate(defs.static, node, "static", _static); return node; } function classPrivateProperty(key, value = null, decorators = null, _static = false) { const node = { type: "ClassPrivateProperty", key, value, decorators, static: _static }; const defs = NODE_FIELDS.ClassPrivateProperty; validate(defs.key, node, "key", key, 1); validate(defs.value, node, "value", value, 1); validate(defs.decorators, node, "decorators", decorators, 1); validate(defs.static, node, "static", _static); return node; } function classPrivateMethod(kind = "method", key, params, body, _static = false) { const node = { type: "ClassPrivateMethod", kind, key, params, body, static: _static }; const defs = NODE_FIELDS.ClassPrivateMethod; validate(defs.kind, node, "kind", kind); validate(defs.key, node, "key", key, 1); validate(defs.params, node, "params", params, 1); validate(defs.body, node, "body", body, 1); validate(defs.static, node, "static", _static); return node; } function privateName(id) { const node = { type: "PrivateName", id }; const defs = NODE_FIELDS.PrivateName; validate(defs.id, node, "id", id, 1); return node; } function staticBlock(body) { const node = { type: "StaticBlock", body }; const defs = NODE_FIELDS.StaticBlock; validate(defs.body, node, "body", body, 1); return node; } function importAttribute(key, value) { const node = { type: "ImportAttribute", key, value }; const defs = NODE_FIELDS.ImportAttribute; validate(defs.key, node, "key", key, 1); validate(defs.value, node, "value", value, 1); return node; } function anyTypeAnnotation() { return { type: "AnyTypeAnnotation" }; } function arrayTypeAnnotation(elementType) { const node = { type: "ArrayTypeAnnotation", elementType }; const defs = NODE_FIELDS.ArrayTypeAnnotation; validate(defs.elementType, node, "elementType", elementType, 1); return node; } function booleanTypeAnnotation() { return { type: "BooleanTypeAnnotation" }; } function booleanLiteralTypeAnnotation(value) { const node = { type: "BooleanLiteralTypeAnnotation", value }; const defs = NODE_FIELDS.BooleanLiteralTypeAnnotation; validate(defs.value, node, "value", value); return node; } function nullLiteralTypeAnnotation() { return { type: "NullLiteralTypeAnnotation" }; } function classImplements(id, typeParameters = null) { const node = { type: "ClassImplements", id, typeParameters }; const defs = NODE_FIELDS.ClassImplements; validate(defs.id, node, "id", id, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); return node; } function declareClass(id, typeParameters = null, _extends = null, body) { const node = { type: "DeclareClass", id, typeParameters, extends: _extends, body }; const defs = NODE_FIELDS.DeclareClass; validate(defs.id, node, "id", id, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.extends, node, "extends", _extends, 1); validate(defs.body, node, "body", body, 1); return node; } function declareFunction(id) { const node = { type: "DeclareFunction", id }; const defs = NODE_FIELDS.DeclareFunction; validate(defs.id, node, "id", id, 1); return node; } function declareInterface(id, typeParameters = null, _extends = null, body) { const node = { type: "DeclareInterface", id, typeParameters, extends: _extends, body }; const defs = NODE_FIELDS.DeclareInterface; validate(defs.id, node, "id", id, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.extends, node, "extends", _extends, 1); validate(defs.body, node, "body", body, 1); return node; } function declareModule(id, body, kind = null) { const node = { type: "DeclareModule", id, body, kind }; const defs = NODE_FIELDS.DeclareModule; validate(defs.id, node, "id", id, 1); validate(defs.body, node, "body", body, 1); validate(defs.kind, node, "kind", kind); return node; } function declareModuleExports(typeAnnotation) { const node = { type: "DeclareModuleExports", typeAnnotation }; const defs = NODE_FIELDS.DeclareModuleExports; validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function declareTypeAlias(id, typeParameters = null, right) { const node = { type: "DeclareTypeAlias", id, typeParameters, right }; const defs = NODE_FIELDS.DeclareTypeAlias; validate(defs.id, node, "id", id, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.right, node, "right", right, 1); return node; } function declareOpaqueType(id, typeParameters = null, supertype = null) { const node = { type: "DeclareOpaqueType", id, typeParameters, supertype }; const defs = NODE_FIELDS.DeclareOpaqueType; validate(defs.id, node, "id", id, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.supertype, node, "supertype", supertype, 1); return node; } function declareVariable(id) { const node = { type: "DeclareVariable", id }; const defs = NODE_FIELDS.DeclareVariable; validate(defs.id, node, "id", id, 1); return node; } function declareExportDeclaration(declaration = null, specifiers = null, source = null, attributes = null) { const node = { type: "DeclareExportDeclaration", declaration, specifiers, source, attributes }; const defs = NODE_FIELDS.DeclareExportDeclaration; validate(defs.declaration, node, "declaration", declaration, 1); validate(defs.specifiers, node, "specifiers", specifiers, 1); validate(defs.source, node, "source", source, 1); validate(defs.attributes, node, "attributes", attributes, 1); return node; } function declareExportAllDeclaration(source, attributes = null) { const node = { type: "DeclareExportAllDeclaration", source, attributes }; const defs = NODE_FIELDS.DeclareExportAllDeclaration; validate(defs.source, node, "source", source, 1); validate(defs.attributes, node, "attributes", attributes, 1); return node; } function declaredPredicate(value) { const node = { type: "DeclaredPredicate", value }; const defs = NODE_FIELDS.DeclaredPredicate; validate(defs.value, node, "value", value, 1); return node; } function existsTypeAnnotation() { return { type: "ExistsTypeAnnotation" }; } function functionTypeAnnotation(typeParameters = null, params, rest = null, returnType) { const node = { type: "FunctionTypeAnnotation", typeParameters, params, rest, returnType }; const defs = NODE_FIELDS.FunctionTypeAnnotation; validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.params, node, "params", params, 1); validate(defs.rest, node, "rest", rest, 1); validate(defs.returnType, node, "returnType", returnType, 1); return node; } function functionTypeParam(name = null, typeAnnotation) { const node = { type: "FunctionTypeParam", name, typeAnnotation }; const defs = NODE_FIELDS.FunctionTypeParam; validate(defs.name, node, "name", name, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function genericTypeAnnotation(id, typeParameters = null) { const node = { type: "GenericTypeAnnotation", id, typeParameters }; const defs = NODE_FIELDS.GenericTypeAnnotation; validate(defs.id, node, "id", id, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); return node; } function inferredPredicate() { return { type: "InferredPredicate" }; } function interfaceExtends(id, typeParameters = null) { const node = { type: "InterfaceExtends", id, typeParameters }; const defs = NODE_FIELDS.InterfaceExtends; validate(defs.id, node, "id", id, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); return node; } function interfaceDeclaration(id, typeParameters = null, _extends = null, body) { const node = { type: "InterfaceDeclaration", id, typeParameters, extends: _extends, body }; const defs = NODE_FIELDS.InterfaceDeclaration; validate(defs.id, node, "id", id, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.extends, node, "extends", _extends, 1); validate(defs.body, node, "body", body, 1); return node; } function interfaceTypeAnnotation(_extends = null, body) { const node = { type: "InterfaceTypeAnnotation", extends: _extends, body }; const defs = NODE_FIELDS.InterfaceTypeAnnotation; validate(defs.extends, node, "extends", _extends, 1); validate(defs.body, node, "body", body, 1); return node; } function intersectionTypeAnnotation(types) { const node = { type: "IntersectionTypeAnnotation", types }; const defs = NODE_FIELDS.IntersectionTypeAnnotation; validate(defs.types, node, "types", types, 1); return node; } function mixedTypeAnnotation() { return { type: "MixedTypeAnnotation" }; } function emptyTypeAnnotation() { return { type: "EmptyTypeAnnotation" }; } function nullableTypeAnnotation(typeAnnotation) { const node = { type: "NullableTypeAnnotation", typeAnnotation }; const defs = NODE_FIELDS.NullableTypeAnnotation; validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function numberLiteralTypeAnnotation(value) { const node = { type: "NumberLiteralTypeAnnotation", value }; const defs = NODE_FIELDS.NumberLiteralTypeAnnotation; validate(defs.value, node, "value", value); return node; } function numberTypeAnnotation() { return { type: "NumberTypeAnnotation" }; } function objectTypeAnnotation(properties, indexers = [], callProperties = [], internalSlots = [], exact = false) { const node = { type: "ObjectTypeAnnotation", properties, indexers, callProperties, internalSlots, exact }; const defs = NODE_FIELDS.ObjectTypeAnnotation; validate(defs.properties, node, "properties", properties, 1); validate(defs.indexers, node, "indexers", indexers, 1); validate(defs.callProperties, node, "callProperties", callProperties, 1); validate(defs.internalSlots, node, "internalSlots", internalSlots, 1); validate(defs.exact, node, "exact", exact); return node; } function objectTypeInternalSlot(id, value, optional, _static, method) { const node = { type: "ObjectTypeInternalSlot", id, value, optional, static: _static, method }; const defs = NODE_FIELDS.ObjectTypeInternalSlot; validate(defs.id, node, "id", id, 1); validate(defs.value, node, "value", value, 1); validate(defs.optional, node, "optional", optional); validate(defs.static, node, "static", _static); validate(defs.method, node, "method", method); return node; } function objectTypeCallProperty(value) { const node = { type: "ObjectTypeCallProperty", value, static: null }; const defs = NODE_FIELDS.ObjectTypeCallProperty; validate(defs.value, node, "value", value, 1); return node; } function objectTypeIndexer(id = null, key, value, variance = null) { const node = { type: "ObjectTypeIndexer", id, key, value, variance, static: null }; const defs = NODE_FIELDS.ObjectTypeIndexer; validate(defs.id, node, "id", id, 1); validate(defs.key, node, "key", key, 1); validate(defs.value, node, "value", value, 1); validate(defs.variance, node, "variance", variance, 1); return node; } function objectTypeProperty(key, value, variance = null) { const node = { type: "ObjectTypeProperty", key, value, variance, kind: null, method: null, optional: null, proto: null, static: null }; const defs = NODE_FIELDS.ObjectTypeProperty; validate(defs.key, node, "key", key, 1); validate(defs.value, node, "value", value, 1); validate(defs.variance, node, "variance", variance, 1); return node; } function objectTypeSpreadProperty(argument) { const node = { type: "ObjectTypeSpreadProperty", argument }; const defs = NODE_FIELDS.ObjectTypeSpreadProperty; validate(defs.argument, node, "argument", argument, 1); return node; } function opaqueType(id, typeParameters = null, supertype = null, impltype) { const node = { type: "OpaqueType", id, typeParameters, supertype, impltype }; const defs = NODE_FIELDS.OpaqueType; validate(defs.id, node, "id", id, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.supertype, node, "supertype", supertype, 1); validate(defs.impltype, node, "impltype", impltype, 1); return node; } function qualifiedTypeIdentifier(id, qualification) { const node = { type: "QualifiedTypeIdentifier", id, qualification }; const defs = NODE_FIELDS.QualifiedTypeIdentifier; validate(defs.id, node, "id", id, 1); validate(defs.qualification, node, "qualification", qualification, 1); return node; } function stringLiteralTypeAnnotation(value) { const node = { type: "StringLiteralTypeAnnotation", value }; const defs = NODE_FIELDS.StringLiteralTypeAnnotation; validate(defs.value, node, "value", value); return node; } function stringTypeAnnotation() { return { type: "StringTypeAnnotation" }; } function symbolTypeAnnotation() { return { type: "SymbolTypeAnnotation" }; } function thisTypeAnnotation() { return { type: "ThisTypeAnnotation" }; } function tupleTypeAnnotation(types) { const node = { type: "TupleTypeAnnotation", types }; const defs = NODE_FIELDS.TupleTypeAnnotation; validate(defs.types, node, "types", types, 1); return node; } function typeofTypeAnnotation(argument) { const node = { type: "TypeofTypeAnnotation", argument }; const defs = NODE_FIELDS.TypeofTypeAnnotation; validate(defs.argument, node, "argument", argument, 1); return node; } function typeAlias(id, typeParameters = null, right) { const node = { type: "TypeAlias", id, typeParameters, right }; const defs = NODE_FIELDS.TypeAlias; validate(defs.id, node, "id", id, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.right, node, "right", right, 1); return node; } function typeAnnotation(typeAnnotation) { const node = { type: "TypeAnnotation", typeAnnotation }; const defs = NODE_FIELDS.TypeAnnotation; validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function typeCastExpression(expression, typeAnnotation) { const node = { type: "TypeCastExpression", expression, typeAnnotation }; const defs = NODE_FIELDS.TypeCastExpression; validate(defs.expression, node, "expression", expression, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function typeParameter(bound = null, _default = null, variance = null) { const node = { type: "TypeParameter", bound, default: _default, variance, name: null }; const defs = NODE_FIELDS.TypeParameter; validate(defs.bound, node, "bound", bound, 1); validate(defs.default, node, "default", _default, 1); validate(defs.variance, node, "variance", variance, 1); return node; } function typeParameterDeclaration(params) { const node = { type: "TypeParameterDeclaration", params }; const defs = NODE_FIELDS.TypeParameterDeclaration; validate(defs.params, node, "params", params, 1); return node; } function typeParameterInstantiation(params) { const node = { type: "TypeParameterInstantiation", params }; const defs = NODE_FIELDS.TypeParameterInstantiation; validate(defs.params, node, "params", params, 1); return node; } function unionTypeAnnotation(types) { const node = { type: "UnionTypeAnnotation", types }; const defs = NODE_FIELDS.UnionTypeAnnotation; validate(defs.types, node, "types", types, 1); return node; } function variance(kind) { const node = { type: "Variance", kind }; const defs = NODE_FIELDS.Variance; validate(defs.kind, node, "kind", kind); return node; } function voidTypeAnnotation() { return { type: "VoidTypeAnnotation" }; } function enumDeclaration(id, body) { const node = { type: "EnumDeclaration", id, body }; const defs = NODE_FIELDS.EnumDeclaration; validate(defs.id, node, "id", id, 1); validate(defs.body, node, "body", body, 1); return node; } function enumBooleanBody(members) { const node = { type: "EnumBooleanBody", members, explicitType: null, hasUnknownMembers: null }; const defs = NODE_FIELDS.EnumBooleanBody; validate(defs.members, node, "members", members, 1); return node; } function enumNumberBody(members) { const node = { type: "EnumNumberBody", members, explicitType: null, hasUnknownMembers: null }; const defs = NODE_FIELDS.EnumNumberBody; validate(defs.members, node, "members", members, 1); return node; } function enumStringBody(members) { const node = { type: "EnumStringBody", members, explicitType: null, hasUnknownMembers: null }; const defs = NODE_FIELDS.EnumStringBody; validate(defs.members, node, "members", members, 1); return node; } function enumSymbolBody(members) { const node = { type: "EnumSymbolBody", members, hasUnknownMembers: null }; const defs = NODE_FIELDS.EnumSymbolBody; validate(defs.members, node, "members", members, 1); return node; } function enumBooleanMember(id) { const node = { type: "EnumBooleanMember", id, init: null }; const defs = NODE_FIELDS.EnumBooleanMember; validate(defs.id, node, "id", id, 1); return node; } function enumNumberMember(id, init) { const node = { type: "EnumNumberMember", id, init }; const defs = NODE_FIELDS.EnumNumberMember; validate(defs.id, node, "id", id, 1); validate(defs.init, node, "init", init, 1); return node; } function enumStringMember(id, init) { const node = { type: "EnumStringMember", id, init }; const defs = NODE_FIELDS.EnumStringMember; validate(defs.id, node, "id", id, 1); validate(defs.init, node, "init", init, 1); return node; } function enumDefaultedMember(id) { const node = { type: "EnumDefaultedMember", id }; const defs = NODE_FIELDS.EnumDefaultedMember; validate(defs.id, node, "id", id, 1); return node; } function indexedAccessType(objectType, indexType) { const node = { type: "IndexedAccessType", objectType, indexType }; const defs = NODE_FIELDS.IndexedAccessType; validate(defs.objectType, node, "objectType", objectType, 1); validate(defs.indexType, node, "indexType", indexType, 1); return node; } function optionalIndexedAccessType(objectType, indexType) { const node = { type: "OptionalIndexedAccessType", objectType, indexType, optional: null }; const defs = NODE_FIELDS.OptionalIndexedAccessType; validate(defs.objectType, node, "objectType", objectType, 1); validate(defs.indexType, node, "indexType", indexType, 1); return node; } function jsxAttribute(name, value = null) { const node = { type: "JSXAttribute", name, value }; const defs = NODE_FIELDS.JSXAttribute; validate(defs.name, node, "name", name, 1); validate(defs.value, node, "value", value, 1); return node; } function jsxClosingElement(name) { const node = { type: "JSXClosingElement", name }; const defs = NODE_FIELDS.JSXClosingElement; validate(defs.name, node, "name", name, 1); return node; } function jsxElement(openingElement, closingElement = null, children, selfClosing = null) { const node = { type: "JSXElement", openingElement, closingElement, children, selfClosing }; const defs = NODE_FIELDS.JSXElement; validate(defs.openingElement, node, "openingElement", openingElement, 1); validate(defs.closingElement, node, "closingElement", closingElement, 1); validate(defs.children, node, "children", children, 1); validate(defs.selfClosing, node, "selfClosing", selfClosing); return node; } function jsxEmptyExpression() { return { type: "JSXEmptyExpression" }; } function jsxExpressionContainer(expression) { const node = { type: "JSXExpressionContainer", expression }; const defs = NODE_FIELDS.JSXExpressionContainer; validate(defs.expression, node, "expression", expression, 1); return node; } function jsxSpreadChild(expression) { const node = { type: "JSXSpreadChild", expression }; const defs = NODE_FIELDS.JSXSpreadChild; validate(defs.expression, node, "expression", expression, 1); return node; } function jsxIdentifier(name) { const node = { type: "JSXIdentifier", name }; const defs = NODE_FIELDS.JSXIdentifier; validate(defs.name, node, "name", name); return node; } function jsxMemberExpression(object, property) { const node = { type: "JSXMemberExpression", object, property }; const defs = NODE_FIELDS.JSXMemberExpression; validate(defs.object, node, "object", object, 1); validate(defs.property, node, "property", property, 1); return node; } function jsxNamespacedName(namespace, name) { const node = { type: "JSXNamespacedName", namespace, name }; const defs = NODE_FIELDS.JSXNamespacedName; validate(defs.namespace, node, "namespace", namespace, 1); validate(defs.name, node, "name", name, 1); return node; } function jsxOpeningElement(name, attributes, selfClosing = false) { const node = { type: "JSXOpeningElement", name, attributes, selfClosing }; const defs = NODE_FIELDS.JSXOpeningElement; validate(defs.name, node, "name", name, 1); validate(defs.attributes, node, "attributes", attributes, 1); validate(defs.selfClosing, node, "selfClosing", selfClosing); return node; } function jsxSpreadAttribute(argument) { const node = { type: "JSXSpreadAttribute", argument }; const defs = NODE_FIELDS.JSXSpreadAttribute; validate(defs.argument, node, "argument", argument, 1); return node; } function jsxText(value) { const node = { type: "JSXText", value }; const defs = NODE_FIELDS.JSXText; validate(defs.value, node, "value", value); return node; } function jsxFragment(openingFragment, closingFragment, children) { const node = { type: "JSXFragment", openingFragment, closingFragment, children }; const defs = NODE_FIELDS.JSXFragment; validate(defs.openingFragment, node, "openingFragment", openingFragment, 1); validate(defs.closingFragment, node, "closingFragment", closingFragment, 1); validate(defs.children, node, "children", children, 1); return node; } function jsxOpeningFragment() { return { type: "JSXOpeningFragment" }; } function jsxClosingFragment() { return { type: "JSXClosingFragment" }; } function noop() { return { type: "Noop" }; } function placeholder(expectedNode, name) { const node = { type: "Placeholder", expectedNode, name }; const defs = NODE_FIELDS.Placeholder; validate(defs.expectedNode, node, "expectedNode", expectedNode); validate(defs.name, node, "name", name, 1); return node; } function v8IntrinsicIdentifier(name) { const node = { type: "V8IntrinsicIdentifier", name }; const defs = NODE_FIELDS.V8IntrinsicIdentifier; validate(defs.name, node, "name", name); return node; } function argumentPlaceholder() { return { type: "ArgumentPlaceholder" }; } function bindExpression(object, callee) { const node = { type: "BindExpression", object, callee }; const defs = NODE_FIELDS.BindExpression; validate(defs.object, node, "object", object, 1); validate(defs.callee, node, "callee", callee, 1); return node; } function decorator(expression) { const node = { type: "Decorator", expression }; const defs = NODE_FIELDS.Decorator; validate(defs.expression, node, "expression", expression, 1); return node; } function doExpression(body, async = false) { const node = { type: "DoExpression", body, async }; const defs = NODE_FIELDS.DoExpression; validate(defs.body, node, "body", body, 1); validate(defs.async, node, "async", async); return node; } function exportDefaultSpecifier(exported) { const node = { type: "ExportDefaultSpecifier", exported }; const defs = NODE_FIELDS.ExportDefaultSpecifier; validate(defs.exported, node, "exported", exported, 1); return node; } function recordExpression(properties) { const node = { type: "RecordExpression", properties }; const defs = NODE_FIELDS.RecordExpression; validate(defs.properties, node, "properties", properties, 1); return node; } function tupleExpression(elements = []) { const node = { type: "TupleExpression", elements }; const defs = NODE_FIELDS.TupleExpression; validate(defs.elements, node, "elements", elements, 1); return node; } function decimalLiteral(value) { const node = { type: "DecimalLiteral", value }; const defs = NODE_FIELDS.DecimalLiteral; validate(defs.value, node, "value", value); return node; } function moduleExpression(body) { const node = { type: "ModuleExpression", body }; const defs = NODE_FIELDS.ModuleExpression; validate(defs.body, node, "body", body, 1); return node; } function topicReference() { return { type: "TopicReference" }; } function pipelineTopicExpression(expression) { const node = { type: "PipelineTopicExpression", expression }; const defs = NODE_FIELDS.PipelineTopicExpression; validate(defs.expression, node, "expression", expression, 1); return node; } function pipelineBareFunction(callee) { const node = { type: "PipelineBareFunction", callee }; const defs = NODE_FIELDS.PipelineBareFunction; validate(defs.callee, node, "callee", callee, 1); return node; } function pipelinePrimaryTopicReference() { return { type: "PipelinePrimaryTopicReference" }; } function voidPattern() { return { type: "VoidPattern" }; } function tsParameterProperty(parameter) { const node = { type: "TSParameterProperty", parameter }; const defs = NODE_FIELDS.TSParameterProperty; validate(defs.parameter, node, "parameter", parameter, 1); return node; } function tsDeclareFunction(id = null, typeParameters = null, params, returnType = null) { const node = { type: "TSDeclareFunction", id, typeParameters, params, returnType }; const defs = NODE_FIELDS.TSDeclareFunction; validate(defs.id, node, "id", id, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.params, node, "params", params, 1); validate(defs.returnType, node, "returnType", returnType, 1); return node; } function tsDeclareMethod(decorators = null, key, typeParameters = null, params, returnType = null) { const node = { type: "TSDeclareMethod", decorators, key, typeParameters, params, returnType }; const defs = NODE_FIELDS.TSDeclareMethod; validate(defs.decorators, node, "decorators", decorators, 1); validate(defs.key, node, "key", key, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.params, node, "params", params, 1); validate(defs.returnType, node, "returnType", returnType, 1); return node; } function tsQualifiedName(left, right) { const node = { type: "TSQualifiedName", left, right }; const defs = NODE_FIELDS.TSQualifiedName; validate(defs.left, node, "left", left, 1); validate(defs.right, node, "right", right, 1); return node; } function tsCallSignatureDeclaration(typeParameters = null, parameters, typeAnnotation = null) { const node = { type: "TSCallSignatureDeclaration", typeParameters, parameters, typeAnnotation }; const defs = NODE_FIELDS.TSCallSignatureDeclaration; validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.parameters, node, "parameters", parameters, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function tsConstructSignatureDeclaration(typeParameters = null, parameters, typeAnnotation = null) { const node = { type: "TSConstructSignatureDeclaration", typeParameters, parameters, typeAnnotation }; const defs = NODE_FIELDS.TSConstructSignatureDeclaration; validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.parameters, node, "parameters", parameters, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function tsPropertySignature(key, typeAnnotation = null) { const node = { type: "TSPropertySignature", key, typeAnnotation }; const defs = NODE_FIELDS.TSPropertySignature; validate(defs.key, node, "key", key, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function tsMethodSignature(key, typeParameters = null, parameters, typeAnnotation = null) { const node = { type: "TSMethodSignature", key, typeParameters, parameters, typeAnnotation, kind: null }; const defs = NODE_FIELDS.TSMethodSignature; validate(defs.key, node, "key", key, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.parameters, node, "parameters", parameters, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function tsIndexSignature(parameters, typeAnnotation = null) { const node = { type: "TSIndexSignature", parameters, typeAnnotation }; const defs = NODE_FIELDS.TSIndexSignature; validate(defs.parameters, node, "parameters", parameters, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function tsAnyKeyword() { return { type: "TSAnyKeyword" }; } function tsBooleanKeyword() { return { type: "TSBooleanKeyword" }; } function tsBigIntKeyword() { return { type: "TSBigIntKeyword" }; } function tsIntrinsicKeyword() { return { type: "TSIntrinsicKeyword" }; } function tsNeverKeyword() { return { type: "TSNeverKeyword" }; } function tsNullKeyword() { return { type: "TSNullKeyword" }; } function tsNumberKeyword() { return { type: "TSNumberKeyword" }; } function tsObjectKeyword() { return { type: "TSObjectKeyword" }; } function tsStringKeyword() { return { type: "TSStringKeyword" }; } function tsSymbolKeyword() { return { type: "TSSymbolKeyword" }; } function tsUndefinedKeyword() { return { type: "TSUndefinedKeyword" }; } function tsUnknownKeyword() { return { type: "TSUnknownKeyword" }; } function tsVoidKeyword() { return { type: "TSVoidKeyword" }; } function tsThisType() { return { type: "TSThisType" }; } function tsFunctionType(typeParameters = null, parameters, typeAnnotation = null) { const node = { type: "TSFunctionType", typeParameters, parameters, typeAnnotation }; const defs = NODE_FIELDS.TSFunctionType; validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.parameters, node, "parameters", parameters, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function tsConstructorType(typeParameters = null, parameters, typeAnnotation = null) { const node = { type: "TSConstructorType", typeParameters, parameters, typeAnnotation }; const defs = NODE_FIELDS.TSConstructorType; validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.parameters, node, "parameters", parameters, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function tsTypeReference(typeName, typeParameters = null) { const node = { type: "TSTypeReference", typeName, typeParameters }; const defs = NODE_FIELDS.TSTypeReference; validate(defs.typeName, node, "typeName", typeName, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); return node; } function tsTypePredicate(parameterName, typeAnnotation = null, asserts = null) { const node = { type: "TSTypePredicate", parameterName, typeAnnotation, asserts }; const defs = NODE_FIELDS.TSTypePredicate; validate(defs.parameterName, node, "parameterName", parameterName, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); validate(defs.asserts, node, "asserts", asserts); return node; } function tsTypeQuery(exprName, typeParameters = null) { const node = { type: "TSTypeQuery", exprName, typeParameters }; const defs = NODE_FIELDS.TSTypeQuery; validate(defs.exprName, node, "exprName", exprName, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); return node; } function tsTypeLiteral(members) { const node = { type: "TSTypeLiteral", members }; const defs = NODE_FIELDS.TSTypeLiteral; validate(defs.members, node, "members", members, 1); return node; } function tsArrayType(elementType) { const node = { type: "TSArrayType", elementType }; const defs = NODE_FIELDS.TSArrayType; validate(defs.elementType, node, "elementType", elementType, 1); return node; } function tsTupleType(elementTypes) { const node = { type: "TSTupleType", elementTypes }; const defs = NODE_FIELDS.TSTupleType; validate(defs.elementTypes, node, "elementTypes", elementTypes, 1); return node; } function tsOptionalType(typeAnnotation) { const node = { type: "TSOptionalType", typeAnnotation }; const defs = NODE_FIELDS.TSOptionalType; validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function tsRestType(typeAnnotation) { const node = { type: "TSRestType", typeAnnotation }; const defs = NODE_FIELDS.TSRestType; validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function tsNamedTupleMember(label, elementType, optional = false) { const node = { type: "TSNamedTupleMember", label, elementType, optional }; const defs = NODE_FIELDS.TSNamedTupleMember; validate(defs.label, node, "label", label, 1); validate(defs.elementType, node, "elementType", elementType, 1); validate(defs.optional, node, "optional", optional); return node; } function tsUnionType(types) { const node = { type: "TSUnionType", types }; const defs = NODE_FIELDS.TSUnionType; validate(defs.types, node, "types", types, 1); return node; } function tsIntersectionType(types) { const node = { type: "TSIntersectionType", types }; const defs = NODE_FIELDS.TSIntersectionType; validate(defs.types, node, "types", types, 1); return node; } function tsConditionalType(checkType, extendsType, trueType, falseType) { const node = { type: "TSConditionalType", checkType, extendsType, trueType, falseType }; const defs = NODE_FIELDS.TSConditionalType; validate(defs.checkType, node, "checkType", checkType, 1); validate(defs.extendsType, node, "extendsType", extendsType, 1); validate(defs.trueType, node, "trueType", trueType, 1); validate(defs.falseType, node, "falseType", falseType, 1); return node; } function tsInferType(typeParameter) { const node = { type: "TSInferType", typeParameter }; const defs = NODE_FIELDS.TSInferType; validate(defs.typeParameter, node, "typeParameter", typeParameter, 1); return node; } function tsParenthesizedType(typeAnnotation) { const node = { type: "TSParenthesizedType", typeAnnotation }; const defs = NODE_FIELDS.TSParenthesizedType; validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function tsTypeOperator(typeAnnotation, operator = "keyof") { const node = { type: "TSTypeOperator", typeAnnotation, operator }; const defs = NODE_FIELDS.TSTypeOperator; validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); validate(defs.operator, node, "operator", operator); return node; } function tsIndexedAccessType(objectType, indexType) { const node = { type: "TSIndexedAccessType", objectType, indexType }; const defs = NODE_FIELDS.TSIndexedAccessType; validate(defs.objectType, node, "objectType", objectType, 1); validate(defs.indexType, node, "indexType", indexType, 1); return node; } function tsMappedType(typeParameter, typeAnnotation = null, nameType = null) { const node = { type: "TSMappedType", typeParameter, typeAnnotation, nameType }; const defs = NODE_FIELDS.TSMappedType; validate(defs.typeParameter, node, "typeParameter", typeParameter, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); validate(defs.nameType, node, "nameType", nameType, 1); return node; } function tsTemplateLiteralType(quasis, types) { const node = { type: "TSTemplateLiteralType", quasis, types }; const defs = NODE_FIELDS.TSTemplateLiteralType; validate(defs.quasis, node, "quasis", quasis, 1); validate(defs.types, node, "types", types, 1); return node; } function tsLiteralType(literal) { const node = { type: "TSLiteralType", literal }; const defs = NODE_FIELDS.TSLiteralType; validate(defs.literal, node, "literal", literal, 1); return node; } function tsExpressionWithTypeArguments(expression, typeParameters = null) { const node = { type: "TSExpressionWithTypeArguments", expression, typeParameters }; const defs = NODE_FIELDS.TSExpressionWithTypeArguments; validate(defs.expression, node, "expression", expression, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); return node; } function tsInterfaceDeclaration(id, typeParameters = null, _extends = null, body) { const node = { type: "TSInterfaceDeclaration", id, typeParameters, extends: _extends, body }; const defs = NODE_FIELDS.TSInterfaceDeclaration; validate(defs.id, node, "id", id, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.extends, node, "extends", _extends, 1); validate(defs.body, node, "body", body, 1); return node; } function tsInterfaceBody(body) { const node = { type: "TSInterfaceBody", body }; const defs = NODE_FIELDS.TSInterfaceBody; validate(defs.body, node, "body", body, 1); return node; } function tsTypeAliasDeclaration(id, typeParameters = null, typeAnnotation) { const node = { type: "TSTypeAliasDeclaration", id, typeParameters, typeAnnotation }; const defs = NODE_FIELDS.TSTypeAliasDeclaration; validate(defs.id, node, "id", id, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function tsInstantiationExpression(expression, typeParameters = null) { const node = { type: "TSInstantiationExpression", expression, typeParameters }; const defs = NODE_FIELDS.TSInstantiationExpression; validate(defs.expression, node, "expression", expression, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); return node; } function tsAsExpression(expression, typeAnnotation) { const node = { type: "TSAsExpression", expression, typeAnnotation }; const defs = NODE_FIELDS.TSAsExpression; validate(defs.expression, node, "expression", expression, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function tsSatisfiesExpression(expression, typeAnnotation) { const node = { type: "TSSatisfiesExpression", expression, typeAnnotation }; const defs = NODE_FIELDS.TSSatisfiesExpression; validate(defs.expression, node, "expression", expression, 1); validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function tsTypeAssertion(typeAnnotation, expression) { const node = { type: "TSTypeAssertion", typeAnnotation, expression }; const defs = NODE_FIELDS.TSTypeAssertion; validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); validate(defs.expression, node, "expression", expression, 1); return node; } function tsEnumBody(members) { const node = { type: "TSEnumBody", members }; const defs = NODE_FIELDS.TSEnumBody; validate(defs.members, node, "members", members, 1); return node; } function tsEnumDeclaration(id, members) { const node = { type: "TSEnumDeclaration", id, members }; const defs = NODE_FIELDS.TSEnumDeclaration; validate(defs.id, node, "id", id, 1); validate(defs.members, node, "members", members, 1); return node; } function tsEnumMember(id, initializer = null) { const node = { type: "TSEnumMember", id, initializer }; const defs = NODE_FIELDS.TSEnumMember; validate(defs.id, node, "id", id, 1); validate(defs.initializer, node, "initializer", initializer, 1); return node; } function tsModuleDeclaration(id, body) { const node = { type: "TSModuleDeclaration", id, body, kind: null }; const defs = NODE_FIELDS.TSModuleDeclaration; validate(defs.id, node, "id", id, 1); validate(defs.body, node, "body", body, 1); return node; } function tsModuleBlock(body) { const node = { type: "TSModuleBlock", body }; const defs = NODE_FIELDS.TSModuleBlock; validate(defs.body, node, "body", body, 1); return node; } function tsImportType(argument, qualifier = null, typeParameters = null) { const node = { type: "TSImportType", argument, qualifier, typeParameters }; const defs = NODE_FIELDS.TSImportType; validate(defs.argument, node, "argument", argument, 1); validate(defs.qualifier, node, "qualifier", qualifier, 1); validate(defs.typeParameters, node, "typeParameters", typeParameters, 1); return node; } function tsImportEqualsDeclaration(id, moduleReference) { const node = { type: "TSImportEqualsDeclaration", id, moduleReference, isExport: null }; const defs = NODE_FIELDS.TSImportEqualsDeclaration; validate(defs.id, node, "id", id, 1); validate(defs.moduleReference, node, "moduleReference", moduleReference, 1); return node; } function tsExternalModuleReference(expression) { const node = { type: "TSExternalModuleReference", expression }; const defs = NODE_FIELDS.TSExternalModuleReference; validate(defs.expression, node, "expression", expression, 1); return node; } function tsNonNullExpression(expression) { const node = { type: "TSNonNullExpression", expression }; const defs = NODE_FIELDS.TSNonNullExpression; validate(defs.expression, node, "expression", expression, 1); return node; } function tsExportAssignment(expression) { const node = { type: "TSExportAssignment", expression }; const defs = NODE_FIELDS.TSExportAssignment; validate(defs.expression, node, "expression", expression, 1); return node; } function tsNamespaceExportDeclaration(id) { const node = { type: "TSNamespaceExportDeclaration", id }; const defs = NODE_FIELDS.TSNamespaceExportDeclaration; validate(defs.id, node, "id", id, 1); return node; } function tsTypeAnnotation(typeAnnotation) { const node = { type: "TSTypeAnnotation", typeAnnotation }; const defs = NODE_FIELDS.TSTypeAnnotation; validate(defs.typeAnnotation, node, "typeAnnotation", typeAnnotation, 1); return node; } function tsTypeParameterInstantiation(params) { const node = { type: "TSTypeParameterInstantiation", params }; const defs = NODE_FIELDS.TSTypeParameterInstantiation; validate(defs.params, node, "params", params, 1); return node; } function tsTypeParameterDeclaration(params) { const node = { type: "TSTypeParameterDeclaration", params }; const defs = NODE_FIELDS.TSTypeParameterDeclaration; validate(defs.params, node, "params", params, 1); return node; } function tsTypeParameter(constraint = null, _default = null, name) { const node = { type: "TSTypeParameter", constraint, default: _default, name }; const defs = NODE_FIELDS.TSTypeParameter; validate(defs.constraint, node, "constraint", constraint, 1); validate(defs.default, node, "default", _default, 1); validate(defs.name, node, "name", name); return node; } function NumberLiteral(value) { (0, _deprecationWarning.default)("NumberLiteral", "NumericLiteral", "The node type "); return numericLiteral(value); } function RegexLiteral(pattern, flags = "") { (0, _deprecationWarning.default)("RegexLiteral", "RegExpLiteral", "The node type "); return regExpLiteral(pattern, flags); } function RestProperty(argument) { (0, _deprecationWarning.default)("RestProperty", "RestElement", "The node type "); return restElement(argument); } function SpreadProperty(argument) { (0, _deprecationWarning.default)("SpreadProperty", "SpreadElement", "The node type "); return spreadElement(argument); } //# sourceMappingURL=lowercase.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/builders/generated/uppercase.js": /*!***********************************************************************!*\ !*** ./node_modules/@babel/types/lib/builders/generated/uppercase.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.JSXIdentifier = exports.JSXFragment = exports.JSXExpressionContainer = exports.JSXEmptyExpression = exports.JSXElement = exports.JSXClosingFragment = exports.JSXClosingElement = exports.JSXAttribute = exports.IntersectionTypeAnnotation = exports.InterpreterDirective = exports.InterfaceTypeAnnotation = exports.InterfaceExtends = exports.InterfaceDeclaration = exports.InferredPredicate = exports.IndexedAccessType = exports.ImportSpecifier = exports.ImportNamespaceSpecifier = exports.ImportExpression = exports.ImportDefaultSpecifier = exports.ImportDeclaration = exports.ImportAttribute = exports.Import = exports.IfStatement = exports.Identifier = exports.GenericTypeAnnotation = exports.FunctionTypeParam = exports.FunctionTypeAnnotation = exports.FunctionExpression = exports.FunctionDeclaration = exports.ForStatement = exports.ForOfStatement = exports.ForInStatement = exports.File = exports.ExpressionStatement = exports.ExportSpecifier = exports.ExportNamespaceSpecifier = exports.ExportNamedDeclaration = exports.ExportDefaultSpecifier = exports.ExportDefaultDeclaration = exports.ExportAllDeclaration = exports.ExistsTypeAnnotation = exports.EnumSymbolBody = exports.EnumStringMember = exports.EnumStringBody = exports.EnumNumberMember = exports.EnumNumberBody = exports.EnumDefaultedMember = exports.EnumDeclaration = exports.EnumBooleanMember = exports.EnumBooleanBody = exports.EmptyTypeAnnotation = exports.EmptyStatement = exports.DoWhileStatement = exports.DoExpression = exports.DirectiveLiteral = exports.Directive = exports.Decorator = exports.DeclaredPredicate = exports.DeclareVariable = exports.DeclareTypeAlias = exports.DeclareOpaqueType = exports.DeclareModuleExports = exports.DeclareModule = exports.DeclareInterface = exports.DeclareFunction = exports.DeclareExportDeclaration = exports.DeclareExportAllDeclaration = exports.DeclareClass = exports.DecimalLiteral = exports.DebuggerStatement = exports.ContinueStatement = exports.ConditionalExpression = exports.ClassProperty = exports.ClassPrivateProperty = exports.ClassPrivateMethod = exports.ClassMethod = exports.ClassImplements = exports.ClassExpression = exports.ClassDeclaration = exports.ClassBody = exports.ClassAccessorProperty = exports.CatchClause = exports.CallExpression = exports.BreakStatement = exports.BooleanTypeAnnotation = exports.BooleanLiteralTypeAnnotation = exports.BooleanLiteral = exports.BlockStatement = exports.BindExpression = exports.BinaryExpression = exports.BigIntLiteral = exports.AwaitExpression = exports.AssignmentPattern = exports.AssignmentExpression = exports.ArrowFunctionExpression = exports.ArrayTypeAnnotation = exports.ArrayPattern = exports.ArrayExpression = exports.ArgumentPlaceholder = exports.AnyTypeAnnotation = void 0; exports.TSNumberKeyword = exports.TSNullKeyword = exports.TSNonNullExpression = exports.TSNeverKeyword = exports.TSNamespaceExportDeclaration = exports.TSNamedTupleMember = exports.TSModuleDeclaration = exports.TSModuleBlock = exports.TSMethodSignature = exports.TSMappedType = exports.TSLiteralType = exports.TSIntrinsicKeyword = exports.TSIntersectionType = exports.TSInterfaceDeclaration = exports.TSInterfaceBody = exports.TSInstantiationExpression = exports.TSInferType = exports.TSIndexedAccessType = exports.TSIndexSignature = exports.TSImportType = exports.TSImportEqualsDeclaration = exports.TSFunctionType = exports.TSExternalModuleReference = exports.TSExpressionWithTypeArguments = exports.TSExportAssignment = exports.TSEnumMember = exports.TSEnumDeclaration = exports.TSEnumBody = exports.TSDeclareMethod = exports.TSDeclareFunction = exports.TSConstructorType = exports.TSConstructSignatureDeclaration = exports.TSConditionalType = exports.TSCallSignatureDeclaration = exports.TSBooleanKeyword = exports.TSBigIntKeyword = exports.TSAsExpression = exports.TSArrayType = exports.TSAnyKeyword = exports.SymbolTypeAnnotation = exports.SwitchStatement = exports.SwitchCase = exports.Super = exports.StringTypeAnnotation = exports.StringLiteralTypeAnnotation = exports.StringLiteral = exports.StaticBlock = exports.SpreadProperty = exports.SpreadElement = exports.SequenceExpression = exports.ReturnStatement = exports.RestProperty = exports.RestElement = exports.RegexLiteral = exports.RegExpLiteral = exports.RecordExpression = exports.QualifiedTypeIdentifier = exports.Program = exports.PrivateName = exports.Placeholder = exports.PipelineTopicExpression = exports.PipelinePrimaryTopicReference = exports.PipelineBareFunction = exports.ParenthesizedExpression = exports.OptionalMemberExpression = exports.OptionalIndexedAccessType = exports.OptionalCallExpression = exports.OpaqueType = exports.ObjectTypeSpreadProperty = exports.ObjectTypeProperty = exports.ObjectTypeInternalSlot = exports.ObjectTypeIndexer = exports.ObjectTypeCallProperty = exports.ObjectTypeAnnotation = exports.ObjectProperty = exports.ObjectPattern = exports.ObjectMethod = exports.ObjectExpression = exports.NumericLiteral = exports.NumberTypeAnnotation = exports.NumberLiteralTypeAnnotation = exports.NumberLiteral = exports.NullableTypeAnnotation = exports.NullLiteralTypeAnnotation = exports.NullLiteral = exports.Noop = exports.NewExpression = exports.ModuleExpression = exports.MixedTypeAnnotation = exports.MetaProperty = exports.MemberExpression = exports.LogicalExpression = exports.LabeledStatement = exports.JSXText = exports.JSXSpreadChild = exports.JSXSpreadAttribute = exports.JSXOpeningFragment = exports.JSXOpeningElement = exports.JSXNamespacedName = exports.JSXMemberExpression = void 0; exports.YieldExpression = exports.WithStatement = exports.WhileStatement = exports.VoidTypeAnnotation = exports.VoidPattern = exports.Variance = exports.VariableDeclarator = exports.VariableDeclaration = exports.V8IntrinsicIdentifier = exports.UpdateExpression = exports.UnionTypeAnnotation = exports.UnaryExpression = exports.TypeofTypeAnnotation = exports.TypeParameterInstantiation = exports.TypeParameterDeclaration = exports.TypeParameter = exports.TypeCastExpression = exports.TypeAnnotation = exports.TypeAlias = exports.TupleTypeAnnotation = exports.TupleExpression = exports.TryStatement = exports.TopicReference = exports.ThrowStatement = exports.ThisTypeAnnotation = exports.ThisExpression = exports.TemplateLiteral = exports.TemplateElement = exports.TaggedTemplateExpression = exports.TSVoidKeyword = exports.TSUnknownKeyword = exports.TSUnionType = exports.TSUndefinedKeyword = exports.TSTypeReference = exports.TSTypeQuery = exports.TSTypePredicate = exports.TSTypeParameterInstantiation = exports.TSTypeParameterDeclaration = exports.TSTypeParameter = exports.TSTypeOperator = exports.TSTypeLiteral = exports.TSTypeAssertion = exports.TSTypeAnnotation = exports.TSTypeAliasDeclaration = exports.TSTupleType = exports.TSThisType = exports.TSTemplateLiteralType = exports.TSSymbolKeyword = exports.TSStringKeyword = exports.TSSatisfiesExpression = exports.TSRestType = exports.TSQualifiedName = exports.TSPropertySignature = exports.TSParenthesizedType = exports.TSParameterProperty = exports.TSOptionalType = exports.TSObjectKeyword = void 0; var b = __webpack_require__(/*! ./lowercase.js */ "./node_modules/@babel/types/lib/builders/generated/lowercase.js"); var _deprecationWarning = __webpack_require__(/*! ../../utils/deprecationWarning.js */ "./node_modules/@babel/types/lib/utils/deprecationWarning.js"); function alias(lowercase) { { return b[lowercase]; } } const ArrayExpression = exports.ArrayExpression = alias("arrayExpression"), AssignmentExpression = exports.AssignmentExpression = alias("assignmentExpression"), BinaryExpression = exports.BinaryExpression = alias("binaryExpression"), InterpreterDirective = exports.InterpreterDirective = alias("interpreterDirective"), Directive = exports.Directive = alias("directive"), DirectiveLiteral = exports.DirectiveLiteral = alias("directiveLiteral"), BlockStatement = exports.BlockStatement = alias("blockStatement"), BreakStatement = exports.BreakStatement = alias("breakStatement"), CallExpression = exports.CallExpression = alias("callExpression"), CatchClause = exports.CatchClause = alias("catchClause"), ConditionalExpression = exports.ConditionalExpression = alias("conditionalExpression"), ContinueStatement = exports.ContinueStatement = alias("continueStatement"), DebuggerStatement = exports.DebuggerStatement = alias("debuggerStatement"), DoWhileStatement = exports.DoWhileStatement = alias("doWhileStatement"), EmptyStatement = exports.EmptyStatement = alias("emptyStatement"), ExpressionStatement = exports.ExpressionStatement = alias("expressionStatement"), File = exports.File = alias("file"), ForInStatement = exports.ForInStatement = alias("forInStatement"), ForStatement = exports.ForStatement = alias("forStatement"), FunctionDeclaration = exports.FunctionDeclaration = alias("functionDeclaration"), FunctionExpression = exports.FunctionExpression = alias("functionExpression"), Identifier = exports.Identifier = alias("identifier"), IfStatement = exports.IfStatement = alias("ifStatement"), LabeledStatement = exports.LabeledStatement = alias("labeledStatement"), StringLiteral = exports.StringLiteral = alias("stringLiteral"), NumericLiteral = exports.NumericLiteral = alias("numericLiteral"), NullLiteral = exports.NullLiteral = alias("nullLiteral"), BooleanLiteral = exports.BooleanLiteral = alias("booleanLiteral"), RegExpLiteral = exports.RegExpLiteral = alias("regExpLiteral"), LogicalExpression = exports.LogicalExpression = alias("logicalExpression"), MemberExpression = exports.MemberExpression = alias("memberExpression"), NewExpression = exports.NewExpression = alias("newExpression"), Program = exports.Program = alias("program"), ObjectExpression = exports.ObjectExpression = alias("objectExpression"), ObjectMethod = exports.ObjectMethod = alias("objectMethod"), ObjectProperty = exports.ObjectProperty = alias("objectProperty"), RestElement = exports.RestElement = alias("restElement"), ReturnStatement = exports.ReturnStatement = alias("returnStatement"), SequenceExpression = exports.SequenceExpression = alias("sequenceExpression"), ParenthesizedExpression = exports.ParenthesizedExpression = alias("parenthesizedExpression"), SwitchCase = exports.SwitchCase = alias("switchCase"), SwitchStatement = exports.SwitchStatement = alias("switchStatement"), ThisExpression = exports.ThisExpression = alias("thisExpression"), ThrowStatement = exports.ThrowStatement = alias("throwStatement"), TryStatement = exports.TryStatement = alias("tryStatement"), UnaryExpression = exports.UnaryExpression = alias("unaryExpression"), UpdateExpression = exports.UpdateExpression = alias("updateExpression"), VariableDeclaration = exports.VariableDeclaration = alias("variableDeclaration"), VariableDeclarator = exports.VariableDeclarator = alias("variableDeclarator"), WhileStatement = exports.WhileStatement = alias("whileStatement"), WithStatement = exports.WithStatement = alias("withStatement"), AssignmentPattern = exports.AssignmentPattern = alias("assignmentPattern"), ArrayPattern = exports.ArrayPattern = alias("arrayPattern"), ArrowFunctionExpression = exports.ArrowFunctionExpression = alias("arrowFunctionExpression"), ClassBody = exports.ClassBody = alias("classBody"), ClassExpression = exports.ClassExpression = alias("classExpression"), ClassDeclaration = exports.ClassDeclaration = alias("classDeclaration"), ExportAllDeclaration = exports.ExportAllDeclaration = alias("exportAllDeclaration"), ExportDefaultDeclaration = exports.ExportDefaultDeclaration = alias("exportDefaultDeclaration"), ExportNamedDeclaration = exports.ExportNamedDeclaration = alias("exportNamedDeclaration"), ExportSpecifier = exports.ExportSpecifier = alias("exportSpecifier"), ForOfStatement = exports.ForOfStatement = alias("forOfStatement"), ImportDeclaration = exports.ImportDeclaration = alias("importDeclaration"), ImportDefaultSpecifier = exports.ImportDefaultSpecifier = alias("importDefaultSpecifier"), ImportNamespaceSpecifier = exports.ImportNamespaceSpecifier = alias("importNamespaceSpecifier"), ImportSpecifier = exports.ImportSpecifier = alias("importSpecifier"), ImportExpression = exports.ImportExpression = alias("importExpression"), MetaProperty = exports.MetaProperty = alias("metaProperty"), ClassMethod = exports.ClassMethod = alias("classMethod"), ObjectPattern = exports.ObjectPattern = alias("objectPattern"), SpreadElement = exports.SpreadElement = alias("spreadElement"), Super = exports.Super = alias("super"), TaggedTemplateExpression = exports.TaggedTemplateExpression = alias("taggedTemplateExpression"), TemplateElement = exports.TemplateElement = alias("templateElement"), TemplateLiteral = exports.TemplateLiteral = alias("templateLiteral"), YieldExpression = exports.YieldExpression = alias("yieldExpression"), AwaitExpression = exports.AwaitExpression = alias("awaitExpression"), Import = exports.Import = alias("import"), BigIntLiteral = exports.BigIntLiteral = alias("bigIntLiteral"), ExportNamespaceSpecifier = exports.ExportNamespaceSpecifier = alias("exportNamespaceSpecifier"), OptionalMemberExpression = exports.OptionalMemberExpression = alias("optionalMemberExpression"), OptionalCallExpression = exports.OptionalCallExpression = alias("optionalCallExpression"), ClassProperty = exports.ClassProperty = alias("classProperty"), ClassAccessorProperty = exports.ClassAccessorProperty = alias("classAccessorProperty"), ClassPrivateProperty = exports.ClassPrivateProperty = alias("classPrivateProperty"), ClassPrivateMethod = exports.ClassPrivateMethod = alias("classPrivateMethod"), PrivateName = exports.PrivateName = alias("privateName"), StaticBlock = exports.StaticBlock = alias("staticBlock"), ImportAttribute = exports.ImportAttribute = alias("importAttribute"), AnyTypeAnnotation = exports.AnyTypeAnnotation = alias("anyTypeAnnotation"), ArrayTypeAnnotation = exports.ArrayTypeAnnotation = alias("arrayTypeAnnotation"), BooleanTypeAnnotation = exports.BooleanTypeAnnotation = alias("booleanTypeAnnotation"), BooleanLiteralTypeAnnotation = exports.BooleanLiteralTypeAnnotation = alias("booleanLiteralTypeAnnotation"), NullLiteralTypeAnnotation = exports.NullLiteralTypeAnnotation = alias("nullLiteralTypeAnnotation"), ClassImplements = exports.ClassImplements = alias("classImplements"), DeclareClass = exports.DeclareClass = alias("declareClass"), DeclareFunction = exports.DeclareFunction = alias("declareFunction"), DeclareInterface = exports.DeclareInterface = alias("declareInterface"), DeclareModule = exports.DeclareModule = alias("declareModule"), DeclareModuleExports = exports.DeclareModuleExports = alias("declareModuleExports"), DeclareTypeAlias = exports.DeclareTypeAlias = alias("declareTypeAlias"), DeclareOpaqueType = exports.DeclareOpaqueType = alias("declareOpaqueType"), DeclareVariable = exports.DeclareVariable = alias("declareVariable"), DeclareExportDeclaration = exports.DeclareExportDeclaration = alias("declareExportDeclaration"), DeclareExportAllDeclaration = exports.DeclareExportAllDeclaration = alias("declareExportAllDeclaration"), DeclaredPredicate = exports.DeclaredPredicate = alias("declaredPredicate"), ExistsTypeAnnotation = exports.ExistsTypeAnnotation = alias("existsTypeAnnotation"), FunctionTypeAnnotation = exports.FunctionTypeAnnotation = alias("functionTypeAnnotation"), FunctionTypeParam = exports.FunctionTypeParam = alias("functionTypeParam"), GenericTypeAnnotation = exports.GenericTypeAnnotation = alias("genericTypeAnnotation"), InferredPredicate = exports.InferredPredicate = alias("inferredPredicate"), InterfaceExtends = exports.InterfaceExtends = alias("interfaceExtends"), InterfaceDeclaration = exports.InterfaceDeclaration = alias("interfaceDeclaration"), InterfaceTypeAnnotation = exports.InterfaceTypeAnnotation = alias("interfaceTypeAnnotation"), IntersectionTypeAnnotation = exports.IntersectionTypeAnnotation = alias("intersectionTypeAnnotation"), MixedTypeAnnotation = exports.MixedTypeAnnotation = alias("mixedTypeAnnotation"), EmptyTypeAnnotation = exports.EmptyTypeAnnotation = alias("emptyTypeAnnotation"), NullableTypeAnnotation = exports.NullableTypeAnnotation = alias("nullableTypeAnnotation"), NumberLiteralTypeAnnotation = exports.NumberLiteralTypeAnnotation = alias("numberLiteralTypeAnnotation"), NumberTypeAnnotation = exports.NumberTypeAnnotation = alias("numberTypeAnnotation"), ObjectTypeAnnotation = exports.ObjectTypeAnnotation = alias("objectTypeAnnotation"), ObjectTypeInternalSlot = exports.ObjectTypeInternalSlot = alias("objectTypeInternalSlot"), ObjectTypeCallProperty = exports.ObjectTypeCallProperty = alias("objectTypeCallProperty"), ObjectTypeIndexer = exports.ObjectTypeIndexer = alias("objectTypeIndexer"), ObjectTypeProperty = exports.ObjectTypeProperty = alias("objectTypeProperty"), ObjectTypeSpreadProperty = exports.ObjectTypeSpreadProperty = alias("objectTypeSpreadProperty"), OpaqueType = exports.OpaqueType = alias("opaqueType"), QualifiedTypeIdentifier = exports.QualifiedTypeIdentifier = alias("qualifiedTypeIdentifier"), StringLiteralTypeAnnotation = exports.StringLiteralTypeAnnotation = alias("stringLiteralTypeAnnotation"), StringTypeAnnotation = exports.StringTypeAnnotation = alias("stringTypeAnnotation"), SymbolTypeAnnotation = exports.SymbolTypeAnnotation = alias("symbolTypeAnnotation"), ThisTypeAnnotation = exports.ThisTypeAnnotation = alias("thisTypeAnnotation"), TupleTypeAnnotation = exports.TupleTypeAnnotation = alias("tupleTypeAnnotation"), TypeofTypeAnnotation = exports.TypeofTypeAnnotation = alias("typeofTypeAnnotation"), TypeAlias = exports.TypeAlias = alias("typeAlias"), TypeAnnotation = exports.TypeAnnotation = alias("typeAnnotation"), TypeCastExpression = exports.TypeCastExpression = alias("typeCastExpression"), TypeParameter = exports.TypeParameter = alias("typeParameter"), TypeParameterDeclaration = exports.TypeParameterDeclaration = alias("typeParameterDeclaration"), TypeParameterInstantiation = exports.TypeParameterInstantiation = alias("typeParameterInstantiation"), UnionTypeAnnotation = exports.UnionTypeAnnotation = alias("unionTypeAnnotation"), Variance = exports.Variance = alias("variance"), VoidTypeAnnotation = exports.VoidTypeAnnotation = alias("voidTypeAnnotation"), EnumDeclaration = exports.EnumDeclaration = alias("enumDeclaration"), EnumBooleanBody = exports.EnumBooleanBody = alias("enumBooleanBody"), EnumNumberBody = exports.EnumNumberBody = alias("enumNumberBody"), EnumStringBody = exports.EnumStringBody = alias("enumStringBody"), EnumSymbolBody = exports.EnumSymbolBody = alias("enumSymbolBody"), EnumBooleanMember = exports.EnumBooleanMember = alias("enumBooleanMember"), EnumNumberMember = exports.EnumNumberMember = alias("enumNumberMember"), EnumStringMember = exports.EnumStringMember = alias("enumStringMember"), EnumDefaultedMember = exports.EnumDefaultedMember = alias("enumDefaultedMember"), IndexedAccessType = exports.IndexedAccessType = alias("indexedAccessType"), OptionalIndexedAccessType = exports.OptionalIndexedAccessType = alias("optionalIndexedAccessType"), JSXAttribute = exports.JSXAttribute = alias("jsxAttribute"), JSXClosingElement = exports.JSXClosingElement = alias("jsxClosingElement"), JSXElement = exports.JSXElement = alias("jsxElement"), JSXEmptyExpression = exports.JSXEmptyExpression = alias("jsxEmptyExpression"), JSXExpressionContainer = exports.JSXExpressionContainer = alias("jsxExpressionContainer"), JSXSpreadChild = exports.JSXSpreadChild = alias("jsxSpreadChild"), JSXIdentifier = exports.JSXIdentifier = alias("jsxIdentifier"), JSXMemberExpression = exports.JSXMemberExpression = alias("jsxMemberExpression"), JSXNamespacedName = exports.JSXNamespacedName = alias("jsxNamespacedName"), JSXOpeningElement = exports.JSXOpeningElement = alias("jsxOpeningElement"), JSXSpreadAttribute = exports.JSXSpreadAttribute = alias("jsxSpreadAttribute"), JSXText = exports.JSXText = alias("jsxText"), JSXFragment = exports.JSXFragment = alias("jsxFragment"), JSXOpeningFragment = exports.JSXOpeningFragment = alias("jsxOpeningFragment"), JSXClosingFragment = exports.JSXClosingFragment = alias("jsxClosingFragment"), Noop = exports.Noop = alias("noop"), Placeholder = exports.Placeholder = alias("placeholder"), V8IntrinsicIdentifier = exports.V8IntrinsicIdentifier = alias("v8IntrinsicIdentifier"), ArgumentPlaceholder = exports.ArgumentPlaceholder = alias("argumentPlaceholder"), BindExpression = exports.BindExpression = alias("bindExpression"), Decorator = exports.Decorator = alias("decorator"), DoExpression = exports.DoExpression = alias("doExpression"), ExportDefaultSpecifier = exports.ExportDefaultSpecifier = alias("exportDefaultSpecifier"), RecordExpression = exports.RecordExpression = alias("recordExpression"), TupleExpression = exports.TupleExpression = alias("tupleExpression"), DecimalLiteral = exports.DecimalLiteral = alias("decimalLiteral"), ModuleExpression = exports.ModuleExpression = alias("moduleExpression"), TopicReference = exports.TopicReference = alias("topicReference"), PipelineTopicExpression = exports.PipelineTopicExpression = alias("pipelineTopicExpression"), PipelineBareFunction = exports.PipelineBareFunction = alias("pipelineBareFunction"), PipelinePrimaryTopicReference = exports.PipelinePrimaryTopicReference = alias("pipelinePrimaryTopicReference"), VoidPattern = exports.VoidPattern = alias("voidPattern"), TSParameterProperty = exports.TSParameterProperty = alias("tsParameterProperty"), TSDeclareFunction = exports.TSDeclareFunction = alias("tsDeclareFunction"), TSDeclareMethod = exports.TSDeclareMethod = alias("tsDeclareMethod"), TSQualifiedName = exports.TSQualifiedName = alias("tsQualifiedName"), TSCallSignatureDeclaration = exports.TSCallSignatureDeclaration = alias("tsCallSignatureDeclaration"), TSConstructSignatureDeclaration = exports.TSConstructSignatureDeclaration = alias("tsConstructSignatureDeclaration"), TSPropertySignature = exports.TSPropertySignature = alias("tsPropertySignature"), TSMethodSignature = exports.TSMethodSignature = alias("tsMethodSignature"), TSIndexSignature = exports.TSIndexSignature = alias("tsIndexSignature"), TSAnyKeyword = exports.TSAnyKeyword = alias("tsAnyKeyword"), TSBooleanKeyword = exports.TSBooleanKeyword = alias("tsBooleanKeyword"), TSBigIntKeyword = exports.TSBigIntKeyword = alias("tsBigIntKeyword"), TSIntrinsicKeyword = exports.TSIntrinsicKeyword = alias("tsIntrinsicKeyword"), TSNeverKeyword = exports.TSNeverKeyword = alias("tsNeverKeyword"), TSNullKeyword = exports.TSNullKeyword = alias("tsNullKeyword"), TSNumberKeyword = exports.TSNumberKeyword = alias("tsNumberKeyword"), TSObjectKeyword = exports.TSObjectKeyword = alias("tsObjectKeyword"), TSStringKeyword = exports.TSStringKeyword = alias("tsStringKeyword"), TSSymbolKeyword = exports.TSSymbolKeyword = alias("tsSymbolKeyword"), TSUndefinedKeyword = exports.TSUndefinedKeyword = alias("tsUndefinedKeyword"), TSUnknownKeyword = exports.TSUnknownKeyword = alias("tsUnknownKeyword"), TSVoidKeyword = exports.TSVoidKeyword = alias("tsVoidKeyword"), TSThisType = exports.TSThisType = alias("tsThisType"), TSFunctionType = exports.TSFunctionType = alias("tsFunctionType"), TSConstructorType = exports.TSConstructorType = alias("tsConstructorType"), TSTypeReference = exports.TSTypeReference = alias("tsTypeReference"), TSTypePredicate = exports.TSTypePredicate = alias("tsTypePredicate"), TSTypeQuery = exports.TSTypeQuery = alias("tsTypeQuery"), TSTypeLiteral = exports.TSTypeLiteral = alias("tsTypeLiteral"), TSArrayType = exports.TSArrayType = alias("tsArrayType"), TSTupleType = exports.TSTupleType = alias("tsTupleType"), TSOptionalType = exports.TSOptionalType = alias("tsOptionalType"), TSRestType = exports.TSRestType = alias("tsRestType"), TSNamedTupleMember = exports.TSNamedTupleMember = alias("tsNamedTupleMember"), TSUnionType = exports.TSUnionType = alias("tsUnionType"), TSIntersectionType = exports.TSIntersectionType = alias("tsIntersectionType"), TSConditionalType = exports.TSConditionalType = alias("tsConditionalType"), TSInferType = exports.TSInferType = alias("tsInferType"), TSParenthesizedType = exports.TSParenthesizedType = alias("tsParenthesizedType"), TSTypeOperator = exports.TSTypeOperator = alias("tsTypeOperator"), TSIndexedAccessType = exports.TSIndexedAccessType = alias("tsIndexedAccessType"), TSMappedType = exports.TSMappedType = alias("tsMappedType"), TSTemplateLiteralType = exports.TSTemplateLiteralType = alias("tsTemplateLiteralType"), TSLiteralType = exports.TSLiteralType = alias("tsLiteralType"), TSExpressionWithTypeArguments = exports.TSExpressionWithTypeArguments = alias("tsExpressionWithTypeArguments"), TSInterfaceDeclaration = exports.TSInterfaceDeclaration = alias("tsInterfaceDeclaration"), TSInterfaceBody = exports.TSInterfaceBody = alias("tsInterfaceBody"), TSTypeAliasDeclaration = exports.TSTypeAliasDeclaration = alias("tsTypeAliasDeclaration"), TSInstantiationExpression = exports.TSInstantiationExpression = alias("tsInstantiationExpression"), TSAsExpression = exports.TSAsExpression = alias("tsAsExpression"), TSSatisfiesExpression = exports.TSSatisfiesExpression = alias("tsSatisfiesExpression"), TSTypeAssertion = exports.TSTypeAssertion = alias("tsTypeAssertion"), TSEnumBody = exports.TSEnumBody = alias("tsEnumBody"), TSEnumDeclaration = exports.TSEnumDeclaration = alias("tsEnumDeclaration"), TSEnumMember = exports.TSEnumMember = alias("tsEnumMember"), TSModuleDeclaration = exports.TSModuleDeclaration = alias("tsModuleDeclaration"), TSModuleBlock = exports.TSModuleBlock = alias("tsModuleBlock"), TSImportType = exports.TSImportType = alias("tsImportType"), TSImportEqualsDeclaration = exports.TSImportEqualsDeclaration = alias("tsImportEqualsDeclaration"), TSExternalModuleReference = exports.TSExternalModuleReference = alias("tsExternalModuleReference"), TSNonNullExpression = exports.TSNonNullExpression = alias("tsNonNullExpression"), TSExportAssignment = exports.TSExportAssignment = alias("tsExportAssignment"), TSNamespaceExportDeclaration = exports.TSNamespaceExportDeclaration = alias("tsNamespaceExportDeclaration"), TSTypeAnnotation = exports.TSTypeAnnotation = alias("tsTypeAnnotation"), TSTypeParameterInstantiation = exports.TSTypeParameterInstantiation = alias("tsTypeParameterInstantiation"), TSTypeParameterDeclaration = exports.TSTypeParameterDeclaration = alias("tsTypeParameterDeclaration"), TSTypeParameter = exports.TSTypeParameter = alias("tsTypeParameter"); const NumberLiteral = exports.NumberLiteral = b.numberLiteral, RegexLiteral = exports.RegexLiteral = b.regexLiteral, RestProperty = exports.RestProperty = b.restProperty, SpreadProperty = exports.SpreadProperty = b.spreadProperty; //# sourceMappingURL=uppercase.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/builders/productions.js": /*!***************************************************************!*\ !*** ./node_modules/@babel/types/lib/builders/productions.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.buildUndefinedNode = buildUndefinedNode; var _index = __webpack_require__(/*! ./generated/index.js */ "./node_modules/@babel/types/lib/builders/generated/index.js"); function buildUndefinedNode() { return (0, _index.unaryExpression)("void", (0, _index.numericLiteral)(0), true); } //# sourceMappingURL=productions.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/builders/react/buildChildren.js": /*!***********************************************************************!*\ !*** ./node_modules/@babel/types/lib/builders/react/buildChildren.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = buildChildren; var _index = __webpack_require__(/*! ../../validators/generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); var _cleanJSXElementLiteralChild = __webpack_require__(/*! ../../utils/react/cleanJSXElementLiteralChild.js */ "./node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js"); function buildChildren(node) { const elements = []; for (let i = 0; i < node.children.length; i++) { let child = node.children[i]; if ((0, _index.isJSXText)(child)) { (0, _cleanJSXElementLiteralChild.default)(child, elements); continue; } if ((0, _index.isJSXExpressionContainer)(child)) child = child.expression; if ((0, _index.isJSXEmptyExpression)(child)) continue; elements.push(child); } return elements; } //# sourceMappingURL=buildChildren.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js": /*!********************************************************************************!*\ !*** ./node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js ***! \********************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = createTSUnionType; var _index = __webpack_require__(/*! ../generated/index.js */ "./node_modules/@babel/types/lib/builders/generated/index.js"); var _removeTypeDuplicates = __webpack_require__(/*! ../../modifications/typescript/removeTypeDuplicates.js */ "./node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js"); var _index2 = __webpack_require__(/*! ../../validators/generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); function createTSUnionType(typeAnnotations) { const types = typeAnnotations.map(type => { return (0, _index2.isTSTypeAnnotation)(type) ? type.typeAnnotation : type; }); const flattened = (0, _removeTypeDuplicates.default)(types); if (flattened.length === 1) { return flattened[0]; } else { return (0, _index.tsUnionType)(flattened); } } //# sourceMappingURL=createTSUnionType.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/clone/clone.js": /*!******************************************************!*\ !*** ./node_modules/@babel/types/lib/clone/clone.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = clone; var _cloneNode = __webpack_require__(/*! ./cloneNode.js */ "./node_modules/@babel/types/lib/clone/cloneNode.js"); function clone(node) { return (0, _cloneNode.default)(node, false); } //# sourceMappingURL=clone.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/clone/cloneDeep.js": /*!**********************************************************!*\ !*** ./node_modules/@babel/types/lib/clone/cloneDeep.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = cloneDeep; var _cloneNode = __webpack_require__(/*! ./cloneNode.js */ "./node_modules/@babel/types/lib/clone/cloneNode.js"); function cloneDeep(node) { return (0, _cloneNode.default)(node); } //# sourceMappingURL=cloneDeep.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = cloneDeepWithoutLoc; var _cloneNode = __webpack_require__(/*! ./cloneNode.js */ "./node_modules/@babel/types/lib/clone/cloneNode.js"); function cloneDeepWithoutLoc(node) { return (0, _cloneNode.default)(node, true, true); } //# sourceMappingURL=cloneDeepWithoutLoc.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/clone/cloneNode.js": /*!**********************************************************!*\ !*** ./node_modules/@babel/types/lib/clone/cloneNode.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = cloneNode; var _index = __webpack_require__(/*! ../definitions/index.js */ "./node_modules/@babel/types/lib/definitions/index.js"); var _index2 = __webpack_require__(/*! ../validators/generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); const { hasOwn } = { hasOwn: Function.call.bind(Object.prototype.hasOwnProperty) }; function cloneIfNode(obj, deep, withoutLoc, commentsCache) { if (obj && typeof obj.type === "string") { return cloneNodeInternal(obj, deep, withoutLoc, commentsCache); } return obj; } function cloneIfNodeOrArray(obj, deep, withoutLoc, commentsCache) { if (Array.isArray(obj)) { return obj.map(node => cloneIfNode(node, deep, withoutLoc, commentsCache)); } return cloneIfNode(obj, deep, withoutLoc, commentsCache); } function cloneNode(node, deep = true, withoutLoc = false) { return cloneNodeInternal(node, deep, withoutLoc, new Map()); } function cloneNodeInternal(node, deep = true, withoutLoc = false, commentsCache) { if (!node) return node; const { type } = node; const newNode = { type: node.type }; if ((0, _index2.isIdentifier)(node)) { newNode.name = node.name; if (hasOwn(node, "optional") && typeof node.optional === "boolean") { newNode.optional = node.optional; } if (hasOwn(node, "typeAnnotation")) { newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc, commentsCache) : node.typeAnnotation; } if (hasOwn(node, "decorators")) { newNode.decorators = deep ? cloneIfNodeOrArray(node.decorators, true, withoutLoc, commentsCache) : node.decorators; } } else if (!hasOwn(_index.NODE_FIELDS, type)) { throw new Error(`Unknown node type: "${type}"`); } else { for (const field of Object.keys(_index.NODE_FIELDS[type])) { if (hasOwn(node, field)) { if (deep) { newNode[field] = (0, _index2.isFile)(node) && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc, commentsCache) : cloneIfNodeOrArray(node[field], true, withoutLoc, commentsCache); } else { newNode[field] = node[field]; } } } } if (hasOwn(node, "loc")) { if (withoutLoc) { newNode.loc = null; } else { newNode.loc = node.loc; } } if (hasOwn(node, "leadingComments")) { newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc, commentsCache); } if (hasOwn(node, "innerComments")) { newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc, commentsCache); } if (hasOwn(node, "trailingComments")) { newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc, commentsCache); } if (hasOwn(node, "extra")) { newNode.extra = Object.assign({}, node.extra); } return newNode; } function maybeCloneComments(comments, deep, withoutLoc, commentsCache) { if (!comments || !deep) { return comments; } return comments.map(comment => { const cache = commentsCache.get(comment); if (cache) return cache; const { type, value, loc } = comment; const ret = { type, value, loc }; if (withoutLoc) { ret.loc = null; } commentsCache.set(comment, ret); return ret; }); } //# sourceMappingURL=cloneNode.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/clone/cloneWithoutLoc.js": /*!****************************************************************!*\ !*** ./node_modules/@babel/types/lib/clone/cloneWithoutLoc.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = cloneWithoutLoc; var _cloneNode = __webpack_require__(/*! ./cloneNode.js */ "./node_modules/@babel/types/lib/clone/cloneNode.js"); function cloneWithoutLoc(node) { return (0, _cloneNode.default)(node, false, true); } //# sourceMappingURL=cloneWithoutLoc.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/comments/addComment.js": /*!**************************************************************!*\ !*** ./node_modules/@babel/types/lib/comments/addComment.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = addComment; var _addComments = __webpack_require__(/*! ./addComments.js */ "./node_modules/@babel/types/lib/comments/addComments.js"); function addComment(node, type, content, line) { return (0, _addComments.default)(node, type, [{ type: line ? "CommentLine" : "CommentBlock", value: content }]); } //# sourceMappingURL=addComment.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/comments/addComments.js": /*!***************************************************************!*\ !*** ./node_modules/@babel/types/lib/comments/addComments.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = addComments; function addComments(node, type, comments) { if (!comments || !node) return node; const key = `${type}Comments`; if (node[key]) { if (type === "leading") { node[key] = comments.concat(node[key]); } else { node[key].push(...comments); } } else { node[key] = comments; } return node; } //# sourceMappingURL=addComments.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/comments/inheritInnerComments.js": /*!************************************************************************!*\ !*** ./node_modules/@babel/types/lib/comments/inheritInnerComments.js ***! \************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = inheritInnerComments; var _inherit = __webpack_require__(/*! ../utils/inherit.js */ "./node_modules/@babel/types/lib/utils/inherit.js"); function inheritInnerComments(child, parent) { (0, _inherit.default)("innerComments", child, parent); } //# sourceMappingURL=inheritInnerComments.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/comments/inheritLeadingComments.js": /*!**************************************************************************!*\ !*** ./node_modules/@babel/types/lib/comments/inheritLeadingComments.js ***! \**************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = inheritLeadingComments; var _inherit = __webpack_require__(/*! ../utils/inherit.js */ "./node_modules/@babel/types/lib/utils/inherit.js"); function inheritLeadingComments(child, parent) { (0, _inherit.default)("leadingComments", child, parent); } //# sourceMappingURL=inheritLeadingComments.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/comments/inheritTrailingComments.js": /*!***************************************************************************!*\ !*** ./node_modules/@babel/types/lib/comments/inheritTrailingComments.js ***! \***************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = inheritTrailingComments; var _inherit = __webpack_require__(/*! ../utils/inherit.js */ "./node_modules/@babel/types/lib/utils/inherit.js"); function inheritTrailingComments(child, parent) { (0, _inherit.default)("trailingComments", child, parent); } //# sourceMappingURL=inheritTrailingComments.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/comments/inheritsComments.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/types/lib/comments/inheritsComments.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = inheritsComments; var _inheritTrailingComments = __webpack_require__(/*! ./inheritTrailingComments.js */ "./node_modules/@babel/types/lib/comments/inheritTrailingComments.js"); var _inheritLeadingComments = __webpack_require__(/*! ./inheritLeadingComments.js */ "./node_modules/@babel/types/lib/comments/inheritLeadingComments.js"); var _inheritInnerComments = __webpack_require__(/*! ./inheritInnerComments.js */ "./node_modules/@babel/types/lib/comments/inheritInnerComments.js"); function inheritsComments(child, parent) { (0, _inheritTrailingComments.default)(child, parent); (0, _inheritLeadingComments.default)(child, parent); (0, _inheritInnerComments.default)(child, parent); return child; } //# sourceMappingURL=inheritsComments.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/comments/removeComments.js": /*!******************************************************************!*\ !*** ./node_modules/@babel/types/lib/comments/removeComments.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = removeComments; var _index = __webpack_require__(/*! ../constants/index.js */ "./node_modules/@babel/types/lib/constants/index.js"); function removeComments(node) { _index.COMMENT_KEYS.forEach(key => { node[key] = null; }); return node; } //# sourceMappingURL=removeComments.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/constants/generated/index.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/types/lib/constants/generated/index.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.WHILE_TYPES = exports.USERWHITESPACABLE_TYPES = exports.UNARYLIKE_TYPES = exports.TYPESCRIPT_TYPES = exports.TSTYPE_TYPES = exports.TSTYPEELEMENT_TYPES = exports.TSENTITYNAME_TYPES = exports.TSBASETYPE_TYPES = exports.TERMINATORLESS_TYPES = exports.STATEMENT_TYPES = exports.STANDARDIZED_TYPES = exports.SCOPABLE_TYPES = exports.PUREISH_TYPES = exports.PROPERTY_TYPES = exports.PRIVATE_TYPES = exports.PATTERN_TYPES = exports.PATTERNLIKE_TYPES = exports.OBJECTMEMBER_TYPES = exports.MODULESPECIFIER_TYPES = exports.MODULEDECLARATION_TYPES = exports.MISCELLANEOUS_TYPES = exports.METHOD_TYPES = exports.LVAL_TYPES = exports.LOOP_TYPES = exports.LITERAL_TYPES = exports.JSX_TYPES = exports.IMPORTOREXPORTDECLARATION_TYPES = exports.IMMUTABLE_TYPES = exports.FUNCTION_TYPES = exports.FUNCTIONPARENT_TYPES = exports.FUNCTIONPARAMETER_TYPES = exports.FOR_TYPES = exports.FORXSTATEMENT_TYPES = exports.FLOW_TYPES = exports.FLOWTYPE_TYPES = exports.FLOWPREDICATE_TYPES = exports.FLOWDECLARATION_TYPES = exports.FLOWBASEANNOTATION_TYPES = exports.EXPRESSION_TYPES = exports.EXPRESSIONWRAPPER_TYPES = exports.EXPORTDECLARATION_TYPES = exports.ENUMMEMBER_TYPES = exports.ENUMBODY_TYPES = exports.DECLARATION_TYPES = exports.CONDITIONAL_TYPES = exports.COMPLETIONSTATEMENT_TYPES = exports.CLASS_TYPES = exports.BLOCK_TYPES = exports.BLOCKPARENT_TYPES = exports.BINARY_TYPES = exports.ACCESSOR_TYPES = void 0; var _index = __webpack_require__(/*! ../../definitions/index.js */ "./node_modules/@babel/types/lib/definitions/index.js"); const STANDARDIZED_TYPES = exports.STANDARDIZED_TYPES = _index.FLIPPED_ALIAS_KEYS["Standardized"]; const EXPRESSION_TYPES = exports.EXPRESSION_TYPES = _index.FLIPPED_ALIAS_KEYS["Expression"]; const BINARY_TYPES = exports.BINARY_TYPES = _index.FLIPPED_ALIAS_KEYS["Binary"]; const SCOPABLE_TYPES = exports.SCOPABLE_TYPES = _index.FLIPPED_ALIAS_KEYS["Scopable"]; const BLOCKPARENT_TYPES = exports.BLOCKPARENT_TYPES = _index.FLIPPED_ALIAS_KEYS["BlockParent"]; const BLOCK_TYPES = exports.BLOCK_TYPES = _index.FLIPPED_ALIAS_KEYS["Block"]; const STATEMENT_TYPES = exports.STATEMENT_TYPES = _index.FLIPPED_ALIAS_KEYS["Statement"]; const TERMINATORLESS_TYPES = exports.TERMINATORLESS_TYPES = _index.FLIPPED_ALIAS_KEYS["Terminatorless"]; const COMPLETIONSTATEMENT_TYPES = exports.COMPLETIONSTATEMENT_TYPES = _index.FLIPPED_ALIAS_KEYS["CompletionStatement"]; const CONDITIONAL_TYPES = exports.CONDITIONAL_TYPES = _index.FLIPPED_ALIAS_KEYS["Conditional"]; const LOOP_TYPES = exports.LOOP_TYPES = _index.FLIPPED_ALIAS_KEYS["Loop"]; const WHILE_TYPES = exports.WHILE_TYPES = _index.FLIPPED_ALIAS_KEYS["While"]; const EXPRESSIONWRAPPER_TYPES = exports.EXPRESSIONWRAPPER_TYPES = _index.FLIPPED_ALIAS_KEYS["ExpressionWrapper"]; const FOR_TYPES = exports.FOR_TYPES = _index.FLIPPED_ALIAS_KEYS["For"]; const FORXSTATEMENT_TYPES = exports.FORXSTATEMENT_TYPES = _index.FLIPPED_ALIAS_KEYS["ForXStatement"]; const FUNCTION_TYPES = exports.FUNCTION_TYPES = _index.FLIPPED_ALIAS_KEYS["Function"]; const FUNCTIONPARENT_TYPES = exports.FUNCTIONPARENT_TYPES = _index.FLIPPED_ALIAS_KEYS["FunctionParent"]; const PUREISH_TYPES = exports.PUREISH_TYPES = _index.FLIPPED_ALIAS_KEYS["Pureish"]; const DECLARATION_TYPES = exports.DECLARATION_TYPES = _index.FLIPPED_ALIAS_KEYS["Declaration"]; const FUNCTIONPARAMETER_TYPES = exports.FUNCTIONPARAMETER_TYPES = _index.FLIPPED_ALIAS_KEYS["FunctionParameter"]; const PATTERNLIKE_TYPES = exports.PATTERNLIKE_TYPES = _index.FLIPPED_ALIAS_KEYS["PatternLike"]; const LVAL_TYPES = exports.LVAL_TYPES = _index.FLIPPED_ALIAS_KEYS["LVal"]; const TSENTITYNAME_TYPES = exports.TSENTITYNAME_TYPES = _index.FLIPPED_ALIAS_KEYS["TSEntityName"]; const LITERAL_TYPES = exports.LITERAL_TYPES = _index.FLIPPED_ALIAS_KEYS["Literal"]; const IMMUTABLE_TYPES = exports.IMMUTABLE_TYPES = _index.FLIPPED_ALIAS_KEYS["Immutable"]; const USERWHITESPACABLE_TYPES = exports.USERWHITESPACABLE_TYPES = _index.FLIPPED_ALIAS_KEYS["UserWhitespacable"]; const METHOD_TYPES = exports.METHOD_TYPES = _index.FLIPPED_ALIAS_KEYS["Method"]; const OBJECTMEMBER_TYPES = exports.OBJECTMEMBER_TYPES = _index.FLIPPED_ALIAS_KEYS["ObjectMember"]; const PROPERTY_TYPES = exports.PROPERTY_TYPES = _index.FLIPPED_ALIAS_KEYS["Property"]; const UNARYLIKE_TYPES = exports.UNARYLIKE_TYPES = _index.FLIPPED_ALIAS_KEYS["UnaryLike"]; const PATTERN_TYPES = exports.PATTERN_TYPES = _index.FLIPPED_ALIAS_KEYS["Pattern"]; const CLASS_TYPES = exports.CLASS_TYPES = _index.FLIPPED_ALIAS_KEYS["Class"]; const IMPORTOREXPORTDECLARATION_TYPES = exports.IMPORTOREXPORTDECLARATION_TYPES = _index.FLIPPED_ALIAS_KEYS["ImportOrExportDeclaration"]; const EXPORTDECLARATION_TYPES = exports.EXPORTDECLARATION_TYPES = _index.FLIPPED_ALIAS_KEYS["ExportDeclaration"]; const MODULESPECIFIER_TYPES = exports.MODULESPECIFIER_TYPES = _index.FLIPPED_ALIAS_KEYS["ModuleSpecifier"]; const ACCESSOR_TYPES = exports.ACCESSOR_TYPES = _index.FLIPPED_ALIAS_KEYS["Accessor"]; const PRIVATE_TYPES = exports.PRIVATE_TYPES = _index.FLIPPED_ALIAS_KEYS["Private"]; const FLOW_TYPES = exports.FLOW_TYPES = _index.FLIPPED_ALIAS_KEYS["Flow"]; const FLOWTYPE_TYPES = exports.FLOWTYPE_TYPES = _index.FLIPPED_ALIAS_KEYS["FlowType"]; const FLOWBASEANNOTATION_TYPES = exports.FLOWBASEANNOTATION_TYPES = _index.FLIPPED_ALIAS_KEYS["FlowBaseAnnotation"]; const FLOWDECLARATION_TYPES = exports.FLOWDECLARATION_TYPES = _index.FLIPPED_ALIAS_KEYS["FlowDeclaration"]; const FLOWPREDICATE_TYPES = exports.FLOWPREDICATE_TYPES = _index.FLIPPED_ALIAS_KEYS["FlowPredicate"]; const ENUMBODY_TYPES = exports.ENUMBODY_TYPES = _index.FLIPPED_ALIAS_KEYS["EnumBody"]; const ENUMMEMBER_TYPES = exports.ENUMMEMBER_TYPES = _index.FLIPPED_ALIAS_KEYS["EnumMember"]; const JSX_TYPES = exports.JSX_TYPES = _index.FLIPPED_ALIAS_KEYS["JSX"]; const MISCELLANEOUS_TYPES = exports.MISCELLANEOUS_TYPES = _index.FLIPPED_ALIAS_KEYS["Miscellaneous"]; const TYPESCRIPT_TYPES = exports.TYPESCRIPT_TYPES = _index.FLIPPED_ALIAS_KEYS["TypeScript"]; const TSTYPEELEMENT_TYPES = exports.TSTYPEELEMENT_TYPES = _index.FLIPPED_ALIAS_KEYS["TSTypeElement"]; const TSTYPE_TYPES = exports.TSTYPE_TYPES = _index.FLIPPED_ALIAS_KEYS["TSType"]; const TSBASETYPE_TYPES = exports.TSBASETYPE_TYPES = _index.FLIPPED_ALIAS_KEYS["TSBaseType"]; const MODULEDECLARATION_TYPES = exports.MODULEDECLARATION_TYPES = IMPORTOREXPORTDECLARATION_TYPES; //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/constants/index.js": /*!**********************************************************!*\ !*** ./node_modules/@babel/types/lib/constants/index.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.UPDATE_OPERATORS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.STATEMENT_OR_BLOCK_KEYS = exports.NUMBER_UNARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.LOGICAL_OPERATORS = exports.INHERIT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.EQUALITY_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.COMMENT_KEYS = exports.BOOLEAN_UNARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.BINARY_OPERATORS = exports.ASSIGNMENT_OPERATORS = void 0; const STATEMENT_OR_BLOCK_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"]; const FLATTENABLE_KEYS = exports.FLATTENABLE_KEYS = ["body", "expressions"]; const FOR_INIT_KEYS = exports.FOR_INIT_KEYS = ["left", "init"]; const COMMENT_KEYS = exports.COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"]; const LOGICAL_OPERATORS = exports.LOGICAL_OPERATORS = ["||", "&&", "??"]; const UPDATE_OPERATORS = exports.UPDATE_OPERATORS = ["++", "--"]; const BOOLEAN_NUMBER_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="]; const EQUALITY_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="]; const COMPARISON_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = [...EQUALITY_BINARY_OPERATORS, "in", "instanceof"]; const BOOLEAN_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = [...COMPARISON_BINARY_OPERATORS, ...BOOLEAN_NUMBER_BINARY_OPERATORS]; const NUMBER_BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"]; const BINARY_OPERATORS = exports.BINARY_OPERATORS = ["+", ...NUMBER_BINARY_OPERATORS, ...BOOLEAN_BINARY_OPERATORS, "|>"]; const ASSIGNMENT_OPERATORS = exports.ASSIGNMENT_OPERATORS = ["=", "+=", ...NUMBER_BINARY_OPERATORS.map(op => op + "="), ...LOGICAL_OPERATORS.map(op => op + "=")]; const BOOLEAN_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = ["delete", "!"]; const NUMBER_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = ["+", "-", "~"]; const STRING_UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = ["typeof"]; const UNARY_OPERATORS = exports.UNARY_OPERATORS = ["void", "throw", ...BOOLEAN_UNARY_OPERATORS, ...NUMBER_UNARY_OPERATORS, ...STRING_UNARY_OPERATORS]; const INHERIT_KEYS = exports.INHERIT_KEYS = { optional: ["typeAnnotation", "typeParameters", "returnType"], force: ["start", "loc", "end"] }; { exports.BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped"); exports.NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding"); } //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/converters/ensureBlock.js": /*!*****************************************************************!*\ !*** ./node_modules/@babel/types/lib/converters/ensureBlock.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = ensureBlock; var _toBlock = __webpack_require__(/*! ./toBlock.js */ "./node_modules/@babel/types/lib/converters/toBlock.js"); function ensureBlock(node, key = "body") { const result = (0, _toBlock.default)(node[key], node); node[key] = result; return result; } //# sourceMappingURL=ensureBlock.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js": /*!*******************************************************************************!*\ !*** ./node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js ***! \*******************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = gatherSequenceExpressions; var _getBindingIdentifiers = __webpack_require__(/*! ../retrievers/getBindingIdentifiers.js */ "./node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js"); var _index = __webpack_require__(/*! ../validators/generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); var _index2 = __webpack_require__(/*! ../builders/generated/index.js */ "./node_modules/@babel/types/lib/builders/generated/index.js"); var _productions = __webpack_require__(/*! ../builders/productions.js */ "./node_modules/@babel/types/lib/builders/productions.js"); var _cloneNode = __webpack_require__(/*! ../clone/cloneNode.js */ "./node_modules/@babel/types/lib/clone/cloneNode.js"); ; function gatherSequenceExpressions(nodes, declars) { const exprs = []; let ensureLastUndefined = true; for (const node of nodes) { if (!(0, _index.isEmptyStatement)(node)) { ensureLastUndefined = false; } if ((0, _index.isExpression)(node)) { exprs.push(node); } else if ((0, _index.isExpressionStatement)(node)) { exprs.push(node.expression); } else if ((0, _index.isVariableDeclaration)(node)) { if (node.kind !== "var") return; for (const declar of node.declarations) { const bindings = (0, _getBindingIdentifiers.default)(declar); for (const key of Object.keys(bindings)) { declars.push({ kind: node.kind, id: (0, _cloneNode.default)(bindings[key]) }); } if (declar.init) { exprs.push((0, _index2.assignmentExpression)("=", declar.id, declar.init)); } } ensureLastUndefined = true; } else if ((0, _index.isIfStatement)(node)) { const consequent = node.consequent ? gatherSequenceExpressions([node.consequent], declars) : (0, _productions.buildUndefinedNode)(); const alternate = node.alternate ? gatherSequenceExpressions([node.alternate], declars) : (0, _productions.buildUndefinedNode)(); if (!consequent || !alternate) return; exprs.push((0, _index2.conditionalExpression)(node.test, consequent, alternate)); } else if ((0, _index.isBlockStatement)(node)) { const body = gatherSequenceExpressions(node.body, declars); if (!body) return; exprs.push(body); } else if ((0, _index.isEmptyStatement)(node)) { if (nodes.indexOf(node) === 0) { ensureLastUndefined = true; } } else { return; } } if (ensureLastUndefined) { exprs.push((0, _productions.buildUndefinedNode)()); } if (exprs.length === 1) { return exprs[0]; } else { return (0, _index2.sequenceExpression)(exprs); } } //# sourceMappingURL=gatherSequenceExpressions.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/converters/toBindingIdentifierName.js": /*!*****************************************************************************!*\ !*** ./node_modules/@babel/types/lib/converters/toBindingIdentifierName.js ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = toBindingIdentifierName; var _toIdentifier = __webpack_require__(/*! ./toIdentifier.js */ "./node_modules/@babel/types/lib/converters/toIdentifier.js"); function toBindingIdentifierName(name) { name = (0, _toIdentifier.default)(name); if (name === "eval" || name === "arguments") name = "_" + name; return name; } //# sourceMappingURL=toBindingIdentifierName.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/converters/toBlock.js": /*!*************************************************************!*\ !*** ./node_modules/@babel/types/lib/converters/toBlock.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = toBlock; var _index = __webpack_require__(/*! ../validators/generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); var _index2 = __webpack_require__(/*! ../builders/generated/index.js */ "./node_modules/@babel/types/lib/builders/generated/index.js"); function toBlock(node, parent) { if ((0, _index.isBlockStatement)(node)) { return node; } let blockNodes = []; if ((0, _index.isEmptyStatement)(node)) { blockNodes = []; } else { if (!(0, _index.isStatement)(node)) { if ((0, _index.isFunction)(parent)) { node = (0, _index2.returnStatement)(node); } else { node = (0, _index2.expressionStatement)(node); } } blockNodes = [node]; } return (0, _index2.blockStatement)(blockNodes); } //# sourceMappingURL=toBlock.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/converters/toComputedKey.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/types/lib/converters/toComputedKey.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = toComputedKey; var _index = __webpack_require__(/*! ../validators/generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); var _index2 = __webpack_require__(/*! ../builders/generated/index.js */ "./node_modules/@babel/types/lib/builders/generated/index.js"); function toComputedKey(node, key = node.key || node.property) { if (!node.computed && (0, _index.isIdentifier)(key)) key = (0, _index2.stringLiteral)(key.name); return key; } //# sourceMappingURL=toComputedKey.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/converters/toExpression.js": /*!******************************************************************!*\ !*** ./node_modules/@babel/types/lib/converters/toExpression.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _index = __webpack_require__(/*! ../validators/generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); var _default = exports["default"] = toExpression; function toExpression(node) { if ((0, _index.isExpressionStatement)(node)) { node = node.expression; } if ((0, _index.isExpression)(node)) { return node; } if ((0, _index.isClass)(node)) { node.type = "ClassExpression"; node.abstract = false; } else if ((0, _index.isFunction)(node)) { node.type = "FunctionExpression"; } if (!(0, _index.isExpression)(node)) { throw new Error(`cannot turn ${node.type} to an expression`); } return node; } //# sourceMappingURL=toExpression.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/converters/toIdentifier.js": /*!******************************************************************!*\ !*** ./node_modules/@babel/types/lib/converters/toIdentifier.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = toIdentifier; var _isValidIdentifier = __webpack_require__(/*! ../validators/isValidIdentifier.js */ "./node_modules/@babel/types/lib/validators/isValidIdentifier.js"); var _helperValidatorIdentifier = __webpack_require__(/*! @babel/helper-validator-identifier */ "./node_modules/@babel/helper-validator-identifier/lib/index.js"); function toIdentifier(input) { input = input + ""; let name = ""; for (const c of input) { name += (0, _helperValidatorIdentifier.isIdentifierChar)(c.codePointAt(0)) ? c : "-"; } name = name.replace(/^[-0-9]+/, ""); name = name.replace(/[-\s]+(.)?/g, function (match, c) { return c ? c.toUpperCase() : ""; }); if (!(0, _isValidIdentifier.default)(name)) { name = `_${name}`; } return name || "_"; } //# sourceMappingURL=toIdentifier.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/converters/toKeyAlias.js": /*!****************************************************************!*\ !*** ./node_modules/@babel/types/lib/converters/toKeyAlias.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = toKeyAlias; var _index = __webpack_require__(/*! ../validators/generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); var _cloneNode = __webpack_require__(/*! ../clone/cloneNode.js */ "./node_modules/@babel/types/lib/clone/cloneNode.js"); var _removePropertiesDeep = __webpack_require__(/*! ../modifications/removePropertiesDeep.js */ "./node_modules/@babel/types/lib/modifications/removePropertiesDeep.js"); function toKeyAlias(node, key = node.key) { let alias; if (node.kind === "method") { return toKeyAlias.increment() + ""; } else if ((0, _index.isIdentifier)(key)) { alias = key.name; } else if ((0, _index.isStringLiteral)(key)) { alias = JSON.stringify(key.value); } else { alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode.default)(key))); } if (node.computed) { alias = `[${alias}]`; } if (node.static) { alias = `static:${alias}`; } return alias; } toKeyAlias.uid = 0; toKeyAlias.increment = function () { if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) { return toKeyAlias.uid = 0; } else { return toKeyAlias.uid++; } }; //# sourceMappingURL=toKeyAlias.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/converters/toSequenceExpression.js": /*!**************************************************************************!*\ !*** ./node_modules/@babel/types/lib/converters/toSequenceExpression.js ***! \**************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = toSequenceExpression; var _gatherSequenceExpressions = __webpack_require__(/*! ./gatherSequenceExpressions.js */ "./node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js"); ; function toSequenceExpression(nodes, scope) { if (!(nodes != null && nodes.length)) return; const declars = []; const result = (0, _gatherSequenceExpressions.default)(nodes, declars); if (!result) return; for (const declar of declars) { scope.push(declar); } return result; } //# sourceMappingURL=toSequenceExpression.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/converters/toStatement.js": /*!*****************************************************************!*\ !*** ./node_modules/@babel/types/lib/converters/toStatement.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _index = __webpack_require__(/*! ../validators/generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); var _index2 = __webpack_require__(/*! ../builders/generated/index.js */ "./node_modules/@babel/types/lib/builders/generated/index.js"); var _default = exports["default"] = toStatement; function toStatement(node, ignore) { if ((0, _index.isStatement)(node)) { return node; } let mustHaveId = false; let newType; if ((0, _index.isClass)(node)) { mustHaveId = true; newType = "ClassDeclaration"; } else if ((0, _index.isFunction)(node)) { mustHaveId = true; newType = "FunctionDeclaration"; } else if ((0, _index.isAssignmentExpression)(node)) { return (0, _index2.expressionStatement)(node); } if (mustHaveId && !node.id) { newType = false; } if (!newType) { if (ignore) { return false; } else { throw new Error(`cannot turn ${node.type} to a statement`); } } node.type = newType; return node; } //# sourceMappingURL=toStatement.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/converters/valueToNode.js": /*!*****************************************************************!*\ !*** ./node_modules/@babel/types/lib/converters/valueToNode.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _isValidIdentifier = __webpack_require__(/*! ../validators/isValidIdentifier.js */ "./node_modules/@babel/types/lib/validators/isValidIdentifier.js"); var _index = __webpack_require__(/*! ../builders/generated/index.js */ "./node_modules/@babel/types/lib/builders/generated/index.js"); var _default = exports["default"] = valueToNode; const objectToString = Function.call.bind(Object.prototype.toString); function isRegExp(value) { return objectToString(value) === "[object RegExp]"; } function isPlainObject(value) { if (typeof value !== "object" || value === null || Object.prototype.toString.call(value) !== "[object Object]") { return false; } const proto = Object.getPrototypeOf(value); return proto === null || Object.getPrototypeOf(proto) === null; } function valueToNode(value) { if (value === undefined) { return (0, _index.identifier)("undefined"); } if (value === true || value === false) { return (0, _index.booleanLiteral)(value); } if (value === null) { return (0, _index.nullLiteral)(); } if (typeof value === "string") { return (0, _index.stringLiteral)(value); } if (typeof value === "number") { let result; if (Number.isFinite(value)) { result = (0, _index.numericLiteral)(Math.abs(value)); } else { let numerator; if (Number.isNaN(value)) { numerator = (0, _index.numericLiteral)(0); } else { numerator = (0, _index.numericLiteral)(1); } result = (0, _index.binaryExpression)("/", numerator, (0, _index.numericLiteral)(0)); } if (value < 0 || Object.is(value, -0)) { result = (0, _index.unaryExpression)("-", result); } return result; } if (typeof value === "bigint") { if (value < 0) { return (0, _index.unaryExpression)("-", (0, _index.bigIntLiteral)(-value)); } else { return (0, _index.bigIntLiteral)(value); } } if (isRegExp(value)) { const pattern = value.source; const flags = /\/([a-z]*)$/.exec(value.toString())[1]; return (0, _index.regExpLiteral)(pattern, flags); } if (Array.isArray(value)) { return (0, _index.arrayExpression)(value.map(valueToNode)); } if (isPlainObject(value)) { const props = []; for (const key of Object.keys(value)) { let nodeKey, computed = false; if ((0, _isValidIdentifier.default)(key)) { if (key === "__proto__") { computed = true; nodeKey = (0, _index.stringLiteral)(key); } else { nodeKey = (0, _index.identifier)(key); } } else { nodeKey = (0, _index.stringLiteral)(key); } props.push((0, _index.objectProperty)(nodeKey, valueToNode(value[key]), computed)); } return (0, _index.objectExpression)(props); } throw new Error("don't know how to turn this value into a node"); } //# sourceMappingURL=valueToNode.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/definitions/core.js": /*!***********************************************************!*\ !*** ./node_modules/@babel/types/lib/definitions/core.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.patternLikeCommon = exports.importAttributes = exports.functionTypeAnnotationCommon = exports.functionDeclarationCommon = exports.functionCommon = exports.classMethodOrPropertyCommon = exports.classMethodOrDeclareMethodCommon = void 0; var _is = __webpack_require__(/*! ../validators/is.js */ "./node_modules/@babel/types/lib/validators/is.js"); var _isValidIdentifier = __webpack_require__(/*! ../validators/isValidIdentifier.js */ "./node_modules/@babel/types/lib/validators/isValidIdentifier.js"); var _helperValidatorIdentifier = __webpack_require__(/*! @babel/helper-validator-identifier */ "./node_modules/@babel/helper-validator-identifier/lib/index.js"); var _helperStringParser = __webpack_require__(/*! @babel/helper-string-parser */ "./node_modules/@babel/helper-string-parser/lib/index.js"); var _index = __webpack_require__(/*! ../constants/index.js */ "./node_modules/@babel/types/lib/constants/index.js"); var _utils = __webpack_require__(/*! ./utils.js */ "./node_modules/@babel/types/lib/definitions/utils.js"); const defineType = (0, _utils.defineAliasedType)("Standardized"); defineType("ArrayExpression", { fields: { elements: { validate: (0, _utils.arrayOf)((0, _utils.assertNodeOrValueType)("null", "Expression", "SpreadElement")), default: !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined } }, visitor: ["elements"], aliases: ["Expression"] }); defineType("AssignmentExpression", { fields: { operator: { validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("string") : Object.assign(function () { const identifier = (0, _utils.assertOneOf)(..._index.ASSIGNMENT_OPERATORS); const pattern = (0, _utils.assertOneOf)("="); return function (node, key, val) { const validator = (0, _is.default)("Pattern", node.left) ? pattern : identifier; validator(node, key, val); }; }(), { oneOf: _index.ASSIGNMENT_OPERATORS }) }, left: { validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal", "OptionalMemberExpression") : (0, _utils.assertNodeType)("Identifier", "MemberExpression", "OptionalMemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression") }, right: { validate: (0, _utils.assertNodeType)("Expression") } }, builder: ["operator", "left", "right"], visitor: ["left", "right"], aliases: ["Expression"] }); defineType("BinaryExpression", { builder: ["operator", "left", "right"], fields: { operator: { validate: (0, _utils.assertOneOf)(..._index.BINARY_OPERATORS) }, left: { validate: function () { const expression = (0, _utils.assertNodeType)("Expression"); const inOp = (0, _utils.assertNodeType)("Expression", "PrivateName"); const validator = Object.assign(function (node, key, val) { const validator = node.operator === "in" ? inOp : expression; validator(node, key, val); }, { oneOfNodeTypes: ["Expression", "PrivateName"] }); return validator; }() }, right: { validate: (0, _utils.assertNodeType)("Expression") } }, visitor: ["left", "right"], aliases: ["Binary", "Expression"] }); defineType("InterpreterDirective", { builder: ["value"], fields: { value: { validate: (0, _utils.assertValueType)("string") } } }); defineType("Directive", { visitor: ["value"], fields: { value: { validate: (0, _utils.assertNodeType)("DirectiveLiteral") } } }); defineType("DirectiveLiteral", { builder: ["value"], fields: { value: { validate: (0, _utils.assertValueType)("string") } } }); defineType("BlockStatement", { builder: ["body", "directives"], visitor: ["directives", "body"], fields: { directives: { validate: (0, _utils.arrayOfType)("Directive"), default: [] }, body: (0, _utils.validateArrayOfType)("Statement") }, aliases: ["Scopable", "BlockParent", "Block", "Statement"] }); defineType("BreakStatement", { visitor: ["label"], fields: { label: { validate: (0, _utils.assertNodeType)("Identifier"), optional: true } }, aliases: ["Statement", "Terminatorless", "CompletionStatement"] }); defineType("CallExpression", { visitor: ["callee", "typeParameters", "typeArguments", "arguments"], builder: ["callee", "arguments"], aliases: ["Expression"], fields: Object.assign({ callee: { validate: (0, _utils.assertNodeType)("Expression", "Super", "V8IntrinsicIdentifier") }, arguments: (0, _utils.validateArrayOfType)("Expression", "SpreadElement", "ArgumentPlaceholder"), typeArguments: { validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"), optional: true } }, process.env.BABEL_TYPES_8_BREAKING ? {} : { optional: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, typeParameters: { validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"), optional: true } }) }); defineType("CatchClause", { visitor: ["param", "body"], fields: { param: { validate: (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern"), optional: true }, body: { validate: (0, _utils.assertNodeType)("BlockStatement") } }, aliases: ["Scopable", "BlockParent"] }); defineType("ConditionalExpression", { visitor: ["test", "consequent", "alternate"], fields: { test: { validate: (0, _utils.assertNodeType)("Expression") }, consequent: { validate: (0, _utils.assertNodeType)("Expression") }, alternate: { validate: (0, _utils.assertNodeType)("Expression") } }, aliases: ["Expression", "Conditional"] }); defineType("ContinueStatement", { visitor: ["label"], fields: { label: { validate: (0, _utils.assertNodeType)("Identifier"), optional: true } }, aliases: ["Statement", "Terminatorless", "CompletionStatement"] }); defineType("DebuggerStatement", { aliases: ["Statement"] }); defineType("DoWhileStatement", { builder: ["test", "body"], visitor: ["body", "test"], fields: { test: { validate: (0, _utils.assertNodeType)("Expression") }, body: { validate: (0, _utils.assertNodeType)("Statement") } }, aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"] }); defineType("EmptyStatement", { aliases: ["Statement"] }); defineType("ExpressionStatement", { visitor: ["expression"], fields: { expression: { validate: (0, _utils.assertNodeType)("Expression") } }, aliases: ["Statement", "ExpressionWrapper"] }); defineType("File", { builder: ["program", "comments", "tokens"], visitor: ["program"], fields: { program: { validate: (0, _utils.assertNodeType)("Program") }, comments: { validate: !process.env.BABEL_TYPES_8_BREAKING ? Object.assign(() => {}, { each: { oneOfNodeTypes: ["CommentBlock", "CommentLine"] } }) : (0, _utils.assertEach)((0, _utils.assertNodeType)("CommentBlock", "CommentLine")), optional: true }, tokens: { validate: (0, _utils.assertEach)(Object.assign(() => {}, { type: "any" })), optional: true } } }); defineType("ForInStatement", { visitor: ["left", "right", "body"], aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], fields: { left: { validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("VariableDeclaration", "LVal") : (0, _utils.assertNodeType)("VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression") }, right: { validate: (0, _utils.assertNodeType)("Expression") }, body: { validate: (0, _utils.assertNodeType)("Statement") } } }); defineType("ForStatement", { visitor: ["init", "test", "update", "body"], aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"], fields: { init: { validate: (0, _utils.assertNodeType)("VariableDeclaration", "Expression"), optional: true }, test: { validate: (0, _utils.assertNodeType)("Expression"), optional: true }, update: { validate: (0, _utils.assertNodeType)("Expression"), optional: true }, body: { validate: (0, _utils.assertNodeType)("Statement") } } }); const functionCommon = () => ({ params: (0, _utils.validateArrayOfType)("FunctionParameter"), generator: { default: false }, async: { default: false } }); exports.functionCommon = functionCommon; const functionTypeAnnotationCommon = () => ({ returnType: { validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), optional: true }, typeParameters: { validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), optional: true } }); exports.functionTypeAnnotationCommon = functionTypeAnnotationCommon; const functionDeclarationCommon = () => Object.assign({}, functionCommon(), { declare: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, id: { validate: (0, _utils.assertNodeType)("Identifier"), optional: true } }); exports.functionDeclarationCommon = functionDeclarationCommon; defineType("FunctionDeclaration", { builder: ["id", "params", "body", "generator", "async"], visitor: ["id", "typeParameters", "params", "predicate", "returnType", "body"], fields: Object.assign({}, functionDeclarationCommon(), functionTypeAnnotationCommon(), { body: { validate: (0, _utils.assertNodeType)("BlockStatement") }, predicate: { validate: (0, _utils.assertNodeType)("DeclaredPredicate", "InferredPredicate"), optional: true } }), aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"], validate: !process.env.BABEL_TYPES_8_BREAKING ? undefined : function () { const identifier = (0, _utils.assertNodeType)("Identifier"); return function (parent, key, node) { if (!(0, _is.default)("ExportDefaultDeclaration", parent)) { identifier(node, "id", node.id); } }; }() }); defineType("FunctionExpression", { inherits: "FunctionDeclaration", aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], fields: Object.assign({}, functionCommon(), functionTypeAnnotationCommon(), { id: { validate: (0, _utils.assertNodeType)("Identifier"), optional: true }, body: { validate: (0, _utils.assertNodeType)("BlockStatement") }, predicate: { validate: (0, _utils.assertNodeType)("DeclaredPredicate", "InferredPredicate"), optional: true } }) }); const patternLikeCommon = () => ({ typeAnnotation: { validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), optional: true }, optional: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, decorators: { validate: (0, _utils.arrayOfType)("Decorator"), optional: true } }); exports.patternLikeCommon = patternLikeCommon; defineType("Identifier", { builder: ["name"], visitor: ["typeAnnotation", "decorators"], aliases: ["Expression", "FunctionParameter", "PatternLike", "LVal", "TSEntityName"], fields: Object.assign({}, patternLikeCommon(), { name: { validate: process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function (node, key, val) { if (!(0, _isValidIdentifier.default)(val, false)) { throw new TypeError(`"${val}" is not a valid identifier name`); } }, { type: "string" })) : (0, _utils.assertValueType)("string") } }), validate: process.env.BABEL_TYPES_8_BREAKING ? function (parent, key, node) { const match = /\.(\w+)$/.exec(key.toString()); if (!match) return; const [, parentKey] = match; const nonComp = { computed: false }; if (parentKey === "property") { if ((0, _is.default)("MemberExpression", parent, nonComp)) return; if ((0, _is.default)("OptionalMemberExpression", parent, nonComp)) return; } else if (parentKey === "key") { if ((0, _is.default)("Property", parent, nonComp)) return; if ((0, _is.default)("Method", parent, nonComp)) return; } else if (parentKey === "exported") { if ((0, _is.default)("ExportSpecifier", parent)) return; } else if (parentKey === "imported") { if ((0, _is.default)("ImportSpecifier", parent, { imported: node })) return; } else if (parentKey === "meta") { if ((0, _is.default)("MetaProperty", parent, { meta: node })) return; } if (((0, _helperValidatorIdentifier.isKeyword)(node.name) || (0, _helperValidatorIdentifier.isReservedWord)(node.name, false)) && node.name !== "this") { throw new TypeError(`"${node.name}" is not a valid identifier`); } } : undefined }); defineType("IfStatement", { visitor: ["test", "consequent", "alternate"], aliases: ["Statement", "Conditional"], fields: { test: { validate: (0, _utils.assertNodeType)("Expression") }, consequent: { validate: (0, _utils.assertNodeType)("Statement") }, alternate: { optional: true, validate: (0, _utils.assertNodeType)("Statement") } } }); defineType("LabeledStatement", { visitor: ["label", "body"], aliases: ["Statement"], fields: { label: { validate: (0, _utils.assertNodeType)("Identifier") }, body: { validate: (0, _utils.assertNodeType)("Statement") } } }); defineType("StringLiteral", { builder: ["value"], fields: { value: { validate: (0, _utils.assertValueType)("string") } }, aliases: ["Expression", "Pureish", "Literal", "Immutable"] }); defineType("NumericLiteral", { builder: ["value"], deprecatedAlias: "NumberLiteral", fields: { value: { validate: (0, _utils.chain)((0, _utils.assertValueType)("number"), Object.assign(function (node, key, val) { if (1 / val < 0 || !Number.isFinite(val)) { const error = new Error("NumericLiterals must be non-negative finite numbers. " + `You can use t.valueToNode(${val}) instead.`); {} } }, { type: "number" })) } }, aliases: ["Expression", "Pureish", "Literal", "Immutable"] }); defineType("NullLiteral", { aliases: ["Expression", "Pureish", "Literal", "Immutable"] }); defineType("BooleanLiteral", { builder: ["value"], fields: { value: { validate: (0, _utils.assertValueType)("boolean") } }, aliases: ["Expression", "Pureish", "Literal", "Immutable"] }); defineType("RegExpLiteral", { builder: ["pattern", "flags"], deprecatedAlias: "RegexLiteral", aliases: ["Expression", "Pureish", "Literal"], fields: { pattern: { validate: (0, _utils.assertValueType)("string") }, flags: { validate: process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.chain)((0, _utils.assertValueType)("string"), Object.assign(function (node, key, val) { const invalid = /[^gimsuy]/.exec(val); if (invalid) { throw new TypeError(`"${invalid[0]}" is not a valid RegExp flag`); } }, { type: "string" })) : (0, _utils.assertValueType)("string"), default: "" } } }); defineType("LogicalExpression", { builder: ["operator", "left", "right"], visitor: ["left", "right"], aliases: ["Binary", "Expression"], fields: { operator: { validate: (0, _utils.assertOneOf)(..._index.LOGICAL_OPERATORS) }, left: { validate: (0, _utils.assertNodeType)("Expression") }, right: { validate: (0, _utils.assertNodeType)("Expression") } } }); defineType("MemberExpression", { builder: ["object", "property", "computed", ...(!process.env.BABEL_TYPES_8_BREAKING ? ["optional"] : [])], visitor: ["object", "property"], aliases: ["Expression", "LVal", "PatternLike"], fields: Object.assign({ object: { validate: (0, _utils.assertNodeType)("Expression", "Super") }, property: { validate: function () { const normal = (0, _utils.assertNodeType)("Identifier", "PrivateName"); const computed = (0, _utils.assertNodeType)("Expression"); const validator = function (node, key, val) { const validator = node.computed ? computed : normal; validator(node, key, val); }; validator.oneOfNodeTypes = ["Expression", "Identifier", "PrivateName"]; return validator; }() }, computed: { default: false } }, !process.env.BABEL_TYPES_8_BREAKING ? { optional: { validate: (0, _utils.assertValueType)("boolean"), optional: true } } : {}) }); defineType("NewExpression", { inherits: "CallExpression" }); defineType("Program", { visitor: ["directives", "body"], builder: ["body", "directives", "sourceType", "interpreter"], fields: { sourceType: { validate: (0, _utils.assertOneOf)("script", "module"), default: "script" }, interpreter: { validate: (0, _utils.assertNodeType)("InterpreterDirective"), default: null, optional: true }, directives: { validate: (0, _utils.arrayOfType)("Directive"), default: [] }, body: (0, _utils.validateArrayOfType)("Statement") }, aliases: ["Scopable", "BlockParent", "Block"] }); defineType("ObjectExpression", { visitor: ["properties"], aliases: ["Expression"], fields: { properties: (0, _utils.validateArrayOfType)("ObjectMethod", "ObjectProperty", "SpreadElement") } }); defineType("ObjectMethod", { builder: ["kind", "key", "params", "body", "computed", "generator", "async"], visitor: ["decorators", "key", "typeParameters", "params", "returnType", "body"], fields: Object.assign({}, functionCommon(), functionTypeAnnotationCommon(), { kind: Object.assign({ validate: (0, _utils.assertOneOf)("method", "get", "set") }, !process.env.BABEL_TYPES_8_BREAKING ? { default: "method" } : {}), computed: { default: false }, key: { validate: function () { const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral"); const computed = (0, _utils.assertNodeType)("Expression"); const validator = function (node, key, val) { const validator = node.computed ? computed : normal; validator(node, key, val); }; validator.oneOfNodeTypes = ["Expression", "Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral"]; return validator; }() }, decorators: { validate: (0, _utils.arrayOfType)("Decorator"), optional: true }, body: { validate: (0, _utils.assertNodeType)("BlockStatement") } }), aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"] }); defineType("ObjectProperty", { builder: ["key", "value", "computed", "shorthand", ...(!process.env.BABEL_TYPES_8_BREAKING ? ["decorators"] : [])], fields: { computed: { default: false }, key: { validate: function () { const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "DecimalLiteral", "PrivateName"); const computed = (0, _utils.assertNodeType)("Expression"); const validator = Object.assign(function (node, key, val) { const validator = node.computed ? computed : normal; validator(node, key, val); }, { oneOfNodeTypes: ["Expression", "Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "DecimalLiteral", "PrivateName"] }); return validator; }() }, value: { validate: (0, _utils.assertNodeType)("Expression", "PatternLike") }, shorthand: { validate: process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function (node, key, shorthand) { if (!shorthand) return; if (node.computed) { throw new TypeError("Property shorthand of ObjectProperty cannot be true if computed is true"); } if (!(0, _is.default)("Identifier", node.key)) { throw new TypeError("Property shorthand of ObjectProperty cannot be true if key is not an Identifier"); } }, { type: "boolean" })) : (0, _utils.assertValueType)("boolean"), default: false }, decorators: { validate: (0, _utils.arrayOfType)("Decorator"), optional: true } }, visitor: ["decorators", "key", "value"], aliases: ["UserWhitespacable", "Property", "ObjectMember"], validate: !process.env.BABEL_TYPES_8_BREAKING ? undefined : function () { const pattern = (0, _utils.assertNodeType)("Identifier", "Pattern", "TSAsExpression", "TSSatisfiesExpression", "TSNonNullExpression", "TSTypeAssertion"); const expression = (0, _utils.assertNodeType)("Expression"); return function (parent, key, node) { const validator = (0, _is.default)("ObjectPattern", parent) ? pattern : expression; validator(node, "value", node.value); }; }() }); defineType("RestElement", { visitor: ["argument", "typeAnnotation"], builder: ["argument"], aliases: ["FunctionParameter", "PatternLike", "LVal"], deprecatedAlias: "RestProperty", fields: Object.assign({}, patternLikeCommon(), { argument: { validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern", "MemberExpression", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression", "RestElement", "AssignmentPattern") : (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern", "MemberExpression", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression") } }), validate: process.env.BABEL_TYPES_8_BREAKING ? function (parent, key) { const match = /(\w+)\[(\d+)\]/.exec(key.toString()); if (!match) throw new Error("Internal Babel error: malformed key."); const [, listKey, index] = match; if (parent[listKey].length > +index + 1) { throw new TypeError(`RestElement must be last element of ${listKey}`); } } : undefined }); defineType("ReturnStatement", { visitor: ["argument"], aliases: ["Statement", "Terminatorless", "CompletionStatement"], fields: { argument: { validate: (0, _utils.assertNodeType)("Expression"), optional: true } } }); defineType("SequenceExpression", { visitor: ["expressions"], fields: { expressions: (0, _utils.validateArrayOfType)("Expression") }, aliases: ["Expression"] }); defineType("ParenthesizedExpression", { visitor: ["expression"], aliases: ["Expression", "ExpressionWrapper"], fields: { expression: { validate: (0, _utils.assertNodeType)("Expression") } } }); defineType("SwitchCase", { visitor: ["test", "consequent"], fields: { test: { validate: (0, _utils.assertNodeType)("Expression"), optional: true }, consequent: (0, _utils.validateArrayOfType)("Statement") } }); defineType("SwitchStatement", { visitor: ["discriminant", "cases"], aliases: ["Statement", "BlockParent", "Scopable"], fields: { discriminant: { validate: (0, _utils.assertNodeType)("Expression") }, cases: (0, _utils.validateArrayOfType)("SwitchCase") } }); defineType("ThisExpression", { aliases: ["Expression"] }); defineType("ThrowStatement", { visitor: ["argument"], aliases: ["Statement", "Terminatorless", "CompletionStatement"], fields: { argument: { validate: (0, _utils.assertNodeType)("Expression") } } }); defineType("TryStatement", { visitor: ["block", "handler", "finalizer"], aliases: ["Statement"], fields: { block: { validate: process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.chain)((0, _utils.assertNodeType)("BlockStatement"), Object.assign(function (node) { if (!node.handler && !node.finalizer) { throw new TypeError("TryStatement expects either a handler or finalizer, or both"); } }, { oneOfNodeTypes: ["BlockStatement"] })) : (0, _utils.assertNodeType)("BlockStatement") }, handler: { optional: true, validate: (0, _utils.assertNodeType)("CatchClause") }, finalizer: { optional: true, validate: (0, _utils.assertNodeType)("BlockStatement") } } }); defineType("UnaryExpression", { builder: ["operator", "argument", "prefix"], fields: { prefix: { default: true }, argument: { validate: (0, _utils.assertNodeType)("Expression") }, operator: { validate: (0, _utils.assertOneOf)(..._index.UNARY_OPERATORS) } }, visitor: ["argument"], aliases: ["UnaryLike", "Expression"] }); defineType("UpdateExpression", { builder: ["operator", "argument", "prefix"], fields: { prefix: { default: false }, argument: { validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("Expression") : (0, _utils.assertNodeType)("Identifier", "MemberExpression") }, operator: { validate: (0, _utils.assertOneOf)(..._index.UPDATE_OPERATORS) } }, visitor: ["argument"], aliases: ["Expression"] }); defineType("VariableDeclaration", { builder: ["kind", "declarations"], visitor: ["declarations"], aliases: ["Statement", "Declaration"], fields: { declare: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, kind: { validate: (0, _utils.assertOneOf)("var", "let", "const", "using", "await using") }, declarations: (0, _utils.validateArrayOfType)("VariableDeclarator") }, validate: process.env.BABEL_TYPES_8_BREAKING ? (() => { const withoutInit = (0, _utils.assertNodeType)("Identifier", "Placeholder"); const constOrLetOrVar = (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern", "Placeholder"); const usingOrAwaitUsing = (0, _utils.assertNodeType)("Identifier", "VoidPattern", "Placeholder"); return function (parent, key, node) { const { kind, declarations } = node; const parentIsForX = (0, _is.default)("ForXStatement", parent, { left: node }); if (parentIsForX) { if (declarations.length !== 1) { throw new TypeError(`Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`); } } for (const decl of declarations) { if (kind === "const" || kind === "let" || kind === "var") { if (!parentIsForX && !decl.init) { withoutInit(decl, "id", decl.id); } else { constOrLetOrVar(decl, "id", decl.id); } } else { usingOrAwaitUsing(decl, "id", decl.id); } } }; })() : undefined }); defineType("VariableDeclarator", { visitor: ["id", "init"], fields: { id: { validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertNodeType)("LVal", "VoidPattern") : (0, _utils.assertNodeType)("Identifier", "ArrayPattern", "ObjectPattern", "VoidPattern") }, definite: { optional: true, validate: (0, _utils.assertValueType)("boolean") }, init: { optional: true, validate: (0, _utils.assertNodeType)("Expression") } } }); defineType("WhileStatement", { visitor: ["test", "body"], aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"], fields: { test: { validate: (0, _utils.assertNodeType)("Expression") }, body: { validate: (0, _utils.assertNodeType)("Statement") } } }); defineType("WithStatement", { visitor: ["object", "body"], aliases: ["Statement"], fields: { object: { validate: (0, _utils.assertNodeType)("Expression") }, body: { validate: (0, _utils.assertNodeType)("Statement") } } }); defineType("AssignmentPattern", { visitor: ["left", "right", "decorators"], builder: ["left", "right"], aliases: ["FunctionParameter", "Pattern", "PatternLike", "LVal"], fields: Object.assign({}, patternLikeCommon(), { left: { validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern", "MemberExpression", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression") }, right: { validate: (0, _utils.assertNodeType)("Expression") }, decorators: { validate: (0, _utils.arrayOfType)("Decorator"), optional: true } }) }); defineType("ArrayPattern", { visitor: ["elements", "typeAnnotation"], builder: ["elements"], aliases: ["FunctionParameter", "Pattern", "PatternLike", "LVal"], fields: Object.assign({}, patternLikeCommon(), { elements: { validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "PatternLike"))) } }) }); defineType("ArrowFunctionExpression", { builder: ["params", "body", "async"], visitor: ["typeParameters", "params", "predicate", "returnType", "body"], aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"], fields: Object.assign({}, functionCommon(), functionTypeAnnotationCommon(), { expression: { validate: (0, _utils.assertValueType)("boolean") }, body: { validate: (0, _utils.assertNodeType)("BlockStatement", "Expression") }, predicate: { validate: (0, _utils.assertNodeType)("DeclaredPredicate", "InferredPredicate"), optional: true } }) }); defineType("ClassBody", { visitor: ["body"], fields: { body: (0, _utils.validateArrayOfType)("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "ClassAccessorProperty", "TSDeclareMethod", "TSIndexSignature", "StaticBlock") } }); defineType("ClassExpression", { builder: ["id", "superClass", "body", "decorators"], visitor: ["decorators", "id", "typeParameters", "superClass", "superTypeParameters", "mixins", "implements", "body"], aliases: ["Scopable", "Class", "Expression"], fields: { id: { validate: (0, _utils.assertNodeType)("Identifier"), optional: true }, typeParameters: { validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), optional: true }, body: { validate: (0, _utils.assertNodeType)("ClassBody") }, superClass: { optional: true, validate: (0, _utils.assertNodeType)("Expression") }, ["superTypeParameters"]: { validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), optional: true }, implements: { validate: (0, _utils.arrayOfType)("TSExpressionWithTypeArguments", "ClassImplements"), optional: true }, decorators: { validate: (0, _utils.arrayOfType)("Decorator"), optional: true }, mixins: { validate: (0, _utils.assertNodeType)("InterfaceExtends"), optional: true } } }); defineType("ClassDeclaration", { inherits: "ClassExpression", aliases: ["Scopable", "Class", "Statement", "Declaration"], fields: { id: { validate: (0, _utils.assertNodeType)("Identifier"), optional: true }, typeParameters: { validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"), optional: true }, body: { validate: (0, _utils.assertNodeType)("ClassBody") }, superClass: { optional: true, validate: (0, _utils.assertNodeType)("Expression") }, ["superTypeParameters"]: { validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), optional: true }, implements: { validate: (0, _utils.arrayOfType)("TSExpressionWithTypeArguments", "ClassImplements"), optional: true }, decorators: { validate: (0, _utils.arrayOfType)("Decorator"), optional: true }, mixins: { validate: (0, _utils.assertNodeType)("InterfaceExtends"), optional: true }, declare: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, abstract: { validate: (0, _utils.assertValueType)("boolean"), optional: true } }, validate: !process.env.BABEL_TYPES_8_BREAKING ? undefined : function () { const identifier = (0, _utils.assertNodeType)("Identifier"); return function (parent, key, node) { if (!(0, _is.default)("ExportDefaultDeclaration", parent)) { identifier(node, "id", node.id); } }; }() }); const importAttributes = exports.importAttributes = { attributes: { optional: true, validate: (0, _utils.arrayOfType)("ImportAttribute") }, assertions: { deprecated: true, optional: true, validate: (0, _utils.arrayOfType)("ImportAttribute") } }; defineType("ExportAllDeclaration", { builder: ["source"], visitor: ["source", "attributes", "assertions"], aliases: ["Statement", "Declaration", "ImportOrExportDeclaration", "ExportDeclaration"], fields: Object.assign({ source: { validate: (0, _utils.assertNodeType)("StringLiteral") }, exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")) }, importAttributes) }); defineType("ExportDefaultDeclaration", { visitor: ["declaration"], aliases: ["Statement", "Declaration", "ImportOrExportDeclaration", "ExportDeclaration"], fields: { declaration: (0, _utils.validateType)("TSDeclareFunction", "FunctionDeclaration", "ClassDeclaration", "Expression"), exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("value")) } }); defineType("ExportNamedDeclaration", { builder: ["declaration", "specifiers", "source"], visitor: ["declaration", "specifiers", "source", "attributes", "assertions"], aliases: ["Statement", "Declaration", "ImportOrExportDeclaration", "ExportDeclaration"], fields: Object.assign({ declaration: { optional: true, validate: process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.chain)((0, _utils.assertNodeType)("Declaration"), Object.assign(function (node, key, val) { if (val && node.specifiers.length) { throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration"); } if (val && node.source) { throw new TypeError("Cannot export a declaration from a source"); } }, { oneOfNodeTypes: ["Declaration"] })) : (0, _utils.assertNodeType)("Declaration") } }, importAttributes, { specifiers: { default: [], validate: (0, _utils.arrayOf)(function () { const sourced = (0, _utils.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier"); const sourceless = (0, _utils.assertNodeType)("ExportSpecifier"); if (!process.env.BABEL_TYPES_8_BREAKING) return sourced; return Object.assign(function (node, key, val) { const validator = node.source ? sourced : sourceless; validator(node, key, val); }, { oneOfNodeTypes: ["ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier"] }); }()) }, source: { validate: (0, _utils.assertNodeType)("StringLiteral"), optional: true }, exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")) }) }); defineType("ExportSpecifier", { visitor: ["local", "exported"], aliases: ["ModuleSpecifier"], fields: { local: { validate: (0, _utils.assertNodeType)("Identifier") }, exported: { validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral") }, exportKind: { validate: (0, _utils.assertOneOf)("type", "value"), optional: true } } }); defineType("ForOfStatement", { visitor: ["left", "right", "body"], builder: ["left", "right", "body", "await"], aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"], fields: { left: { validate: function () { if (!process.env.BABEL_TYPES_8_BREAKING) { return (0, _utils.assertNodeType)("VariableDeclaration", "LVal"); } const declaration = (0, _utils.assertNodeType)("VariableDeclaration"); const lval = (0, _utils.assertNodeType)("Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression"); return Object.assign(function (node, key, val) { if ((0, _is.default)("VariableDeclaration", val)) { declaration(node, key, val); } else { lval(node, key, val); } }, { oneOfNodeTypes: ["VariableDeclaration", "Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern", "TSAsExpression", "TSSatisfiesExpression", "TSTypeAssertion", "TSNonNullExpression"] }); }() }, right: { validate: (0, _utils.assertNodeType)("Expression") }, body: { validate: (0, _utils.assertNodeType)("Statement") }, await: { default: false } } }); defineType("ImportDeclaration", { builder: ["specifiers", "source"], visitor: ["specifiers", "source", "attributes", "assertions"], aliases: ["Statement", "Declaration", "ImportOrExportDeclaration"], fields: Object.assign({}, importAttributes, { module: { optional: true, validate: (0, _utils.assertValueType)("boolean") }, phase: { default: null, validate: (0, _utils.assertOneOf)("source", "defer") }, specifiers: (0, _utils.validateArrayOfType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier"), source: { validate: (0, _utils.assertNodeType)("StringLiteral") }, importKind: { validate: (0, _utils.assertOneOf)("type", "typeof", "value"), optional: true } }) }); defineType("ImportDefaultSpecifier", { visitor: ["local"], aliases: ["ModuleSpecifier"], fields: { local: { validate: (0, _utils.assertNodeType)("Identifier") } } }); defineType("ImportNamespaceSpecifier", { visitor: ["local"], aliases: ["ModuleSpecifier"], fields: { local: { validate: (0, _utils.assertNodeType)("Identifier") } } }); defineType("ImportSpecifier", { visitor: ["imported", "local"], builder: ["local", "imported"], aliases: ["ModuleSpecifier"], fields: { local: { validate: (0, _utils.assertNodeType)("Identifier") }, imported: { validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral") }, importKind: { validate: (0, _utils.assertOneOf)("type", "typeof", "value"), optional: true } } }); defineType("ImportExpression", { visitor: ["source", "options"], aliases: ["Expression"], fields: { phase: { default: null, validate: (0, _utils.assertOneOf)("source", "defer") }, source: { validate: (0, _utils.assertNodeType)("Expression") }, options: { validate: (0, _utils.assertNodeType)("Expression"), optional: true } } }); defineType("MetaProperty", { visitor: ["meta", "property"], aliases: ["Expression"], fields: { meta: { validate: process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.chain)((0, _utils.assertNodeType)("Identifier"), Object.assign(function (node, key, val) { let property; switch (val.name) { case "function": property = "sent"; break; case "new": property = "target"; break; case "import": property = "meta"; break; } if (!(0, _is.default)("Identifier", node.property, { name: property })) { throw new TypeError("Unrecognised MetaProperty"); } }, { oneOfNodeTypes: ["Identifier"] })) : (0, _utils.assertNodeType)("Identifier") }, property: { validate: (0, _utils.assertNodeType)("Identifier") } } }); const classMethodOrPropertyCommon = () => ({ abstract: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, accessibility: { validate: (0, _utils.assertOneOf)("public", "private", "protected"), optional: true }, static: { default: false }, override: { default: false }, computed: { default: false }, optional: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, key: { validate: (0, _utils.chain)(function () { const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral"); const computed = (0, _utils.assertNodeType)("Expression"); return function (node, key, val) { const validator = node.computed ? computed : normal; validator(node, key, val); }; }(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "Expression")) } }); exports.classMethodOrPropertyCommon = classMethodOrPropertyCommon; const classMethodOrDeclareMethodCommon = () => Object.assign({}, functionCommon(), classMethodOrPropertyCommon(), { params: (0, _utils.validateArrayOfType)("FunctionParameter", "TSParameterProperty"), kind: { validate: (0, _utils.assertOneOf)("get", "set", "method", "constructor"), default: "method" }, access: { validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")), optional: true }, decorators: { validate: (0, _utils.arrayOfType)("Decorator"), optional: true } }); exports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon; defineType("ClassMethod", { aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"], builder: ["kind", "key", "params", "body", "computed", "static", "generator", "async"], visitor: ["decorators", "key", "typeParameters", "params", "returnType", "body"], fields: Object.assign({}, classMethodOrDeclareMethodCommon(), functionTypeAnnotationCommon(), { body: { validate: (0, _utils.assertNodeType)("BlockStatement") } }) }); defineType("ObjectPattern", { visitor: ["decorators", "properties", "typeAnnotation"], builder: ["properties"], aliases: ["FunctionParameter", "Pattern", "PatternLike", "LVal"], fields: Object.assign({}, patternLikeCommon(), { properties: (0, _utils.validateArrayOfType)("RestElement", "ObjectProperty") }) }); defineType("SpreadElement", { visitor: ["argument"], aliases: ["UnaryLike"], deprecatedAlias: "SpreadProperty", fields: { argument: { validate: (0, _utils.assertNodeType)("Expression") } } }); defineType("Super", { aliases: ["Expression"] }); defineType("TaggedTemplateExpression", { visitor: ["tag", "typeParameters", "quasi"], builder: ["tag", "quasi"], aliases: ["Expression"], fields: { tag: { validate: (0, _utils.assertNodeType)("Expression") }, quasi: { validate: (0, _utils.assertNodeType)("TemplateLiteral") }, ["typeParameters"]: { validate: (0, _utils.assertNodeType)("TypeParameterInstantiation", "TSTypeParameterInstantiation"), optional: true } } }); defineType("TemplateElement", { builder: ["value", "tail"], fields: { value: { validate: (0, _utils.chain)((0, _utils.assertShape)({ raw: { validate: (0, _utils.assertValueType)("string") }, cooked: { validate: (0, _utils.assertValueType)("string"), optional: true } }), function templateElementCookedValidator(node) { const raw = node.value.raw; let unterminatedCalled = false; const error = () => { throw new Error("Internal @babel/types error."); }; const { str, firstInvalidLoc } = (0, _helperStringParser.readStringContents)("template", raw, 0, 0, 0, { unterminated() { unterminatedCalled = true; }, strictNumericEscape: error, invalidEscapeSequence: error, numericSeparatorInEscapeSequence: error, unexpectedNumericSeparator: error, invalidDigit: error, invalidCodePoint: error }); if (!unterminatedCalled) throw new Error("Invalid raw"); node.value.cooked = firstInvalidLoc ? null : str; }) }, tail: { default: false } } }); defineType("TemplateLiteral", { visitor: ["quasis", "expressions"], aliases: ["Expression", "Literal"], fields: { quasis: (0, _utils.validateArrayOfType)("TemplateElement"), expressions: { validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "TSType")), function (node, key, val) { if (node.quasis.length !== val.length + 1) { throw new TypeError(`Number of ${node.type} quasis should be exactly one more than the number of expressions.\nExpected ${val.length + 1} quasis but got ${node.quasis.length}`); } }) } } }); defineType("YieldExpression", { builder: ["argument", "delegate"], visitor: ["argument"], aliases: ["Expression", "Terminatorless"], fields: { delegate: { validate: process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.chain)((0, _utils.assertValueType)("boolean"), Object.assign(function (node, key, val) { if (val && !node.argument) { throw new TypeError("Property delegate of YieldExpression cannot be true if there is no argument"); } }, { type: "boolean" })) : (0, _utils.assertValueType)("boolean"), default: false }, argument: { optional: true, validate: (0, _utils.assertNodeType)("Expression") } } }); defineType("AwaitExpression", { builder: ["argument"], visitor: ["argument"], aliases: ["Expression", "Terminatorless"], fields: { argument: { validate: (0, _utils.assertNodeType)("Expression") } } }); defineType("Import", { aliases: ["Expression"] }); defineType("BigIntLiteral", { builder: ["value"], fields: { value: { validate: (0, _utils.assertValueType)("string") } }, aliases: ["Expression", "Pureish", "Literal", "Immutable"] }); defineType("ExportNamespaceSpecifier", { visitor: ["exported"], aliases: ["ModuleSpecifier"], fields: { exported: { validate: (0, _utils.assertNodeType)("Identifier") } } }); defineType("OptionalMemberExpression", { builder: ["object", "property", "computed", "optional"], visitor: ["object", "property"], aliases: ["Expression"], fields: { object: { validate: (0, _utils.assertNodeType)("Expression") }, property: { validate: function () { const normal = (0, _utils.assertNodeType)("Identifier"); const computed = (0, _utils.assertNodeType)("Expression"); const validator = Object.assign(function (node, key, val) { const validator = node.computed ? computed : normal; validator(node, key, val); }, { oneOfNodeTypes: ["Expression", "Identifier"] }); return validator; }() }, computed: { default: false }, optional: { validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)()) } } }); defineType("OptionalCallExpression", { visitor: ["callee", "typeParameters", "typeArguments", "arguments"], builder: ["callee", "arguments", "optional"], aliases: ["Expression"], fields: Object.assign({ callee: { validate: (0, _utils.assertNodeType)("Expression") }, arguments: (0, _utils.validateArrayOfType)("Expression", "SpreadElement", "ArgumentPlaceholder"), optional: { validate: !process.env.BABEL_TYPES_8_BREAKING ? (0, _utils.assertValueType)("boolean") : (0, _utils.chain)((0, _utils.assertValueType)("boolean"), (0, _utils.assertOptionalChainStart)()) }, typeArguments: { validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"), optional: true } }, { typeParameters: { validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"), optional: true } }) }); defineType("ClassProperty", { visitor: ["decorators", "variance", "key", "typeAnnotation", "value"], builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"], aliases: ["Property"], fields: Object.assign({}, classMethodOrPropertyCommon(), { value: { validate: (0, _utils.assertNodeType)("Expression"), optional: true }, definite: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, typeAnnotation: { validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), optional: true }, decorators: { validate: (0, _utils.arrayOfType)("Decorator"), optional: true }, readonly: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, declare: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, variance: { validate: (0, _utils.assertNodeType)("Variance"), optional: true } }) }); defineType("ClassAccessorProperty", { visitor: ["decorators", "key", "typeAnnotation", "value"], builder: ["key", "value", "typeAnnotation", "decorators", "computed", "static"], aliases: ["Property", "Accessor"], fields: Object.assign({}, classMethodOrPropertyCommon(), { key: { validate: (0, _utils.chain)(function () { const normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "PrivateName"); const computed = (0, _utils.assertNodeType)("Expression"); return function (node, key, val) { const validator = node.computed ? computed : normal; validator(node, key, val); }; }(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "Expression", "PrivateName")) }, value: { validate: (0, _utils.assertNodeType)("Expression"), optional: true }, definite: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, typeAnnotation: { validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), optional: true }, decorators: { validate: (0, _utils.arrayOfType)("Decorator"), optional: true }, readonly: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, declare: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, variance: { validate: (0, _utils.assertNodeType)("Variance"), optional: true } }) }); defineType("ClassPrivateProperty", { visitor: ["decorators", "variance", "key", "typeAnnotation", "value"], builder: ["key", "value", "decorators", "static"], aliases: ["Property", "Private"], fields: { key: { validate: (0, _utils.assertNodeType)("PrivateName") }, value: { validate: (0, _utils.assertNodeType)("Expression"), optional: true }, typeAnnotation: { validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"), optional: true }, decorators: { validate: (0, _utils.arrayOfType)("Decorator"), optional: true }, static: { validate: (0, _utils.assertValueType)("boolean"), default: false }, readonly: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, optional: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, definite: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, variance: { validate: (0, _utils.assertNodeType)("Variance"), optional: true } } }); defineType("ClassPrivateMethod", { builder: ["kind", "key", "params", "body", "static"], visitor: ["decorators", "key", "typeParameters", "params", "returnType", "body"], aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method", "Private"], fields: Object.assign({}, classMethodOrDeclareMethodCommon(), functionTypeAnnotationCommon(), { kind: { validate: (0, _utils.assertOneOf)("get", "set", "method"), default: "method" }, key: { validate: (0, _utils.assertNodeType)("PrivateName") }, body: { validate: (0, _utils.assertNodeType)("BlockStatement") } }) }); defineType("PrivateName", { visitor: ["id"], aliases: ["Private"], fields: { id: { validate: (0, _utils.assertNodeType)("Identifier") } } }); defineType("StaticBlock", { visitor: ["body"], fields: { body: (0, _utils.validateArrayOfType)("Statement") }, aliases: ["Scopable", "BlockParent", "FunctionParent"] }); defineType("ImportAttribute", { visitor: ["key", "value"], fields: { key: { validate: (0, _utils.assertNodeType)("Identifier", "StringLiteral") }, value: { validate: (0, _utils.assertNodeType)("StringLiteral") } } }); //# sourceMappingURL=core.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/definitions/deprecated-aliases.js": /*!*************************************************************************!*\ !*** ./node_modules/@babel/types/lib/definitions/deprecated-aliases.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DEPRECATED_ALIASES = void 0; const DEPRECATED_ALIASES = exports.DEPRECATED_ALIASES = { ModuleDeclaration: "ImportOrExportDeclaration" }; //# sourceMappingURL=deprecated-aliases.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/definitions/experimental.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/types/lib/definitions/experimental.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); var _utils = __webpack_require__(/*! ./utils.js */ "./node_modules/@babel/types/lib/definitions/utils.js"); (0, _utils.default)("ArgumentPlaceholder", {}); (0, _utils.default)("BindExpression", { visitor: ["object", "callee"], aliases: ["Expression"], fields: !process.env.BABEL_TYPES_8_BREAKING ? { object: { validate: Object.assign(() => {}, { oneOfNodeTypes: ["Expression"] }) }, callee: { validate: Object.assign(() => {}, { oneOfNodeTypes: ["Expression"] }) } } : { object: { validate: (0, _utils.assertNodeType)("Expression") }, callee: { validate: (0, _utils.assertNodeType)("Expression") } } }); (0, _utils.default)("Decorator", { visitor: ["expression"], fields: { expression: { validate: (0, _utils.assertNodeType)("Expression") } } }); (0, _utils.default)("DoExpression", { visitor: ["body"], builder: ["body", "async"], aliases: ["Expression"], fields: { body: { validate: (0, _utils.assertNodeType)("BlockStatement") }, async: { validate: (0, _utils.assertValueType)("boolean"), default: false } } }); (0, _utils.default)("ExportDefaultSpecifier", { visitor: ["exported"], aliases: ["ModuleSpecifier"], fields: { exported: { validate: (0, _utils.assertNodeType)("Identifier") } } }); (0, _utils.default)("RecordExpression", { visitor: ["properties"], aliases: ["Expression"], fields: { properties: (0, _utils.validateArrayOfType)("ObjectProperty", "SpreadElement") } }); (0, _utils.default)("TupleExpression", { fields: { elements: { validate: (0, _utils.arrayOfType)("Expression", "SpreadElement"), default: [] } }, visitor: ["elements"], aliases: ["Expression"] }); { (0, _utils.default)("DecimalLiteral", { builder: ["value"], fields: { value: { validate: (0, _utils.assertValueType)("string") } }, aliases: ["Expression", "Pureish", "Literal", "Immutable"] }); } (0, _utils.default)("ModuleExpression", { visitor: ["body"], fields: { body: { validate: (0, _utils.assertNodeType)("Program") } }, aliases: ["Expression"] }); (0, _utils.default)("TopicReference", { aliases: ["Expression"] }); (0, _utils.default)("PipelineTopicExpression", { builder: ["expression"], visitor: ["expression"], fields: { expression: { validate: (0, _utils.assertNodeType)("Expression") } }, aliases: ["Expression"] }); (0, _utils.default)("PipelineBareFunction", { builder: ["callee"], visitor: ["callee"], fields: { callee: { validate: (0, _utils.assertNodeType)("Expression") } }, aliases: ["Expression"] }); (0, _utils.default)("PipelinePrimaryTopicReference", { aliases: ["Expression"] }); (0, _utils.default)("VoidPattern", { aliases: ["Pattern", "PatternLike", "FunctionParameter"] }); //# sourceMappingURL=experimental.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/definitions/flow.js": /*!***********************************************************!*\ !*** ./node_modules/@babel/types/lib/definitions/flow.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var _core = __webpack_require__(/*! ./core.js */ "./node_modules/@babel/types/lib/definitions/core.js"); var _utils = __webpack_require__(/*! ./utils.js */ "./node_modules/@babel/types/lib/definitions/utils.js"); const defineType = (0, _utils.defineAliasedType)("Flow"); const defineInterfaceishType = name => { const isDeclareClass = name === "DeclareClass"; defineType(name, { builder: ["id", "typeParameters", "extends", "body"], visitor: ["id", "typeParameters", "extends", ...(isDeclareClass ? ["mixins", "implements"] : []), "body"], aliases: ["FlowDeclaration", "Statement", "Declaration"], fields: Object.assign({ id: (0, _utils.validateType)("Identifier"), typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")) }, isDeclareClass ? { mixins: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")), implements: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ClassImplements")) } : {}, { body: (0, _utils.validateType)("ObjectTypeAnnotation") }) }); }; defineType("AnyTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }); defineType("ArrayTypeAnnotation", { visitor: ["elementType"], aliases: ["FlowType"], fields: { elementType: (0, _utils.validateType)("FlowType") } }); defineType("BooleanTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }); defineType("BooleanLiteralTypeAnnotation", { builder: ["value"], aliases: ["FlowType"], fields: { value: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) } }); defineType("NullLiteralTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }); defineType("ClassImplements", { visitor: ["id", "typeParameters"], fields: { id: (0, _utils.validateType)("Identifier"), typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") } }); defineInterfaceishType("DeclareClass"); defineType("DeclareFunction", { builder: ["id"], visitor: ["id", "predicate"], aliases: ["FlowDeclaration", "Statement", "Declaration"], fields: { id: (0, _utils.validateType)("Identifier"), predicate: (0, _utils.validateOptionalType)("DeclaredPredicate") } }); defineInterfaceishType("DeclareInterface"); defineType("DeclareModule", { builder: ["id", "body", "kind"], visitor: ["id", "body"], aliases: ["FlowDeclaration", "Statement", "Declaration"], fields: { id: (0, _utils.validateType)("Identifier", "StringLiteral"), body: (0, _utils.validateType)("BlockStatement"), kind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("CommonJS", "ES")) } }); defineType("DeclareModuleExports", { visitor: ["typeAnnotation"], aliases: ["FlowDeclaration", "Statement", "Declaration"], fields: { typeAnnotation: (0, _utils.validateType)("TypeAnnotation") } }); defineType("DeclareTypeAlias", { visitor: ["id", "typeParameters", "right"], aliases: ["FlowDeclaration", "Statement", "Declaration"], fields: { id: (0, _utils.validateType)("Identifier"), typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), right: (0, _utils.validateType)("FlowType") } }); defineType("DeclareOpaqueType", { visitor: ["id", "typeParameters", "supertype"], aliases: ["FlowDeclaration", "Statement", "Declaration"], fields: { id: (0, _utils.validateType)("Identifier"), typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), supertype: (0, _utils.validateOptionalType)("FlowType"), impltype: (0, _utils.validateOptionalType)("FlowType") } }); defineType("DeclareVariable", { visitor: ["id"], aliases: ["FlowDeclaration", "Statement", "Declaration"], fields: { id: (0, _utils.validateType)("Identifier") } }); defineType("DeclareExportDeclaration", { visitor: ["declaration", "specifiers", "source", "attributes"], aliases: ["FlowDeclaration", "Statement", "Declaration"], fields: Object.assign({ declaration: (0, _utils.validateOptionalType)("Flow"), specifiers: (0, _utils.validateOptional)((0, _utils.arrayOfType)("ExportSpecifier", "ExportNamespaceSpecifier")), source: (0, _utils.validateOptionalType)("StringLiteral"), default: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) }, _core.importAttributes) }); defineType("DeclareExportAllDeclaration", { visitor: ["source", "attributes"], aliases: ["FlowDeclaration", "Statement", "Declaration"], fields: Object.assign({ source: (0, _utils.validateType)("StringLiteral"), exportKind: (0, _utils.validateOptional)((0, _utils.assertOneOf)("type", "value")) }, _core.importAttributes) }); defineType("DeclaredPredicate", { visitor: ["value"], aliases: ["FlowPredicate"], fields: { value: (0, _utils.validateType)("Flow") } }); defineType("ExistsTypeAnnotation", { aliases: ["FlowType"] }); defineType("FunctionTypeAnnotation", { builder: ["typeParameters", "params", "rest", "returnType"], visitor: ["typeParameters", "this", "params", "rest", "returnType"], aliases: ["FlowType"], fields: { typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), params: (0, _utils.validateArrayOfType)("FunctionTypeParam"), rest: (0, _utils.validateOptionalType)("FunctionTypeParam"), this: (0, _utils.validateOptionalType)("FunctionTypeParam"), returnType: (0, _utils.validateType)("FlowType") } }); defineType("FunctionTypeParam", { visitor: ["name", "typeAnnotation"], fields: { name: (0, _utils.validateOptionalType)("Identifier"), typeAnnotation: (0, _utils.validateType)("FlowType"), optional: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) } }); defineType("GenericTypeAnnotation", { visitor: ["id", "typeParameters"], aliases: ["FlowType"], fields: { id: (0, _utils.validateType)("Identifier", "QualifiedTypeIdentifier"), typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") } }); defineType("InferredPredicate", { aliases: ["FlowPredicate"] }); defineType("InterfaceExtends", { visitor: ["id", "typeParameters"], fields: { id: (0, _utils.validateType)("Identifier", "QualifiedTypeIdentifier"), typeParameters: (0, _utils.validateOptionalType)("TypeParameterInstantiation") } }); defineInterfaceishType("InterfaceDeclaration"); defineType("InterfaceTypeAnnotation", { visitor: ["extends", "body"], aliases: ["FlowType"], fields: { extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("InterfaceExtends")), body: (0, _utils.validateType)("ObjectTypeAnnotation") } }); defineType("IntersectionTypeAnnotation", { visitor: ["types"], aliases: ["FlowType"], fields: { types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) } }); defineType("MixedTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }); defineType("EmptyTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }); defineType("NullableTypeAnnotation", { visitor: ["typeAnnotation"], aliases: ["FlowType"], fields: { typeAnnotation: (0, _utils.validateType)("FlowType") } }); defineType("NumberLiteralTypeAnnotation", { builder: ["value"], aliases: ["FlowType"], fields: { value: (0, _utils.validate)((0, _utils.assertValueType)("number")) } }); defineType("NumberTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }); defineType("ObjectTypeAnnotation", { visitor: ["properties", "indexers", "callProperties", "internalSlots"], aliases: ["FlowType"], builder: ["properties", "indexers", "callProperties", "internalSlots", "exact"], fields: { properties: (0, _utils.validate)((0, _utils.arrayOfType)("ObjectTypeProperty", "ObjectTypeSpreadProperty")), indexers: { validate: (0, _utils.arrayOfType)("ObjectTypeIndexer"), optional: true, default: [] }, callProperties: { validate: (0, _utils.arrayOfType)("ObjectTypeCallProperty"), optional: true, default: [] }, internalSlots: { validate: (0, _utils.arrayOfType)("ObjectTypeInternalSlot"), optional: true, default: [] }, exact: { validate: (0, _utils.assertValueType)("boolean"), default: false }, inexact: (0, _utils.validateOptional)((0, _utils.assertValueType)("boolean")) } }); defineType("ObjectTypeInternalSlot", { visitor: ["id", "value"], builder: ["id", "value", "optional", "static", "method"], aliases: ["UserWhitespacable"], fields: { id: (0, _utils.validateType)("Identifier"), value: (0, _utils.validateType)("FlowType"), optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), method: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) } }); defineType("ObjectTypeCallProperty", { visitor: ["value"], aliases: ["UserWhitespacable"], fields: { value: (0, _utils.validateType)("FlowType"), static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) } }); defineType("ObjectTypeIndexer", { visitor: ["variance", "id", "key", "value"], builder: ["id", "key", "value", "variance"], aliases: ["UserWhitespacable"], fields: { id: (0, _utils.validateOptionalType)("Identifier"), key: (0, _utils.validateType)("FlowType"), value: (0, _utils.validateType)("FlowType"), static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), variance: (0, _utils.validateOptionalType)("Variance") } }); defineType("ObjectTypeProperty", { visitor: ["key", "value", "variance"], aliases: ["UserWhitespacable"], fields: { key: (0, _utils.validateType)("Identifier", "StringLiteral"), value: (0, _utils.validateType)("FlowType"), kind: (0, _utils.validate)((0, _utils.assertOneOf)("init", "get", "set")), static: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), proto: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), variance: (0, _utils.validateOptionalType)("Variance"), method: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) } }); defineType("ObjectTypeSpreadProperty", { visitor: ["argument"], aliases: ["UserWhitespacable"], fields: { argument: (0, _utils.validateType)("FlowType") } }); defineType("OpaqueType", { visitor: ["id", "typeParameters", "supertype", "impltype"], aliases: ["FlowDeclaration", "Statement", "Declaration"], fields: { id: (0, _utils.validateType)("Identifier"), typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), supertype: (0, _utils.validateOptionalType)("FlowType"), impltype: (0, _utils.validateType)("FlowType") } }); defineType("QualifiedTypeIdentifier", { visitor: ["qualification", "id"], builder: ["id", "qualification"], fields: { id: (0, _utils.validateType)("Identifier"), qualification: (0, _utils.validateType)("Identifier", "QualifiedTypeIdentifier") } }); defineType("StringLiteralTypeAnnotation", { builder: ["value"], aliases: ["FlowType"], fields: { value: (0, _utils.validate)((0, _utils.assertValueType)("string")) } }); defineType("StringTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }); defineType("SymbolTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }); defineType("ThisTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }); defineType("TupleTypeAnnotation", { visitor: ["types"], aliases: ["FlowType"], fields: { types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) } }); defineType("TypeofTypeAnnotation", { visitor: ["argument"], aliases: ["FlowType"], fields: { argument: (0, _utils.validateType)("FlowType") } }); defineType("TypeAlias", { visitor: ["id", "typeParameters", "right"], aliases: ["FlowDeclaration", "Statement", "Declaration"], fields: { id: (0, _utils.validateType)("Identifier"), typeParameters: (0, _utils.validateOptionalType)("TypeParameterDeclaration"), right: (0, _utils.validateType)("FlowType") } }); defineType("TypeAnnotation", { visitor: ["typeAnnotation"], fields: { typeAnnotation: (0, _utils.validateType)("FlowType") } }); defineType("TypeCastExpression", { visitor: ["expression", "typeAnnotation"], aliases: ["ExpressionWrapper", "Expression"], fields: { expression: (0, _utils.validateType)("Expression"), typeAnnotation: (0, _utils.validateType)("TypeAnnotation") } }); defineType("TypeParameter", { visitor: ["bound", "default", "variance"], fields: { name: (0, _utils.validate)((0, _utils.assertValueType)("string")), bound: (0, _utils.validateOptionalType)("TypeAnnotation"), default: (0, _utils.validateOptionalType)("FlowType"), variance: (0, _utils.validateOptionalType)("Variance") } }); defineType("TypeParameterDeclaration", { visitor: ["params"], fields: { params: (0, _utils.validate)((0, _utils.arrayOfType)("TypeParameter")) } }); defineType("TypeParameterInstantiation", { visitor: ["params"], fields: { params: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) } }); defineType("UnionTypeAnnotation", { visitor: ["types"], aliases: ["FlowType"], fields: { types: (0, _utils.validate)((0, _utils.arrayOfType)("FlowType")) } }); defineType("Variance", { builder: ["kind"], fields: { kind: (0, _utils.validate)((0, _utils.assertOneOf)("minus", "plus")) } }); defineType("VoidTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] }); defineType("EnumDeclaration", { aliases: ["Statement", "Declaration"], visitor: ["id", "body"], fields: { id: (0, _utils.validateType)("Identifier"), body: (0, _utils.validateType)("EnumBooleanBody", "EnumNumberBody", "EnumStringBody", "EnumSymbolBody") } }); defineType("EnumBooleanBody", { aliases: ["EnumBody"], visitor: ["members"], fields: { explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), members: (0, _utils.validateArrayOfType)("EnumBooleanMember"), hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) } }); defineType("EnumNumberBody", { aliases: ["EnumBody"], visitor: ["members"], fields: { explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), members: (0, _utils.validateArrayOfType)("EnumNumberMember"), hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) } }); defineType("EnumStringBody", { aliases: ["EnumBody"], visitor: ["members"], fields: { explicitType: (0, _utils.validate)((0, _utils.assertValueType)("boolean")), members: (0, _utils.validateArrayOfType)("EnumStringMember", "EnumDefaultedMember"), hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) } }); defineType("EnumSymbolBody", { aliases: ["EnumBody"], visitor: ["members"], fields: { members: (0, _utils.validateArrayOfType)("EnumDefaultedMember"), hasUnknownMembers: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) } }); defineType("EnumBooleanMember", { aliases: ["EnumMember"], builder: ["id"], visitor: ["id", "init"], fields: { id: (0, _utils.validateType)("Identifier"), init: (0, _utils.validateType)("BooleanLiteral") } }); defineType("EnumNumberMember", { aliases: ["EnumMember"], visitor: ["id", "init"], fields: { id: (0, _utils.validateType)("Identifier"), init: (0, _utils.validateType)("NumericLiteral") } }); defineType("EnumStringMember", { aliases: ["EnumMember"], visitor: ["id", "init"], fields: { id: (0, _utils.validateType)("Identifier"), init: (0, _utils.validateType)("StringLiteral") } }); defineType("EnumDefaultedMember", { aliases: ["EnumMember"], visitor: ["id"], fields: { id: (0, _utils.validateType)("Identifier") } }); defineType("IndexedAccessType", { visitor: ["objectType", "indexType"], aliases: ["FlowType"], fields: { objectType: (0, _utils.validateType)("FlowType"), indexType: (0, _utils.validateType)("FlowType") } }); defineType("OptionalIndexedAccessType", { visitor: ["objectType", "indexType"], aliases: ["FlowType"], fields: { objectType: (0, _utils.validateType)("FlowType"), indexType: (0, _utils.validateType)("FlowType"), optional: (0, _utils.validate)((0, _utils.assertValueType)("boolean")) } }); //# sourceMappingURL=flow.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/definitions/index.js": /*!************************************************************!*\ !*** ./node_modules/@babel/types/lib/definitions/index.js ***! \************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "ALIAS_KEYS", ({ enumerable: true, get: function () { return _utils.ALIAS_KEYS; } })); Object.defineProperty(exports, "BUILDER_KEYS", ({ enumerable: true, get: function () { return _utils.BUILDER_KEYS; } })); Object.defineProperty(exports, "DEPRECATED_ALIASES", ({ enumerable: true, get: function () { return _deprecatedAliases.DEPRECATED_ALIASES; } })); Object.defineProperty(exports, "DEPRECATED_KEYS", ({ enumerable: true, get: function () { return _utils.DEPRECATED_KEYS; } })); Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", ({ enumerable: true, get: function () { return _utils.FLIPPED_ALIAS_KEYS; } })); Object.defineProperty(exports, "NODE_FIELDS", ({ enumerable: true, get: function () { return _utils.NODE_FIELDS; } })); Object.defineProperty(exports, "NODE_PARENT_VALIDATIONS", ({ enumerable: true, get: function () { return _utils.NODE_PARENT_VALIDATIONS; } })); Object.defineProperty(exports, "PLACEHOLDERS", ({ enumerable: true, get: function () { return _placeholders.PLACEHOLDERS; } })); Object.defineProperty(exports, "PLACEHOLDERS_ALIAS", ({ enumerable: true, get: function () { return _placeholders.PLACEHOLDERS_ALIAS; } })); Object.defineProperty(exports, "PLACEHOLDERS_FLIPPED_ALIAS", ({ enumerable: true, get: function () { return _placeholders.PLACEHOLDERS_FLIPPED_ALIAS; } })); exports.TYPES = void 0; Object.defineProperty(exports, "VISITOR_KEYS", ({ enumerable: true, get: function () { return _utils.VISITOR_KEYS; } })); __webpack_require__(/*! ./core.js */ "./node_modules/@babel/types/lib/definitions/core.js"); __webpack_require__(/*! ./flow.js */ "./node_modules/@babel/types/lib/definitions/flow.js"); __webpack_require__(/*! ./jsx.js */ "./node_modules/@babel/types/lib/definitions/jsx.js"); __webpack_require__(/*! ./misc.js */ "./node_modules/@babel/types/lib/definitions/misc.js"); __webpack_require__(/*! ./experimental.js */ "./node_modules/@babel/types/lib/definitions/experimental.js"); __webpack_require__(/*! ./typescript.js */ "./node_modules/@babel/types/lib/definitions/typescript.js"); var _utils = __webpack_require__(/*! ./utils.js */ "./node_modules/@babel/types/lib/definitions/utils.js"); var _placeholders = __webpack_require__(/*! ./placeholders.js */ "./node_modules/@babel/types/lib/definitions/placeholders.js"); var _deprecatedAliases = __webpack_require__(/*! ./deprecated-aliases.js */ "./node_modules/@babel/types/lib/definitions/deprecated-aliases.js"); Object.keys(_deprecatedAliases.DEPRECATED_ALIASES).forEach(deprecatedAlias => { _utils.FLIPPED_ALIAS_KEYS[deprecatedAlias] = _utils.FLIPPED_ALIAS_KEYS[_deprecatedAliases.DEPRECATED_ALIASES[deprecatedAlias]]; }); for (const { types, set } of _utils.allExpandedTypes) { for (const type of types) { const aliases = _utils.FLIPPED_ALIAS_KEYS[type]; if (aliases) { aliases.forEach(set.add, set); } else { set.add(type); } } } const TYPES = exports.TYPES = [].concat(Object.keys(_utils.VISITOR_KEYS), Object.keys(_utils.FLIPPED_ALIAS_KEYS), Object.keys(_utils.DEPRECATED_KEYS)); //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/definitions/jsx.js": /*!**********************************************************!*\ !*** ./node_modules/@babel/types/lib/definitions/jsx.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var _utils = __webpack_require__(/*! ./utils.js */ "./node_modules/@babel/types/lib/definitions/utils.js"); const defineType = (0, _utils.defineAliasedType)("JSX"); defineType("JSXAttribute", { visitor: ["name", "value"], aliases: ["Immutable"], fields: { name: { validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXNamespacedName") }, value: { optional: true, validate: (0, _utils.assertNodeType)("JSXElement", "JSXFragment", "StringLiteral", "JSXExpressionContainer") } } }); defineType("JSXClosingElement", { visitor: ["name"], aliases: ["Immutable"], fields: { name: { validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName") } } }); defineType("JSXElement", { builder: ["openingElement", "closingElement", "children", "selfClosing"], visitor: ["openingElement", "children", "closingElement"], aliases: ["Immutable", "Expression"], fields: Object.assign({ openingElement: { validate: (0, _utils.assertNodeType)("JSXOpeningElement") }, closingElement: { optional: true, validate: (0, _utils.assertNodeType)("JSXClosingElement") }, children: (0, _utils.validateArrayOfType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment") }, { selfClosing: { validate: (0, _utils.assertValueType)("boolean"), optional: true } }) }); defineType("JSXEmptyExpression", {}); defineType("JSXExpressionContainer", { visitor: ["expression"], aliases: ["Immutable"], fields: { expression: { validate: (0, _utils.assertNodeType)("Expression", "JSXEmptyExpression") } } }); defineType("JSXSpreadChild", { visitor: ["expression"], aliases: ["Immutable"], fields: { expression: { validate: (0, _utils.assertNodeType)("Expression") } } }); defineType("JSXIdentifier", { builder: ["name"], fields: { name: { validate: (0, _utils.assertValueType)("string") } } }); defineType("JSXMemberExpression", { visitor: ["object", "property"], fields: { object: { validate: (0, _utils.assertNodeType)("JSXMemberExpression", "JSXIdentifier") }, property: { validate: (0, _utils.assertNodeType)("JSXIdentifier") } } }); defineType("JSXNamespacedName", { visitor: ["namespace", "name"], fields: { namespace: { validate: (0, _utils.assertNodeType)("JSXIdentifier") }, name: { validate: (0, _utils.assertNodeType)("JSXIdentifier") } } }); defineType("JSXOpeningElement", { builder: ["name", "attributes", "selfClosing"], visitor: ["name", "typeParameters", "typeArguments", "attributes"], aliases: ["Immutable"], fields: Object.assign({ name: { validate: (0, _utils.assertNodeType)("JSXIdentifier", "JSXMemberExpression", "JSXNamespacedName") }, selfClosing: { default: false }, attributes: (0, _utils.validateArrayOfType)("JSXAttribute", "JSXSpreadAttribute"), typeArguments: { validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"), optional: true } }, { typeParameters: { validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"), optional: true } }) }); defineType("JSXSpreadAttribute", { visitor: ["argument"], fields: { argument: { validate: (0, _utils.assertNodeType)("Expression") } } }); defineType("JSXText", { aliases: ["Immutable"], builder: ["value"], fields: { value: { validate: (0, _utils.assertValueType)("string") } } }); defineType("JSXFragment", { builder: ["openingFragment", "closingFragment", "children"], visitor: ["openingFragment", "children", "closingFragment"], aliases: ["Immutable", "Expression"], fields: { openingFragment: { validate: (0, _utils.assertNodeType)("JSXOpeningFragment") }, closingFragment: { validate: (0, _utils.assertNodeType)("JSXClosingFragment") }, children: (0, _utils.validateArrayOfType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement", "JSXFragment") } }); defineType("JSXOpeningFragment", { aliases: ["Immutable"] }); defineType("JSXClosingFragment", { aliases: ["Immutable"] }); //# sourceMappingURL=jsx.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/definitions/misc.js": /*!***********************************************************!*\ !*** ./node_modules/@babel/types/lib/definitions/misc.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var _utils = __webpack_require__(/*! ./utils.js */ "./node_modules/@babel/types/lib/definitions/utils.js"); var _placeholders = __webpack_require__(/*! ./placeholders.js */ "./node_modules/@babel/types/lib/definitions/placeholders.js"); var _core = __webpack_require__(/*! ./core.js */ "./node_modules/@babel/types/lib/definitions/core.js"); const defineType = (0, _utils.defineAliasedType)("Miscellaneous"); { defineType("Noop", { visitor: [] }); } defineType("Placeholder", { visitor: [], builder: ["expectedNode", "name"], fields: Object.assign({ name: { validate: (0, _utils.assertNodeType)("Identifier") }, expectedNode: { validate: (0, _utils.assertOneOf)(..._placeholders.PLACEHOLDERS) } }, (0, _core.patternLikeCommon)()) }); defineType("V8IntrinsicIdentifier", { builder: ["name"], fields: { name: { validate: (0, _utils.assertValueType)("string") } } }); //# sourceMappingURL=misc.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/definitions/placeholders.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/types/lib/definitions/placeholders.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PLACEHOLDERS_FLIPPED_ALIAS = exports.PLACEHOLDERS_ALIAS = exports.PLACEHOLDERS = void 0; var _utils = __webpack_require__(/*! ./utils.js */ "./node_modules/@babel/types/lib/definitions/utils.js"); const PLACEHOLDERS = exports.PLACEHOLDERS = ["Identifier", "StringLiteral", "Expression", "Statement", "Declaration", "BlockStatement", "ClassBody", "Pattern"]; const PLACEHOLDERS_ALIAS = exports.PLACEHOLDERS_ALIAS = { Declaration: ["Statement"], Pattern: ["PatternLike", "LVal"] }; for (const type of PLACEHOLDERS) { const alias = _utils.ALIAS_KEYS[type]; if (alias != null && alias.length) PLACEHOLDERS_ALIAS[type] = alias; } const PLACEHOLDERS_FLIPPED_ALIAS = exports.PLACEHOLDERS_FLIPPED_ALIAS = {}; Object.keys(PLACEHOLDERS_ALIAS).forEach(type => { PLACEHOLDERS_ALIAS[type].forEach(alias => { if (!hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) { PLACEHOLDERS_FLIPPED_ALIAS[alias] = []; } PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type); }); }); //# sourceMappingURL=placeholders.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/definitions/typescript.js": /*!*****************************************************************!*\ !*** ./node_modules/@babel/types/lib/definitions/typescript.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var _utils = __webpack_require__(/*! ./utils.js */ "./node_modules/@babel/types/lib/definitions/utils.js"); var _core = __webpack_require__(/*! ./core.js */ "./node_modules/@babel/types/lib/definitions/core.js"); var _is = __webpack_require__(/*! ../validators/is.js */ "./node_modules/@babel/types/lib/validators/is.js"); const defineType = (0, _utils.defineAliasedType)("TypeScript"); const bool = (0, _utils.assertValueType)("boolean"); const tSFunctionTypeAnnotationCommon = () => ({ returnType: { validate: (0, _utils.assertNodeType)("TSTypeAnnotation", "Noop"), optional: true }, typeParameters: { validate: (0, _utils.assertNodeType)("TSTypeParameterDeclaration", "Noop"), optional: true } }); defineType("TSParameterProperty", { aliases: ["LVal"], visitor: ["parameter"], fields: { accessibility: { validate: (0, _utils.assertOneOf)("public", "private", "protected"), optional: true }, readonly: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, parameter: { validate: (0, _utils.assertNodeType)("Identifier", "AssignmentPattern") }, override: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, decorators: { validate: (0, _utils.arrayOfType)("Decorator"), optional: true } } }); defineType("TSDeclareFunction", { aliases: ["Statement", "Declaration"], visitor: ["id", "typeParameters", "params", "returnType"], fields: Object.assign({}, (0, _core.functionDeclarationCommon)(), tSFunctionTypeAnnotationCommon()) }); defineType("TSDeclareMethod", { visitor: ["decorators", "key", "typeParameters", "params", "returnType"], fields: Object.assign({}, (0, _core.classMethodOrDeclareMethodCommon)(), tSFunctionTypeAnnotationCommon()) }); defineType("TSQualifiedName", { aliases: ["TSEntityName"], visitor: ["left", "right"], fields: { left: (0, _utils.validateType)("TSEntityName"), right: (0, _utils.validateType)("Identifier") } }); const signatureDeclarationCommon = () => ({ typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"), ["parameters"]: (0, _utils.validateArrayOfType)("ArrayPattern", "Identifier", "ObjectPattern", "RestElement"), ["typeAnnotation"]: (0, _utils.validateOptionalType)("TSTypeAnnotation") }); const callConstructSignatureDeclaration = { aliases: ["TSTypeElement"], visitor: ["typeParameters", "parameters", "typeAnnotation"], fields: signatureDeclarationCommon() }; defineType("TSCallSignatureDeclaration", callConstructSignatureDeclaration); defineType("TSConstructSignatureDeclaration", callConstructSignatureDeclaration); const namedTypeElementCommon = () => ({ key: (0, _utils.validateType)("Expression"), computed: { default: false }, optional: (0, _utils.validateOptional)(bool) }); defineType("TSPropertySignature", { aliases: ["TSTypeElement"], visitor: ["key", "typeAnnotation"], fields: Object.assign({}, namedTypeElementCommon(), { readonly: (0, _utils.validateOptional)(bool), typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"), kind: { optional: true, validate: (0, _utils.assertOneOf)("get", "set") } }) }); defineType("TSMethodSignature", { aliases: ["TSTypeElement"], visitor: ["key", "typeParameters", "parameters", "typeAnnotation"], fields: Object.assign({}, signatureDeclarationCommon(), namedTypeElementCommon(), { kind: { validate: (0, _utils.assertOneOf)("method", "get", "set") } }) }); defineType("TSIndexSignature", { aliases: ["TSTypeElement"], visitor: ["parameters", "typeAnnotation"], fields: { readonly: (0, _utils.validateOptional)(bool), static: (0, _utils.validateOptional)(bool), parameters: (0, _utils.validateArrayOfType)("Identifier"), typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation") } }); const tsKeywordTypes = ["TSAnyKeyword", "TSBooleanKeyword", "TSBigIntKeyword", "TSIntrinsicKeyword", "TSNeverKeyword", "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", "TSStringKeyword", "TSSymbolKeyword", "TSUndefinedKeyword", "TSUnknownKeyword", "TSVoidKeyword"]; for (const type of tsKeywordTypes) { defineType(type, { aliases: ["TSType", "TSBaseType"], visitor: [], fields: {} }); } defineType("TSThisType", { aliases: ["TSType", "TSBaseType"], visitor: [], fields: {} }); const fnOrCtrBase = { aliases: ["TSType"], visitor: ["typeParameters", "parameters", "typeAnnotation"] }; defineType("TSFunctionType", Object.assign({}, fnOrCtrBase, { fields: signatureDeclarationCommon() })); defineType("TSConstructorType", Object.assign({}, fnOrCtrBase, { fields: Object.assign({}, signatureDeclarationCommon(), { abstract: (0, _utils.validateOptional)(bool) }) })); defineType("TSTypeReference", { aliases: ["TSType"], visitor: ["typeName", "typeParameters"], fields: { typeName: (0, _utils.validateType)("TSEntityName"), ["typeParameters"]: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation") } }); defineType("TSTypePredicate", { aliases: ["TSType"], visitor: ["parameterName", "typeAnnotation"], builder: ["parameterName", "typeAnnotation", "asserts"], fields: { parameterName: (0, _utils.validateType)("Identifier", "TSThisType"), typeAnnotation: (0, _utils.validateOptionalType)("TSTypeAnnotation"), asserts: (0, _utils.validateOptional)(bool) } }); defineType("TSTypeQuery", { aliases: ["TSType"], visitor: ["exprName", "typeParameters"], fields: { exprName: (0, _utils.validateType)("TSEntityName", "TSImportType"), ["typeParameters"]: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation") } }); defineType("TSTypeLiteral", { aliases: ["TSType"], visitor: ["members"], fields: { members: (0, _utils.validateArrayOfType)("TSTypeElement") } }); defineType("TSArrayType", { aliases: ["TSType"], visitor: ["elementType"], fields: { elementType: (0, _utils.validateType)("TSType") } }); defineType("TSTupleType", { aliases: ["TSType"], visitor: ["elementTypes"], fields: { elementTypes: (0, _utils.validateArrayOfType)("TSType", "TSNamedTupleMember") } }); defineType("TSOptionalType", { aliases: ["TSType"], visitor: ["typeAnnotation"], fields: { typeAnnotation: (0, _utils.validateType)("TSType") } }); defineType("TSRestType", { aliases: ["TSType"], visitor: ["typeAnnotation"], fields: { typeAnnotation: (0, _utils.validateType)("TSType") } }); defineType("TSNamedTupleMember", { visitor: ["label", "elementType"], builder: ["label", "elementType", "optional"], fields: { label: (0, _utils.validateType)("Identifier"), optional: { validate: bool, default: false }, elementType: (0, _utils.validateType)("TSType") } }); const unionOrIntersection = { aliases: ["TSType"], visitor: ["types"], fields: { types: (0, _utils.validateArrayOfType)("TSType") } }; defineType("TSUnionType", unionOrIntersection); defineType("TSIntersectionType", unionOrIntersection); defineType("TSConditionalType", { aliases: ["TSType"], visitor: ["checkType", "extendsType", "trueType", "falseType"], fields: { checkType: (0, _utils.validateType)("TSType"), extendsType: (0, _utils.validateType)("TSType"), trueType: (0, _utils.validateType)("TSType"), falseType: (0, _utils.validateType)("TSType") } }); defineType("TSInferType", { aliases: ["TSType"], visitor: ["typeParameter"], fields: { typeParameter: (0, _utils.validateType)("TSTypeParameter") } }); defineType("TSParenthesizedType", { aliases: ["TSType"], visitor: ["typeAnnotation"], fields: { typeAnnotation: (0, _utils.validateType)("TSType") } }); defineType("TSTypeOperator", { aliases: ["TSType"], visitor: ["typeAnnotation"], builder: ["typeAnnotation", "operator"], fields: { operator: { validate: (0, _utils.assertValueType)("string"), default: "keyof" }, typeAnnotation: (0, _utils.validateType)("TSType") } }); defineType("TSIndexedAccessType", { aliases: ["TSType"], visitor: ["objectType", "indexType"], fields: { objectType: (0, _utils.validateType)("TSType"), indexType: (0, _utils.validateType)("TSType") } }); defineType("TSMappedType", { aliases: ["TSType"], visitor: ["typeParameter", "nameType", "typeAnnotation"], builder: ["typeParameter", "typeAnnotation", "nameType"], fields: Object.assign({}, { typeParameter: (0, _utils.validateType)("TSTypeParameter") }, { readonly: (0, _utils.validateOptional)((0, _utils.assertOneOf)(true, false, "+", "-")), optional: (0, _utils.validateOptional)((0, _utils.assertOneOf)(true, false, "+", "-")), typeAnnotation: (0, _utils.validateOptionalType)("TSType"), nameType: (0, _utils.validateOptionalType)("TSType") }) }); defineType("TSTemplateLiteralType", { aliases: ["TSType", "TSBaseType"], visitor: ["quasis", "types"], fields: { quasis: (0, _utils.validateArrayOfType)("TemplateElement"), types: { validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSType")), function (node, key, val) { if (node.quasis.length !== val.length + 1) { throw new TypeError(`Number of ${node.type} quasis should be exactly one more than the number of types.\nExpected ${val.length + 1} quasis but got ${node.quasis.length}`); } }) } } }); defineType("TSLiteralType", { aliases: ["TSType", "TSBaseType"], visitor: ["literal"], fields: { literal: { validate: function () { const unaryExpression = (0, _utils.assertNodeType)("NumericLiteral", "BigIntLiteral"); const unaryOperator = (0, _utils.assertOneOf)("-"); const literal = (0, _utils.assertNodeType)("NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral", "TemplateLiteral"); function validator(parent, key, node) { if ((0, _is.default)("UnaryExpression", node)) { unaryOperator(node, "operator", node.operator); unaryExpression(node, "argument", node.argument); } else { literal(parent, key, node); } } validator.oneOfNodeTypes = ["NumericLiteral", "StringLiteral", "BooleanLiteral", "BigIntLiteral", "TemplateLiteral", "UnaryExpression"]; return validator; }() } } }); { defineType("TSExpressionWithTypeArguments", { aliases: ["TSType"], visitor: ["expression", "typeParameters"], fields: { expression: (0, _utils.validateType)("TSEntityName"), typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation") } }); } defineType("TSInterfaceDeclaration", { aliases: ["Statement", "Declaration"], visitor: ["id", "typeParameters", "extends", "body"], fields: { declare: (0, _utils.validateOptional)(bool), id: (0, _utils.validateType)("Identifier"), typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"), extends: (0, _utils.validateOptional)((0, _utils.arrayOfType)("TSExpressionWithTypeArguments")), body: (0, _utils.validateType)("TSInterfaceBody") } }); defineType("TSInterfaceBody", { visitor: ["body"], fields: { body: (0, _utils.validateArrayOfType)("TSTypeElement") } }); defineType("TSTypeAliasDeclaration", { aliases: ["Statement", "Declaration"], visitor: ["id", "typeParameters", "typeAnnotation"], fields: { declare: (0, _utils.validateOptional)(bool), id: (0, _utils.validateType)("Identifier"), typeParameters: (0, _utils.validateOptionalType)("TSTypeParameterDeclaration"), typeAnnotation: (0, _utils.validateType)("TSType") } }); defineType("TSInstantiationExpression", { aliases: ["Expression"], visitor: ["expression", "typeParameters"], fields: { expression: (0, _utils.validateType)("Expression"), ["typeParameters"]: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation") } }); const TSTypeExpression = { aliases: ["Expression", "LVal", "PatternLike"], visitor: ["expression", "typeAnnotation"], fields: { expression: (0, _utils.validateType)("Expression"), typeAnnotation: (0, _utils.validateType)("TSType") } }; defineType("TSAsExpression", TSTypeExpression); defineType("TSSatisfiesExpression", TSTypeExpression); defineType("TSTypeAssertion", { aliases: ["Expression", "LVal", "PatternLike"], visitor: ["typeAnnotation", "expression"], fields: { typeAnnotation: (0, _utils.validateType)("TSType"), expression: (0, _utils.validateType)("Expression") } }); defineType("TSEnumBody", { visitor: ["members"], fields: { members: (0, _utils.validateArrayOfType)("TSEnumMember") } }); { defineType("TSEnumDeclaration", { aliases: ["Statement", "Declaration"], visitor: ["id", "members"], fields: { declare: (0, _utils.validateOptional)(bool), const: (0, _utils.validateOptional)(bool), id: (0, _utils.validateType)("Identifier"), members: (0, _utils.validateArrayOfType)("TSEnumMember"), initializer: (0, _utils.validateOptionalType)("Expression"), body: (0, _utils.validateOptionalType)("TSEnumBody") } }); } defineType("TSEnumMember", { visitor: ["id", "initializer"], fields: { id: (0, _utils.validateType)("Identifier", "StringLiteral"), initializer: (0, _utils.validateOptionalType)("Expression") } }); defineType("TSModuleDeclaration", { aliases: ["Statement", "Declaration"], visitor: ["id", "body"], fields: Object.assign({ kind: { validate: (0, _utils.assertOneOf)("global", "module", "namespace") }, declare: (0, _utils.validateOptional)(bool) }, { global: (0, _utils.validateOptional)(bool) }, { id: (0, _utils.validateType)("Identifier", "StringLiteral"), body: (0, _utils.validateType)("TSModuleBlock", "TSModuleDeclaration") }) }); defineType("TSModuleBlock", { aliases: ["Scopable", "Block", "BlockParent", "FunctionParent"], visitor: ["body"], fields: { body: (0, _utils.validateArrayOfType)("Statement") } }); defineType("TSImportType", { aliases: ["TSType"], builder: ["argument", "qualifier", "typeParameters"], visitor: ["argument", "options", "qualifier", "typeParameters"], fields: { argument: (0, _utils.validateType)("StringLiteral"), qualifier: (0, _utils.validateOptionalType)("TSEntityName"), ["typeParameters"]: (0, _utils.validateOptionalType)("TSTypeParameterInstantiation"), options: { validate: (0, _utils.assertNodeType)("ObjectExpression"), optional: true } } }); defineType("TSImportEqualsDeclaration", { aliases: ["Statement", "Declaration"], visitor: ["id", "moduleReference"], fields: Object.assign({}, { isExport: (0, _utils.validate)(bool) }, { id: (0, _utils.validateType)("Identifier"), moduleReference: (0, _utils.validateType)("TSEntityName", "TSExternalModuleReference"), importKind: { validate: (0, _utils.assertOneOf)("type", "value"), optional: true } }) }); defineType("TSExternalModuleReference", { visitor: ["expression"], fields: { expression: (0, _utils.validateType)("StringLiteral") } }); defineType("TSNonNullExpression", { aliases: ["Expression", "LVal", "PatternLike"], visitor: ["expression"], fields: { expression: (0, _utils.validateType)("Expression") } }); defineType("TSExportAssignment", { aliases: ["Statement"], visitor: ["expression"], fields: { expression: (0, _utils.validateType)("Expression") } }); defineType("TSNamespaceExportDeclaration", { aliases: ["Statement"], visitor: ["id"], fields: { id: (0, _utils.validateType)("Identifier") } }); defineType("TSTypeAnnotation", { visitor: ["typeAnnotation"], fields: { typeAnnotation: { validate: (0, _utils.assertNodeType)("TSType") } } }); defineType("TSTypeParameterInstantiation", { visitor: ["params"], fields: { params: (0, _utils.validateArrayOfType)("TSType") } }); defineType("TSTypeParameterDeclaration", { visitor: ["params"], fields: { params: (0, _utils.validateArrayOfType)("TSTypeParameter") } }); defineType("TSTypeParameter", { builder: ["constraint", "default", "name"], visitor: ["constraint", "default"], fields: { name: { validate: (0, _utils.assertValueType)("string") }, in: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, out: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, const: { validate: (0, _utils.assertValueType)("boolean"), optional: true }, constraint: { validate: (0, _utils.assertNodeType)("TSType"), optional: true }, default: { validate: (0, _utils.assertNodeType)("TSType"), optional: true } } }); //# sourceMappingURL=typescript.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/definitions/utils.js": /*!************************************************************!*\ !*** ./node_modules/@babel/types/lib/definitions/utils.js ***! \************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.allExpandedTypes = exports.VISITOR_KEYS = exports.NODE_PARENT_VALIDATIONS = exports.NODE_FIELDS = exports.FLIPPED_ALIAS_KEYS = exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.ALIAS_KEYS = void 0; exports.arrayOf = arrayOf; exports.arrayOfType = arrayOfType; exports.assertEach = assertEach; exports.assertNodeOrValueType = assertNodeOrValueType; exports.assertNodeType = assertNodeType; exports.assertOneOf = assertOneOf; exports.assertOptionalChainStart = assertOptionalChainStart; exports.assertShape = assertShape; exports.assertValueType = assertValueType; exports.chain = chain; exports["default"] = defineType; exports.defineAliasedType = defineAliasedType; exports.validate = validate; exports.validateArrayOfType = validateArrayOfType; exports.validateOptional = validateOptional; exports.validateOptionalType = validateOptionalType; exports.validateType = validateType; var _is = __webpack_require__(/*! ../validators/is.js */ "./node_modules/@babel/types/lib/validators/is.js"); var _validate = __webpack_require__(/*! ../validators/validate.js */ "./node_modules/@babel/types/lib/validators/validate.js"); const VISITOR_KEYS = exports.VISITOR_KEYS = {}; const ALIAS_KEYS = exports.ALIAS_KEYS = {}; const FLIPPED_ALIAS_KEYS = exports.FLIPPED_ALIAS_KEYS = {}; const NODE_FIELDS = exports.NODE_FIELDS = {}; const BUILDER_KEYS = exports.BUILDER_KEYS = {}; const DEPRECATED_KEYS = exports.DEPRECATED_KEYS = {}; const NODE_PARENT_VALIDATIONS = exports.NODE_PARENT_VALIDATIONS = {}; function getType(val) { if (Array.isArray(val)) { return "array"; } else if (val === null) { return "null"; } else { return typeof val; } } function validate(validate) { return { validate }; } function validateType(...typeNames) { return validate(assertNodeType(...typeNames)); } function validateOptional(validate) { return { validate, optional: true }; } function validateOptionalType(...typeNames) { return { validate: assertNodeType(...typeNames), optional: true }; } function arrayOf(elementType) { return chain(assertValueType("array"), assertEach(elementType)); } function arrayOfType(...typeNames) { return arrayOf(assertNodeType(...typeNames)); } function validateArrayOfType(...typeNames) { return validate(arrayOfType(...typeNames)); } function assertEach(callback) { const childValidator = process.env.BABEL_TYPES_8_BREAKING ? _validate.validateChild : () => {}; function validator(node, key, val) { if (!Array.isArray(val)) return; let i = 0; const subKey = { toString() { return `${key}[${i}]`; } }; for (; i < val.length; i++) { const v = val[i]; callback(node, subKey, v); childValidator(node, subKey, v); } } validator.each = callback; return validator; } function assertOneOf(...values) { function validate(node, key, val) { if (!values.includes(val)) { throw new TypeError(`Property ${key} expected value to be one of ${JSON.stringify(values)} but got ${JSON.stringify(val)}`); } } validate.oneOf = values; return validate; } const allExpandedTypes = exports.allExpandedTypes = []; function assertNodeType(...types) { const expandedTypes = new Set(); allExpandedTypes.push({ types, set: expandedTypes }); function validate(node, key, val) { const valType = val == null ? void 0 : val.type; if (valType != null) { if (expandedTypes.has(valType)) { (0, _validate.validateChild)(node, key, val); return; } if (valType === "Placeholder") { for (const type of types) { if ((0, _is.default)(type, val)) { (0, _validate.validateChild)(node, key, val); return; } } } } throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(valType)}`); } validate.oneOfNodeTypes = types; return validate; } function assertNodeOrValueType(...types) { function validate(node, key, val) { const primitiveType = getType(val); for (const type of types) { if (primitiveType === type || (0, _is.default)(type, val)) { (0, _validate.validateChild)(node, key, val); return; } } throw new TypeError(`Property ${key} of ${node.type} expected node to be of a type ${JSON.stringify(types)} but instead got ${JSON.stringify(val == null ? void 0 : val.type)}`); } validate.oneOfNodeOrValueTypes = types; return validate; } function assertValueType(type) { function validate(node, key, val) { if (getType(val) === type) { return; } throw new TypeError(`Property ${key} expected type of ${type} but got ${getType(val)}`); } validate.type = type; return validate; } function assertShape(shape) { const keys = Object.keys(shape); function validate(node, key, val) { const errors = []; for (const property of keys) { try { (0, _validate.validateField)(node, property, val[property], shape[property]); } catch (error) { if (error instanceof TypeError) { errors.push(error.message); continue; } throw error; } } if (errors.length) { throw new TypeError(`Property ${key} of ${node.type} expected to have the following:\n${errors.join("\n")}`); } } validate.shapeOf = shape; return validate; } function assertOptionalChainStart() { function validate(node) { var _current; let current = node; while (node) { const { type } = current; if (type === "OptionalCallExpression") { if (current.optional) return; current = current.callee; continue; } if (type === "OptionalMemberExpression") { if (current.optional) return; current = current.object; continue; } break; } throw new TypeError(`Non-optional ${node.type} must chain from an optional OptionalMemberExpression or OptionalCallExpression. Found chain from ${(_current = current) == null ? void 0 : _current.type}`); } return validate; } function chain(...fns) { function validate(...args) { for (const fn of fns) { fn(...args); } } validate.chainOf = fns; if (fns.length >= 2 && "type" in fns[0] && fns[0].type === "array" && !("each" in fns[1])) { throw new Error(`An assertValueType("array") validator can only be followed by an assertEach(...) validator.`); } return validate; } const validTypeOpts = new Set(["aliases", "builder", "deprecatedAlias", "fields", "inherits", "visitor", "validate"]); const validFieldKeys = new Set(["default", "optional", "deprecated", "validate"]); const store = {}; function defineAliasedType(...aliases) { return (type, opts = {}) => { let defined = opts.aliases; if (!defined) { var _store$opts$inherits$; if (opts.inherits) defined = (_store$opts$inherits$ = store[opts.inherits].aliases) == null ? void 0 : _store$opts$inherits$.slice(); defined != null ? defined : defined = []; opts.aliases = defined; } const additional = aliases.filter(a => !defined.includes(a)); defined.unshift(...additional); defineType(type, opts); }; } function defineType(type, opts = {}) { const inherits = opts.inherits && store[opts.inherits] || {}; let fields = opts.fields; if (!fields) { fields = {}; if (inherits.fields) { const keys = Object.getOwnPropertyNames(inherits.fields); for (const key of keys) { const field = inherits.fields[key]; const def = field.default; if (Array.isArray(def) ? def.length > 0 : def && typeof def === "object") { throw new Error("field defaults can only be primitives or empty arrays currently"); } fields[key] = { default: Array.isArray(def) ? [] : def, optional: field.optional, deprecated: field.deprecated, validate: field.validate }; } } } const visitor = opts.visitor || inherits.visitor || []; const aliases = opts.aliases || inherits.aliases || []; const builder = opts.builder || inherits.builder || opts.visitor || []; for (const k of Object.keys(opts)) { if (!validTypeOpts.has(k)) { throw new Error(`Unknown type option "${k}" on ${type}`); } } if (opts.deprecatedAlias) { DEPRECATED_KEYS[opts.deprecatedAlias] = type; } for (const key of visitor.concat(builder)) { fields[key] = fields[key] || {}; } for (const key of Object.keys(fields)) { const field = fields[key]; if (field.default !== undefined && !builder.includes(key)) { field.optional = true; } if (field.default === undefined) { field.default = null; } else if (!field.validate && field.default != null) { field.validate = assertValueType(getType(field.default)); } for (const k of Object.keys(field)) { if (!validFieldKeys.has(k)) { throw new Error(`Unknown field key "${k}" on ${type}.${key}`); } } } VISITOR_KEYS[type] = opts.visitor = visitor; BUILDER_KEYS[type] = opts.builder = builder; NODE_FIELDS[type] = opts.fields = fields; ALIAS_KEYS[type] = opts.aliases = aliases; aliases.forEach(alias => { FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || []; FLIPPED_ALIAS_KEYS[alias].push(type); }); if (opts.validate) { NODE_PARENT_VALIDATIONS[type] = opts.validate; } store[type] = opts; } //# sourceMappingURL=utils.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/index.js": /*!************************************************!*\ !*** ./node_modules/@babel/types/lib/index.js ***! \************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); var _exportNames = { react: true, assertNode: true, createTypeAnnotationBasedOnTypeof: true, createUnionTypeAnnotation: true, createFlowUnionType: true, createTSUnionType: true, cloneNode: true, clone: true, cloneDeep: true, cloneDeepWithoutLoc: true, cloneWithoutLoc: true, addComment: true, addComments: true, inheritInnerComments: true, inheritLeadingComments: true, inheritsComments: true, inheritTrailingComments: true, removeComments: true, ensureBlock: true, toBindingIdentifierName: true, toBlock: true, toComputedKey: true, toExpression: true, toIdentifier: true, toKeyAlias: true, toStatement: true, valueToNode: true, appendToMemberExpression: true, inherits: true, prependToMemberExpression: true, removeProperties: true, removePropertiesDeep: true, removeTypeDuplicates: true, getAssignmentIdentifiers: true, getBindingIdentifiers: true, getOuterBindingIdentifiers: true, getFunctionName: true, traverse: true, traverseFast: true, shallowEqual: true, is: true, isBinding: true, isBlockScoped: true, isImmutable: true, isLet: true, isNode: true, isNodesEquivalent: true, isPlaceholderType: true, isReferenced: true, isScope: true, isSpecifierDefault: true, isType: true, isValidES3Identifier: true, isValidIdentifier: true, isVar: true, matchesPattern: true, validate: true, buildMatchMemberExpression: true, __internal__deprecationWarning: true }; Object.defineProperty(exports, "__internal__deprecationWarning", ({ enumerable: true, get: function () { return _deprecationWarning.default; } })); Object.defineProperty(exports, "addComment", ({ enumerable: true, get: function () { return _addComment.default; } })); Object.defineProperty(exports, "addComments", ({ enumerable: true, get: function () { return _addComments.default; } })); Object.defineProperty(exports, "appendToMemberExpression", ({ enumerable: true, get: function () { return _appendToMemberExpression.default; } })); Object.defineProperty(exports, "assertNode", ({ enumerable: true, get: function () { return _assertNode.default; } })); Object.defineProperty(exports, "buildMatchMemberExpression", ({ enumerable: true, get: function () { return _buildMatchMemberExpression.default; } })); Object.defineProperty(exports, "clone", ({ enumerable: true, get: function () { return _clone.default; } })); Object.defineProperty(exports, "cloneDeep", ({ enumerable: true, get: function () { return _cloneDeep.default; } })); Object.defineProperty(exports, "cloneDeepWithoutLoc", ({ enumerable: true, get: function () { return _cloneDeepWithoutLoc.default; } })); Object.defineProperty(exports, "cloneNode", ({ enumerable: true, get: function () { return _cloneNode.default; } })); Object.defineProperty(exports, "cloneWithoutLoc", ({ enumerable: true, get: function () { return _cloneWithoutLoc.default; } })); Object.defineProperty(exports, "createFlowUnionType", ({ enumerable: true, get: function () { return _createFlowUnionType.default; } })); Object.defineProperty(exports, "createTSUnionType", ({ enumerable: true, get: function () { return _createTSUnionType.default; } })); Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", ({ enumerable: true, get: function () { return _createTypeAnnotationBasedOnTypeof.default; } })); Object.defineProperty(exports, "createUnionTypeAnnotation", ({ enumerable: true, get: function () { return _createFlowUnionType.default; } })); Object.defineProperty(exports, "ensureBlock", ({ enumerable: true, get: function () { return _ensureBlock.default; } })); Object.defineProperty(exports, "getAssignmentIdentifiers", ({ enumerable: true, get: function () { return _getAssignmentIdentifiers.default; } })); Object.defineProperty(exports, "getBindingIdentifiers", ({ enumerable: true, get: function () { return _getBindingIdentifiers.default; } })); Object.defineProperty(exports, "getFunctionName", ({ enumerable: true, get: function () { return _getFunctionName.default; } })); Object.defineProperty(exports, "getOuterBindingIdentifiers", ({ enumerable: true, get: function () { return _getOuterBindingIdentifiers.default; } })); Object.defineProperty(exports, "inheritInnerComments", ({ enumerable: true, get: function () { return _inheritInnerComments.default; } })); Object.defineProperty(exports, "inheritLeadingComments", ({ enumerable: true, get: function () { return _inheritLeadingComments.default; } })); Object.defineProperty(exports, "inheritTrailingComments", ({ enumerable: true, get: function () { return _inheritTrailingComments.default; } })); Object.defineProperty(exports, "inherits", ({ enumerable: true, get: function () { return _inherits.default; } })); Object.defineProperty(exports, "inheritsComments", ({ enumerable: true, get: function () { return _inheritsComments.default; } })); Object.defineProperty(exports, "is", ({ enumerable: true, get: function () { return _is.default; } })); Object.defineProperty(exports, "isBinding", ({ enumerable: true, get: function () { return _isBinding.default; } })); Object.defineProperty(exports, "isBlockScoped", ({ enumerable: true, get: function () { return _isBlockScoped.default; } })); Object.defineProperty(exports, "isImmutable", ({ enumerable: true, get: function () { return _isImmutable.default; } })); Object.defineProperty(exports, "isLet", ({ enumerable: true, get: function () { return _isLet.default; } })); Object.defineProperty(exports, "isNode", ({ enumerable: true, get: function () { return _isNode.default; } })); Object.defineProperty(exports, "isNodesEquivalent", ({ enumerable: true, get: function () { return _isNodesEquivalent.default; } })); Object.defineProperty(exports, "isPlaceholderType", ({ enumerable: true, get: function () { return _isPlaceholderType.default; } })); Object.defineProperty(exports, "isReferenced", ({ enumerable: true, get: function () { return _isReferenced.default; } })); Object.defineProperty(exports, "isScope", ({ enumerable: true, get: function () { return _isScope.default; } })); Object.defineProperty(exports, "isSpecifierDefault", ({ enumerable: true, get: function () { return _isSpecifierDefault.default; } })); Object.defineProperty(exports, "isType", ({ enumerable: true, get: function () { return _isType.default; } })); Object.defineProperty(exports, "isValidES3Identifier", ({ enumerable: true, get: function () { return _isValidES3Identifier.default; } })); Object.defineProperty(exports, "isValidIdentifier", ({ enumerable: true, get: function () { return _isValidIdentifier.default; } })); Object.defineProperty(exports, "isVar", ({ enumerable: true, get: function () { return _isVar.default; } })); Object.defineProperty(exports, "matchesPattern", ({ enumerable: true, get: function () { return _matchesPattern.default; } })); Object.defineProperty(exports, "prependToMemberExpression", ({ enumerable: true, get: function () { return _prependToMemberExpression.default; } })); exports.react = void 0; Object.defineProperty(exports, "removeComments", ({ enumerable: true, get: function () { return _removeComments.default; } })); Object.defineProperty(exports, "removeProperties", ({ enumerable: true, get: function () { return _removeProperties.default; } })); Object.defineProperty(exports, "removePropertiesDeep", ({ enumerable: true, get: function () { return _removePropertiesDeep.default; } })); Object.defineProperty(exports, "removeTypeDuplicates", ({ enumerable: true, get: function () { return _removeTypeDuplicates.default; } })); Object.defineProperty(exports, "shallowEqual", ({ enumerable: true, get: function () { return _shallowEqual.default; } })); Object.defineProperty(exports, "toBindingIdentifierName", ({ enumerable: true, get: function () { return _toBindingIdentifierName.default; } })); Object.defineProperty(exports, "toBlock", ({ enumerable: true, get: function () { return _toBlock.default; } })); Object.defineProperty(exports, "toComputedKey", ({ enumerable: true, get: function () { return _toComputedKey.default; } })); Object.defineProperty(exports, "toExpression", ({ enumerable: true, get: function () { return _toExpression.default; } })); Object.defineProperty(exports, "toIdentifier", ({ enumerable: true, get: function () { return _toIdentifier.default; } })); Object.defineProperty(exports, "toKeyAlias", ({ enumerable: true, get: function () { return _toKeyAlias.default; } })); Object.defineProperty(exports, "toStatement", ({ enumerable: true, get: function () { return _toStatement.default; } })); Object.defineProperty(exports, "traverse", ({ enumerable: true, get: function () { return _traverse.default; } })); Object.defineProperty(exports, "traverseFast", ({ enumerable: true, get: function () { return _traverseFast.default; } })); Object.defineProperty(exports, "validate", ({ enumerable: true, get: function () { return _validate.default; } })); Object.defineProperty(exports, "valueToNode", ({ enumerable: true, get: function () { return _valueToNode.default; } })); var _isReactComponent = __webpack_require__(/*! ./validators/react/isReactComponent.js */ "./node_modules/@babel/types/lib/validators/react/isReactComponent.js"); var _isCompatTag = __webpack_require__(/*! ./validators/react/isCompatTag.js */ "./node_modules/@babel/types/lib/validators/react/isCompatTag.js"); var _buildChildren = __webpack_require__(/*! ./builders/react/buildChildren.js */ "./node_modules/@babel/types/lib/builders/react/buildChildren.js"); var _assertNode = __webpack_require__(/*! ./asserts/assertNode.js */ "./node_modules/@babel/types/lib/asserts/assertNode.js"); var _index = __webpack_require__(/*! ./asserts/generated/index.js */ "./node_modules/@babel/types/lib/asserts/generated/index.js"); Object.keys(_index).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _index[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _index[key]; } }); }); var _createTypeAnnotationBasedOnTypeof = __webpack_require__(/*! ./builders/flow/createTypeAnnotationBasedOnTypeof.js */ "./node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js"); var _createFlowUnionType = __webpack_require__(/*! ./builders/flow/createFlowUnionType.js */ "./node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js"); var _createTSUnionType = __webpack_require__(/*! ./builders/typescript/createTSUnionType.js */ "./node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js"); var _productions = __webpack_require__(/*! ./builders/productions.js */ "./node_modules/@babel/types/lib/builders/productions.js"); Object.keys(_productions).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _productions[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _productions[key]; } }); }); var _index2 = __webpack_require__(/*! ./builders/generated/index.js */ "./node_modules/@babel/types/lib/builders/generated/index.js"); Object.keys(_index2).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _index2[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _index2[key]; } }); }); var _cloneNode = __webpack_require__(/*! ./clone/cloneNode.js */ "./node_modules/@babel/types/lib/clone/cloneNode.js"); var _clone = __webpack_require__(/*! ./clone/clone.js */ "./node_modules/@babel/types/lib/clone/clone.js"); var _cloneDeep = __webpack_require__(/*! ./clone/cloneDeep.js */ "./node_modules/@babel/types/lib/clone/cloneDeep.js"); var _cloneDeepWithoutLoc = __webpack_require__(/*! ./clone/cloneDeepWithoutLoc.js */ "./node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js"); var _cloneWithoutLoc = __webpack_require__(/*! ./clone/cloneWithoutLoc.js */ "./node_modules/@babel/types/lib/clone/cloneWithoutLoc.js"); var _addComment = __webpack_require__(/*! ./comments/addComment.js */ "./node_modules/@babel/types/lib/comments/addComment.js"); var _addComments = __webpack_require__(/*! ./comments/addComments.js */ "./node_modules/@babel/types/lib/comments/addComments.js"); var _inheritInnerComments = __webpack_require__(/*! ./comments/inheritInnerComments.js */ "./node_modules/@babel/types/lib/comments/inheritInnerComments.js"); var _inheritLeadingComments = __webpack_require__(/*! ./comments/inheritLeadingComments.js */ "./node_modules/@babel/types/lib/comments/inheritLeadingComments.js"); var _inheritsComments = __webpack_require__(/*! ./comments/inheritsComments.js */ "./node_modules/@babel/types/lib/comments/inheritsComments.js"); var _inheritTrailingComments = __webpack_require__(/*! ./comments/inheritTrailingComments.js */ "./node_modules/@babel/types/lib/comments/inheritTrailingComments.js"); var _removeComments = __webpack_require__(/*! ./comments/removeComments.js */ "./node_modules/@babel/types/lib/comments/removeComments.js"); var _index3 = __webpack_require__(/*! ./constants/generated/index.js */ "./node_modules/@babel/types/lib/constants/generated/index.js"); Object.keys(_index3).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _index3[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _index3[key]; } }); }); var _index4 = __webpack_require__(/*! ./constants/index.js */ "./node_modules/@babel/types/lib/constants/index.js"); Object.keys(_index4).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _index4[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _index4[key]; } }); }); var _ensureBlock = __webpack_require__(/*! ./converters/ensureBlock.js */ "./node_modules/@babel/types/lib/converters/ensureBlock.js"); var _toBindingIdentifierName = __webpack_require__(/*! ./converters/toBindingIdentifierName.js */ "./node_modules/@babel/types/lib/converters/toBindingIdentifierName.js"); var _toBlock = __webpack_require__(/*! ./converters/toBlock.js */ "./node_modules/@babel/types/lib/converters/toBlock.js"); var _toComputedKey = __webpack_require__(/*! ./converters/toComputedKey.js */ "./node_modules/@babel/types/lib/converters/toComputedKey.js"); var _toExpression = __webpack_require__(/*! ./converters/toExpression.js */ "./node_modules/@babel/types/lib/converters/toExpression.js"); var _toIdentifier = __webpack_require__(/*! ./converters/toIdentifier.js */ "./node_modules/@babel/types/lib/converters/toIdentifier.js"); var _toKeyAlias = __webpack_require__(/*! ./converters/toKeyAlias.js */ "./node_modules/@babel/types/lib/converters/toKeyAlias.js"); var _toStatement = __webpack_require__(/*! ./converters/toStatement.js */ "./node_modules/@babel/types/lib/converters/toStatement.js"); var _valueToNode = __webpack_require__(/*! ./converters/valueToNode.js */ "./node_modules/@babel/types/lib/converters/valueToNode.js"); var _index5 = __webpack_require__(/*! ./definitions/index.js */ "./node_modules/@babel/types/lib/definitions/index.js"); Object.keys(_index5).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _index5[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _index5[key]; } }); }); var _appendToMemberExpression = __webpack_require__(/*! ./modifications/appendToMemberExpression.js */ "./node_modules/@babel/types/lib/modifications/appendToMemberExpression.js"); var _inherits = __webpack_require__(/*! ./modifications/inherits.js */ "./node_modules/@babel/types/lib/modifications/inherits.js"); var _prependToMemberExpression = __webpack_require__(/*! ./modifications/prependToMemberExpression.js */ "./node_modules/@babel/types/lib/modifications/prependToMemberExpression.js"); var _removeProperties = __webpack_require__(/*! ./modifications/removeProperties.js */ "./node_modules/@babel/types/lib/modifications/removeProperties.js"); var _removePropertiesDeep = __webpack_require__(/*! ./modifications/removePropertiesDeep.js */ "./node_modules/@babel/types/lib/modifications/removePropertiesDeep.js"); var _removeTypeDuplicates = __webpack_require__(/*! ./modifications/flow/removeTypeDuplicates.js */ "./node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js"); var _getAssignmentIdentifiers = __webpack_require__(/*! ./retrievers/getAssignmentIdentifiers.js */ "./node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js"); var _getBindingIdentifiers = __webpack_require__(/*! ./retrievers/getBindingIdentifiers.js */ "./node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js"); var _getOuterBindingIdentifiers = __webpack_require__(/*! ./retrievers/getOuterBindingIdentifiers.js */ "./node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js"); var _getFunctionName = __webpack_require__(/*! ./retrievers/getFunctionName.js */ "./node_modules/@babel/types/lib/retrievers/getFunctionName.js"); var _traverse = __webpack_require__(/*! ./traverse/traverse.js */ "./node_modules/@babel/types/lib/traverse/traverse.js"); Object.keys(_traverse).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _traverse[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _traverse[key]; } }); }); var _traverseFast = __webpack_require__(/*! ./traverse/traverseFast.js */ "./node_modules/@babel/types/lib/traverse/traverseFast.js"); var _shallowEqual = __webpack_require__(/*! ./utils/shallowEqual.js */ "./node_modules/@babel/types/lib/utils/shallowEqual.js"); var _is = __webpack_require__(/*! ./validators/is.js */ "./node_modules/@babel/types/lib/validators/is.js"); var _isBinding = __webpack_require__(/*! ./validators/isBinding.js */ "./node_modules/@babel/types/lib/validators/isBinding.js"); var _isBlockScoped = __webpack_require__(/*! ./validators/isBlockScoped.js */ "./node_modules/@babel/types/lib/validators/isBlockScoped.js"); var _isImmutable = __webpack_require__(/*! ./validators/isImmutable.js */ "./node_modules/@babel/types/lib/validators/isImmutable.js"); var _isLet = __webpack_require__(/*! ./validators/isLet.js */ "./node_modules/@babel/types/lib/validators/isLet.js"); var _isNode = __webpack_require__(/*! ./validators/isNode.js */ "./node_modules/@babel/types/lib/validators/isNode.js"); var _isNodesEquivalent = __webpack_require__(/*! ./validators/isNodesEquivalent.js */ "./node_modules/@babel/types/lib/validators/isNodesEquivalent.js"); var _isPlaceholderType = __webpack_require__(/*! ./validators/isPlaceholderType.js */ "./node_modules/@babel/types/lib/validators/isPlaceholderType.js"); var _isReferenced = __webpack_require__(/*! ./validators/isReferenced.js */ "./node_modules/@babel/types/lib/validators/isReferenced.js"); var _isScope = __webpack_require__(/*! ./validators/isScope.js */ "./node_modules/@babel/types/lib/validators/isScope.js"); var _isSpecifierDefault = __webpack_require__(/*! ./validators/isSpecifierDefault.js */ "./node_modules/@babel/types/lib/validators/isSpecifierDefault.js"); var _isType = __webpack_require__(/*! ./validators/isType.js */ "./node_modules/@babel/types/lib/validators/isType.js"); var _isValidES3Identifier = __webpack_require__(/*! ./validators/isValidES3Identifier.js */ "./node_modules/@babel/types/lib/validators/isValidES3Identifier.js"); var _isValidIdentifier = __webpack_require__(/*! ./validators/isValidIdentifier.js */ "./node_modules/@babel/types/lib/validators/isValidIdentifier.js"); var _isVar = __webpack_require__(/*! ./validators/isVar.js */ "./node_modules/@babel/types/lib/validators/isVar.js"); var _matchesPattern = __webpack_require__(/*! ./validators/matchesPattern.js */ "./node_modules/@babel/types/lib/validators/matchesPattern.js"); var _validate = __webpack_require__(/*! ./validators/validate.js */ "./node_modules/@babel/types/lib/validators/validate.js"); var _buildMatchMemberExpression = __webpack_require__(/*! ./validators/buildMatchMemberExpression.js */ "./node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js"); var _index6 = __webpack_require__(/*! ./validators/generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); Object.keys(_index6).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _index6[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _index6[key]; } }); }); var _deprecationWarning = __webpack_require__(/*! ./utils/deprecationWarning.js */ "./node_modules/@babel/types/lib/utils/deprecationWarning.js"); var _toSequenceExpression = __webpack_require__(/*! ./converters/toSequenceExpression.js */ "./node_modules/@babel/types/lib/converters/toSequenceExpression.js"); const react = exports.react = { isReactComponent: _isReactComponent.default, isCompatTag: _isCompatTag.default, buildChildren: _buildChildren.default }; { exports.toSequenceExpression = _toSequenceExpression.default; } if (process.env.BABEL_TYPES_8_BREAKING) { console.warn("BABEL_TYPES_8_BREAKING is not supported anymore. Use the latest Babel 8.0.0 pre-release instead!"); } //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/modifications/appendToMemberExpression.js": /*!*********************************************************************************!*\ !*** ./node_modules/@babel/types/lib/modifications/appendToMemberExpression.js ***! \*********************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = appendToMemberExpression; var _index = __webpack_require__(/*! ../builders/generated/index.js */ "./node_modules/@babel/types/lib/builders/generated/index.js"); function appendToMemberExpression(member, append, computed = false) { member.object = (0, _index.memberExpression)(member.object, member.property, member.computed); member.property = append; member.computed = !!computed; return member; } //# sourceMappingURL=appendToMemberExpression.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js": /*!**********************************************************************************!*\ !*** ./node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js ***! \**********************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = removeTypeDuplicates; var _index = __webpack_require__(/*! ../../validators/generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); function getQualifiedName(node) { return (0, _index.isIdentifier)(node) ? node.name : `${node.id.name}.${getQualifiedName(node.qualification)}`; } function removeTypeDuplicates(nodesIn) { const nodes = Array.from(nodesIn); const generics = new Map(); const bases = new Map(); const typeGroups = new Set(); const types = []; for (let i = 0; i < nodes.length; i++) { const node = nodes[i]; if (!node) continue; if (types.includes(node)) { continue; } if ((0, _index.isAnyTypeAnnotation)(node)) { return [node]; } if ((0, _index.isFlowBaseAnnotation)(node)) { bases.set(node.type, node); continue; } if ((0, _index.isUnionTypeAnnotation)(node)) { if (!typeGroups.has(node.types)) { nodes.push(...node.types); typeGroups.add(node.types); } continue; } if ((0, _index.isGenericTypeAnnotation)(node)) { const name = getQualifiedName(node.id); if (generics.has(name)) { let existing = generics.get(name); if (existing.typeParameters) { if (node.typeParameters) { existing.typeParameters.params.push(...node.typeParameters.params); existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params); } } else { existing = node.typeParameters; } } else { generics.set(name, node); } continue; } types.push(node); } for (const [, baseType] of bases) { types.push(baseType); } for (const [, genericName] of generics) { types.push(genericName); } return types; } //# sourceMappingURL=removeTypeDuplicates.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/modifications/inherits.js": /*!*****************************************************************!*\ !*** ./node_modules/@babel/types/lib/modifications/inherits.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = inherits; var _index = __webpack_require__(/*! ../constants/index.js */ "./node_modules/@babel/types/lib/constants/index.js"); var _inheritsComments = __webpack_require__(/*! ../comments/inheritsComments.js */ "./node_modules/@babel/types/lib/comments/inheritsComments.js"); function inherits(child, parent) { if (!child || !parent) return child; for (const key of _index.INHERIT_KEYS.optional) { if (child[key] == null) { child[key] = parent[key]; } } for (const key of Object.keys(parent)) { if (key[0] === "_" && key !== "__clone") { child[key] = parent[key]; } } for (const key of _index.INHERIT_KEYS.force) { child[key] = parent[key]; } (0, _inheritsComments.default)(child, parent); return child; } //# sourceMappingURL=inherits.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/modifications/prependToMemberExpression.js": /*!**********************************************************************************!*\ !*** ./node_modules/@babel/types/lib/modifications/prependToMemberExpression.js ***! \**********************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = prependToMemberExpression; var _index = __webpack_require__(/*! ../builders/generated/index.js */ "./node_modules/@babel/types/lib/builders/generated/index.js"); var _index2 = __webpack_require__(/*! ../index.js */ "./node_modules/@babel/types/lib/index.js"); function prependToMemberExpression(member, prepend) { if ((0, _index2.isSuper)(member.object)) { throw new Error("Cannot prepend node to super property access (`super.foo`)."); } member.object = (0, _index.memberExpression)(prepend, member.object); return member; } //# sourceMappingURL=prependToMemberExpression.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/modifications/removeProperties.js": /*!*************************************************************************!*\ !*** ./node_modules/@babel/types/lib/modifications/removeProperties.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = removeProperties; var _index = __webpack_require__(/*! ../constants/index.js */ "./node_modules/@babel/types/lib/constants/index.js"); const CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"]; const CLEAR_KEYS_PLUS_COMMENTS = [..._index.COMMENT_KEYS, "comments", ...CLEAR_KEYS]; function removeProperties(node, opts = {}) { const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS; for (const key of map) { if (node[key] != null) node[key] = undefined; } for (const key of Object.keys(node)) { if (key[0] === "_" && node[key] != null) node[key] = undefined; } const symbols = Object.getOwnPropertySymbols(node); for (const sym of symbols) { node[sym] = null; } } //# sourceMappingURL=removeProperties.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/modifications/removePropertiesDeep.js": /*!*****************************************************************************!*\ !*** ./node_modules/@babel/types/lib/modifications/removePropertiesDeep.js ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = removePropertiesDeep; var _traverseFast = __webpack_require__(/*! ../traverse/traverseFast.js */ "./node_modules/@babel/types/lib/traverse/traverseFast.js"); var _removeProperties = __webpack_require__(/*! ./removeProperties.js */ "./node_modules/@babel/types/lib/modifications/removeProperties.js"); function removePropertiesDeep(tree, opts) { (0, _traverseFast.default)(tree, _removeProperties.default, opts); return tree; } //# sourceMappingURL=removePropertiesDeep.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js": /*!****************************************************************************************!*\ !*** ./node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js ***! \****************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = removeTypeDuplicates; var _index = __webpack_require__(/*! ../../validators/generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); function getQualifiedName(node) { return (0, _index.isIdentifier)(node) ? node.name : (0, _index.isThisExpression)(node) ? "this" : `${node.right.name}.${getQualifiedName(node.left)}`; } function removeTypeDuplicates(nodesIn) { const nodes = Array.from(nodesIn); const generics = new Map(); const bases = new Map(); const typeGroups = new Set(); const types = []; for (let i = 0; i < nodes.length; i++) { const node = nodes[i]; if (!node) continue; if (types.includes(node)) { continue; } if ((0, _index.isTSAnyKeyword)(node)) { return [node]; } if ((0, _index.isTSBaseType)(node)) { bases.set(node.type, node); continue; } if ((0, _index.isTSUnionType)(node)) { if (!typeGroups.has(node.types)) { nodes.push(...node.types); typeGroups.add(node.types); } continue; } const typeArgumentsKey = "typeParameters"; if ((0, _index.isTSTypeReference)(node) && node[typeArgumentsKey]) { const typeArguments = node[typeArgumentsKey]; const name = getQualifiedName(node.typeName); if (generics.has(name)) { let existing = generics.get(name); const existingTypeArguments = existing[typeArgumentsKey]; if (existingTypeArguments) { existingTypeArguments.params.push(...typeArguments.params); existingTypeArguments.params = removeTypeDuplicates(existingTypeArguments.params); } else { existing = typeArguments; } } else { generics.set(name, node); } continue; } types.push(node); } for (const [, baseType] of bases) { types.push(baseType); } for (const [, genericName] of generics) { types.push(genericName); } return types; } //# sourceMappingURL=removeTypeDuplicates.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js": /*!******************************************************************************!*\ !*** ./node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js ***! \******************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = getAssignmentIdentifiers; function getAssignmentIdentifiers(node) { const search = [].concat(node); const ids = Object.create(null); while (search.length) { const id = search.pop(); if (!id) continue; switch (id.type) { case "ArrayPattern": search.push(...id.elements); break; case "AssignmentExpression": case "AssignmentPattern": case "ForInStatement": case "ForOfStatement": search.push(id.left); break; case "ObjectPattern": search.push(...id.properties); break; case "ObjectProperty": search.push(id.value); break; case "RestElement": case "UpdateExpression": search.push(id.argument); break; case "UnaryExpression": if (id.operator === "delete") { search.push(id.argument); } break; case "Identifier": ids[id.name] = id; break; default: break; } } return ids; } //# sourceMappingURL=getAssignmentIdentifiers.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js": /*!***************************************************************************!*\ !*** ./node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js ***! \***************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = getBindingIdentifiers; var _index = __webpack_require__(/*! ../validators/generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); function getBindingIdentifiers(node, duplicates, outerOnly, newBindingsOnly) { const search = [].concat(node); const ids = Object.create(null); while (search.length) { const id = search.shift(); if (!id) continue; if (newBindingsOnly && ((0, _index.isAssignmentExpression)(id) || (0, _index.isUnaryExpression)(id) || (0, _index.isUpdateExpression)(id))) { continue; } if ((0, _index.isIdentifier)(id)) { if (duplicates) { const _ids = ids[id.name] = ids[id.name] || []; _ids.push(id); } else { ids[id.name] = id; } continue; } if ((0, _index.isExportDeclaration)(id) && !(0, _index.isExportAllDeclaration)(id)) { if ((0, _index.isDeclaration)(id.declaration)) { search.push(id.declaration); } continue; } if (outerOnly) { if ((0, _index.isFunctionDeclaration)(id)) { search.push(id.id); continue; } if ((0, _index.isFunctionExpression)(id)) { continue; } } const keys = getBindingIdentifiers.keys[id.type]; if (keys) { for (let i = 0; i < keys.length; i++) { const key = keys[i]; const nodes = id[key]; if (nodes) { if (Array.isArray(nodes)) { search.push(...nodes); } else { search.push(nodes); } } } } } return ids; } const keys = { DeclareClass: ["id"], DeclareFunction: ["id"], DeclareModule: ["id"], DeclareVariable: ["id"], DeclareInterface: ["id"], DeclareTypeAlias: ["id"], DeclareOpaqueType: ["id"], InterfaceDeclaration: ["id"], TypeAlias: ["id"], OpaqueType: ["id"], CatchClause: ["param"], LabeledStatement: ["label"], UnaryExpression: ["argument"], AssignmentExpression: ["left"], ImportSpecifier: ["local"], ImportNamespaceSpecifier: ["local"], ImportDefaultSpecifier: ["local"], ImportDeclaration: ["specifiers"], TSImportEqualsDeclaration: ["id"], ExportSpecifier: ["exported"], ExportNamespaceSpecifier: ["exported"], ExportDefaultSpecifier: ["exported"], FunctionDeclaration: ["id", "params"], FunctionExpression: ["id", "params"], ArrowFunctionExpression: ["params"], ObjectMethod: ["params"], ClassMethod: ["params"], ClassPrivateMethod: ["params"], ForInStatement: ["left"], ForOfStatement: ["left"], ClassDeclaration: ["id"], ClassExpression: ["id"], RestElement: ["argument"], UpdateExpression: ["argument"], ObjectProperty: ["value"], AssignmentPattern: ["left"], ArrayPattern: ["elements"], ObjectPattern: ["properties"], VariableDeclaration: ["declarations"], VariableDeclarator: ["id"] }; getBindingIdentifiers.keys = keys; //# sourceMappingURL=getBindingIdentifiers.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/retrievers/getFunctionName.js": /*!*********************************************************************!*\ !*** ./node_modules/@babel/types/lib/retrievers/getFunctionName.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = getFunctionName; var _index = __webpack_require__(/*! ../validators/generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); function getNameFromLiteralId(id) { if ((0, _index.isNullLiteral)(id)) { return "null"; } if ((0, _index.isRegExpLiteral)(id)) { return `/${id.pattern}/${id.flags}`; } if ((0, _index.isTemplateLiteral)(id)) { return id.quasis.map(quasi => quasi.value.raw).join(""); } if (id.value !== undefined) { return String(id.value); } return null; } function getObjectMemberKey(node) { if (!node.computed || (0, _index.isLiteral)(node.key)) { return node.key; } } function getFunctionName(node, parent) { if ("id" in node && node.id) { return { name: node.id.name, originalNode: node.id }; } let prefix = ""; let id; if ((0, _index.isObjectProperty)(parent, { value: node })) { id = getObjectMemberKey(parent); } else if ((0, _index.isObjectMethod)(node) || (0, _index.isClassMethod)(node)) { id = getObjectMemberKey(node); if (node.kind === "get") prefix = "get ";else if (node.kind === "set") prefix = "set "; } else if ((0, _index.isVariableDeclarator)(parent, { init: node })) { id = parent.id; } else if ((0, _index.isAssignmentExpression)(parent, { operator: "=", right: node })) { id = parent.left; } if (!id) return null; const name = (0, _index.isLiteral)(id) ? getNameFromLiteralId(id) : (0, _index.isIdentifier)(id) ? id.name : (0, _index.isPrivateName)(id) ? id.id.name : null; if (name == null) return null; return { name: prefix + name, originalNode: id }; } //# sourceMappingURL=getFunctionName.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js": /*!********************************************************************************!*\ !*** ./node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js ***! \********************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _getBindingIdentifiers = __webpack_require__(/*! ./getBindingIdentifiers.js */ "./node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js"); var _default = exports["default"] = getOuterBindingIdentifiers; function getOuterBindingIdentifiers(node, duplicates) { return (0, _getBindingIdentifiers.default)(node, duplicates, true); } //# sourceMappingURL=getOuterBindingIdentifiers.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/traverse/traverse.js": /*!************************************************************!*\ !*** ./node_modules/@babel/types/lib/traverse/traverse.js ***! \************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = traverse; var _index = __webpack_require__(/*! ../definitions/index.js */ "./node_modules/@babel/types/lib/definitions/index.js"); function traverse(node, handlers, state) { if (typeof handlers === "function") { handlers = { enter: handlers }; } const { enter, exit } = handlers; traverseSimpleImpl(node, enter, exit, state, []); } function traverseSimpleImpl(node, enter, exit, state, ancestors) { const keys = _index.VISITOR_KEYS[node.type]; if (!keys) return; if (enter) enter(node, ancestors, state); for (const key of keys) { const subNode = node[key]; if (Array.isArray(subNode)) { for (let i = 0; i < subNode.length; i++) { const child = subNode[i]; if (!child) continue; ancestors.push({ node, key, index: i }); traverseSimpleImpl(child, enter, exit, state, ancestors); ancestors.pop(); } } else if (subNode) { ancestors.push({ node, key }); traverseSimpleImpl(subNode, enter, exit, state, ancestors); ancestors.pop(); } } if (exit) exit(node, ancestors, state); } //# sourceMappingURL=traverse.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/traverse/traverseFast.js": /*!****************************************************************!*\ !*** ./node_modules/@babel/types/lib/traverse/traverseFast.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = traverseFast; var _index = __webpack_require__(/*! ../definitions/index.js */ "./node_modules/@babel/types/lib/definitions/index.js"); const _skip = Symbol(); const _stop = Symbol(); function traverseFast(node, enter, opts) { if (!node) return false; const keys = _index.VISITOR_KEYS[node.type]; if (!keys) return false; opts = opts || {}; const ret = enter(node, opts); if (ret !== undefined) { switch (ret) { case _skip: return false; case _stop: return true; } } for (const key of keys) { const subNode = node[key]; if (!subNode) continue; if (Array.isArray(subNode)) { for (const node of subNode) { if (traverseFast(node, enter, opts)) return true; } } else { if (traverseFast(subNode, enter, opts)) return true; } } return false; } traverseFast.skip = _skip; traverseFast.stop = _stop; //# sourceMappingURL=traverseFast.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/utils/deprecationWarning.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/types/lib/utils/deprecationWarning.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = deprecationWarning; const warnings = new Set(); function deprecationWarning(oldName, newName, prefix = "", cacheKey = oldName) { if (warnings.has(cacheKey)) return; warnings.add(cacheKey); const { internal, trace } = captureShortStackTrace(1, 2); if (internal) { return; } console.warn(`${prefix}\`${oldName}\` has been deprecated, please migrate to \`${newName}\`\n${trace}`); } function captureShortStackTrace(skip, length) { const { stackTraceLimit, prepareStackTrace } = Error; let stackTrace; Error.stackTraceLimit = 1 + skip + length; Error.prepareStackTrace = function (err, stack) { stackTrace = stack; }; new Error().stack; Error.stackTraceLimit = stackTraceLimit; Error.prepareStackTrace = prepareStackTrace; if (!stackTrace) return { internal: false, trace: "" }; const shortStackTrace = stackTrace.slice(1 + skip, 1 + skip + length); return { internal: /[\\/]@babel[\\/]/.test(shortStackTrace[1].getFileName()), trace: shortStackTrace.map(frame => ` at ${frame}`).join("\n") }; } //# sourceMappingURL=deprecationWarning.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/utils/inherit.js": /*!********************************************************!*\ !*** ./node_modules/@babel/types/lib/utils/inherit.js ***! \********************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = inherit; function inherit(key, child, parent) { if (child && parent) { child[key] = Array.from(new Set([].concat(child[key], parent[key]).filter(Boolean))); } } //# sourceMappingURL=inherit.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js": /*!**********************************************************************************!*\ !*** ./node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js ***! \**********************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = cleanJSXElementLiteralChild; var _index = __webpack_require__(/*! ../../builders/generated/index.js */ "./node_modules/@babel/types/lib/builders/generated/index.js"); var _index2 = __webpack_require__(/*! ../../index.js */ "./node_modules/@babel/types/lib/index.js"); function cleanJSXElementLiteralChild(child, args) { const lines = child.value.split(/\r\n|\n|\r/); let lastNonEmptyLine = 0; for (let i = 0; i < lines.length; i++) { if (/[^ \t]/.exec(lines[i])) { lastNonEmptyLine = i; } } let str = ""; for (let i = 0; i < lines.length; i++) { const line = lines[i]; const isFirstLine = i === 0; const isLastLine = i === lines.length - 1; const isLastNonEmptyLine = i === lastNonEmptyLine; let trimmedLine = line.replace(/\t/g, " "); if (!isFirstLine) { trimmedLine = trimmedLine.replace(/^ +/, ""); } if (!isLastLine) { trimmedLine = trimmedLine.replace(/ +$/, ""); } if (trimmedLine) { if (!isLastNonEmptyLine) { trimmedLine += " "; } str += trimmedLine; } } if (str) args.push((0, _index2.inherits)((0, _index.stringLiteral)(str), child)); } //# sourceMappingURL=cleanJSXElementLiteralChild.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/utils/shallowEqual.js": /*!*************************************************************!*\ !*** ./node_modules/@babel/types/lib/utils/shallowEqual.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = shallowEqual; function shallowEqual(actual, expected) { const keys = Object.keys(expected); for (const key of keys) { if (actual[key] !== expected[key]) { return false; } } return true; } //# sourceMappingURL=shallowEqual.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js": /*!********************************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js ***! \********************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = buildMatchMemberExpression; var _matchesPattern = __webpack_require__(/*! ./matchesPattern.js */ "./node_modules/@babel/types/lib/validators/matchesPattern.js"); function buildMatchMemberExpression(match, allowPartial) { const parts = match.split("."); return member => (0, _matchesPattern.default)(member, parts, allowPartial); } //# sourceMappingURL=buildMatchMemberExpression.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/generated/index.js": /*!*********************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/generated/index.js ***! \*********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isAccessor = isAccessor; exports.isAnyTypeAnnotation = isAnyTypeAnnotation; exports.isArgumentPlaceholder = isArgumentPlaceholder; exports.isArrayExpression = isArrayExpression; exports.isArrayPattern = isArrayPattern; exports.isArrayTypeAnnotation = isArrayTypeAnnotation; exports.isArrowFunctionExpression = isArrowFunctionExpression; exports.isAssignmentExpression = isAssignmentExpression; exports.isAssignmentPattern = isAssignmentPattern; exports.isAwaitExpression = isAwaitExpression; exports.isBigIntLiteral = isBigIntLiteral; exports.isBinary = isBinary; exports.isBinaryExpression = isBinaryExpression; exports.isBindExpression = isBindExpression; exports.isBlock = isBlock; exports.isBlockParent = isBlockParent; exports.isBlockStatement = isBlockStatement; exports.isBooleanLiteral = isBooleanLiteral; exports.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation; exports.isBooleanTypeAnnotation = isBooleanTypeAnnotation; exports.isBreakStatement = isBreakStatement; exports.isCallExpression = isCallExpression; exports.isCatchClause = isCatchClause; exports.isClass = isClass; exports.isClassAccessorProperty = isClassAccessorProperty; exports.isClassBody = isClassBody; exports.isClassDeclaration = isClassDeclaration; exports.isClassExpression = isClassExpression; exports.isClassImplements = isClassImplements; exports.isClassMethod = isClassMethod; exports.isClassPrivateMethod = isClassPrivateMethod; exports.isClassPrivateProperty = isClassPrivateProperty; exports.isClassProperty = isClassProperty; exports.isCompletionStatement = isCompletionStatement; exports.isConditional = isConditional; exports.isConditionalExpression = isConditionalExpression; exports.isContinueStatement = isContinueStatement; exports.isDebuggerStatement = isDebuggerStatement; exports.isDecimalLiteral = isDecimalLiteral; exports.isDeclaration = isDeclaration; exports.isDeclareClass = isDeclareClass; exports.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration; exports.isDeclareExportDeclaration = isDeclareExportDeclaration; exports.isDeclareFunction = isDeclareFunction; exports.isDeclareInterface = isDeclareInterface; exports.isDeclareModule = isDeclareModule; exports.isDeclareModuleExports = isDeclareModuleExports; exports.isDeclareOpaqueType = isDeclareOpaqueType; exports.isDeclareTypeAlias = isDeclareTypeAlias; exports.isDeclareVariable = isDeclareVariable; exports.isDeclaredPredicate = isDeclaredPredicate; exports.isDecorator = isDecorator; exports.isDirective = isDirective; exports.isDirectiveLiteral = isDirectiveLiteral; exports.isDoExpression = isDoExpression; exports.isDoWhileStatement = isDoWhileStatement; exports.isEmptyStatement = isEmptyStatement; exports.isEmptyTypeAnnotation = isEmptyTypeAnnotation; exports.isEnumBody = isEnumBody; exports.isEnumBooleanBody = isEnumBooleanBody; exports.isEnumBooleanMember = isEnumBooleanMember; exports.isEnumDeclaration = isEnumDeclaration; exports.isEnumDefaultedMember = isEnumDefaultedMember; exports.isEnumMember = isEnumMember; exports.isEnumNumberBody = isEnumNumberBody; exports.isEnumNumberMember = isEnumNumberMember; exports.isEnumStringBody = isEnumStringBody; exports.isEnumStringMember = isEnumStringMember; exports.isEnumSymbolBody = isEnumSymbolBody; exports.isExistsTypeAnnotation = isExistsTypeAnnotation; exports.isExportAllDeclaration = isExportAllDeclaration; exports.isExportDeclaration = isExportDeclaration; exports.isExportDefaultDeclaration = isExportDefaultDeclaration; exports.isExportDefaultSpecifier = isExportDefaultSpecifier; exports.isExportNamedDeclaration = isExportNamedDeclaration; exports.isExportNamespaceSpecifier = isExportNamespaceSpecifier; exports.isExportSpecifier = isExportSpecifier; exports.isExpression = isExpression; exports.isExpressionStatement = isExpressionStatement; exports.isExpressionWrapper = isExpressionWrapper; exports.isFile = isFile; exports.isFlow = isFlow; exports.isFlowBaseAnnotation = isFlowBaseAnnotation; exports.isFlowDeclaration = isFlowDeclaration; exports.isFlowPredicate = isFlowPredicate; exports.isFlowType = isFlowType; exports.isFor = isFor; exports.isForInStatement = isForInStatement; exports.isForOfStatement = isForOfStatement; exports.isForStatement = isForStatement; exports.isForXStatement = isForXStatement; exports.isFunction = isFunction; exports.isFunctionDeclaration = isFunctionDeclaration; exports.isFunctionExpression = isFunctionExpression; exports.isFunctionParameter = isFunctionParameter; exports.isFunctionParent = isFunctionParent; exports.isFunctionTypeAnnotation = isFunctionTypeAnnotation; exports.isFunctionTypeParam = isFunctionTypeParam; exports.isGenericTypeAnnotation = isGenericTypeAnnotation; exports.isIdentifier = isIdentifier; exports.isIfStatement = isIfStatement; exports.isImmutable = isImmutable; exports.isImport = isImport; exports.isImportAttribute = isImportAttribute; exports.isImportDeclaration = isImportDeclaration; exports.isImportDefaultSpecifier = isImportDefaultSpecifier; exports.isImportExpression = isImportExpression; exports.isImportNamespaceSpecifier = isImportNamespaceSpecifier; exports.isImportOrExportDeclaration = isImportOrExportDeclaration; exports.isImportSpecifier = isImportSpecifier; exports.isIndexedAccessType = isIndexedAccessType; exports.isInferredPredicate = isInferredPredicate; exports.isInterfaceDeclaration = isInterfaceDeclaration; exports.isInterfaceExtends = isInterfaceExtends; exports.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation; exports.isInterpreterDirective = isInterpreterDirective; exports.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation; exports.isJSX = isJSX; exports.isJSXAttribute = isJSXAttribute; exports.isJSXClosingElement = isJSXClosingElement; exports.isJSXClosingFragment = isJSXClosingFragment; exports.isJSXElement = isJSXElement; exports.isJSXEmptyExpression = isJSXEmptyExpression; exports.isJSXExpressionContainer = isJSXExpressionContainer; exports.isJSXFragment = isJSXFragment; exports.isJSXIdentifier = isJSXIdentifier; exports.isJSXMemberExpression = isJSXMemberExpression; exports.isJSXNamespacedName = isJSXNamespacedName; exports.isJSXOpeningElement = isJSXOpeningElement; exports.isJSXOpeningFragment = isJSXOpeningFragment; exports.isJSXSpreadAttribute = isJSXSpreadAttribute; exports.isJSXSpreadChild = isJSXSpreadChild; exports.isJSXText = isJSXText; exports.isLVal = isLVal; exports.isLabeledStatement = isLabeledStatement; exports.isLiteral = isLiteral; exports.isLogicalExpression = isLogicalExpression; exports.isLoop = isLoop; exports.isMemberExpression = isMemberExpression; exports.isMetaProperty = isMetaProperty; exports.isMethod = isMethod; exports.isMiscellaneous = isMiscellaneous; exports.isMixedTypeAnnotation = isMixedTypeAnnotation; exports.isModuleDeclaration = isModuleDeclaration; exports.isModuleExpression = isModuleExpression; exports.isModuleSpecifier = isModuleSpecifier; exports.isNewExpression = isNewExpression; exports.isNoop = isNoop; exports.isNullLiteral = isNullLiteral; exports.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation; exports.isNullableTypeAnnotation = isNullableTypeAnnotation; exports.isNumberLiteral = isNumberLiteral; exports.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation; exports.isNumberTypeAnnotation = isNumberTypeAnnotation; exports.isNumericLiteral = isNumericLiteral; exports.isObjectExpression = isObjectExpression; exports.isObjectMember = isObjectMember; exports.isObjectMethod = isObjectMethod; exports.isObjectPattern = isObjectPattern; exports.isObjectProperty = isObjectProperty; exports.isObjectTypeAnnotation = isObjectTypeAnnotation; exports.isObjectTypeCallProperty = isObjectTypeCallProperty; exports.isObjectTypeIndexer = isObjectTypeIndexer; exports.isObjectTypeInternalSlot = isObjectTypeInternalSlot; exports.isObjectTypeProperty = isObjectTypeProperty; exports.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty; exports.isOpaqueType = isOpaqueType; exports.isOptionalCallExpression = isOptionalCallExpression; exports.isOptionalIndexedAccessType = isOptionalIndexedAccessType; exports.isOptionalMemberExpression = isOptionalMemberExpression; exports.isParenthesizedExpression = isParenthesizedExpression; exports.isPattern = isPattern; exports.isPatternLike = isPatternLike; exports.isPipelineBareFunction = isPipelineBareFunction; exports.isPipelinePrimaryTopicReference = isPipelinePrimaryTopicReference; exports.isPipelineTopicExpression = isPipelineTopicExpression; exports.isPlaceholder = isPlaceholder; exports.isPrivate = isPrivate; exports.isPrivateName = isPrivateName; exports.isProgram = isProgram; exports.isProperty = isProperty; exports.isPureish = isPureish; exports.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier; exports.isRecordExpression = isRecordExpression; exports.isRegExpLiteral = isRegExpLiteral; exports.isRegexLiteral = isRegexLiteral; exports.isRestElement = isRestElement; exports.isRestProperty = isRestProperty; exports.isReturnStatement = isReturnStatement; exports.isScopable = isScopable; exports.isSequenceExpression = isSequenceExpression; exports.isSpreadElement = isSpreadElement; exports.isSpreadProperty = isSpreadProperty; exports.isStandardized = isStandardized; exports.isStatement = isStatement; exports.isStaticBlock = isStaticBlock; exports.isStringLiteral = isStringLiteral; exports.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation; exports.isStringTypeAnnotation = isStringTypeAnnotation; exports.isSuper = isSuper; exports.isSwitchCase = isSwitchCase; exports.isSwitchStatement = isSwitchStatement; exports.isSymbolTypeAnnotation = isSymbolTypeAnnotation; exports.isTSAnyKeyword = isTSAnyKeyword; exports.isTSArrayType = isTSArrayType; exports.isTSAsExpression = isTSAsExpression; exports.isTSBaseType = isTSBaseType; exports.isTSBigIntKeyword = isTSBigIntKeyword; exports.isTSBooleanKeyword = isTSBooleanKeyword; exports.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration; exports.isTSConditionalType = isTSConditionalType; exports.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration; exports.isTSConstructorType = isTSConstructorType; exports.isTSDeclareFunction = isTSDeclareFunction; exports.isTSDeclareMethod = isTSDeclareMethod; exports.isTSEntityName = isTSEntityName; exports.isTSEnumBody = isTSEnumBody; exports.isTSEnumDeclaration = isTSEnumDeclaration; exports.isTSEnumMember = isTSEnumMember; exports.isTSExportAssignment = isTSExportAssignment; exports.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments; exports.isTSExternalModuleReference = isTSExternalModuleReference; exports.isTSFunctionType = isTSFunctionType; exports.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration; exports.isTSImportType = isTSImportType; exports.isTSIndexSignature = isTSIndexSignature; exports.isTSIndexedAccessType = isTSIndexedAccessType; exports.isTSInferType = isTSInferType; exports.isTSInstantiationExpression = isTSInstantiationExpression; exports.isTSInterfaceBody = isTSInterfaceBody; exports.isTSInterfaceDeclaration = isTSInterfaceDeclaration; exports.isTSIntersectionType = isTSIntersectionType; exports.isTSIntrinsicKeyword = isTSIntrinsicKeyword; exports.isTSLiteralType = isTSLiteralType; exports.isTSMappedType = isTSMappedType; exports.isTSMethodSignature = isTSMethodSignature; exports.isTSModuleBlock = isTSModuleBlock; exports.isTSModuleDeclaration = isTSModuleDeclaration; exports.isTSNamedTupleMember = isTSNamedTupleMember; exports.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration; exports.isTSNeverKeyword = isTSNeverKeyword; exports.isTSNonNullExpression = isTSNonNullExpression; exports.isTSNullKeyword = isTSNullKeyword; exports.isTSNumberKeyword = isTSNumberKeyword; exports.isTSObjectKeyword = isTSObjectKeyword; exports.isTSOptionalType = isTSOptionalType; exports.isTSParameterProperty = isTSParameterProperty; exports.isTSParenthesizedType = isTSParenthesizedType; exports.isTSPropertySignature = isTSPropertySignature; exports.isTSQualifiedName = isTSQualifiedName; exports.isTSRestType = isTSRestType; exports.isTSSatisfiesExpression = isTSSatisfiesExpression; exports.isTSStringKeyword = isTSStringKeyword; exports.isTSSymbolKeyword = isTSSymbolKeyword; exports.isTSTemplateLiteralType = isTSTemplateLiteralType; exports.isTSThisType = isTSThisType; exports.isTSTupleType = isTSTupleType; exports.isTSType = isTSType; exports.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration; exports.isTSTypeAnnotation = isTSTypeAnnotation; exports.isTSTypeAssertion = isTSTypeAssertion; exports.isTSTypeElement = isTSTypeElement; exports.isTSTypeLiteral = isTSTypeLiteral; exports.isTSTypeOperator = isTSTypeOperator; exports.isTSTypeParameter = isTSTypeParameter; exports.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration; exports.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation; exports.isTSTypePredicate = isTSTypePredicate; exports.isTSTypeQuery = isTSTypeQuery; exports.isTSTypeReference = isTSTypeReference; exports.isTSUndefinedKeyword = isTSUndefinedKeyword; exports.isTSUnionType = isTSUnionType; exports.isTSUnknownKeyword = isTSUnknownKeyword; exports.isTSVoidKeyword = isTSVoidKeyword; exports.isTaggedTemplateExpression = isTaggedTemplateExpression; exports.isTemplateElement = isTemplateElement; exports.isTemplateLiteral = isTemplateLiteral; exports.isTerminatorless = isTerminatorless; exports.isThisExpression = isThisExpression; exports.isThisTypeAnnotation = isThisTypeAnnotation; exports.isThrowStatement = isThrowStatement; exports.isTopicReference = isTopicReference; exports.isTryStatement = isTryStatement; exports.isTupleExpression = isTupleExpression; exports.isTupleTypeAnnotation = isTupleTypeAnnotation; exports.isTypeAlias = isTypeAlias; exports.isTypeAnnotation = isTypeAnnotation; exports.isTypeCastExpression = isTypeCastExpression; exports.isTypeParameter = isTypeParameter; exports.isTypeParameterDeclaration = isTypeParameterDeclaration; exports.isTypeParameterInstantiation = isTypeParameterInstantiation; exports.isTypeScript = isTypeScript; exports.isTypeofTypeAnnotation = isTypeofTypeAnnotation; exports.isUnaryExpression = isUnaryExpression; exports.isUnaryLike = isUnaryLike; exports.isUnionTypeAnnotation = isUnionTypeAnnotation; exports.isUpdateExpression = isUpdateExpression; exports.isUserWhitespacable = isUserWhitespacable; exports.isV8IntrinsicIdentifier = isV8IntrinsicIdentifier; exports.isVariableDeclaration = isVariableDeclaration; exports.isVariableDeclarator = isVariableDeclarator; exports.isVariance = isVariance; exports.isVoidPattern = isVoidPattern; exports.isVoidTypeAnnotation = isVoidTypeAnnotation; exports.isWhile = isWhile; exports.isWhileStatement = isWhileStatement; exports.isWithStatement = isWithStatement; exports.isYieldExpression = isYieldExpression; var _shallowEqual = __webpack_require__(/*! ../../utils/shallowEqual.js */ "./node_modules/@babel/types/lib/utils/shallowEqual.js"); var _deprecationWarning = __webpack_require__(/*! ../../utils/deprecationWarning.js */ "./node_modules/@babel/types/lib/utils/deprecationWarning.js"); function isArrayExpression(node, opts) { if (!node) return false; if (node.type !== "ArrayExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isAssignmentExpression(node, opts) { if (!node) return false; if (node.type !== "AssignmentExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isBinaryExpression(node, opts) { if (!node) return false; if (node.type !== "BinaryExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isInterpreterDirective(node, opts) { if (!node) return false; if (node.type !== "InterpreterDirective") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDirective(node, opts) { if (!node) return false; if (node.type !== "Directive") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDirectiveLiteral(node, opts) { if (!node) return false; if (node.type !== "DirectiveLiteral") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isBlockStatement(node, opts) { if (!node) return false; if (node.type !== "BlockStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isBreakStatement(node, opts) { if (!node) return false; if (node.type !== "BreakStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isCallExpression(node, opts) { if (!node) return false; if (node.type !== "CallExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isCatchClause(node, opts) { if (!node) return false; if (node.type !== "CatchClause") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isConditionalExpression(node, opts) { if (!node) return false; if (node.type !== "ConditionalExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isContinueStatement(node, opts) { if (!node) return false; if (node.type !== "ContinueStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDebuggerStatement(node, opts) { if (!node) return false; if (node.type !== "DebuggerStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDoWhileStatement(node, opts) { if (!node) return false; if (node.type !== "DoWhileStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isEmptyStatement(node, opts) { if (!node) return false; if (node.type !== "EmptyStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isExpressionStatement(node, opts) { if (!node) return false; if (node.type !== "ExpressionStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isFile(node, opts) { if (!node) return false; if (node.type !== "File") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isForInStatement(node, opts) { if (!node) return false; if (node.type !== "ForInStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isForStatement(node, opts) { if (!node) return false; if (node.type !== "ForStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isFunctionDeclaration(node, opts) { if (!node) return false; if (node.type !== "FunctionDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isFunctionExpression(node, opts) { if (!node) return false; if (node.type !== "FunctionExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isIdentifier(node, opts) { if (!node) return false; if (node.type !== "Identifier") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isIfStatement(node, opts) { if (!node) return false; if (node.type !== "IfStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isLabeledStatement(node, opts) { if (!node) return false; if (node.type !== "LabeledStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isStringLiteral(node, opts) { if (!node) return false; if (node.type !== "StringLiteral") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isNumericLiteral(node, opts) { if (!node) return false; if (node.type !== "NumericLiteral") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isNullLiteral(node, opts) { if (!node) return false; if (node.type !== "NullLiteral") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isBooleanLiteral(node, opts) { if (!node) return false; if (node.type !== "BooleanLiteral") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isRegExpLiteral(node, opts) { if (!node) return false; if (node.type !== "RegExpLiteral") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isLogicalExpression(node, opts) { if (!node) return false; if (node.type !== "LogicalExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isMemberExpression(node, opts) { if (!node) return false; if (node.type !== "MemberExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isNewExpression(node, opts) { if (!node) return false; if (node.type !== "NewExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isProgram(node, opts) { if (!node) return false; if (node.type !== "Program") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isObjectExpression(node, opts) { if (!node) return false; if (node.type !== "ObjectExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isObjectMethod(node, opts) { if (!node) return false; if (node.type !== "ObjectMethod") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isObjectProperty(node, opts) { if (!node) return false; if (node.type !== "ObjectProperty") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isRestElement(node, opts) { if (!node) return false; if (node.type !== "RestElement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isReturnStatement(node, opts) { if (!node) return false; if (node.type !== "ReturnStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isSequenceExpression(node, opts) { if (!node) return false; if (node.type !== "SequenceExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isParenthesizedExpression(node, opts) { if (!node) return false; if (node.type !== "ParenthesizedExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isSwitchCase(node, opts) { if (!node) return false; if (node.type !== "SwitchCase") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isSwitchStatement(node, opts) { if (!node) return false; if (node.type !== "SwitchStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isThisExpression(node, opts) { if (!node) return false; if (node.type !== "ThisExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isThrowStatement(node, opts) { if (!node) return false; if (node.type !== "ThrowStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTryStatement(node, opts) { if (!node) return false; if (node.type !== "TryStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isUnaryExpression(node, opts) { if (!node) return false; if (node.type !== "UnaryExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isUpdateExpression(node, opts) { if (!node) return false; if (node.type !== "UpdateExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isVariableDeclaration(node, opts) { if (!node) return false; if (node.type !== "VariableDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isVariableDeclarator(node, opts) { if (!node) return false; if (node.type !== "VariableDeclarator") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isWhileStatement(node, opts) { if (!node) return false; if (node.type !== "WhileStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isWithStatement(node, opts) { if (!node) return false; if (node.type !== "WithStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isAssignmentPattern(node, opts) { if (!node) return false; if (node.type !== "AssignmentPattern") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isArrayPattern(node, opts) { if (!node) return false; if (node.type !== "ArrayPattern") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isArrowFunctionExpression(node, opts) { if (!node) return false; if (node.type !== "ArrowFunctionExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isClassBody(node, opts) { if (!node) return false; if (node.type !== "ClassBody") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isClassExpression(node, opts) { if (!node) return false; if (node.type !== "ClassExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isClassDeclaration(node, opts) { if (!node) return false; if (node.type !== "ClassDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isExportAllDeclaration(node, opts) { if (!node) return false; if (node.type !== "ExportAllDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isExportDefaultDeclaration(node, opts) { if (!node) return false; if (node.type !== "ExportDefaultDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isExportNamedDeclaration(node, opts) { if (!node) return false; if (node.type !== "ExportNamedDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isExportSpecifier(node, opts) { if (!node) return false; if (node.type !== "ExportSpecifier") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isForOfStatement(node, opts) { if (!node) return false; if (node.type !== "ForOfStatement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isImportDeclaration(node, opts) { if (!node) return false; if (node.type !== "ImportDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isImportDefaultSpecifier(node, opts) { if (!node) return false; if (node.type !== "ImportDefaultSpecifier") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isImportNamespaceSpecifier(node, opts) { if (!node) return false; if (node.type !== "ImportNamespaceSpecifier") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isImportSpecifier(node, opts) { if (!node) return false; if (node.type !== "ImportSpecifier") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isImportExpression(node, opts) { if (!node) return false; if (node.type !== "ImportExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isMetaProperty(node, opts) { if (!node) return false; if (node.type !== "MetaProperty") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isClassMethod(node, opts) { if (!node) return false; if (node.type !== "ClassMethod") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isObjectPattern(node, opts) { if (!node) return false; if (node.type !== "ObjectPattern") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isSpreadElement(node, opts) { if (!node) return false; if (node.type !== "SpreadElement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isSuper(node, opts) { if (!node) return false; if (node.type !== "Super") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTaggedTemplateExpression(node, opts) { if (!node) return false; if (node.type !== "TaggedTemplateExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTemplateElement(node, opts) { if (!node) return false; if (node.type !== "TemplateElement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTemplateLiteral(node, opts) { if (!node) return false; if (node.type !== "TemplateLiteral") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isYieldExpression(node, opts) { if (!node) return false; if (node.type !== "YieldExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isAwaitExpression(node, opts) { if (!node) return false; if (node.type !== "AwaitExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isImport(node, opts) { if (!node) return false; if (node.type !== "Import") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isBigIntLiteral(node, opts) { if (!node) return false; if (node.type !== "BigIntLiteral") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isExportNamespaceSpecifier(node, opts) { if (!node) return false; if (node.type !== "ExportNamespaceSpecifier") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isOptionalMemberExpression(node, opts) { if (!node) return false; if (node.type !== "OptionalMemberExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isOptionalCallExpression(node, opts) { if (!node) return false; if (node.type !== "OptionalCallExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isClassProperty(node, opts) { if (!node) return false; if (node.type !== "ClassProperty") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isClassAccessorProperty(node, opts) { if (!node) return false; if (node.type !== "ClassAccessorProperty") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isClassPrivateProperty(node, opts) { if (!node) return false; if (node.type !== "ClassPrivateProperty") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isClassPrivateMethod(node, opts) { if (!node) return false; if (node.type !== "ClassPrivateMethod") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isPrivateName(node, opts) { if (!node) return false; if (node.type !== "PrivateName") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isStaticBlock(node, opts) { if (!node) return false; if (node.type !== "StaticBlock") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isImportAttribute(node, opts) { if (!node) return false; if (node.type !== "ImportAttribute") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isAnyTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "AnyTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isArrayTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "ArrayTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isBooleanTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "BooleanTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isBooleanLiteralTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "BooleanLiteralTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isNullLiteralTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "NullLiteralTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isClassImplements(node, opts) { if (!node) return false; if (node.type !== "ClassImplements") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDeclareClass(node, opts) { if (!node) return false; if (node.type !== "DeclareClass") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDeclareFunction(node, opts) { if (!node) return false; if (node.type !== "DeclareFunction") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDeclareInterface(node, opts) { if (!node) return false; if (node.type !== "DeclareInterface") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDeclareModule(node, opts) { if (!node) return false; if (node.type !== "DeclareModule") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDeclareModuleExports(node, opts) { if (!node) return false; if (node.type !== "DeclareModuleExports") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDeclareTypeAlias(node, opts) { if (!node) return false; if (node.type !== "DeclareTypeAlias") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDeclareOpaqueType(node, opts) { if (!node) return false; if (node.type !== "DeclareOpaqueType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDeclareVariable(node, opts) { if (!node) return false; if (node.type !== "DeclareVariable") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDeclareExportDeclaration(node, opts) { if (!node) return false; if (node.type !== "DeclareExportDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDeclareExportAllDeclaration(node, opts) { if (!node) return false; if (node.type !== "DeclareExportAllDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDeclaredPredicate(node, opts) { if (!node) return false; if (node.type !== "DeclaredPredicate") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isExistsTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "ExistsTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isFunctionTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "FunctionTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isFunctionTypeParam(node, opts) { if (!node) return false; if (node.type !== "FunctionTypeParam") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isGenericTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "GenericTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isInferredPredicate(node, opts) { if (!node) return false; if (node.type !== "InferredPredicate") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isInterfaceExtends(node, opts) { if (!node) return false; if (node.type !== "InterfaceExtends") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isInterfaceDeclaration(node, opts) { if (!node) return false; if (node.type !== "InterfaceDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isInterfaceTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "InterfaceTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isIntersectionTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "IntersectionTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isMixedTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "MixedTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isEmptyTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "EmptyTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isNullableTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "NullableTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isNumberLiteralTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "NumberLiteralTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isNumberTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "NumberTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isObjectTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "ObjectTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isObjectTypeInternalSlot(node, opts) { if (!node) return false; if (node.type !== "ObjectTypeInternalSlot") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isObjectTypeCallProperty(node, opts) { if (!node) return false; if (node.type !== "ObjectTypeCallProperty") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isObjectTypeIndexer(node, opts) { if (!node) return false; if (node.type !== "ObjectTypeIndexer") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isObjectTypeProperty(node, opts) { if (!node) return false; if (node.type !== "ObjectTypeProperty") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isObjectTypeSpreadProperty(node, opts) { if (!node) return false; if (node.type !== "ObjectTypeSpreadProperty") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isOpaqueType(node, opts) { if (!node) return false; if (node.type !== "OpaqueType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isQualifiedTypeIdentifier(node, opts) { if (!node) return false; if (node.type !== "QualifiedTypeIdentifier") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isStringLiteralTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "StringLiteralTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isStringTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "StringTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isSymbolTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "SymbolTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isThisTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "ThisTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTupleTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "TupleTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTypeofTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "TypeofTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTypeAlias(node, opts) { if (!node) return false; if (node.type !== "TypeAlias") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "TypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTypeCastExpression(node, opts) { if (!node) return false; if (node.type !== "TypeCastExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTypeParameter(node, opts) { if (!node) return false; if (node.type !== "TypeParameter") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTypeParameterDeclaration(node, opts) { if (!node) return false; if (node.type !== "TypeParameterDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTypeParameterInstantiation(node, opts) { if (!node) return false; if (node.type !== "TypeParameterInstantiation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isUnionTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "UnionTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isVariance(node, opts) { if (!node) return false; if (node.type !== "Variance") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isVoidTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "VoidTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isEnumDeclaration(node, opts) { if (!node) return false; if (node.type !== "EnumDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isEnumBooleanBody(node, opts) { if (!node) return false; if (node.type !== "EnumBooleanBody") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isEnumNumberBody(node, opts) { if (!node) return false; if (node.type !== "EnumNumberBody") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isEnumStringBody(node, opts) { if (!node) return false; if (node.type !== "EnumStringBody") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isEnumSymbolBody(node, opts) { if (!node) return false; if (node.type !== "EnumSymbolBody") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isEnumBooleanMember(node, opts) { if (!node) return false; if (node.type !== "EnumBooleanMember") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isEnumNumberMember(node, opts) { if (!node) return false; if (node.type !== "EnumNumberMember") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isEnumStringMember(node, opts) { if (!node) return false; if (node.type !== "EnumStringMember") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isEnumDefaultedMember(node, opts) { if (!node) return false; if (node.type !== "EnumDefaultedMember") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isIndexedAccessType(node, opts) { if (!node) return false; if (node.type !== "IndexedAccessType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isOptionalIndexedAccessType(node, opts) { if (!node) return false; if (node.type !== "OptionalIndexedAccessType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXAttribute(node, opts) { if (!node) return false; if (node.type !== "JSXAttribute") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXClosingElement(node, opts) { if (!node) return false; if (node.type !== "JSXClosingElement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXElement(node, opts) { if (!node) return false; if (node.type !== "JSXElement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXEmptyExpression(node, opts) { if (!node) return false; if (node.type !== "JSXEmptyExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXExpressionContainer(node, opts) { if (!node) return false; if (node.type !== "JSXExpressionContainer") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXSpreadChild(node, opts) { if (!node) return false; if (node.type !== "JSXSpreadChild") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXIdentifier(node, opts) { if (!node) return false; if (node.type !== "JSXIdentifier") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXMemberExpression(node, opts) { if (!node) return false; if (node.type !== "JSXMemberExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXNamespacedName(node, opts) { if (!node) return false; if (node.type !== "JSXNamespacedName") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXOpeningElement(node, opts) { if (!node) return false; if (node.type !== "JSXOpeningElement") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXSpreadAttribute(node, opts) { if (!node) return false; if (node.type !== "JSXSpreadAttribute") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXText(node, opts) { if (!node) return false; if (node.type !== "JSXText") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXFragment(node, opts) { if (!node) return false; if (node.type !== "JSXFragment") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXOpeningFragment(node, opts) { if (!node) return false; if (node.type !== "JSXOpeningFragment") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSXClosingFragment(node, opts) { if (!node) return false; if (node.type !== "JSXClosingFragment") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isNoop(node, opts) { if (!node) return false; if (node.type !== "Noop") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isPlaceholder(node, opts) { if (!node) return false; if (node.type !== "Placeholder") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isV8IntrinsicIdentifier(node, opts) { if (!node) return false; if (node.type !== "V8IntrinsicIdentifier") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isArgumentPlaceholder(node, opts) { if (!node) return false; if (node.type !== "ArgumentPlaceholder") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isBindExpression(node, opts) { if (!node) return false; if (node.type !== "BindExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDecorator(node, opts) { if (!node) return false; if (node.type !== "Decorator") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDoExpression(node, opts) { if (!node) return false; if (node.type !== "DoExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isExportDefaultSpecifier(node, opts) { if (!node) return false; if (node.type !== "ExportDefaultSpecifier") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isRecordExpression(node, opts) { if (!node) return false; if (node.type !== "RecordExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTupleExpression(node, opts) { if (!node) return false; if (node.type !== "TupleExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isDecimalLiteral(node, opts) { if (!node) return false; if (node.type !== "DecimalLiteral") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isModuleExpression(node, opts) { if (!node) return false; if (node.type !== "ModuleExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTopicReference(node, opts) { if (!node) return false; if (node.type !== "TopicReference") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isPipelineTopicExpression(node, opts) { if (!node) return false; if (node.type !== "PipelineTopicExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isPipelineBareFunction(node, opts) { if (!node) return false; if (node.type !== "PipelineBareFunction") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isPipelinePrimaryTopicReference(node, opts) { if (!node) return false; if (node.type !== "PipelinePrimaryTopicReference") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isVoidPattern(node, opts) { if (!node) return false; if (node.type !== "VoidPattern") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSParameterProperty(node, opts) { if (!node) return false; if (node.type !== "TSParameterProperty") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSDeclareFunction(node, opts) { if (!node) return false; if (node.type !== "TSDeclareFunction") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSDeclareMethod(node, opts) { if (!node) return false; if (node.type !== "TSDeclareMethod") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSQualifiedName(node, opts) { if (!node) return false; if (node.type !== "TSQualifiedName") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSCallSignatureDeclaration(node, opts) { if (!node) return false; if (node.type !== "TSCallSignatureDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSConstructSignatureDeclaration(node, opts) { if (!node) return false; if (node.type !== "TSConstructSignatureDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSPropertySignature(node, opts) { if (!node) return false; if (node.type !== "TSPropertySignature") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSMethodSignature(node, opts) { if (!node) return false; if (node.type !== "TSMethodSignature") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSIndexSignature(node, opts) { if (!node) return false; if (node.type !== "TSIndexSignature") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSAnyKeyword(node, opts) { if (!node) return false; if (node.type !== "TSAnyKeyword") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSBooleanKeyword(node, opts) { if (!node) return false; if (node.type !== "TSBooleanKeyword") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSBigIntKeyword(node, opts) { if (!node) return false; if (node.type !== "TSBigIntKeyword") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSIntrinsicKeyword(node, opts) { if (!node) return false; if (node.type !== "TSIntrinsicKeyword") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSNeverKeyword(node, opts) { if (!node) return false; if (node.type !== "TSNeverKeyword") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSNullKeyword(node, opts) { if (!node) return false; if (node.type !== "TSNullKeyword") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSNumberKeyword(node, opts) { if (!node) return false; if (node.type !== "TSNumberKeyword") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSObjectKeyword(node, opts) { if (!node) return false; if (node.type !== "TSObjectKeyword") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSStringKeyword(node, opts) { if (!node) return false; if (node.type !== "TSStringKeyword") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSSymbolKeyword(node, opts) { if (!node) return false; if (node.type !== "TSSymbolKeyword") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSUndefinedKeyword(node, opts) { if (!node) return false; if (node.type !== "TSUndefinedKeyword") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSUnknownKeyword(node, opts) { if (!node) return false; if (node.type !== "TSUnknownKeyword") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSVoidKeyword(node, opts) { if (!node) return false; if (node.type !== "TSVoidKeyword") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSThisType(node, opts) { if (!node) return false; if (node.type !== "TSThisType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSFunctionType(node, opts) { if (!node) return false; if (node.type !== "TSFunctionType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSConstructorType(node, opts) { if (!node) return false; if (node.type !== "TSConstructorType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSTypeReference(node, opts) { if (!node) return false; if (node.type !== "TSTypeReference") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSTypePredicate(node, opts) { if (!node) return false; if (node.type !== "TSTypePredicate") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSTypeQuery(node, opts) { if (!node) return false; if (node.type !== "TSTypeQuery") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSTypeLiteral(node, opts) { if (!node) return false; if (node.type !== "TSTypeLiteral") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSArrayType(node, opts) { if (!node) return false; if (node.type !== "TSArrayType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSTupleType(node, opts) { if (!node) return false; if (node.type !== "TSTupleType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSOptionalType(node, opts) { if (!node) return false; if (node.type !== "TSOptionalType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSRestType(node, opts) { if (!node) return false; if (node.type !== "TSRestType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSNamedTupleMember(node, opts) { if (!node) return false; if (node.type !== "TSNamedTupleMember") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSUnionType(node, opts) { if (!node) return false; if (node.type !== "TSUnionType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSIntersectionType(node, opts) { if (!node) return false; if (node.type !== "TSIntersectionType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSConditionalType(node, opts) { if (!node) return false; if (node.type !== "TSConditionalType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSInferType(node, opts) { if (!node) return false; if (node.type !== "TSInferType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSParenthesizedType(node, opts) { if (!node) return false; if (node.type !== "TSParenthesizedType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSTypeOperator(node, opts) { if (!node) return false; if (node.type !== "TSTypeOperator") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSIndexedAccessType(node, opts) { if (!node) return false; if (node.type !== "TSIndexedAccessType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSMappedType(node, opts) { if (!node) return false; if (node.type !== "TSMappedType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSTemplateLiteralType(node, opts) { if (!node) return false; if (node.type !== "TSTemplateLiteralType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSLiteralType(node, opts) { if (!node) return false; if (node.type !== "TSLiteralType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSExpressionWithTypeArguments(node, opts) { if (!node) return false; if (node.type !== "TSExpressionWithTypeArguments") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSInterfaceDeclaration(node, opts) { if (!node) return false; if (node.type !== "TSInterfaceDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSInterfaceBody(node, opts) { if (!node) return false; if (node.type !== "TSInterfaceBody") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSTypeAliasDeclaration(node, opts) { if (!node) return false; if (node.type !== "TSTypeAliasDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSInstantiationExpression(node, opts) { if (!node) return false; if (node.type !== "TSInstantiationExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSAsExpression(node, opts) { if (!node) return false; if (node.type !== "TSAsExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSSatisfiesExpression(node, opts) { if (!node) return false; if (node.type !== "TSSatisfiesExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSTypeAssertion(node, opts) { if (!node) return false; if (node.type !== "TSTypeAssertion") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSEnumBody(node, opts) { if (!node) return false; if (node.type !== "TSEnumBody") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSEnumDeclaration(node, opts) { if (!node) return false; if (node.type !== "TSEnumDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSEnumMember(node, opts) { if (!node) return false; if (node.type !== "TSEnumMember") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSModuleDeclaration(node, opts) { if (!node) return false; if (node.type !== "TSModuleDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSModuleBlock(node, opts) { if (!node) return false; if (node.type !== "TSModuleBlock") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSImportType(node, opts) { if (!node) return false; if (node.type !== "TSImportType") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSImportEqualsDeclaration(node, opts) { if (!node) return false; if (node.type !== "TSImportEqualsDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSExternalModuleReference(node, opts) { if (!node) return false; if (node.type !== "TSExternalModuleReference") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSNonNullExpression(node, opts) { if (!node) return false; if (node.type !== "TSNonNullExpression") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSExportAssignment(node, opts) { if (!node) return false; if (node.type !== "TSExportAssignment") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSNamespaceExportDeclaration(node, opts) { if (!node) return false; if (node.type !== "TSNamespaceExportDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSTypeAnnotation(node, opts) { if (!node) return false; if (node.type !== "TSTypeAnnotation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSTypeParameterInstantiation(node, opts) { if (!node) return false; if (node.type !== "TSTypeParameterInstantiation") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSTypeParameterDeclaration(node, opts) { if (!node) return false; if (node.type !== "TSTypeParameterDeclaration") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSTypeParameter(node, opts) { if (!node) return false; if (node.type !== "TSTypeParameter") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isStandardized(node, opts) { if (!node) return false; switch (node.type) { case "ArrayExpression": case "AssignmentExpression": case "BinaryExpression": case "InterpreterDirective": case "Directive": case "DirectiveLiteral": case "BlockStatement": case "BreakStatement": case "CallExpression": case "CatchClause": case "ConditionalExpression": case "ContinueStatement": case "DebuggerStatement": case "DoWhileStatement": case "EmptyStatement": case "ExpressionStatement": case "File": case "ForInStatement": case "ForStatement": case "FunctionDeclaration": case "FunctionExpression": case "Identifier": case "IfStatement": case "LabeledStatement": case "StringLiteral": case "NumericLiteral": case "NullLiteral": case "BooleanLiteral": case "RegExpLiteral": case "LogicalExpression": case "MemberExpression": case "NewExpression": case "Program": case "ObjectExpression": case "ObjectMethod": case "ObjectProperty": case "RestElement": case "ReturnStatement": case "SequenceExpression": case "ParenthesizedExpression": case "SwitchCase": case "SwitchStatement": case "ThisExpression": case "ThrowStatement": case "TryStatement": case "UnaryExpression": case "UpdateExpression": case "VariableDeclaration": case "VariableDeclarator": case "WhileStatement": case "WithStatement": case "AssignmentPattern": case "ArrayPattern": case "ArrowFunctionExpression": case "ClassBody": case "ClassExpression": case "ClassDeclaration": case "ExportAllDeclaration": case "ExportDefaultDeclaration": case "ExportNamedDeclaration": case "ExportSpecifier": case "ForOfStatement": case "ImportDeclaration": case "ImportDefaultSpecifier": case "ImportNamespaceSpecifier": case "ImportSpecifier": case "ImportExpression": case "MetaProperty": case "ClassMethod": case "ObjectPattern": case "SpreadElement": case "Super": case "TaggedTemplateExpression": case "TemplateElement": case "TemplateLiteral": case "YieldExpression": case "AwaitExpression": case "Import": case "BigIntLiteral": case "ExportNamespaceSpecifier": case "OptionalMemberExpression": case "OptionalCallExpression": case "ClassProperty": case "ClassAccessorProperty": case "ClassPrivateProperty": case "ClassPrivateMethod": case "PrivateName": case "StaticBlock": case "ImportAttribute": break; case "Placeholder": switch (node.expectedNode) { case "Identifier": case "StringLiteral": case "BlockStatement": case "ClassBody": break; default: return false; } break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isExpression(node, opts) { if (!node) return false; switch (node.type) { case "ArrayExpression": case "AssignmentExpression": case "BinaryExpression": case "CallExpression": case "ConditionalExpression": case "FunctionExpression": case "Identifier": case "StringLiteral": case "NumericLiteral": case "NullLiteral": case "BooleanLiteral": case "RegExpLiteral": case "LogicalExpression": case "MemberExpression": case "NewExpression": case "ObjectExpression": case "SequenceExpression": case "ParenthesizedExpression": case "ThisExpression": case "UnaryExpression": case "UpdateExpression": case "ArrowFunctionExpression": case "ClassExpression": case "ImportExpression": case "MetaProperty": case "Super": case "TaggedTemplateExpression": case "TemplateLiteral": case "YieldExpression": case "AwaitExpression": case "Import": case "BigIntLiteral": case "OptionalMemberExpression": case "OptionalCallExpression": case "TypeCastExpression": case "JSXElement": case "JSXFragment": case "BindExpression": case "DoExpression": case "RecordExpression": case "TupleExpression": case "DecimalLiteral": case "ModuleExpression": case "TopicReference": case "PipelineTopicExpression": case "PipelineBareFunction": case "PipelinePrimaryTopicReference": case "TSInstantiationExpression": case "TSAsExpression": case "TSSatisfiesExpression": case "TSTypeAssertion": case "TSNonNullExpression": break; case "Placeholder": switch (node.expectedNode) { case "Expression": case "Identifier": case "StringLiteral": break; default: return false; } break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isBinary(node, opts) { if (!node) return false; switch (node.type) { case "BinaryExpression": case "LogicalExpression": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isScopable(node, opts) { if (!node) return false; switch (node.type) { case "BlockStatement": case "CatchClause": case "DoWhileStatement": case "ForInStatement": case "ForStatement": case "FunctionDeclaration": case "FunctionExpression": case "Program": case "ObjectMethod": case "SwitchStatement": case "WhileStatement": case "ArrowFunctionExpression": case "ClassExpression": case "ClassDeclaration": case "ForOfStatement": case "ClassMethod": case "ClassPrivateMethod": case "StaticBlock": case "TSModuleBlock": break; case "Placeholder": if (node.expectedNode === "BlockStatement") break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isBlockParent(node, opts) { if (!node) return false; switch (node.type) { case "BlockStatement": case "CatchClause": case "DoWhileStatement": case "ForInStatement": case "ForStatement": case "FunctionDeclaration": case "FunctionExpression": case "Program": case "ObjectMethod": case "SwitchStatement": case "WhileStatement": case "ArrowFunctionExpression": case "ForOfStatement": case "ClassMethod": case "ClassPrivateMethod": case "StaticBlock": case "TSModuleBlock": break; case "Placeholder": if (node.expectedNode === "BlockStatement") break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isBlock(node, opts) { if (!node) return false; switch (node.type) { case "BlockStatement": case "Program": case "TSModuleBlock": break; case "Placeholder": if (node.expectedNode === "BlockStatement") break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isStatement(node, opts) { if (!node) return false; switch (node.type) { case "BlockStatement": case "BreakStatement": case "ContinueStatement": case "DebuggerStatement": case "DoWhileStatement": case "EmptyStatement": case "ExpressionStatement": case "ForInStatement": case "ForStatement": case "FunctionDeclaration": case "IfStatement": case "LabeledStatement": case "ReturnStatement": case "SwitchStatement": case "ThrowStatement": case "TryStatement": case "VariableDeclaration": case "WhileStatement": case "WithStatement": case "ClassDeclaration": case "ExportAllDeclaration": case "ExportDefaultDeclaration": case "ExportNamedDeclaration": case "ForOfStatement": case "ImportDeclaration": case "DeclareClass": case "DeclareFunction": case "DeclareInterface": case "DeclareModule": case "DeclareModuleExports": case "DeclareTypeAlias": case "DeclareOpaqueType": case "DeclareVariable": case "DeclareExportDeclaration": case "DeclareExportAllDeclaration": case "InterfaceDeclaration": case "OpaqueType": case "TypeAlias": case "EnumDeclaration": case "TSDeclareFunction": case "TSInterfaceDeclaration": case "TSTypeAliasDeclaration": case "TSEnumDeclaration": case "TSModuleDeclaration": case "TSImportEqualsDeclaration": case "TSExportAssignment": case "TSNamespaceExportDeclaration": break; case "Placeholder": switch (node.expectedNode) { case "Statement": case "Declaration": case "BlockStatement": break; default: return false; } break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isTerminatorless(node, opts) { if (!node) return false; switch (node.type) { case "BreakStatement": case "ContinueStatement": case "ReturnStatement": case "ThrowStatement": case "YieldExpression": case "AwaitExpression": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isCompletionStatement(node, opts) { if (!node) return false; switch (node.type) { case "BreakStatement": case "ContinueStatement": case "ReturnStatement": case "ThrowStatement": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isConditional(node, opts) { if (!node) return false; switch (node.type) { case "ConditionalExpression": case "IfStatement": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isLoop(node, opts) { if (!node) return false; switch (node.type) { case "DoWhileStatement": case "ForInStatement": case "ForStatement": case "WhileStatement": case "ForOfStatement": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isWhile(node, opts) { if (!node) return false; switch (node.type) { case "DoWhileStatement": case "WhileStatement": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isExpressionWrapper(node, opts) { if (!node) return false; switch (node.type) { case "ExpressionStatement": case "ParenthesizedExpression": case "TypeCastExpression": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isFor(node, opts) { if (!node) return false; switch (node.type) { case "ForInStatement": case "ForStatement": case "ForOfStatement": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isForXStatement(node, opts) { if (!node) return false; switch (node.type) { case "ForInStatement": case "ForOfStatement": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isFunction(node, opts) { if (!node) return false; switch (node.type) { case "FunctionDeclaration": case "FunctionExpression": case "ObjectMethod": case "ArrowFunctionExpression": case "ClassMethod": case "ClassPrivateMethod": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isFunctionParent(node, opts) { if (!node) return false; switch (node.type) { case "FunctionDeclaration": case "FunctionExpression": case "ObjectMethod": case "ArrowFunctionExpression": case "ClassMethod": case "ClassPrivateMethod": case "StaticBlock": case "TSModuleBlock": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isPureish(node, opts) { if (!node) return false; switch (node.type) { case "FunctionDeclaration": case "FunctionExpression": case "StringLiteral": case "NumericLiteral": case "NullLiteral": case "BooleanLiteral": case "RegExpLiteral": case "ArrowFunctionExpression": case "BigIntLiteral": case "DecimalLiteral": break; case "Placeholder": if (node.expectedNode === "StringLiteral") break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isDeclaration(node, opts) { if (!node) return false; switch (node.type) { case "FunctionDeclaration": case "VariableDeclaration": case "ClassDeclaration": case "ExportAllDeclaration": case "ExportDefaultDeclaration": case "ExportNamedDeclaration": case "ImportDeclaration": case "DeclareClass": case "DeclareFunction": case "DeclareInterface": case "DeclareModule": case "DeclareModuleExports": case "DeclareTypeAlias": case "DeclareOpaqueType": case "DeclareVariable": case "DeclareExportDeclaration": case "DeclareExportAllDeclaration": case "InterfaceDeclaration": case "OpaqueType": case "TypeAlias": case "EnumDeclaration": case "TSDeclareFunction": case "TSInterfaceDeclaration": case "TSTypeAliasDeclaration": case "TSEnumDeclaration": case "TSModuleDeclaration": case "TSImportEqualsDeclaration": break; case "Placeholder": if (node.expectedNode === "Declaration") break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isFunctionParameter(node, opts) { if (!node) return false; switch (node.type) { case "Identifier": case "RestElement": case "AssignmentPattern": case "ArrayPattern": case "ObjectPattern": case "VoidPattern": break; case "Placeholder": if (node.expectedNode === "Identifier") break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isPatternLike(node, opts) { if (!node) return false; switch (node.type) { case "Identifier": case "MemberExpression": case "RestElement": case "AssignmentPattern": case "ArrayPattern": case "ObjectPattern": case "VoidPattern": case "TSAsExpression": case "TSSatisfiesExpression": case "TSTypeAssertion": case "TSNonNullExpression": break; case "Placeholder": switch (node.expectedNode) { case "Pattern": case "Identifier": break; default: return false; } break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isLVal(node, opts) { if (!node) return false; switch (node.type) { case "Identifier": case "MemberExpression": case "RestElement": case "AssignmentPattern": case "ArrayPattern": case "ObjectPattern": case "TSParameterProperty": case "TSAsExpression": case "TSSatisfiesExpression": case "TSTypeAssertion": case "TSNonNullExpression": break; case "Placeholder": switch (node.expectedNode) { case "Pattern": case "Identifier": break; default: return false; } break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSEntityName(node, opts) { if (!node) return false; switch (node.type) { case "Identifier": case "TSQualifiedName": break; case "Placeholder": if (node.expectedNode === "Identifier") break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isLiteral(node, opts) { if (!node) return false; switch (node.type) { case "StringLiteral": case "NumericLiteral": case "NullLiteral": case "BooleanLiteral": case "RegExpLiteral": case "TemplateLiteral": case "BigIntLiteral": case "DecimalLiteral": break; case "Placeholder": if (node.expectedNode === "StringLiteral") break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isImmutable(node, opts) { if (!node) return false; switch (node.type) { case "StringLiteral": case "NumericLiteral": case "NullLiteral": case "BooleanLiteral": case "BigIntLiteral": case "JSXAttribute": case "JSXClosingElement": case "JSXElement": case "JSXExpressionContainer": case "JSXSpreadChild": case "JSXOpeningElement": case "JSXText": case "JSXFragment": case "JSXOpeningFragment": case "JSXClosingFragment": case "DecimalLiteral": break; case "Placeholder": if (node.expectedNode === "StringLiteral") break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isUserWhitespacable(node, opts) { if (!node) return false; switch (node.type) { case "ObjectMethod": case "ObjectProperty": case "ObjectTypeInternalSlot": case "ObjectTypeCallProperty": case "ObjectTypeIndexer": case "ObjectTypeProperty": case "ObjectTypeSpreadProperty": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isMethod(node, opts) { if (!node) return false; switch (node.type) { case "ObjectMethod": case "ClassMethod": case "ClassPrivateMethod": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isObjectMember(node, opts) { if (!node) return false; switch (node.type) { case "ObjectMethod": case "ObjectProperty": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isProperty(node, opts) { if (!node) return false; switch (node.type) { case "ObjectProperty": case "ClassProperty": case "ClassAccessorProperty": case "ClassPrivateProperty": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isUnaryLike(node, opts) { if (!node) return false; switch (node.type) { case "UnaryExpression": case "SpreadElement": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isPattern(node, opts) { if (!node) return false; switch (node.type) { case "AssignmentPattern": case "ArrayPattern": case "ObjectPattern": case "VoidPattern": break; case "Placeholder": if (node.expectedNode === "Pattern") break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isClass(node, opts) { if (!node) return false; switch (node.type) { case "ClassExpression": case "ClassDeclaration": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isImportOrExportDeclaration(node, opts) { if (!node) return false; switch (node.type) { case "ExportAllDeclaration": case "ExportDefaultDeclaration": case "ExportNamedDeclaration": case "ImportDeclaration": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isExportDeclaration(node, opts) { if (!node) return false; switch (node.type) { case "ExportAllDeclaration": case "ExportDefaultDeclaration": case "ExportNamedDeclaration": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isModuleSpecifier(node, opts) { if (!node) return false; switch (node.type) { case "ExportSpecifier": case "ImportDefaultSpecifier": case "ImportNamespaceSpecifier": case "ImportSpecifier": case "ExportNamespaceSpecifier": case "ExportDefaultSpecifier": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isAccessor(node, opts) { if (!node) return false; switch (node.type) { case "ClassAccessorProperty": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isPrivate(node, opts) { if (!node) return false; switch (node.type) { case "ClassPrivateProperty": case "ClassPrivateMethod": case "PrivateName": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isFlow(node, opts) { if (!node) return false; switch (node.type) { case "AnyTypeAnnotation": case "ArrayTypeAnnotation": case "BooleanTypeAnnotation": case "BooleanLiteralTypeAnnotation": case "NullLiteralTypeAnnotation": case "ClassImplements": case "DeclareClass": case "DeclareFunction": case "DeclareInterface": case "DeclareModule": case "DeclareModuleExports": case "DeclareTypeAlias": case "DeclareOpaqueType": case "DeclareVariable": case "DeclareExportDeclaration": case "DeclareExportAllDeclaration": case "DeclaredPredicate": case "ExistsTypeAnnotation": case "FunctionTypeAnnotation": case "FunctionTypeParam": case "GenericTypeAnnotation": case "InferredPredicate": case "InterfaceExtends": case "InterfaceDeclaration": case "InterfaceTypeAnnotation": case "IntersectionTypeAnnotation": case "MixedTypeAnnotation": case "EmptyTypeAnnotation": case "NullableTypeAnnotation": case "NumberLiteralTypeAnnotation": case "NumberTypeAnnotation": case "ObjectTypeAnnotation": case "ObjectTypeInternalSlot": case "ObjectTypeCallProperty": case "ObjectTypeIndexer": case "ObjectTypeProperty": case "ObjectTypeSpreadProperty": case "OpaqueType": case "QualifiedTypeIdentifier": case "StringLiteralTypeAnnotation": case "StringTypeAnnotation": case "SymbolTypeAnnotation": case "ThisTypeAnnotation": case "TupleTypeAnnotation": case "TypeofTypeAnnotation": case "TypeAlias": case "TypeAnnotation": case "TypeCastExpression": case "TypeParameter": case "TypeParameterDeclaration": case "TypeParameterInstantiation": case "UnionTypeAnnotation": case "Variance": case "VoidTypeAnnotation": case "EnumDeclaration": case "EnumBooleanBody": case "EnumNumberBody": case "EnumStringBody": case "EnumSymbolBody": case "EnumBooleanMember": case "EnumNumberMember": case "EnumStringMember": case "EnumDefaultedMember": case "IndexedAccessType": case "OptionalIndexedAccessType": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isFlowType(node, opts) { if (!node) return false; switch (node.type) { case "AnyTypeAnnotation": case "ArrayTypeAnnotation": case "BooleanTypeAnnotation": case "BooleanLiteralTypeAnnotation": case "NullLiteralTypeAnnotation": case "ExistsTypeAnnotation": case "FunctionTypeAnnotation": case "GenericTypeAnnotation": case "InterfaceTypeAnnotation": case "IntersectionTypeAnnotation": case "MixedTypeAnnotation": case "EmptyTypeAnnotation": case "NullableTypeAnnotation": case "NumberLiteralTypeAnnotation": case "NumberTypeAnnotation": case "ObjectTypeAnnotation": case "StringLiteralTypeAnnotation": case "StringTypeAnnotation": case "SymbolTypeAnnotation": case "ThisTypeAnnotation": case "TupleTypeAnnotation": case "TypeofTypeAnnotation": case "UnionTypeAnnotation": case "VoidTypeAnnotation": case "IndexedAccessType": case "OptionalIndexedAccessType": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isFlowBaseAnnotation(node, opts) { if (!node) return false; switch (node.type) { case "AnyTypeAnnotation": case "BooleanTypeAnnotation": case "NullLiteralTypeAnnotation": case "MixedTypeAnnotation": case "EmptyTypeAnnotation": case "NumberTypeAnnotation": case "StringTypeAnnotation": case "SymbolTypeAnnotation": case "ThisTypeAnnotation": case "VoidTypeAnnotation": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isFlowDeclaration(node, opts) { if (!node) return false; switch (node.type) { case "DeclareClass": case "DeclareFunction": case "DeclareInterface": case "DeclareModule": case "DeclareModuleExports": case "DeclareTypeAlias": case "DeclareOpaqueType": case "DeclareVariable": case "DeclareExportDeclaration": case "DeclareExportAllDeclaration": case "InterfaceDeclaration": case "OpaqueType": case "TypeAlias": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isFlowPredicate(node, opts) { if (!node) return false; switch (node.type) { case "DeclaredPredicate": case "InferredPredicate": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isEnumBody(node, opts) { if (!node) return false; switch (node.type) { case "EnumBooleanBody": case "EnumNumberBody": case "EnumStringBody": case "EnumSymbolBody": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isEnumMember(node, opts) { if (!node) return false; switch (node.type) { case "EnumBooleanMember": case "EnumNumberMember": case "EnumStringMember": case "EnumDefaultedMember": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isJSX(node, opts) { if (!node) return false; switch (node.type) { case "JSXAttribute": case "JSXClosingElement": case "JSXElement": case "JSXEmptyExpression": case "JSXExpressionContainer": case "JSXSpreadChild": case "JSXIdentifier": case "JSXMemberExpression": case "JSXNamespacedName": case "JSXOpeningElement": case "JSXSpreadAttribute": case "JSXText": case "JSXFragment": case "JSXOpeningFragment": case "JSXClosingFragment": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isMiscellaneous(node, opts) { if (!node) return false; switch (node.type) { case "Noop": case "Placeholder": case "V8IntrinsicIdentifier": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isTypeScript(node, opts) { if (!node) return false; switch (node.type) { case "TSParameterProperty": case "TSDeclareFunction": case "TSDeclareMethod": case "TSQualifiedName": case "TSCallSignatureDeclaration": case "TSConstructSignatureDeclaration": case "TSPropertySignature": case "TSMethodSignature": case "TSIndexSignature": case "TSAnyKeyword": case "TSBooleanKeyword": case "TSBigIntKeyword": case "TSIntrinsicKeyword": case "TSNeverKeyword": case "TSNullKeyword": case "TSNumberKeyword": case "TSObjectKeyword": case "TSStringKeyword": case "TSSymbolKeyword": case "TSUndefinedKeyword": case "TSUnknownKeyword": case "TSVoidKeyword": case "TSThisType": case "TSFunctionType": case "TSConstructorType": case "TSTypeReference": case "TSTypePredicate": case "TSTypeQuery": case "TSTypeLiteral": case "TSArrayType": case "TSTupleType": case "TSOptionalType": case "TSRestType": case "TSNamedTupleMember": case "TSUnionType": case "TSIntersectionType": case "TSConditionalType": case "TSInferType": case "TSParenthesizedType": case "TSTypeOperator": case "TSIndexedAccessType": case "TSMappedType": case "TSTemplateLiteralType": case "TSLiteralType": case "TSExpressionWithTypeArguments": case "TSInterfaceDeclaration": case "TSInterfaceBody": case "TSTypeAliasDeclaration": case "TSInstantiationExpression": case "TSAsExpression": case "TSSatisfiesExpression": case "TSTypeAssertion": case "TSEnumBody": case "TSEnumDeclaration": case "TSEnumMember": case "TSModuleDeclaration": case "TSModuleBlock": case "TSImportType": case "TSImportEqualsDeclaration": case "TSExternalModuleReference": case "TSNonNullExpression": case "TSExportAssignment": case "TSNamespaceExportDeclaration": case "TSTypeAnnotation": case "TSTypeParameterInstantiation": case "TSTypeParameterDeclaration": case "TSTypeParameter": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSTypeElement(node, opts) { if (!node) return false; switch (node.type) { case "TSCallSignatureDeclaration": case "TSConstructSignatureDeclaration": case "TSPropertySignature": case "TSMethodSignature": case "TSIndexSignature": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSType(node, opts) { if (!node) return false; switch (node.type) { case "TSAnyKeyword": case "TSBooleanKeyword": case "TSBigIntKeyword": case "TSIntrinsicKeyword": case "TSNeverKeyword": case "TSNullKeyword": case "TSNumberKeyword": case "TSObjectKeyword": case "TSStringKeyword": case "TSSymbolKeyword": case "TSUndefinedKeyword": case "TSUnknownKeyword": case "TSVoidKeyword": case "TSThisType": case "TSFunctionType": case "TSConstructorType": case "TSTypeReference": case "TSTypePredicate": case "TSTypeQuery": case "TSTypeLiteral": case "TSArrayType": case "TSTupleType": case "TSOptionalType": case "TSRestType": case "TSUnionType": case "TSIntersectionType": case "TSConditionalType": case "TSInferType": case "TSParenthesizedType": case "TSTypeOperator": case "TSIndexedAccessType": case "TSMappedType": case "TSTemplateLiteralType": case "TSLiteralType": case "TSExpressionWithTypeArguments": case "TSImportType": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isTSBaseType(node, opts) { if (!node) return false; switch (node.type) { case "TSAnyKeyword": case "TSBooleanKeyword": case "TSBigIntKeyword": case "TSIntrinsicKeyword": case "TSNeverKeyword": case "TSNullKeyword": case "TSNumberKeyword": case "TSObjectKeyword": case "TSStringKeyword": case "TSSymbolKeyword": case "TSUndefinedKeyword": case "TSUnknownKeyword": case "TSVoidKeyword": case "TSThisType": case "TSTemplateLiteralType": case "TSLiteralType": break; default: return false; } return opts == null || (0, _shallowEqual.default)(node, opts); } function isNumberLiteral(node, opts) { (0, _deprecationWarning.default)("isNumberLiteral", "isNumericLiteral"); if (!node) return false; if (node.type !== "NumberLiteral") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isRegexLiteral(node, opts) { (0, _deprecationWarning.default)("isRegexLiteral", "isRegExpLiteral"); if (!node) return false; if (node.type !== "RegexLiteral") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isRestProperty(node, opts) { (0, _deprecationWarning.default)("isRestProperty", "isRestElement"); if (!node) return false; if (node.type !== "RestProperty") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isSpreadProperty(node, opts) { (0, _deprecationWarning.default)("isSpreadProperty", "isSpreadElement"); if (!node) return false; if (node.type !== "SpreadProperty") return false; return opts == null || (0, _shallowEqual.default)(node, opts); } function isModuleDeclaration(node, opts) { (0, _deprecationWarning.default)("isModuleDeclaration", "isImportOrExportDeclaration"); return isImportOrExportDeclaration(node, opts); } //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/is.js": /*!********************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/is.js ***! \********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = is; var _shallowEqual = __webpack_require__(/*! ../utils/shallowEqual.js */ "./node_modules/@babel/types/lib/utils/shallowEqual.js"); var _isType = __webpack_require__(/*! ./isType.js */ "./node_modules/@babel/types/lib/validators/isType.js"); var _isPlaceholderType = __webpack_require__(/*! ./isPlaceholderType.js */ "./node_modules/@babel/types/lib/validators/isPlaceholderType.js"); var _index = __webpack_require__(/*! ../definitions/index.js */ "./node_modules/@babel/types/lib/definitions/index.js"); function is(type, node, opts) { if (!node) return false; const matches = (0, _isType.default)(node.type, type); if (!matches) { if (!opts && node.type === "Placeholder" && type in _index.FLIPPED_ALIAS_KEYS) { return (0, _isPlaceholderType.default)(node.expectedNode, type); } return false; } if (opts === undefined) { return true; } else { return (0, _shallowEqual.default)(node, opts); } } //# sourceMappingURL=is.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/isBinding.js": /*!***************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/isBinding.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isBinding; var _getBindingIdentifiers = __webpack_require__(/*! ../retrievers/getBindingIdentifiers.js */ "./node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js"); function isBinding(node, parent, grandparent) { if (grandparent && node.type === "Identifier" && parent.type === "ObjectProperty" && grandparent.type === "ObjectExpression") { return false; } const keys = _getBindingIdentifiers.default.keys[parent.type]; if (keys) { for (let i = 0; i < keys.length; i++) { const key = keys[i]; const val = parent[key]; if (Array.isArray(val)) { if (val.includes(node)) return true; } else { if (val === node) return true; } } } return false; } //# sourceMappingURL=isBinding.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/isBlockScoped.js": /*!*******************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/isBlockScoped.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isBlockScoped; var _index = __webpack_require__(/*! ./generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); var _isLet = __webpack_require__(/*! ./isLet.js */ "./node_modules/@babel/types/lib/validators/isLet.js"); function isBlockScoped(node) { return (0, _index.isFunctionDeclaration)(node) || (0, _index.isClassDeclaration)(node) || (0, _isLet.default)(node); } //# sourceMappingURL=isBlockScoped.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/isImmutable.js": /*!*****************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/isImmutable.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isImmutable; var _isType = __webpack_require__(/*! ./isType.js */ "./node_modules/@babel/types/lib/validators/isType.js"); var _index = __webpack_require__(/*! ./generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); function isImmutable(node) { if ((0, _isType.default)(node.type, "Immutable")) return true; if ((0, _index.isIdentifier)(node)) { if (node.name === "undefined") { return true; } else { return false; } } return false; } //# sourceMappingURL=isImmutable.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/isLet.js": /*!***********************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/isLet.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isLet; var _index = __webpack_require__(/*! ./generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); { var BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped"); } function isLet(node) { { return (0, _index.isVariableDeclaration)(node) && (node.kind !== "var" || node[BLOCK_SCOPED_SYMBOL]); } } //# sourceMappingURL=isLet.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/isNode.js": /*!************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/isNode.js ***! \************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isNode; var _index = __webpack_require__(/*! ../definitions/index.js */ "./node_modules/@babel/types/lib/definitions/index.js"); function isNode(node) { return !!(node && _index.VISITOR_KEYS[node.type]); } //# sourceMappingURL=isNode.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/isNodesEquivalent.js": /*!***********************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/isNodesEquivalent.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isNodesEquivalent; var _index = __webpack_require__(/*! ../definitions/index.js */ "./node_modules/@babel/types/lib/definitions/index.js"); function isNodesEquivalent(a, b) { if (typeof a !== "object" || typeof b !== "object" || a == null || b == null) { return a === b; } if (a.type !== b.type) { return false; } const fields = Object.keys(_index.NODE_FIELDS[a.type] || a.type); const visitorKeys = _index.VISITOR_KEYS[a.type]; for (const field of fields) { const val_a = a[field]; const val_b = b[field]; if (typeof val_a !== typeof val_b) { return false; } if (val_a == null && val_b == null) { continue; } else if (val_a == null || val_b == null) { return false; } if (Array.isArray(val_a)) { if (!Array.isArray(val_b)) { return false; } if (val_a.length !== val_b.length) { return false; } for (let i = 0; i < val_a.length; i++) { if (!isNodesEquivalent(val_a[i], val_b[i])) { return false; } } continue; } if (typeof val_a === "object" && !(visitorKeys != null && visitorKeys.includes(field))) { for (const key of Object.keys(val_a)) { if (val_a[key] !== val_b[key]) { return false; } } continue; } if (!isNodesEquivalent(val_a, val_b)) { return false; } } return true; } //# sourceMappingURL=isNodesEquivalent.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/isPlaceholderType.js": /*!***********************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/isPlaceholderType.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isPlaceholderType; var _index = __webpack_require__(/*! ../definitions/index.js */ "./node_modules/@babel/types/lib/definitions/index.js"); function isPlaceholderType(placeholderType, targetType) { if (placeholderType === targetType) return true; const aliases = _index.PLACEHOLDERS_ALIAS[placeholderType]; if (aliases != null && aliases.includes(targetType)) return true; return false; } //# sourceMappingURL=isPlaceholderType.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/isReferenced.js": /*!******************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/isReferenced.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isReferenced; function isReferenced(node, parent, grandparent) { switch (parent.type) { case "MemberExpression": case "OptionalMemberExpression": if (parent.property === node) { return !!parent.computed; } return parent.object === node; case "JSXMemberExpression": return parent.object === node; case "VariableDeclarator": return parent.init === node; case "ArrowFunctionExpression": return parent.body === node; case "PrivateName": return false; case "ClassMethod": case "ClassPrivateMethod": case "ObjectMethod": if (parent.key === node) { return !!parent.computed; } return false; case "ObjectProperty": if (parent.key === node) { return !!parent.computed; } return !grandparent || grandparent.type !== "ObjectPattern"; case "ClassProperty": case "ClassAccessorProperty": if (parent.key === node) { return !!parent.computed; } return true; case "ClassPrivateProperty": return parent.key !== node; case "ClassDeclaration": case "ClassExpression": return parent.superClass === node; case "AssignmentExpression": return parent.right === node; case "AssignmentPattern": return parent.right === node; case "LabeledStatement": return false; case "CatchClause": return false; case "RestElement": return false; case "BreakStatement": case "ContinueStatement": return false; case "FunctionDeclaration": case "FunctionExpression": return false; case "ExportNamespaceSpecifier": case "ExportDefaultSpecifier": return false; case "ExportSpecifier": if (grandparent != null && grandparent.source) { return false; } return parent.local === node; case "ImportDefaultSpecifier": case "ImportNamespaceSpecifier": case "ImportSpecifier": return false; case "ImportAttribute": return false; case "JSXAttribute": return false; case "ObjectPattern": case "ArrayPattern": return false; case "MetaProperty": return false; case "ObjectTypeProperty": return parent.key !== node; case "TSEnumMember": return parent.id !== node; case "TSPropertySignature": if (parent.key === node) { return !!parent.computed; } return true; } return true; } //# sourceMappingURL=isReferenced.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/isScope.js": /*!*************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/isScope.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isScope; var _index = __webpack_require__(/*! ./generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); function isScope(node, parent) { if ((0, _index.isBlockStatement)(node) && ((0, _index.isFunction)(parent) || (0, _index.isCatchClause)(parent))) { return false; } if ((0, _index.isPattern)(node) && ((0, _index.isFunction)(parent) || (0, _index.isCatchClause)(parent))) { return true; } return (0, _index.isScopable)(node); } //# sourceMappingURL=isScope.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/isSpecifierDefault.js": /*!************************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/isSpecifierDefault.js ***! \************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isSpecifierDefault; var _index = __webpack_require__(/*! ./generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); function isSpecifierDefault(specifier) { return (0, _index.isImportDefaultSpecifier)(specifier) || (0, _index.isIdentifier)(specifier.imported || specifier.exported, { name: "default" }); } //# sourceMappingURL=isSpecifierDefault.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/isType.js": /*!************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/isType.js ***! \************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isType; var _index = __webpack_require__(/*! ../definitions/index.js */ "./node_modules/@babel/types/lib/definitions/index.js"); function isType(nodeType, targetType) { if (nodeType === targetType) return true; if (nodeType == null) return false; if (_index.ALIAS_KEYS[targetType]) return false; const aliases = _index.FLIPPED_ALIAS_KEYS[targetType]; if (aliases != null && aliases.includes(nodeType)) return true; return false; } //# sourceMappingURL=isType.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/isValidES3Identifier.js": /*!**************************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/isValidES3Identifier.js ***! \**************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isValidES3Identifier; var _isValidIdentifier = __webpack_require__(/*! ./isValidIdentifier.js */ "./node_modules/@babel/types/lib/validators/isValidIdentifier.js"); const RESERVED_WORDS_ES3_ONLY = new Set(["abstract", "boolean", "byte", "char", "double", "enum", "final", "float", "goto", "implements", "int", "interface", "long", "native", "package", "private", "protected", "public", "short", "static", "synchronized", "throws", "transient", "volatile"]); function isValidES3Identifier(name) { return (0, _isValidIdentifier.default)(name) && !RESERVED_WORDS_ES3_ONLY.has(name); } //# sourceMappingURL=isValidES3Identifier.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/isValidIdentifier.js": /*!***********************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/isValidIdentifier.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isValidIdentifier; var _helperValidatorIdentifier = __webpack_require__(/*! @babel/helper-validator-identifier */ "./node_modules/@babel/helper-validator-identifier/lib/index.js"); function isValidIdentifier(name, reserved = true) { if (typeof name !== "string") return false; if (reserved) { if ((0, _helperValidatorIdentifier.isKeyword)(name) || (0, _helperValidatorIdentifier.isStrictReservedWord)(name, true)) { return false; } } return (0, _helperValidatorIdentifier.isIdentifierName)(name); } //# sourceMappingURL=isValidIdentifier.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/isVar.js": /*!***********************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/isVar.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isVar; var _index = __webpack_require__(/*! ./generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); { var BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped"); } function isVar(node) { { return (0, _index.isVariableDeclaration)(node, { kind: "var" }) && !node[BLOCK_SCOPED_SYMBOL]; } } //# sourceMappingURL=isVar.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/matchesPattern.js": /*!********************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/matchesPattern.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = matchesPattern; var _index = __webpack_require__(/*! ./generated/index.js */ "./node_modules/@babel/types/lib/validators/generated/index.js"); function isMemberExpressionLike(node) { return (0, _index.isMemberExpression)(node) || (0, _index.isMetaProperty)(node); } function matchesPattern(member, match, allowPartial) { if (!isMemberExpressionLike(member)) return false; const parts = Array.isArray(match) ? match : match.split("."); const nodes = []; let node; for (node = member; isMemberExpressionLike(node); node = (_object = node.object) != null ? _object : node.meta) { var _object; nodes.push(node.property); } nodes.push(node); if (nodes.length < parts.length) return false; if (!allowPartial && nodes.length > parts.length) return false; for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) { const node = nodes[j]; let value; if ((0, _index.isIdentifier)(node)) { value = node.name; } else if ((0, _index.isStringLiteral)(node)) { value = node.value; } else if ((0, _index.isThisExpression)(node)) { value = "this"; } else if ((0, _index.isSuper)(node)) { value = "super"; } else if ((0, _index.isPrivateName)(node)) { value = "#" + node.id.name; } else { return false; } if (parts[i] !== value) return false; } return true; } //# sourceMappingURL=matchesPattern.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/react/isCompatTag.js": /*!***********************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/react/isCompatTag.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = isCompatTag; function isCompatTag(tagName) { return !!tagName && /^[a-z]/.test(tagName); } //# sourceMappingURL=isCompatTag.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/react/isReactComponent.js": /*!****************************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/react/isReactComponent.js ***! \****************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _buildMatchMemberExpression = __webpack_require__(/*! ../buildMatchMemberExpression.js */ "./node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js"); const isReactComponent = (0, _buildMatchMemberExpression.default)("React.Component"); var _default = exports["default"] = isReactComponent; //# sourceMappingURL=isReactComponent.js.map /***/ }), /***/ "./node_modules/@babel/types/lib/validators/validate.js": /*!**************************************************************!*\ !*** ./node_modules/@babel/types/lib/validators/validate.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = validate; exports.validateChild = validateChild; exports.validateField = validateField; exports.validateInternal = validateInternal; var _index = __webpack_require__(/*! ../definitions/index.js */ "./node_modules/@babel/types/lib/definitions/index.js"); function validate(node, key, val) { if (!node) return; const fields = _index.NODE_FIELDS[node.type]; if (!fields) return; const field = fields[key]; validateField(node, key, val, field); validateChild(node, key, val); } function validateInternal(field, node, key, val, maybeNode) { if (!(field != null && field.validate)) return; if (field.optional && val == null) return; field.validate(node, key, val); if (maybeNode) { var _NODE_PARENT_VALIDATI; const type = val.type; if (type == null) return; (_NODE_PARENT_VALIDATI = _index.NODE_PARENT_VALIDATIONS[type]) == null || _NODE_PARENT_VALIDATI.call(_index.NODE_PARENT_VALIDATIONS, node, key, val); } } function validateField(node, key, val, field) { if (!(field != null && field.validate)) return; if (field.optional && val == null) return; field.validate(node, key, val); } function validateChild(node, key, val) { var _NODE_PARENT_VALIDATI2; const type = val == null ? void 0 : val.type; if (type == null) return; (_NODE_PARENT_VALIDATI2 = _index.NODE_PARENT_VALIDATIONS[type]) == null || _NODE_PARENT_VALIDATI2.call(_index.NODE_PARENT_VALIDATIONS, node, key, val); } //# sourceMappingURL=validate.js.map /***/ }), /***/ "./node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js": /*!**********************************************************************!*\ !*** ./node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js ***! \**********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); (function (global, factory) { if (true) { factory(module, __webpack_require__(/*! @jridgewell/sourcemap-codec */ "./node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js"), __webpack_require__(/*! @jridgewell/trace-mapping */ "./node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js")); module.exports = def(module); } else // removed by dead control flow {} function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } })(this, (function (module, require_sourcemapCodec, require_traceMapping) { "use strict"; 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 __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); // umd:@jridgewell/sourcemap-codec var require_sourcemap_codec = __commonJS({ "umd:@jridgewell/sourcemap-codec"(exports, module2) { module2.exports = require_sourcemapCodec; } }); // umd:@jridgewell/trace-mapping var require_trace_mapping = __commonJS({ "umd:@jridgewell/trace-mapping"(exports, module2) { module2.exports = require_traceMapping; } }); // src/gen-mapping.ts var gen_mapping_exports = {}; __export(gen_mapping_exports, { GenMapping: () => GenMapping, addMapping: () => addMapping, addSegment: () => addSegment, allMappings: () => allMappings, fromMap: () => fromMap, maybeAddMapping: () => maybeAddMapping, maybeAddSegment: () => maybeAddSegment, setIgnore: () => setIgnore, setSourceContent: () => setSourceContent, toDecodedMap: () => toDecodedMap, toEncodedMap: () => toEncodedMap }); module.exports = __toCommonJS(gen_mapping_exports); // src/set-array.ts var SetArray = class { constructor() { this._indexes = { __proto__: null }; this.array = []; } }; function cast(set) { return set; } function get(setarr, key) { return cast(setarr)._indexes[key]; } function put(setarr, key) { const index = get(setarr, key); if (index !== void 0) return index; const { array, _indexes: indexes } = cast(setarr); const length = array.push(key); return indexes[key] = length - 1; } function remove(setarr, key) { const index = get(setarr, key); if (index === void 0) return; const { array, _indexes: indexes } = cast(setarr); for (let i = index + 1; i < array.length; i++) { const k = array[i]; array[i - 1] = k; indexes[k]--; } indexes[key] = void 0; array.pop(); } // src/gen-mapping.ts var import_sourcemap_codec = __toESM(require_sourcemap_codec()); var import_trace_mapping = __toESM(require_trace_mapping()); // src/sourcemap-segment.ts var COLUMN = 0; var SOURCES_INDEX = 1; var SOURCE_LINE = 2; var SOURCE_COLUMN = 3; var NAMES_INDEX = 4; // src/gen-mapping.ts var NO_NAME = -1; var GenMapping = class { constructor({ file, sourceRoot } = {}) { this._names = new SetArray(); this._sources = new SetArray(); this._sourcesContent = []; this._mappings = []; this.file = file; this.sourceRoot = sourceRoot; this._ignoreList = new SetArray(); } }; function cast2(map) { return map; } function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { return addSegmentInternal( false, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content ); } function addMapping(map, mapping) { return addMappingInternal(false, map, mapping); } var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { return addSegmentInternal( true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content ); }; var maybeAddMapping = (map, mapping) => { return addMappingInternal(true, map, mapping); }; function setSourceContent(map, source, content) { const { _sources: sources, _sourcesContent: sourcesContent // _originalScopes: originalScopes, } = cast2(map); const index = put(sources, source); sourcesContent[index] = content; } function setIgnore(map, source, ignore = true) { const { _sources: sources, _sourcesContent: sourcesContent, _ignoreList: ignoreList // _originalScopes: originalScopes, } = cast2(map); const index = put(sources, source); if (index === sourcesContent.length) sourcesContent[index] = null; if (ignore) put(ignoreList, index); else remove(ignoreList, index); } function toDecodedMap(map) { const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, _ignoreList: ignoreList // _originalScopes: originalScopes, // _generatedRanges: generatedRanges, } = cast2(map); removeEmptyFinalLines(mappings); return { version: 3, file: map.file || void 0, names: names.array, sourceRoot: map.sourceRoot || void 0, sources: sources.array, sourcesContent, mappings, // originalScopes, // generatedRanges, ignoreList: ignoreList.array }; } function toEncodedMap(map) { const decoded = toDecodedMap(map); return Object.assign({}, decoded, { // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)), // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]), mappings: (0, import_sourcemap_codec.encode)(decoded.mappings) }); } function fromMap(input) { const map = new import_trace_mapping.TraceMap(input); const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); putAll(cast2(gen)._names, map.names); putAll(cast2(gen)._sources, map.sources); cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null); cast2(gen)._mappings = (0, import_trace_mapping.decodedMappings)(map); if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList); return gen; } function allMappings(map) { const out = []; const { _mappings: mappings, _sources: sources, _names: names } = cast2(map); for (let i = 0; i < mappings.length; i++) { const line = mappings[i]; for (let j = 0; j < line.length; j++) { const seg = line[j]; const generated = { line: i + 1, column: seg[COLUMN] }; let source = void 0; let original = void 0; let name = void 0; if (seg.length !== 1) { source = sources.array[seg[SOURCES_INDEX]]; original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; if (seg.length === 5) name = names.array[seg[NAMES_INDEX]]; } out.push({ generated, source, original, name }); } } return out; } function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names // _originalScopes: originalScopes, } = cast2(map); const line = getIndex(mappings, genLine); const index = getColumnIndex(line, genColumn); if (!source) { if (skipable && skipSourceless(line, index)) return; return insert(line, index, [genColumn]); } assert(sourceLine); assert(sourceColumn); const sourcesIndex = put(sources, source); const namesIndex = name ? put(names, name) : NO_NAME; if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null; if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { return; } return insert( line, index, name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn] ); } function assert(_val) { } function getIndex(arr, index) { for (let i = arr.length; i <= index; i++) { arr[i] = []; } return arr[index]; } function getColumnIndex(line, genColumn) { let index = line.length; for (let i = index - 1; i >= 0; index = i--) { const current = line[i]; if (genColumn >= current[COLUMN]) break; } return index; } function insert(array, index, value) { for (let i = array.length; i > index; i--) { array[i] = array[i - 1]; } array[index] = value; } function removeEmptyFinalLines(mappings) { const { length } = mappings; let len = length; for (let i = len - 1; i >= 0; len = i, i--) { if (mappings[i].length > 0) break; } if (len < length) mappings.length = len; } function putAll(setarr, array) { for (let i = 0; i < array.length; i++) put(setarr, array[i]); } function skipSourceless(line, index) { if (index === 0) return true; const prev = line[index - 1]; return prev.length === 1; } function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { if (index === 0) return false; const prev = line[index - 1]; if (prev.length === 1) return false; return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME); } function addMappingInternal(skipable, map, mapping) { const { generated, source, original, name, content } = mapping; if (!source) { return addSegmentInternal( skipable, map, generated.line - 1, generated.column, null, null, null, null, null ); } assert(original); return addSegmentInternal( skipable, map, generated.line - 1, generated.column, source, original.line - 1, original.column, name, content ); } })); //# sourceMappingURL=gen-mapping.umd.js.map /***/ }), /***/ "./node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js": /*!**********************************************************************!*\ !*** ./node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js ***! \**********************************************************************/ /***/ (function(module) { (function (global, factory) { true ? module.exports = factory() : 0; })(this, (function () { 'use strict'; // Matches the scheme of a URL, eg "http://" const schemeRegex = /^[\w+.-]+:\/\//; /** * Matches the parts of a URL: * 1. Scheme, including ":", guaranteed. * 2. User/password, including "@", optional. * 3. Host, guaranteed. * 4. Port, including ":", optional. * 5. Path, including "/", optional. * 6. Query, including "?", optional. * 7. Hash, including "#", optional. */ const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; /** * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). * * 1. Host, optional. * 2. Path, which may include "/", guaranteed. * 3. Query, including "?", optional. * 4. Hash, including "#", optional. */ const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; function isAbsoluteUrl(input) { return schemeRegex.test(input); } function isSchemeRelativeUrl(input) { return input.startsWith('//'); } function isAbsolutePath(input) { return input.startsWith('/'); } function isFileUrl(input) { return input.startsWith('file:'); } function isRelative(input) { return /^[.?#]/.test(input); } function parseAbsoluteUrl(input) { const match = urlRegex.exec(input); return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); } function parseFileUrl(input) { const match = fileRegex.exec(input); const path = match[2]; return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); } function makeUrl(scheme, user, host, port, path, query, hash) { return { scheme, user, host, port, path, query, hash, type: 7 /* Absolute */, }; } function parseUrl(input) { if (isSchemeRelativeUrl(input)) { const url = parseAbsoluteUrl('http:' + input); url.scheme = ''; url.type = 6 /* SchemeRelative */; return url; } if (isAbsolutePath(input)) { const url = parseAbsoluteUrl('http://foo.com' + input); url.scheme = ''; url.host = ''; url.type = 5 /* AbsolutePath */; return url; } if (isFileUrl(input)) return parseFileUrl(input); if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input); const url = parseAbsoluteUrl('http://foo.com/' + input); url.scheme = ''; url.host = ''; url.type = input ? input.startsWith('?') ? 3 /* Query */ : input.startsWith('#') ? 2 /* Hash */ : 4 /* RelativePath */ : 1 /* Empty */; return url; } function stripPathFilename(path) { // If a path ends with a parent directory "..", then it's a relative path with excess parent // paths. It's not a file, so we can't strip it. if (path.endsWith('/..')) return path; const index = path.lastIndexOf('/'); return path.slice(0, index + 1); } function mergePaths(url, base) { normalizePath(base, base.type); // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative // path). if (url.path === '/') { url.path = base.path; } else { // Resolution happens relative to the base path's directory, not the file. url.path = stripPathFilename(base.path) + url.path; } } /** * The path can have empty directories "//", unneeded parents "foo/..", or current directory * "foo/.". We need to normalize to a standard representation. */ function normalizePath(url, type) { const rel = type <= 4 /* RelativePath */; const pieces = url.path.split('/'); // We need to preserve the first piece always, so that we output a leading slash. The item at // pieces[0] is an empty string. let pointer = 1; // Positive is the number of real directories we've output, used for popping a parent directory. // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". let positive = 0; // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a // real directory, we won't need to append, unless the other conditions happen again. let addTrailingSlash = false; for (let i = 1; i < pieces.length; i++) { const piece = pieces[i]; // An empty directory, could be a trailing slash, or just a double "//" in the path. if (!piece) { addTrailingSlash = true; continue; } // If we encounter a real directory, then we don't need to append anymore. addTrailingSlash = false; // A current directory, which we can always drop. if (piece === '.') continue; // A parent directory, we need to see if there are any real directories we can pop. Else, we // have an excess of parents, and we'll need to keep the "..". if (piece === '..') { if (positive) { addTrailingSlash = true; positive--; pointer--; } else if (rel) { // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute // URL, protocol relative URL, or an absolute path, we don't need to keep excess. pieces[pointer++] = piece; } continue; } // We've encountered a real directory. Move it to the next insertion pointer, which accounts for // any popped or dropped directories. pieces[pointer++] = piece; positive++; } let path = ''; for (let i = 1; i < pointer; i++) { path += '/' + pieces[i]; } if (!path || (addTrailingSlash && !path.endsWith('/..'))) { path += '/'; } url.path = path; } /** * Attempts to resolve `input` URL/path relative to `base`. */ function resolve(input, base) { if (!input && !base) return ''; const url = parseUrl(input); let inputType = url.type; if (base && inputType !== 7 /* Absolute */) { const baseUrl = parseUrl(base); const baseType = baseUrl.type; switch (inputType) { case 1 /* Empty */: url.hash = baseUrl.hash; // fall through case 2 /* Hash */: url.query = baseUrl.query; // fall through case 3 /* Query */: case 4 /* RelativePath */: mergePaths(url, baseUrl); // fall through case 5 /* AbsolutePath */: // The host, user, and port are joined, you can't copy one without the others. url.user = baseUrl.user; url.host = baseUrl.host; url.port = baseUrl.port; // fall through case 6 /* SchemeRelative */: // The input doesn't have a schema at least, so we need to copy at least that over. url.scheme = baseUrl.scheme; } if (baseType > inputType) inputType = baseType; } normalizePath(url, inputType); const queryHash = url.query + url.hash; switch (inputType) { // This is impossible, because of the empty checks at the start of the function. // case UrlType.Empty: case 2 /* Hash */: case 3 /* Query */: return queryHash; case 4 /* RelativePath */: { // The first char is always a "/", and we need it to be relative. const path = url.path.slice(1); if (!path) return queryHash || '.'; if (isRelative(base || input) && !isRelative(path)) { // If base started with a leading ".", or there is no base and input started with a ".", // then we need to ensure that the relative path starts with a ".". We don't know if // relative starts with a "..", though, so check before prepending. return './' + path + queryHash; } return path + queryHash; } case 5 /* AbsolutePath */: return url.path + queryHash; default: return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; } } return resolve; })); //# sourceMappingURL=resolve-uri.umd.js.map /***/ }), /***/ "./node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js": /*!******************************************************************************!*\ !*** ./node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js ***! \******************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); /* provided dependency */ var TextDecoder = __webpack_require__(/*! text-encoder */ "./node_modules/text-encoder/index.js")["TextDecoder"]; (function (global, factory) { if (true) { factory(module); module.exports = def(module); } else // removed by dead control flow {} function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } })(this, (function (module) { "use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/sourcemap-codec.ts var sourcemap_codec_exports = {}; __export(sourcemap_codec_exports, { decode: () => decode, decodeGeneratedRanges: () => decodeGeneratedRanges, decodeOriginalScopes: () => decodeOriginalScopes, encode: () => encode, encodeGeneratedRanges: () => encodeGeneratedRanges, encodeOriginalScopes: () => encodeOriginalScopes }); module.exports = __toCommonJS(sourcemap_codec_exports); // src/vlq.ts var comma = ",".charCodeAt(0); var semicolon = ";".charCodeAt(0); var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; var intToChar = new Uint8Array(64); var charToInt = new Uint8Array(128); for (let i = 0; i < chars.length; i++) { const c = chars.charCodeAt(i); intToChar[i] = c; charToInt[c] = i; } function decodeInteger(reader, relative) { let value = 0; let shift = 0; let integer = 0; do { const c = reader.next(); integer = charToInt[c]; value |= (integer & 31) << shift; shift += 5; } while (integer & 32); const shouldNegate = value & 1; value >>>= 1; if (shouldNegate) { value = -2147483648 | -value; } return relative + value; } function encodeInteger(builder, num, relative) { let delta = num - relative; delta = delta < 0 ? -delta << 1 | 1 : delta << 1; do { let clamped = delta & 31; delta >>>= 5; if (delta > 0) clamped |= 32; builder.write(intToChar[clamped]); } while (delta > 0); return num; } function hasMoreVlq(reader, max) { if (reader.pos >= max) return false; return reader.peek() !== comma; } // src/strings.ts var bufLength = 1024 * 16; var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) { const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); return out.toString(); } } : { decode(buf) { let out = ""; for (let i = 0; i < buf.length; i++) { out += String.fromCharCode(buf[i]); } return out; } }; var StringWriter = class { constructor() { this.pos = 0; this.out = ""; this.buffer = new Uint8Array(bufLength); } write(v) { const { buffer } = this; buffer[this.pos++] = v; if (this.pos === bufLength) { this.out += td.decode(buffer); this.pos = 0; } } flush() { const { buffer, out, pos } = this; return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; } }; var StringReader = class { constructor(buffer) { this.pos = 0; this.buffer = buffer; } next() { return this.buffer.charCodeAt(this.pos++); } peek() { return this.buffer.charCodeAt(this.pos); } indexOf(char) { const { buffer, pos } = this; const idx = buffer.indexOf(char, pos); return idx === -1 ? buffer.length : idx; } }; // src/scopes.ts var EMPTY = []; function decodeOriginalScopes(input) { const { length } = input; const reader = new StringReader(input); const scopes = []; const stack = []; let line = 0; for (; reader.pos < length; reader.pos++) { line = decodeInteger(reader, line); const column = decodeInteger(reader, 0); if (!hasMoreVlq(reader, length)) { const last = stack.pop(); last[2] = line; last[3] = column; continue; } const kind = decodeInteger(reader, 0); const fields = decodeInteger(reader, 0); const hasName = fields & 1; const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind]; let vars = EMPTY; if (hasMoreVlq(reader, length)) { vars = []; do { const varsIndex = decodeInteger(reader, 0); vars.push(varsIndex); } while (hasMoreVlq(reader, length)); } scope.vars = vars; scopes.push(scope); stack.push(scope); } return scopes; } function encodeOriginalScopes(scopes) { const writer = new StringWriter(); for (let i = 0; i < scopes.length; ) { i = _encodeOriginalScopes(scopes, i, writer, [0]); } return writer.flush(); } function _encodeOriginalScopes(scopes, index, writer, state) { const scope = scopes[index]; const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope; if (index > 0) writer.write(comma); state[0] = encodeInteger(writer, startLine, state[0]); encodeInteger(writer, startColumn, 0); encodeInteger(writer, kind, 0); const fields = scope.length === 6 ? 1 : 0; encodeInteger(writer, fields, 0); if (scope.length === 6) encodeInteger(writer, scope[5], 0); for (const v of vars) { encodeInteger(writer, v, 0); } for (index++; index < scopes.length; ) { const next = scopes[index]; const { 0: l, 1: c } = next; if (l > endLine || l === endLine && c >= endColumn) { break; } index = _encodeOriginalScopes(scopes, index, writer, state); } writer.write(comma); state[0] = encodeInteger(writer, endLine, state[0]); encodeInteger(writer, endColumn, 0); return index; } function decodeGeneratedRanges(input) { const { length } = input; const reader = new StringReader(input); const ranges = []; const stack = []; let genLine = 0; let definitionSourcesIndex = 0; let definitionScopeIndex = 0; let callsiteSourcesIndex = 0; let callsiteLine = 0; let callsiteColumn = 0; let bindingLine = 0; let bindingColumn = 0; do { const semi = reader.indexOf(";"); let genColumn = 0; for (; reader.pos < semi; reader.pos++) { genColumn = decodeInteger(reader, genColumn); if (!hasMoreVlq(reader, semi)) { const last = stack.pop(); last[2] = genLine; last[3] = genColumn; continue; } const fields = decodeInteger(reader, 0); const hasDefinition = fields & 1; const hasCallsite = fields & 2; const hasScope = fields & 4; let callsite = null; let bindings = EMPTY; let range; if (hasDefinition) { const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex); definitionScopeIndex = decodeInteger( reader, definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0 ); definitionSourcesIndex = defSourcesIndex; range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex]; } else { range = [genLine, genColumn, 0, 0]; } range.isScope = !!hasScope; if (hasCallsite) { const prevCsi = callsiteSourcesIndex; const prevLine = callsiteLine; callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex); const sameSource = prevCsi === callsiteSourcesIndex; callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0); callsiteColumn = decodeInteger( reader, sameSource && prevLine === callsiteLine ? callsiteColumn : 0 ); callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn]; } range.callsite = callsite; if (hasMoreVlq(reader, semi)) { bindings = []; do { bindingLine = genLine; bindingColumn = genColumn; const expressionsCount = decodeInteger(reader, 0); let expressionRanges; if (expressionsCount < -1) { expressionRanges = [[decodeInteger(reader, 0)]]; for (let i = -1; i > expressionsCount; i--) { const prevBl = bindingLine; bindingLine = decodeInteger(reader, bindingLine); bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0); const expression = decodeInteger(reader, 0); expressionRanges.push([expression, bindingLine, bindingColumn]); } } else { expressionRanges = [[expressionsCount]]; } bindings.push(expressionRanges); } while (hasMoreVlq(reader, semi)); } range.bindings = bindings; ranges.push(range); stack.push(range); } genLine++; reader.pos = semi + 1; } while (reader.pos < length); return ranges; } function encodeGeneratedRanges(ranges) { if (ranges.length === 0) return ""; const writer = new StringWriter(); for (let i = 0; i < ranges.length; ) { i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]); } return writer.flush(); } function _encodeGeneratedRanges(ranges, index, writer, state) { const range = ranges[index]; const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, isScope, callsite, bindings } = range; if (state[0] < startLine) { catchupLine(writer, state[0], startLine); state[0] = startLine; state[1] = 0; } else if (index > 0) { writer.write(comma); } state[1] = encodeInteger(writer, range[1], state[1]); const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0); encodeInteger(writer, fields, 0); if (range.length === 6) { const { 4: sourcesIndex, 5: scopesIndex } = range; if (sourcesIndex !== state[2]) { state[3] = 0; } state[2] = encodeInteger(writer, sourcesIndex, state[2]); state[3] = encodeInteger(writer, scopesIndex, state[3]); } if (callsite) { const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite; if (sourcesIndex !== state[4]) { state[5] = 0; state[6] = 0; } else if (callLine !== state[5]) { state[6] = 0; } state[4] = encodeInteger(writer, sourcesIndex, state[4]); state[5] = encodeInteger(writer, callLine, state[5]); state[6] = encodeInteger(writer, callColumn, state[6]); } if (bindings) { for (const binding of bindings) { if (binding.length > 1) encodeInteger(writer, -binding.length, 0); const expression = binding[0][0]; encodeInteger(writer, expression, 0); let bindingStartLine = startLine; let bindingStartColumn = startColumn; for (let i = 1; i < binding.length; i++) { const expRange = binding[i]; bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine); bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn); encodeInteger(writer, expRange[0], 0); } } } for (index++; index < ranges.length; ) { const next = ranges[index]; const { 0: l, 1: c } = next; if (l > endLine || l === endLine && c >= endColumn) { break; } index = _encodeGeneratedRanges(ranges, index, writer, state); } if (state[0] < endLine) { catchupLine(writer, state[0], endLine); state[0] = endLine; state[1] = 0; } else { writer.write(comma); } state[1] = encodeInteger(writer, endColumn, state[1]); return index; } function catchupLine(writer, lastLine, line) { do { writer.write(semicolon); } while (++lastLine < line); } // src/sourcemap-codec.ts function decode(mappings) { const { length } = mappings; const reader = new StringReader(mappings); const decoded = []; let genColumn = 0; let sourcesIndex = 0; let sourceLine = 0; let sourceColumn = 0; let namesIndex = 0; do { const semi = reader.indexOf(";"); const line = []; let sorted = true; let lastCol = 0; genColumn = 0; while (reader.pos < semi) { let seg; genColumn = decodeInteger(reader, genColumn); if (genColumn < lastCol) sorted = false; lastCol = genColumn; if (hasMoreVlq(reader, semi)) { sourcesIndex = decodeInteger(reader, sourcesIndex); sourceLine = decodeInteger(reader, sourceLine); sourceColumn = decodeInteger(reader, sourceColumn); if (hasMoreVlq(reader, semi)) { namesIndex = decodeInteger(reader, namesIndex); seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; } else { seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; } } else { seg = [genColumn]; } line.push(seg); reader.pos++; } if (!sorted) sort(line); decoded.push(line); reader.pos = semi + 1; } while (reader.pos <= length); return decoded; } function sort(line) { line.sort(sortComparator); } function sortComparator(a, b) { return a[0] - b[0]; } function encode(decoded) { const writer = new StringWriter(); let sourcesIndex = 0; let sourceLine = 0; let sourceColumn = 0; let namesIndex = 0; for (let i = 0; i < decoded.length; i++) { const line = decoded[i]; if (i > 0) writer.write(semicolon); if (line.length === 0) continue; let genColumn = 0; for (let j = 0; j < line.length; j++) { const segment = line[j]; if (j > 0) writer.write(comma); genColumn = encodeInteger(writer, segment[0], genColumn); if (segment.length === 1) continue; sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); sourceLine = encodeInteger(writer, segment[2], sourceLine); sourceColumn = encodeInteger(writer, segment[3], sourceColumn); if (segment.length === 4) continue; namesIndex = encodeInteger(writer, segment[4], namesIndex); } } return writer.flush(); } })); //# sourceMappingURL=sourcemap-codec.umd.js.map /***/ }), /***/ "./node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js": /*!**************************************************************************!*\ !*** ./node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js ***! \**************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); (function (global, factory) { if (true) { factory(module, __webpack_require__(/*! @jridgewell/resolve-uri */ "./node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js"), __webpack_require__(/*! @jridgewell/sourcemap-codec */ "./node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js")); module.exports = def(module); } else // removed by dead control flow {} function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } })(this, (function (module, require_resolveURI, require_sourcemapCodec) { "use strict"; 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 __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); // umd:@jridgewell/sourcemap-codec var require_sourcemap_codec = __commonJS({ "umd:@jridgewell/sourcemap-codec"(exports, module2) { module2.exports = require_sourcemapCodec; } }); // umd:@jridgewell/resolve-uri var require_resolve_uri = __commonJS({ "umd:@jridgewell/resolve-uri"(exports, module2) { module2.exports = require_resolveURI; } }); // src/trace-mapping.ts var trace_mapping_exports = {}; __export(trace_mapping_exports, { AnyMap: () => FlattenMap, FlattenMap: () => FlattenMap, GREATEST_LOWER_BOUND: () => GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND: () => LEAST_UPPER_BOUND, TraceMap: () => TraceMap, allGeneratedPositionsFor: () => allGeneratedPositionsFor, decodedMap: () => decodedMap, decodedMappings: () => decodedMappings, eachMapping: () => eachMapping, encodedMap: () => encodedMap, encodedMappings: () => encodedMappings, generatedPositionFor: () => generatedPositionFor, isIgnored: () => isIgnored, originalPositionFor: () => originalPositionFor, presortedDecodedMap: () => presortedDecodedMap, sourceContentFor: () => sourceContentFor, traceSegment: () => traceSegment }); module.exports = __toCommonJS(trace_mapping_exports); var import_sourcemap_codec = __toESM(require_sourcemap_codec()); // src/resolve.ts var import_resolve_uri = __toESM(require_resolve_uri()); // src/strip-filename.ts function stripFilename(path) { if (!path) return ""; const index = path.lastIndexOf("/"); return path.slice(0, index + 1); } // src/resolve.ts function resolver(mapUrl, sourceRoot) { const from = stripFilename(mapUrl); const prefix = sourceRoot ? sourceRoot + "/" : ""; return (source) => (0, import_resolve_uri.default)(prefix + (source || ""), from); } // src/sourcemap-segment.ts var COLUMN = 0; var SOURCES_INDEX = 1; var SOURCE_LINE = 2; var SOURCE_COLUMN = 3; var NAMES_INDEX = 4; var REV_GENERATED_LINE = 1; var REV_GENERATED_COLUMN = 2; // src/sort.ts function maybeSort(mappings, owned) { const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); if (unsortedIndex === mappings.length) return mappings; if (!owned) mappings = mappings.slice(); for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { mappings[i] = sortSegments(mappings[i], owned); } return mappings; } function nextUnsortedSegmentLine(mappings, start) { for (let i = start; i < mappings.length; i++) { if (!isSorted(mappings[i])) return i; } return mappings.length; } function isSorted(line) { for (let j = 1; j < line.length; j++) { if (line[j][COLUMN] < line[j - 1][COLUMN]) { return false; } } return true; } function sortSegments(line, owned) { if (!owned) line = line.slice(); return line.sort(sortComparator); } function sortComparator(a, b) { return a[COLUMN] - b[COLUMN]; } // src/binary-search.ts var found = false; function binarySearch(haystack, needle, low, high) { while (low <= high) { const mid = low + (high - low >> 1); const cmp = haystack[mid][COLUMN] - needle; if (cmp === 0) { found = true; return mid; } if (cmp < 0) { low = mid + 1; } else { high = mid - 1; } } found = false; return low - 1; } function upperBound(haystack, needle, index) { for (let i = index + 1; i < haystack.length; index = i++) { if (haystack[i][COLUMN] !== needle) break; } return index; } function lowerBound(haystack, needle, index) { for (let i = index - 1; i >= 0; index = i--) { if (haystack[i][COLUMN] !== needle) break; } return index; } function memoizedState() { return { lastKey: -1, lastNeedle: -1, lastIndex: -1 }; } function memoizedBinarySearch(haystack, needle, state, key) { const { lastKey, lastNeedle, lastIndex } = state; let low = 0; let high = haystack.length - 1; if (key === lastKey) { if (needle === lastNeedle) { found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; return lastIndex; } if (needle >= lastNeedle) { low = lastIndex === -1 ? 0 : lastIndex; } else { high = lastIndex; } } state.lastKey = key; state.lastNeedle = needle; return state.lastIndex = binarySearch(haystack, needle, low, high); } // src/by-source.ts function buildBySources(decoded, memos) { const sources = memos.map(buildNullArray); for (let i = 0; i < decoded.length; i++) { const line = decoded[i]; for (let j = 0; j < line.length; j++) { const seg = line[j]; if (seg.length === 1) continue; const sourceIndex2 = seg[SOURCES_INDEX]; const sourceLine = seg[SOURCE_LINE]; const sourceColumn = seg[SOURCE_COLUMN]; const originalSource = sources[sourceIndex2]; const originalLine = originalSource[sourceLine] || (originalSource[sourceLine] = []); const memo = memos[sourceIndex2]; let index = upperBound( originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine) ); memo.lastIndex = ++index; insert(originalLine, index, [sourceColumn, i, seg[COLUMN]]); } } return sources; } function insert(array, index, value) { for (let i = array.length; i > index; i--) { array[i] = array[i - 1]; } array[index] = value; } function buildNullArray() { return { __proto__: null }; } // src/types.ts function parse(map) { return typeof map === "string" ? JSON.parse(map) : map; } // src/flatten-map.ts var FlattenMap = function(map, mapUrl) { const parsed = parse(map); if (!("sections" in parsed)) { return new TraceMap(parsed, mapUrl); } const mappings = []; const sources = []; const sourcesContent = []; const names = []; const ignoreList = []; recurse( parsed, mapUrl, mappings, sources, sourcesContent, names, ignoreList, 0, 0, Infinity, Infinity ); const joined = { version: 3, file: parsed.file, names, sources, sourcesContent, mappings, ignoreList }; return presortedDecodedMap(joined); }; function recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { const { sections } = input; for (let i = 0; i < sections.length; i++) { const { map, offset } = sections[i]; let sl = stopLine; let sc = stopColumn; if (i + 1 < sections.length) { const nextOffset = sections[i + 1].offset; sl = Math.min(stopLine, lineOffset + nextOffset.line); if (sl === stopLine) { sc = Math.min(stopColumn, columnOffset + nextOffset.column); } else if (sl < stopLine) { sc = columnOffset + nextOffset.column; } } addSection( map, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset + offset.line, columnOffset + offset.column, sl, sc ); } } function addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { const parsed = parse(input); if ("sections" in parsed) return recurse(...arguments); const map = new TraceMap(parsed, mapUrl); const sourcesOffset = sources.length; const namesOffset = names.length; const decoded = decodedMappings(map); const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = map; append(sources, resolvedSources); append(names, map.names); if (contents) append(sourcesContent, contents); else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null); if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset); for (let i = 0; i < decoded.length; i++) { const lineI = lineOffset + i; if (lineI > stopLine) return; const out = getLine(mappings, lineI); const cOffset = i === 0 ? columnOffset : 0; const line = decoded[i]; for (let j = 0; j < line.length; j++) { const seg = line[j]; const column = cOffset + seg[COLUMN]; if (lineI === stopLine && column >= stopColumn) return; if (seg.length === 1) { out.push([column]); continue; } const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; const sourceLine = seg[SOURCE_LINE]; const sourceColumn = seg[SOURCE_COLUMN]; out.push( seg.length === 4 ? [column, sourcesIndex, sourceLine, sourceColumn] : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]] ); } } } function append(arr, other) { for (let i = 0; i < other.length; i++) arr.push(other[i]); } function getLine(arr, index) { for (let i = arr.length; i <= index; i++) arr[i] = []; return arr[index]; } // src/trace-mapping.ts var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)"; var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)"; var LEAST_UPPER_BOUND = -1; var GREATEST_LOWER_BOUND = 1; var TraceMap = class { constructor(map, mapUrl) { const isString = typeof map === "string"; if (!isString && map._decodedMemo) return map; const parsed = parse(map); const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; this.version = version; this.file = file; this.names = names || []; this.sourceRoot = sourceRoot; this.sources = sources; this.sourcesContent = sourcesContent; this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0; const resolve = resolver(mapUrl, sourceRoot); this.resolvedSources = sources.map(resolve); const { mappings } = parsed; if (typeof mappings === "string") { this._encoded = mappings; this._decoded = void 0; } else if (Array.isArray(mappings)) { this._encoded = void 0; this._decoded = maybeSort(mappings, isString); } else if (parsed.sections) { throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); } else { throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); } this._decodedMemo = memoizedState(); this._bySources = void 0; this._bySourceMemos = void 0; } }; function cast(map) { return map; } function encodedMappings(map) { var _a, _b; return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = (0, import_sourcemap_codec.encode)(cast(map)._decoded); } function decodedMappings(map) { var _a; return (_a = cast(map))._decoded || (_a._decoded = (0, import_sourcemap_codec.decode)(cast(map)._encoded)); } function traceSegment(map, line, column) { const decoded = decodedMappings(map); if (line >= decoded.length) return null; const segments = decoded[line]; const index = traceSegmentInternal( segments, cast(map)._decodedMemo, line, column, GREATEST_LOWER_BOUND ); return index === -1 ? null : segments[index]; } function originalPositionFor(map, needle) { let { line, column, bias } = needle; line--; if (line < 0) throw new Error(LINE_GTR_ZERO); if (column < 0) throw new Error(COL_GTR_EQ_ZERO); const decoded = decodedMappings(map); if (line >= decoded.length) return OMapping(null, null, null, null); const segments = decoded[line]; const index = traceSegmentInternal( segments, cast(map)._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND ); if (index === -1) return OMapping(null, null, null, null); const segment = segments[index]; if (segment.length === 1) return OMapping(null, null, null, null); const { names, resolvedSources } = map; return OMapping( resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null ); } function generatedPositionFor(map, needle) { const { source, line, column, bias } = needle; return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); } function allGeneratedPositionsFor(map, needle) { const { source, line, column, bias } = needle; return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); } function eachMapping(map, cb) { const decoded = decodedMappings(map); const { names, resolvedSources } = map; for (let i = 0; i < decoded.length; i++) { const line = decoded[i]; for (let j = 0; j < line.length; j++) { const seg = line[j]; const generatedLine = i + 1; const generatedColumn = seg[0]; let source = null; let originalLine = null; let originalColumn = null; let name = null; if (seg.length !== 1) { source = resolvedSources[seg[1]]; originalLine = seg[2] + 1; originalColumn = seg[3]; } if (seg.length === 5) name = names[seg[4]]; cb({ generatedLine, generatedColumn, source, originalLine, originalColumn, name }); } } } function sourceIndex(map, source) { const { sources, resolvedSources } = map; let index = sources.indexOf(source); if (index === -1) index = resolvedSources.indexOf(source); return index; } function sourceContentFor(map, source) { const { sourcesContent } = map; if (sourcesContent == null) return null; const index = sourceIndex(map, source); return index === -1 ? null : sourcesContent[index]; } function isIgnored(map, source) { const { ignoreList } = map; if (ignoreList == null) return false; const index = sourceIndex(map, source); return index === -1 ? false : ignoreList.includes(index); } function presortedDecodedMap(map, mapUrl) { const tracer = new TraceMap(clone(map, []), mapUrl); cast(tracer)._decoded = map.mappings; return tracer; } function decodedMap(map) { return clone(map, decodedMappings(map)); } function encodedMap(map) { return clone(map, encodedMappings(map)); } function clone(map, mappings) { return { version: map.version, file: map.file, names: map.names, sourceRoot: map.sourceRoot, sources: map.sources, sourcesContent: map.sourcesContent, mappings, ignoreList: map.ignoreList || map.x_google_ignoreList }; } function OMapping(source, line, column, name) { return { source, line, column, name }; } function GMapping(line, column) { return { line, column }; } function traceSegmentInternal(segments, memo, line, column, bias) { let index = memoizedBinarySearch(segments, column, memo, line); if (found) { index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); } else if (bias === LEAST_UPPER_BOUND) index++; if (index === -1 || index === segments.length) return -1; return index; } function sliceGeneratedPositions(segments, memo, line, column, bias) { let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); if (!found && bias === LEAST_UPPER_BOUND) min++; if (min === -1 || min === segments.length) return []; const matchedColumn = found ? column : segments[min][COLUMN]; if (!found) min = lowerBound(segments, matchedColumn, min); const max = upperBound(segments, matchedColumn, min); const result = []; for (; min <= max; min++) { const segment = segments[min]; result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); } return result; } function generatedPosition(map, source, line, column, bias, all) { var _a; line--; if (line < 0) throw new Error(LINE_GTR_ZERO); if (column < 0) throw new Error(COL_GTR_EQ_ZERO); const { sources, resolvedSources } = map; let sourceIndex2 = sources.indexOf(source); if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source); if (sourceIndex2 === -1) return all ? [] : GMapping(null, null); const generated = (_a = cast(map))._bySources || (_a._bySources = buildBySources( decodedMappings(map), cast(map)._bySourceMemos = sources.map(memoizedState) )); const segments = generated[sourceIndex2][line]; if (segments == null) return all ? [] : GMapping(null, null); const memo = cast(map)._bySourceMemos[sourceIndex2]; if (all) return sliceGeneratedPositions(segments, memo, line, column, bias); const index = traceSegmentInternal(segments, memo, line, column, bias); if (index === -1) return GMapping(null, null); const segment = segments[index]; return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); } })); //# sourceMappingURL=trace-mapping.umd.js.map /***/ }), /***/ "./node_modules/assert/build/assert.js": /*!*********************************************!*\ !*** ./node_modules/assert/build/assert.js ***! \*********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); // Currently in sync with Node.js lib/assert.js // https://github.com/nodejs/node/commit/2a51ae424a513ec9a6aa3466baa0cc1d55dd4f3b // Originally from narwhal.js (http://narwhaljs.org) // Copyright (c) 2009 Thomas Robinson <280north.com> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the 'Software'), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _require = __webpack_require__(/*! ./internal/errors */ "./node_modules/assert/build/internal/errors.js"), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE, ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS; var AssertionError = __webpack_require__(/*! ./internal/assert/assertion_error */ "./node_modules/assert/build/internal/assert/assertion_error.js"); var _require2 = __webpack_require__(/*! util/ */ "./node_modules/util/util.js"), inspect = _require2.inspect; var _require$types = (__webpack_require__(/*! util/ */ "./node_modules/util/util.js").types), isPromise = _require$types.isPromise, isRegExp = _require$types.isRegExp; var objectAssign = __webpack_require__(/*! object.assign/polyfill */ "./node_modules/object.assign/polyfill.js")(); var objectIs = __webpack_require__(/*! object-is/polyfill */ "./node_modules/object-is/polyfill.js")(); var RegExpPrototypeTest = __webpack_require__(/*! call-bind/callBound */ "./node_modules/call-bind/callBound.js")('RegExp.prototype.test'); var errorCache = new Map(); var isDeepEqual; var isDeepStrictEqual; var parseExpressionAt; var findNodeAround; var decoder; function lazyLoadComparison() { var comparison = __webpack_require__(/*! ./internal/util/comparisons */ "./node_modules/assert/build/internal/util/comparisons.js"); isDeepEqual = comparison.isDeepEqual; isDeepStrictEqual = comparison.isDeepStrictEqual; } // Escape control characters but not \n and \t to keep the line breaks and // indentation intact. // eslint-disable-next-line no-control-regex var escapeSequencesRegExp = /[\x00-\x08\x0b\x0c\x0e-\x1f]/g; var meta = ["\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005", "\\u0006", "\\u0007", '\\b', '', '', "\\u000b", '\\f', '', "\\u000e", "\\u000f", "\\u0010", "\\u0011", "\\u0012", "\\u0013", "\\u0014", "\\u0015", "\\u0016", "\\u0017", "\\u0018", "\\u0019", "\\u001a", "\\u001b", "\\u001c", "\\u001d", "\\u001e", "\\u001f"]; var escapeFn = function escapeFn(str) { return meta[str.charCodeAt(0)]; }; var warned = false; // The assert module provides functions that throw // AssertionError's when particular conditions are not met. The // assert module must conform to the following interface. var assert = module.exports = ok; var NO_EXCEPTION_SENTINEL = {}; // All of the following functions must throw an AssertionError // when a corresponding condition is not met, with a message that // may be undefined if not provided. All assertion methods provide // both the actual and expected values to the assertion error for // display purposes. function innerFail(obj) { if (obj.message instanceof Error) throw obj.message; throw new AssertionError(obj); } function fail(actual, expected, message, operator, stackStartFn) { var argsLen = arguments.length; var internalMessage; if (argsLen === 0) { internalMessage = 'Failed'; } else if (argsLen === 1) { message = actual; actual = undefined; } else { if (warned === false) { warned = true; var warn = process.emitWarning ? process.emitWarning : console.warn.bind(console); warn('assert.fail() with more than one argument is deprecated. ' + 'Please use assert.strictEqual() instead or only pass a message.', 'DeprecationWarning', 'DEP0094'); } if (argsLen === 2) operator = '!='; } if (message instanceof Error) throw message; var errArgs = { actual: actual, expected: expected, operator: operator === undefined ? 'fail' : operator, stackStartFn: stackStartFn || fail }; if (message !== undefined) { errArgs.message = message; } var err = new AssertionError(errArgs); if (internalMessage) { err.message = internalMessage; err.generatedMessage = true; } throw err; } assert.fail = fail; // The AssertionError is defined in internal/error. assert.AssertionError = AssertionError; function innerOk(fn, argLen, value, message) { if (!value) { var generatedMessage = false; if (argLen === 0) { generatedMessage = true; message = 'No value argument passed to `assert.ok()`'; } else if (message instanceof Error) { throw message; } var err = new AssertionError({ actual: value, expected: true, message: message, operator: '==', stackStartFn: fn }); err.generatedMessage = generatedMessage; throw err; } } // Pure assertion tests whether a value is truthy, as determined // by !!value. function ok() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } innerOk.apply(void 0, [ok, args.length].concat(args)); } assert.ok = ok; // The equality assertion tests shallow, coercive equality with ==. /* eslint-disable no-restricted-properties */ assert.equal = function equal(actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected'); } // eslint-disable-next-line eqeqeq if (actual != expected) { innerFail({ actual: actual, expected: expected, message: message, operator: '==', stackStartFn: equal }); } }; // The non-equality assertion tests for whether two objects are not // equal with !=. assert.notEqual = function notEqual(actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected'); } // eslint-disable-next-line eqeqeq if (actual == expected) { innerFail({ actual: actual, expected: expected, message: message, operator: '!=', stackStartFn: notEqual }); } }; // The equivalence assertion tests a deep equality relation. assert.deepEqual = function deepEqual(actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected'); } if (isDeepEqual === undefined) lazyLoadComparison(); if (!isDeepEqual(actual, expected)) { innerFail({ actual: actual, expected: expected, message: message, operator: 'deepEqual', stackStartFn: deepEqual }); } }; // The non-equivalence assertion tests for any deep inequality. assert.notDeepEqual = function notDeepEqual(actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected'); } if (isDeepEqual === undefined) lazyLoadComparison(); if (isDeepEqual(actual, expected)) { innerFail({ actual: actual, expected: expected, message: message, operator: 'notDeepEqual', stackStartFn: notDeepEqual }); } }; /* eslint-enable */ assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected'); } if (isDeepEqual === undefined) lazyLoadComparison(); if (!isDeepStrictEqual(actual, expected)) { innerFail({ actual: actual, expected: expected, message: message, operator: 'deepStrictEqual', stackStartFn: deepStrictEqual }); } }; assert.notDeepStrictEqual = notDeepStrictEqual; function notDeepStrictEqual(actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected'); } if (isDeepEqual === undefined) lazyLoadComparison(); if (isDeepStrictEqual(actual, expected)) { innerFail({ actual: actual, expected: expected, message: message, operator: 'notDeepStrictEqual', stackStartFn: notDeepStrictEqual }); } } assert.strictEqual = function strictEqual(actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected'); } if (!objectIs(actual, expected)) { innerFail({ actual: actual, expected: expected, message: message, operator: 'strictEqual', stackStartFn: strictEqual }); } }; assert.notStrictEqual = function notStrictEqual(actual, expected, message) { if (arguments.length < 2) { throw new ERR_MISSING_ARGS('actual', 'expected'); } if (objectIs(actual, expected)) { innerFail({ actual: actual, expected: expected, message: message, operator: 'notStrictEqual', stackStartFn: notStrictEqual }); } }; var Comparison = /*#__PURE__*/_createClass(function Comparison(obj, keys, actual) { var _this = this; _classCallCheck(this, Comparison); keys.forEach(function (key) { if (key in obj) { if (actual !== undefined && typeof actual[key] === 'string' && isRegExp(obj[key]) && RegExpPrototypeTest(obj[key], actual[key])) { _this[key] = actual[key]; } else { _this[key] = obj[key]; } } }); }); function compareExceptionKey(actual, expected, key, message, keys, fn) { if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) { if (!message) { // Create placeholder objects to create a nice output. var a = new Comparison(actual, keys); var b = new Comparison(expected, keys, actual); var err = new AssertionError({ actual: a, expected: b, operator: 'deepStrictEqual', stackStartFn: fn }); err.actual = actual; err.expected = expected; err.operator = fn.name; throw err; } innerFail({ actual: actual, expected: expected, message: message, operator: fn.name, stackStartFn: fn }); } } function expectedException(actual, expected, msg, fn) { if (typeof expected !== 'function') { if (isRegExp(expected)) return RegExpPrototypeTest(expected, actual); // assert.doesNotThrow does not accept objects. if (arguments.length === 2) { throw new ERR_INVALID_ARG_TYPE('expected', ['Function', 'RegExp'], expected); } // Handle primitives properly. if (_typeof(actual) !== 'object' || actual === null) { var err = new AssertionError({ actual: actual, expected: expected, message: msg, operator: 'deepStrictEqual', stackStartFn: fn }); err.operator = fn.name; throw err; } var keys = Object.keys(expected); // Special handle errors to make sure the name and the message are compared // as well. if (expected instanceof Error) { keys.push('name', 'message'); } else if (keys.length === 0) { throw new ERR_INVALID_ARG_VALUE('error', expected, 'may not be an empty object'); } if (isDeepEqual === undefined) lazyLoadComparison(); keys.forEach(function (key) { if (typeof actual[key] === 'string' && isRegExp(expected[key]) && RegExpPrototypeTest(expected[key], actual[key])) { return; } compareExceptionKey(actual, expected, key, msg, keys, fn); }); return true; } // Guard instanceof against arrow functions as they don't have a prototype. if (expected.prototype !== undefined && actual instanceof expected) { return true; } if (Error.isPrototypeOf(expected)) { return false; } return expected.call({}, actual) === true; } function getActual(fn) { if (typeof fn !== 'function') { throw new ERR_INVALID_ARG_TYPE('fn', 'Function', fn); } try { fn(); } catch (e) { return e; } return NO_EXCEPTION_SENTINEL; } function checkIsPromise(obj) { // Accept native ES6 promises and promises that are implemented in a similar // way. Do not accept thenables that use a function as `obj` and that have no // `catch` handler. // TODO: thenables are checked up until they have the correct methods, // but according to documentation, the `then` method should receive // the `fulfill` and `reject` arguments as well or it may be never resolved. return isPromise(obj) || obj !== null && _typeof(obj) === 'object' && typeof obj.then === 'function' && typeof obj.catch === 'function'; } function waitForActual(promiseFn) { return Promise.resolve().then(function () { var resultPromise; if (typeof promiseFn === 'function') { // Return a rejected promise if `promiseFn` throws synchronously. resultPromise = promiseFn(); // Fail in case no promise is returned. if (!checkIsPromise(resultPromise)) { throw new ERR_INVALID_RETURN_VALUE('instance of Promise', 'promiseFn', resultPromise); } } else if (checkIsPromise(promiseFn)) { resultPromise = promiseFn; } else { throw new ERR_INVALID_ARG_TYPE('promiseFn', ['Function', 'Promise'], promiseFn); } return Promise.resolve().then(function () { return resultPromise; }).then(function () { return NO_EXCEPTION_SENTINEL; }).catch(function (e) { return e; }); }); } function expectsError(stackStartFn, actual, error, message) { if (typeof error === 'string') { if (arguments.length === 4) { throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error); } if (_typeof(actual) === 'object' && actual !== null) { if (actual.message === error) { throw new ERR_AMBIGUOUS_ARGUMENT('error/message', "The error message \"".concat(actual.message, "\" is identical to the message.")); } } else if (actual === error) { throw new ERR_AMBIGUOUS_ARGUMENT('error/message', "The error \"".concat(actual, "\" is identical to the message.")); } message = error; error = undefined; } else if (error != null && _typeof(error) !== 'object' && typeof error !== 'function') { throw new ERR_INVALID_ARG_TYPE('error', ['Object', 'Error', 'Function', 'RegExp'], error); } if (actual === NO_EXCEPTION_SENTINEL) { var details = ''; if (error && error.name) { details += " (".concat(error.name, ")"); } details += message ? ": ".concat(message) : '.'; var fnType = stackStartFn.name === 'rejects' ? 'rejection' : 'exception'; innerFail({ actual: undefined, expected: error, operator: stackStartFn.name, message: "Missing expected ".concat(fnType).concat(details), stackStartFn: stackStartFn }); } if (error && !expectedException(actual, error, message, stackStartFn)) { throw actual; } } function expectsNoError(stackStartFn, actual, error, message) { if (actual === NO_EXCEPTION_SENTINEL) return; if (typeof error === 'string') { message = error; error = undefined; } if (!error || expectedException(actual, error)) { var details = message ? ": ".concat(message) : '.'; var fnType = stackStartFn.name === 'doesNotReject' ? 'rejection' : 'exception'; innerFail({ actual: actual, expected: error, operator: stackStartFn.name, message: "Got unwanted ".concat(fnType).concat(details, "\n") + "Actual message: \"".concat(actual && actual.message, "\""), stackStartFn: stackStartFn }); } throw actual; } assert.throws = function throws(promiseFn) { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args)); }; assert.rejects = function rejects(promiseFn) { for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { args[_key3 - 1] = arguments[_key3]; } return waitForActual(promiseFn).then(function (result) { return expectsError.apply(void 0, [rejects, result].concat(args)); }); }; assert.doesNotThrow = function doesNotThrow(fn) { for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { args[_key4 - 1] = arguments[_key4]; } expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args)); }; assert.doesNotReject = function doesNotReject(fn) { for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) { args[_key5 - 1] = arguments[_key5]; } return waitForActual(fn).then(function (result) { return expectsNoError.apply(void 0, [doesNotReject, result].concat(args)); }); }; assert.ifError = function ifError(err) { if (err !== null && err !== undefined) { var message = 'ifError got unwanted exception: '; if (_typeof(err) === 'object' && typeof err.message === 'string') { if (err.message.length === 0 && err.constructor) { message += err.constructor.name; } else { message += err.message; } } else { message += inspect(err); } var newErr = new AssertionError({ actual: err, expected: null, operator: 'ifError', message: message, stackStartFn: ifError }); // Make sure we actually have a stack trace! var origStack = err.stack; if (typeof origStack === 'string') { // This will remove any duplicated frames from the error frames taken // from within `ifError` and add the original error frames to the newly // created ones. var tmp2 = origStack.split('\n'); tmp2.shift(); // Filter all frames existing in err.stack. var tmp1 = newErr.stack.split('\n'); for (var i = 0; i < tmp2.length; i++) { // Find the first occurrence of the frame. var pos = tmp1.indexOf(tmp2[i]); if (pos !== -1) { // Only keep new frames. tmp1 = tmp1.slice(0, pos); break; } } newErr.stack = "".concat(tmp1.join('\n'), "\n").concat(tmp2.join('\n')); } throw newErr; } }; // Currently in sync with Node.js lib/assert.js // https://github.com/nodejs/node/commit/2a871df3dfb8ea663ef5e1f8f62701ec51384ecb function internalMatch(string, regexp, message, fn, fnName) { if (!isRegExp(regexp)) { throw new ERR_INVALID_ARG_TYPE('regexp', 'RegExp', regexp); } var match = fnName === 'match'; if (typeof string !== 'string' || RegExpPrototypeTest(regexp, string) !== match) { if (message instanceof Error) { throw message; } var generatedMessage = !message; // 'The input was expected to not match the regular expression ' + message = message || (typeof string !== 'string' ? 'The "string" argument must be of type string. Received type ' + "".concat(_typeof(string), " (").concat(inspect(string), ")") : (match ? 'The input did not match the regular expression ' : 'The input was expected to not match the regular expression ') + "".concat(inspect(regexp), ". Input:\n\n").concat(inspect(string), "\n")); var err = new AssertionError({ actual: string, expected: regexp, message: message, operator: fnName, stackStartFn: fn }); err.generatedMessage = generatedMessage; throw err; } } assert.match = function match(string, regexp, message) { internalMatch(string, regexp, message, match, 'match'); }; assert.doesNotMatch = function doesNotMatch(string, regexp, message) { internalMatch(string, regexp, message, doesNotMatch, 'doesNotMatch'); }; // Expose a strict only variant of assert function strict() { for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { args[_key6] = arguments[_key6]; } innerOk.apply(void 0, [strict, args.length].concat(args)); } assert.strict = objectAssign(strict, assert, { equal: assert.strictEqual, deepEqual: assert.deepStrictEqual, notEqual: assert.notStrictEqual, notDeepEqual: assert.notDeepStrictEqual }); assert.strict.strict = assert.strict; /***/ }), /***/ "./node_modules/assert/build/internal/assert/assertion_error.js": /*!**********************************************************************!*\ !*** ./node_modules/assert/build/internal/assert/assertion_error.js ***! \**********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); // Currently in sync with Node.js lib/internal/assert/assertion_error.js // https://github.com/nodejs/node/commit/0817840f775032169ddd70c85ac059f18ffcc81c function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); } function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var _require = __webpack_require__(/*! util/ */ "./node_modules/util/util.js"), inspect = _require.inspect; var _require2 = __webpack_require__(/*! ../errors */ "./node_modules/assert/build/internal/errors.js"), ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE; // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith function endsWith(str, search, this_len) { if (this_len === undefined || this_len > str.length) { this_len = str.length; } return str.substring(this_len - search.length, this_len) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat function repeat(str, count) { count = Math.floor(count); if (str.length == 0 || count == 0) return ''; var maxCount = str.length * count; count = Math.floor(Math.log(count) / Math.log(2)); while (count) { str += str; count--; } str += str.substring(0, maxCount - str.length); return str; } var blue = ''; var green = ''; var red = ''; var white = ''; var kReadableOperator = { deepStrictEqual: 'Expected values to be strictly deep-equal:', strictEqual: 'Expected values to be strictly equal:', strictEqualObject: 'Expected "actual" to be reference-equal to "expected":', deepEqual: 'Expected values to be loosely deep-equal:', equal: 'Expected values to be loosely equal:', notDeepStrictEqual: 'Expected "actual" not to be strictly deep-equal to:', notStrictEqual: 'Expected "actual" to be strictly unequal to:', notStrictEqualObject: 'Expected "actual" not to be reference-equal to "expected":', notDeepEqual: 'Expected "actual" not to be loosely deep-equal to:', notEqual: 'Expected "actual" to be loosely unequal to:', notIdentical: 'Values identical but not reference-equal:' }; // Comparing short primitives should just show === / !== instead of using the // diff. var kMaxShortLength = 10; function copyError(source) { var keys = Object.keys(source); var target = Object.create(Object.getPrototypeOf(source)); keys.forEach(function (key) { target[key] = source[key]; }); Object.defineProperty(target, 'message', { value: source.message }); return target; } function inspectValue(val) { // The util.inspect default values could be changed. This makes sure the // error messages contain the necessary information nevertheless. return inspect(val, { compact: false, customInspect: false, depth: 1000, maxArrayLength: Infinity, // Assert compares only enumerable properties (with a few exceptions). showHidden: false, // Having a long line as error is better than wrapping the line for // comparison for now. // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we // have meta information about the inspected properties (i.e., know where // in what line the property starts and ends). breakLength: Infinity, // Assert does not detect proxies currently. showProxy: false, sorted: true, // Inspect getters as we also check them when comparing entries. getters: true }); } function createErrDiff(actual, expected, operator) { var other = ''; var res = ''; var lastPos = 0; var end = ''; var skipped = false; var actualInspected = inspectValue(actual); var actualLines = actualInspected.split('\n'); var expectedLines = inspectValue(expected).split('\n'); var i = 0; var indicator = ''; // In case both values are objects explicitly mark them as not reference equal // for the `strictEqual` operator. if (operator === 'strictEqual' && _typeof(actual) === 'object' && _typeof(expected) === 'object' && actual !== null && expected !== null) { operator = 'strictEqualObject'; } // If "actual" and "expected" fit on a single line and they are not strictly // equal, check further special handling. if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) { var inputLength = actualLines[0].length + expectedLines[0].length; // If the character length of "actual" and "expected" together is less than // kMaxShortLength and if neither is an object and at least one of them is // not `zero`, use the strict equal comparison to visualize the output. if (inputLength <= kMaxShortLength) { if ((_typeof(actual) !== 'object' || actual === null) && (_typeof(expected) !== 'object' || expected === null) && (actual !== 0 || expected !== 0)) { // -0 === +0 return "".concat(kReadableOperator[operator], "\n\n") + "".concat(actualLines[0], " !== ").concat(expectedLines[0], "\n"); } } else if (operator !== 'strictEqualObject') { // If the stderr is a tty and the input length is lower than the current // columns per line, add a mismatch indicator below the output. If it is // not a tty, use a default value of 80 characters. var maxLength = process.stderr && process.stderr.isTTY ? process.stderr.columns : 80; if (inputLength < maxLength) { while (actualLines[0][i] === expectedLines[0][i]) { i++; } // Ignore the first characters. if (i > 2) { // Add position indicator for the first mismatch in case it is a // single line and the input length is less than the column length. indicator = "\n ".concat(repeat(' ', i), "^"); i = 0; } } } } // Remove all ending lines that match (this optimizes the output for // readability by reducing the number of total changed lines). var a = actualLines[actualLines.length - 1]; var b = expectedLines[expectedLines.length - 1]; while (a === b) { if (i++ < 2) { end = "\n ".concat(a).concat(end); } else { other = a; } actualLines.pop(); expectedLines.pop(); if (actualLines.length === 0 || expectedLines.length === 0) break; a = actualLines[actualLines.length - 1]; b = expectedLines[expectedLines.length - 1]; } var maxLines = Math.max(actualLines.length, expectedLines.length); // Strict equal with identical objects that are not identical by reference. // E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() }) if (maxLines === 0) { // We have to get the result again. The lines were all removed before. var _actualLines = actualInspected.split('\n'); // Only remove lines in case it makes sense to collapse those. // TODO: Accept env to always show the full error. if (_actualLines.length > 30) { _actualLines[26] = "".concat(blue, "...").concat(white); while (_actualLines.length > 27) { _actualLines.pop(); } } return "".concat(kReadableOperator.notIdentical, "\n\n").concat(_actualLines.join('\n'), "\n"); } if (i > 3) { end = "\n".concat(blue, "...").concat(white).concat(end); skipped = true; } if (other !== '') { end = "\n ".concat(other).concat(end); other = ''; } var printedLines = 0; var msg = kReadableOperator[operator] + "\n".concat(green, "+ actual").concat(white, " ").concat(red, "- expected").concat(white); var skippedMsg = " ".concat(blue, "...").concat(white, " Lines skipped"); for (i = 0; i < maxLines; i++) { // Only extra expected lines exist var cur = i - lastPos; if (actualLines.length < i + 1) { // If the last diverging line is more than one line above and the // current line is at least line three, add some of the former lines and // also add dots to indicate skipped entries. if (cur > 1 && i > 2) { if (cur > 4) { res += "\n".concat(blue, "...").concat(white); skipped = true; } else if (cur > 3) { res += "\n ".concat(expectedLines[i - 2]); printedLines++; } res += "\n ".concat(expectedLines[i - 1]); printedLines++; } // Mark the current line as the last diverging one. lastPos = i; // Add the expected line to the cache. other += "\n".concat(red, "-").concat(white, " ").concat(expectedLines[i]); printedLines++; // Only extra actual lines exist } else if (expectedLines.length < i + 1) { // If the last diverging line is more than one line above and the // current line is at least line three, add some of the former lines and // also add dots to indicate skipped entries. if (cur > 1 && i > 2) { if (cur > 4) { res += "\n".concat(blue, "...").concat(white); skipped = true; } else if (cur > 3) { res += "\n ".concat(actualLines[i - 2]); printedLines++; } res += "\n ".concat(actualLines[i - 1]); printedLines++; } // Mark the current line as the last diverging one. lastPos = i; // Add the actual line to the result. res += "\n".concat(green, "+").concat(white, " ").concat(actualLines[i]); printedLines++; // Lines diverge } else { var expectedLine = expectedLines[i]; var actualLine = actualLines[i]; // If the lines diverge, specifically check for lines that only diverge by // a trailing comma. In that case it is actually identical and we should // mark it as such. var divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, ',') || actualLine.slice(0, -1) !== expectedLine); // If the expected line has a trailing comma but is otherwise identical, // add a comma at the end of the actual line. Otherwise the output could // look weird as in: // // [ // 1 // No comma at the end! // + 2 // ] // if (divergingLines && endsWith(expectedLine, ',') && expectedLine.slice(0, -1) === actualLine) { divergingLines = false; actualLine += ','; } if (divergingLines) { // If the last diverging line is more than one line above and the // current line is at least line three, add some of the former lines and // also add dots to indicate skipped entries. if (cur > 1 && i > 2) { if (cur > 4) { res += "\n".concat(blue, "...").concat(white); skipped = true; } else if (cur > 3) { res += "\n ".concat(actualLines[i - 2]); printedLines++; } res += "\n ".concat(actualLines[i - 1]); printedLines++; } // Mark the current line as the last diverging one. lastPos = i; // Add the actual line to the result and cache the expected diverging // line so consecutive diverging lines show up as +++--- and not +-+-+-. res += "\n".concat(green, "+").concat(white, " ").concat(actualLine); other += "\n".concat(red, "-").concat(white, " ").concat(expectedLine); printedLines += 2; // Lines are identical } else { // Add all cached information to the result before adding other things // and reset the cache. res += other; other = ''; // If the last diverging line is exactly one line above or if it is the // very first line, add the line to the result. if (cur === 1 || i === 0) { res += "\n ".concat(actualLine); printedLines++; } } } // Inspected object to big (Show ~20 rows max) if (printedLines > 20 && i < maxLines - 2) { return "".concat(msg).concat(skippedMsg, "\n").concat(res, "\n").concat(blue, "...").concat(white).concat(other, "\n") + "".concat(blue, "...").concat(white); } } return "".concat(msg).concat(skipped ? skippedMsg : '', "\n").concat(res).concat(other).concat(end).concat(indicator); } var AssertionError = /*#__PURE__*/function (_Error, _inspect$custom) { _inherits(AssertionError, _Error); var _super = _createSuper(AssertionError); function AssertionError(options) { var _this; _classCallCheck(this, AssertionError); if (_typeof(options) !== 'object' || options === null) { throw new ERR_INVALID_ARG_TYPE('options', 'Object', options); } var message = options.message, operator = options.operator, stackStartFn = options.stackStartFn; var actual = options.actual, expected = options.expected; var limit = Error.stackTraceLimit; Error.stackTraceLimit = 0; if (message != null) { _this = _super.call(this, String(message)); } else { if (process.stderr && process.stderr.isTTY) { // Reset on each call to make sure we handle dynamically set environment // variables correct. if (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1) { blue = "\x1B[34m"; green = "\x1B[32m"; white = "\x1B[39m"; red = "\x1B[31m"; } else { blue = ''; green = ''; white = ''; red = ''; } } // Prevent the error stack from being visible by duplicating the error // in a very close way to the original in case both sides are actually // instances of Error. if (_typeof(actual) === 'object' && actual !== null && _typeof(expected) === 'object' && expected !== null && 'stack' in actual && actual instanceof Error && 'stack' in expected && expected instanceof Error) { actual = copyError(actual); expected = copyError(expected); } if (operator === 'deepStrictEqual' || operator === 'strictEqual') { _this = _super.call(this, createErrDiff(actual, expected, operator)); } else if (operator === 'notDeepStrictEqual' || operator === 'notStrictEqual') { // In case the objects are equal but the operator requires unequal, show // the first object and say A equals B var base = kReadableOperator[operator]; var res = inspectValue(actual).split('\n'); // In case "actual" is an object, it should not be reference equal. if (operator === 'notStrictEqual' && _typeof(actual) === 'object' && actual !== null) { base = kReadableOperator.notStrictEqualObject; } // Only remove lines in case it makes sense to collapse those. // TODO: Accept env to always show the full error. if (res.length > 30) { res[26] = "".concat(blue, "...").concat(white); while (res.length > 27) { res.pop(); } } // Only print a single input. if (res.length === 1) { _this = _super.call(this, "".concat(base, " ").concat(res[0])); } else { _this = _super.call(this, "".concat(base, "\n\n").concat(res.join('\n'), "\n")); } } else { var _res = inspectValue(actual); var other = ''; var knownOperators = kReadableOperator[operator]; if (operator === 'notDeepEqual' || operator === 'notEqual') { _res = "".concat(kReadableOperator[operator], "\n\n").concat(_res); if (_res.length > 1024) { _res = "".concat(_res.slice(0, 1021), "..."); } } else { other = "".concat(inspectValue(expected)); if (_res.length > 512) { _res = "".concat(_res.slice(0, 509), "..."); } if (other.length > 512) { other = "".concat(other.slice(0, 509), "..."); } if (operator === 'deepEqual' || operator === 'equal') { _res = "".concat(knownOperators, "\n\n").concat(_res, "\n\nshould equal\n\n"); } else { other = " ".concat(operator, " ").concat(other); } } _this = _super.call(this, "".concat(_res).concat(other)); } } Error.stackTraceLimit = limit; _this.generatedMessage = !message; Object.defineProperty(_assertThisInitialized(_this), 'name', { value: 'AssertionError [ERR_ASSERTION]', enumerable: false, writable: true, configurable: true }); _this.code = 'ERR_ASSERTION'; _this.actual = actual; _this.expected = expected; _this.operator = operator; if (Error.captureStackTrace) { // eslint-disable-next-line no-restricted-syntax Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn); } // Create error message including the error code in the name. _this.stack; // Reset the name. _this.name = 'AssertionError'; return _possibleConstructorReturn(_this); } _createClass(AssertionError, [{ key: "toString", value: function toString() { return "".concat(this.name, " [").concat(this.code, "]: ").concat(this.message); } }, { key: _inspect$custom, value: function value(recurseTimes, ctx) { // This limits the `actual` and `expected` property default inspection to // the minimum depth. Otherwise those values would be too verbose compared // to the actual error message which contains a combined view of these two // input values. return inspect(this, _objectSpread(_objectSpread({}, ctx), {}, { customInspect: false, depth: 0 })); } }]); return AssertionError; }( /*#__PURE__*/_wrapNativeSuper(Error), inspect.custom); module.exports = AssertionError; /***/ }), /***/ "./node_modules/assert/build/internal/errors.js": /*!******************************************************!*\ !*** ./node_modules/assert/build/internal/errors.js ***! \******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Currently in sync with Node.js lib/internal/errors.js // https://github.com/nodejs/node/commit/3b044962c48fe313905877a96b5d0894a5404f6f /* eslint node-core/documented-errors: "error" */ /* eslint node-core/alphabetize-errors: "error" */ /* eslint node-core/prefer-util-format-errors: "error" */ // The whole point behind this internal module is to allow Node.js to no // longer be forced to treat every error message change as a semver-major // change. The NodeError classes here all expose a `code` property whose // value statically and permanently identifies the error. While the error // message may change, the code should not. function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var codes = {}; // Lazy loaded var assert; var util; function createErrorType(code, message, Base) { if (!Base) { Base = Error; } function getMessage(arg1, arg2, arg3) { if (typeof message === 'string') { return message; } else { return message(arg1, arg2, arg3); } } var NodeError = /*#__PURE__*/function (_Base) { _inherits(NodeError, _Base); var _super = _createSuper(NodeError); function NodeError(arg1, arg2, arg3) { var _this; _classCallCheck(this, NodeError); _this = _super.call(this, getMessage(arg1, arg2, arg3)); _this.code = code; return _this; } return _createClass(NodeError); }(Base); codes[code] = NodeError; } // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js function oneOf(expected, thing) { if (Array.isArray(expected)) { var len = expected.length; expected = expected.map(function (i) { return String(i); }); if (len > 2) { return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1]; } else if (len === 2) { return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); } else { return "of ".concat(thing, " ").concat(expected[0]); } } else { return "of ".concat(thing, " ").concat(String(expected)); } } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith function startsWith(str, search, pos) { return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith function endsWith(str, search, this_len) { if (this_len === undefined || this_len > str.length) { this_len = str.length; } return str.substring(this_len - search.length, this_len) === search; } // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes function includes(str, search, start) { if (typeof start !== 'number') { start = 0; } if (start + search.length > str.length) { return false; } else { return str.indexOf(search, start) !== -1; } } createErrorType('ERR_AMBIGUOUS_ARGUMENT', 'The "%s" argument is ambiguous. %s', TypeError); createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) { if (assert === undefined) assert = __webpack_require__(/*! ../assert */ "./node_modules/assert/build/assert.js"); assert(typeof name === 'string', "'name' must be a string"); // determiner: 'must be' or 'must not be' var determiner; if (typeof expected === 'string' && startsWith(expected, 'not ')) { determiner = 'must not be'; expected = expected.replace(/^not /, ''); } else { determiner = 'must be'; } var msg; if (endsWith(name, ' argument')) { // For cases like 'first argument' msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); } else { var type = includes(name, '.') ? 'property' : 'argument'; msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type')); } // TODO(BridgeAR): Improve the output by showing `null` and similar. msg += ". Received type ".concat(_typeof(actual)); return msg; }, TypeError); createErrorType('ERR_INVALID_ARG_VALUE', function (name, value) { var reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'is invalid'; if (util === undefined) util = __webpack_require__(/*! util/ */ "./node_modules/util/util.js"); var inspected = util.inspect(value); if (inspected.length > 128) { inspected = "".concat(inspected.slice(0, 128), "..."); } return "The argument '".concat(name, "' ").concat(reason, ". Received ").concat(inspected); }, TypeError, RangeError); createErrorType('ERR_INVALID_RETURN_VALUE', function (input, name, value) { var type; if (value && value.constructor && value.constructor.name) { type = "instance of ".concat(value.constructor.name); } else { type = "type ".concat(_typeof(value)); } return "Expected ".concat(input, " to be returned from the \"").concat(name, "\"") + " function but got ".concat(type, "."); }, TypeError); createErrorType('ERR_MISSING_ARGS', function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (assert === undefined) assert = __webpack_require__(/*! ../assert */ "./node_modules/assert/build/assert.js"); assert(args.length > 0, 'At least one arg needs to be specified'); var msg = 'The '; var len = args.length; args = args.map(function (a) { return "\"".concat(a, "\""); }); switch (len) { case 1: msg += "".concat(args[0], " argument"); break; case 2: msg += "".concat(args[0], " and ").concat(args[1], " arguments"); break; default: msg += args.slice(0, len - 1).join(', '); msg += ", and ".concat(args[len - 1], " arguments"); break; } return "".concat(msg, " must be specified"); }, TypeError); module.exports.codes = codes; /***/ }), /***/ "./node_modules/assert/build/internal/util/comparisons.js": /*!****************************************************************!*\ !*** ./node_modules/assert/build/internal/util/comparisons.js ***! \****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; // Currently in sync with Node.js lib/internal/util/comparisons.js // https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9 function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } var regexFlagsSupported = /a/g.flags !== undefined; var arrayFromSet = function arrayFromSet(set) { var array = []; set.forEach(function (value) { return array.push(value); }); return array; }; var arrayFromMap = function arrayFromMap(map) { var array = []; map.forEach(function (value, key) { return array.push([key, value]); }); return array; }; var objectIs = Object.is ? Object.is : __webpack_require__(/*! object-is */ "./node_modules/object-is/index.js"); var objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function () { return []; }; var numberIsNaN = Number.isNaN ? Number.isNaN : __webpack_require__(/*! is-nan */ "./node_modules/is-nan/index.js"); function uncurryThis(f) { return f.call.bind(f); } var hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty); var propertyIsEnumerable = uncurryThis(Object.prototype.propertyIsEnumerable); var objectToString = uncurryThis(Object.prototype.toString); var _require$types = (__webpack_require__(/*! util/ */ "./node_modules/util/util.js").types), isAnyArrayBuffer = _require$types.isAnyArrayBuffer, isArrayBufferView = _require$types.isArrayBufferView, isDate = _require$types.isDate, isMap = _require$types.isMap, isRegExp = _require$types.isRegExp, isSet = _require$types.isSet, isNativeError = _require$types.isNativeError, isBoxedPrimitive = _require$types.isBoxedPrimitive, isNumberObject = _require$types.isNumberObject, isStringObject = _require$types.isStringObject, isBooleanObject = _require$types.isBooleanObject, isBigIntObject = _require$types.isBigIntObject, isSymbolObject = _require$types.isSymbolObject, isFloat32Array = _require$types.isFloat32Array, isFloat64Array = _require$types.isFloat64Array; function isNonIndex(key) { if (key.length === 0 || key.length > 10) return true; for (var i = 0; i < key.length; i++) { var code = key.charCodeAt(i); if (code < 48 || code > 57) return true; } // The maximum size for an array is 2 ** 32 -1. return key.length === 10 && key >= Math.pow(2, 32); } function getOwnNonIndexProperties(value) { return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value))); } // Taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js // original notice: /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ function compare(a, b) { if (a === b) { return 0; } var x = a.length; var y = b.length; for (var i = 0, len = Math.min(x, y); i < len; ++i) { if (a[i] !== b[i]) { x = a[i]; y = b[i]; break; } } if (x < y) { return -1; } if (y < x) { return 1; } return 0; } var ONLY_ENUMERABLE = undefined; var kStrict = true; var kLoose = false; var kNoIterator = 0; var kIsArray = 1; var kIsSet = 2; var kIsMap = 3; // Check if they have the same source and flags function areSimilarRegExps(a, b) { return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b); } function areSimilarFloatArrays(a, b) { if (a.byteLength !== b.byteLength) { return false; } for (var offset = 0; offset < a.byteLength; offset++) { if (a[offset] !== b[offset]) { return false; } } return true; } function areSimilarTypedArrays(a, b) { if (a.byteLength !== b.byteLength) { return false; } return compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0; } function areEqualArrayBuffers(buf1, buf2) { return buf1.byteLength === buf2.byteLength && compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0; } function isEqualBoxedPrimitive(val1, val2) { if (isNumberObject(val1)) { return isNumberObject(val2) && objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2)); } if (isStringObject(val1)) { return isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2); } if (isBooleanObject(val1)) { return isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2); } if (isBigIntObject(val1)) { return isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2); } return isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2); } // Notes: Type tags are historical [[Class]] properties that can be set by // FunctionTemplate::SetClassName() in C++ or Symbol.toStringTag in JS // and retrieved using Object.prototype.toString.call(obj) in JS // See https://tc39.github.io/ecma262/#sec-object.prototype.tostring // for a list of tags pre-defined in the spec. // There are some unspecified tags in the wild too (e.g. typed array tags). // Since tags can be altered, they only serve fast failures // // Typed arrays and buffers are checked by comparing the content in their // underlying ArrayBuffer. This optimization requires that it's // reasonable to interpret their underlying memory in the same way, // which is checked by comparing their type tags. // (e.g. a Uint8Array and a Uint16Array with the same memory content // could still be different because they will be interpreted differently). // // For strict comparison, objects should have // a) The same built-in type tags // b) The same prototypes. function innerDeepEqual(val1, val2, strict, memos) { // All identical values are equivalent, as determined by ===. if (val1 === val2) { if (val1 !== 0) return true; return strict ? objectIs(val1, val2) : true; } // Check more closely if val1 and val2 are equal. if (strict) { if (_typeof(val1) !== 'object') { return typeof val1 === 'number' && numberIsNaN(val1) && numberIsNaN(val2); } if (_typeof(val2) !== 'object' || val1 === null || val2 === null) { return false; } if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) { return false; } } else { if (val1 === null || _typeof(val1) !== 'object') { if (val2 === null || _typeof(val2) !== 'object') { // eslint-disable-next-line eqeqeq return val1 == val2; } return false; } if (val2 === null || _typeof(val2) !== 'object') { return false; } } var val1Tag = objectToString(val1); var val2Tag = objectToString(val2); if (val1Tag !== val2Tag) { return false; } if (Array.isArray(val1)) { // Check for sparse arrays and general fast path if (val1.length !== val2.length) { return false; } var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE); var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE); if (keys1.length !== keys2.length) { return false; } return keyCheck(val1, val2, strict, memos, kIsArray, keys1); } // [browserify] This triggers on certain types in IE (Map/Set) so we don't // wan't to early return out of the rest of the checks. However we can check // if the second value is one of these values and the first isn't. if (val1Tag === '[object Object]') { // return keyCheck(val1, val2, strict, memos, kNoIterator); if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) { return false; } } if (isDate(val1)) { if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) { return false; } } else if (isRegExp(val1)) { if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) { return false; } } else if (isNativeError(val1) || val1 instanceof Error) { // Do not compare the stack as it might differ even though the error itself // is otherwise identical. if (val1.message !== val2.message || val1.name !== val2.name) { return false; } } else if (isArrayBufferView(val1)) { if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) { if (!areSimilarFloatArrays(val1, val2)) { return false; } } else if (!areSimilarTypedArrays(val1, val2)) { return false; } // Buffer.compare returns true, so val1.length === val2.length. If they both // only contain numeric keys, we don't need to exam further than checking // the symbols. var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE); var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE); if (_keys.length !== _keys2.length) { return false; } return keyCheck(val1, val2, strict, memos, kNoIterator, _keys); } else if (isSet(val1)) { if (!isSet(val2) || val1.size !== val2.size) { return false; } return keyCheck(val1, val2, strict, memos, kIsSet); } else if (isMap(val1)) { if (!isMap(val2) || val1.size !== val2.size) { return false; } return keyCheck(val1, val2, strict, memos, kIsMap); } else if (isAnyArrayBuffer(val1)) { if (!areEqualArrayBuffers(val1, val2)) { return false; } } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) { return false; } return keyCheck(val1, val2, strict, memos, kNoIterator); } function getEnumerables(val, keys) { return keys.filter(function (k) { return propertyIsEnumerable(val, k); }); } function keyCheck(val1, val2, strict, memos, iterationType, aKeys) { // For all remaining Object pairs, including Array, objects and Maps, // equivalence is determined by having: // a) The same number of owned enumerable properties // b) The same set of keys/indexes (although not necessarily the same order) // c) Equivalent values for every corresponding key/index // d) For Sets and Maps, equal contents // Note: this accounts for both named and indexed properties on Arrays. if (arguments.length === 5) { aKeys = Object.keys(val1); var bKeys = Object.keys(val2); // The pair must have the same number of owned properties. if (aKeys.length !== bKeys.length) { return false; } } // Cheap key test var i = 0; for (; i < aKeys.length; i++) { if (!hasOwnProperty(val2, aKeys[i])) { return false; } } if (strict && arguments.length === 5) { var symbolKeysA = objectGetOwnPropertySymbols(val1); if (symbolKeysA.length !== 0) { var count = 0; for (i = 0; i < symbolKeysA.length; i++) { var key = symbolKeysA[i]; if (propertyIsEnumerable(val1, key)) { if (!propertyIsEnumerable(val2, key)) { return false; } aKeys.push(key); count++; } else if (propertyIsEnumerable(val2, key)) { return false; } } var symbolKeysB = objectGetOwnPropertySymbols(val2); if (symbolKeysA.length !== symbolKeysB.length && getEnumerables(val2, symbolKeysB).length !== count) { return false; } } else { var _symbolKeysB = objectGetOwnPropertySymbols(val2); if (_symbolKeysB.length !== 0 && getEnumerables(val2, _symbolKeysB).length !== 0) { return false; } } } if (aKeys.length === 0 && (iterationType === kNoIterator || iterationType === kIsArray && val1.length === 0 || val1.size === 0)) { return true; } // Use memos to handle cycles. if (memos === undefined) { memos = { val1: new Map(), val2: new Map(), position: 0 }; } else { // We prevent up to two map.has(x) calls by directly retrieving the value // and checking for undefined. The map can only contain numbers, so it is // safe to check for undefined only. var val2MemoA = memos.val1.get(val1); if (val2MemoA !== undefined) { var val2MemoB = memos.val2.get(val2); if (val2MemoB !== undefined) { return val2MemoA === val2MemoB; } } memos.position++; } memos.val1.set(val1, memos.position); memos.val2.set(val2, memos.position); var areEq = objEquiv(val1, val2, strict, aKeys, memos, iterationType); memos.val1.delete(val1); memos.val2.delete(val2); return areEq; } function setHasEqualElement(set, val1, strict, memo) { // Go looking. var setValues = arrayFromSet(set); for (var i = 0; i < setValues.length; i++) { var val2 = setValues[i]; if (innerDeepEqual(val1, val2, strict, memo)) { // Remove the matching element to make sure we do not check that again. set.delete(val2); return true; } } return false; } // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness#Loose_equality_using // Sadly it is not possible to detect corresponding values properly in case the // type is a string, number, bigint or boolean. The reason is that those values // can match lots of different string values (e.g., 1n == '+00001'). function findLooseMatchingPrimitives(prim) { switch (_typeof(prim)) { case 'undefined': return null; case 'object': // Only pass in null as object! return undefined; case 'symbol': return false; case 'string': prim = +prim; // Loose equal entries exist only if the string is possible to convert to // a regular number and not NaN. // Fall through case 'number': if (numberIsNaN(prim)) { return false; } } return true; } function setMightHaveLoosePrim(a, b, prim) { var altValue = findLooseMatchingPrimitives(prim); if (altValue != null) return altValue; return b.has(altValue) && !a.has(altValue); } function mapMightHaveLoosePrim(a, b, prim, item, memo) { var altValue = findLooseMatchingPrimitives(prim); if (altValue != null) { return altValue; } var curB = b.get(altValue); if (curB === undefined && !b.has(altValue) || !innerDeepEqual(item, curB, false, memo)) { return false; } return !a.has(altValue) && innerDeepEqual(item, curB, false, memo); } function setEquiv(a, b, strict, memo) { // This is a lazily initiated Set of entries which have to be compared // pairwise. var set = null; var aValues = arrayFromSet(a); for (var i = 0; i < aValues.length; i++) { var val = aValues[i]; // Note: Checking for the objects first improves the performance for object // heavy sets but it is a minor slow down for primitives. As they are fast // to check this improves the worst case scenario instead. if (_typeof(val) === 'object' && val !== null) { if (set === null) { set = new Set(); } // If the specified value doesn't exist in the second set its an not null // object (or non strict only: a not matching primitive) we'll need to go // hunting for something thats deep-(strict-)equal to it. To make this // O(n log n) complexity we have to copy these values in a new set first. set.add(val); } else if (!b.has(val)) { if (strict) return false; // Fast path to detect missing string, symbol, undefined and null values. if (!setMightHaveLoosePrim(a, b, val)) { return false; } if (set === null) { set = new Set(); } set.add(val); } } if (set !== null) { var bValues = arrayFromSet(b); for (var _i = 0; _i < bValues.length; _i++) { var _val = bValues[_i]; // We have to check if a primitive value is already // matching and only if it's not, go hunting for it. if (_typeof(_val) === 'object' && _val !== null) { if (!setHasEqualElement(set, _val, strict, memo)) return false; } else if (!strict && !a.has(_val) && !setHasEqualElement(set, _val, strict, memo)) { return false; } } return set.size === 0; } return true; } function mapHasEqualEntry(set, map, key1, item1, strict, memo) { // To be able to handle cases like: // Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']]) // ... we need to consider *all* matching keys, not just the first we find. var setValues = arrayFromSet(set); for (var i = 0; i < setValues.length; i++) { var key2 = setValues[i]; if (innerDeepEqual(key1, key2, strict, memo) && innerDeepEqual(item1, map.get(key2), strict, memo)) { set.delete(key2); return true; } } return false; } function mapEquiv(a, b, strict, memo) { var set = null; var aEntries = arrayFromMap(a); for (var i = 0; i < aEntries.length; i++) { var _aEntries$i = _slicedToArray(aEntries[i], 2), key = _aEntries$i[0], item1 = _aEntries$i[1]; if (_typeof(key) === 'object' && key !== null) { if (set === null) { set = new Set(); } set.add(key); } else { // By directly retrieving the value we prevent another b.has(key) check in // almost all possible cases. var item2 = b.get(key); if (item2 === undefined && !b.has(key) || !innerDeepEqual(item1, item2, strict, memo)) { if (strict) return false; // Fast path to detect missing string, symbol, undefined and null // keys. if (!mapMightHaveLoosePrim(a, b, key, item1, memo)) return false; if (set === null) { set = new Set(); } set.add(key); } } } if (set !== null) { var bEntries = arrayFromMap(b); for (var _i2 = 0; _i2 < bEntries.length; _i2++) { var _bEntries$_i = _slicedToArray(bEntries[_i2], 2), _key = _bEntries$_i[0], item = _bEntries$_i[1]; if (_typeof(_key) === 'object' && _key !== null) { if (!mapHasEqualEntry(set, a, _key, item, strict, memo)) return false; } else if (!strict && (!a.has(_key) || !innerDeepEqual(a.get(_key), item, false, memo)) && !mapHasEqualEntry(set, a, _key, item, false, memo)) { return false; } } return set.size === 0; } return true; } function objEquiv(a, b, strict, keys, memos, iterationType) { // Sets and maps don't have their entries accessible via normal object // properties. var i = 0; if (iterationType === kIsSet) { if (!setEquiv(a, b, strict, memos)) { return false; } } else if (iterationType === kIsMap) { if (!mapEquiv(a, b, strict, memos)) { return false; } } else if (iterationType === kIsArray) { for (; i < a.length; i++) { if (hasOwnProperty(a, i)) { if (!hasOwnProperty(b, i) || !innerDeepEqual(a[i], b[i], strict, memos)) { return false; } } else if (hasOwnProperty(b, i)) { return false; } else { // Array is sparse. var keysA = Object.keys(a); for (; i < keysA.length; i++) { var key = keysA[i]; if (!hasOwnProperty(b, key) || !innerDeepEqual(a[key], b[key], strict, memos)) { return false; } } if (keysA.length !== Object.keys(b).length) { return false; } return true; } } } // The pair must have equivalent values for every corresponding key. // Possibly expensive deep test: for (i = 0; i < keys.length; i++) { var _key2 = keys[i]; if (!innerDeepEqual(a[_key2], b[_key2], strict, memos)) { return false; } } return true; } function isDeepEqual(val1, val2) { return innerDeepEqual(val1, val2, kLoose); } function isDeepStrictEqual(val1, val2) { return innerDeepEqual(val1, val2, kStrict); } module.exports = { isDeepEqual: isDeepEqual, isDeepStrictEqual: isDeepStrictEqual }; /***/ }), /***/ "./node_modules/available-typed-arrays/index.js": /*!******************************************************!*\ !*** ./node_modules/available-typed-arrays/index.js ***! \******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var possibleNames = __webpack_require__(/*! possible-typed-array-names */ "./node_modules/possible-typed-array-names/index.js"); var g = typeof globalThis === 'undefined' ? __webpack_require__.g : globalThis; /** @type {import('.')} */ module.exports = function availableTypedArrays() { var /** @type {ReturnType} */ out = []; for (var i = 0; i < possibleNames.length; i++) { if (typeof g[possibleNames[i]] === 'function') { // @ts-expect-error out[out.length] = possibleNames[i]; } } return out; }; /***/ }), /***/ "./node_modules/babel-helper-evaluate-path/lib/index.js": /*!**************************************************************!*\ !*** ./node_modules/babel-helper-evaluate-path/lib/index.js ***! \**************************************************************/ /***/ ((module) => { "use strict"; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } module.exports = function evaluate(path, { tdz = false } = {}) { if (!tdz && !path.isReferencedIdentifier()) { return baseEvaluate(path); } if (path.isReferencedIdentifier()) { return evaluateIdentifier(path); } const state = { confident: true }; // prepare path.traverse({ Scope(scopePath) { scopePath.skip(); }, ReferencedIdentifier(idPath) { const binding = idPath.scope.getBinding(idPath.node.name); // don't deopt globals // let babel take care of it if (!binding) return; const evalResult = evaluateIdentifier(idPath); if (!evalResult.confident) { state.confident = evalResult.confident; state.deoptPath = evalResult.deoptPath; } } }); if (!state.confident) { return state; } return baseEvaluate(path); }; function baseEvaluate(path) { try { return path.evaluate(); } catch (e) { return { confident: false, error: e }; } } // Original Source: // https://github.com/babel/babel/blob/master/packages/babel-traverse/src/path/evaluation.js // modified for Babel-minify use function evaluateIdentifier(path) { if (!path.isReferencedIdentifier()) { throw new Error(`Expected ReferencedIdentifier. Got ${path.type}`); } const node = path.node; const binding = path.scope.getBinding(node.name); if (!binding) { const name = node.name; if (!name) { return deopt(path); } switch (name) { case "undefined": return { confident: true, value: undefined }; case "NaN": return { confident: true, value: NaN }; case "Infinity": return { confident: true, value: Infinity }; default: return deopt(path); } } if (binding.constantViolations.length > 0) { return deopt(binding.path); } // referenced in a different scope - deopt if (shouldDeoptBasedOnScope(binding, path)) { return deopt(path); } // let/var/const referenced before init // or "var" referenced in an outer scope const flowEvalResult = evaluateBasedOnControlFlow(binding, path); if (flowEvalResult.confident) { return flowEvalResult; } if (flowEvalResult.shouldDeopt) { return deopt(path); } return path.evaluate(); } // check if referenced in a different fn scope // we can't determine if this function is called sync or async // if the binding is in program scope // all it's references inside a different function should be deopted function shouldDeoptBasedOnScope(binding, refPath) { if (binding.scope.path.isProgram() && refPath.scope !== binding.scope) { return true; } return false; } function evaluateBasedOnControlFlow(binding, refPath) { if (binding.kind === "var") { // early-exit const declaration = binding.path.parentPath; if (declaration.parentPath) { /** * Handle when binding is created inside a parent block and * the corresponding parent is removed by other plugins * if (false) { var a } -> var a */ if (declaration.parentPath.removed) { return { confident: true, value: void 0 }; } if (declaration.parentPath.isIfStatement() || declaration.parentPath.isLoop() || declaration.parentPath.isSwitchCase()) { return { shouldDeopt: true }; } } const fnParent = (binding.path.scope.getFunctionParent() || binding.path.scope.getProgramParent()).path; let blockParentPath = binding.path.scope.getBlockParent().path; let blockParent = blockParentPath.node; if (blockParentPath === fnParent && !fnParent.isProgram()) { blockParent = blockParent.body; } // detect Usage Outside Init Scope const blockBody = blockParent.body; if (Array.isArray(blockBody) && !blockBody.some(stmt => isAncestor(stmt, refPath))) { return { shouldDeopt: true }; } // Detect usage before init const stmts = fnParent.isProgram() ? fnParent.node.body : fnParent.node.body.body; const compareResult = compareBindingAndReference({ binding, refPath, stmts }); if (compareResult.reference && compareResult.binding) { if (compareResult.reference.scope === "current" && compareResult.reference.idx < compareResult.binding.idx) { return { confident: true, value: void 0 }; } } } else if (binding.kind === "let" || binding.kind === "const") { // binding.path is the declarator const declarator = binding.path; const declaration = declarator.parentPath; if (declaration.parentPath && (declaration.parentPath.isIfStatement() || declaration.parentPath.isLoop() || declaration.parentPath.isSwitchCase())) { return { shouldDeopt: true }; } const scopePath = declarator.scope.path; let scopeNode = scopePath.node; if (scopePath.isFunction() || scopePath.isCatchClause()) { scopeNode = scopeNode.body; } // Detect Usage before Init let stmts = scopeNode.body; if (!Array.isArray(stmts)) { stmts = [stmts]; } const compareResult = compareBindingAndReference({ binding, refPath, stmts }); if (compareResult.reference && compareResult.binding) { if (compareResult.reference.scope === "current" && compareResult.reference.idx < compareResult.binding.idx) { throw new Error(`ReferenceError: Used ${refPath.node.name}: ` + `${binding.kind} binding before declaration`); } if (compareResult.reference.scope === "other") { return { shouldDeopt: true }; } } } return { confident: false, shouldDeopt: false }; } function compareBindingAndReference({ binding, refPath, stmts }) { const state = { binding: null, reference: null }; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = stmts.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { const _step$value = _slicedToArray(_step.value, 2), idx = _step$value[0], stmt = _step$value[1]; if (isAncestor(stmt, binding.path)) { state.binding = { idx }; } var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = binding.referencePaths[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { const ref = _step2.value; if (ref === refPath && isAncestor(stmt, ref)) { state.reference = { idx, scope: binding.path.scope === ref.scope ? "current" : "other" }; break; } } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return != null) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } return state; } function deopt(deoptPath) { return { confident: false, deoptPath }; } /** * is nodeParent an ancestor of path */ function isAncestor(nodeParent, path) { return !!path.findParent(parent => parent.node === nodeParent); } /***/ }), /***/ "./node_modules/babel-helper-flip-expressions/lib/index.js": /*!*****************************************************************!*\ !*** ./node_modules/babel-helper-flip-expressions/lib/index.js ***! \*****************************************************************/ /***/ ((module) => { "use strict"; const flipSeen = Symbol("flipSeen"); module.exports = function (t) { return { hasSeen(node) { return !!node[flipSeen]; }, // Takes an expressions and determines if it has // more nodes that could benifit from flipping than not. shouldFlip(topNode, savings = 0) { visit(topNode); return savings > 0; function visit(node) { if (t.isUnaryExpression(node, { operator: "!" })) { savings++; return; } if (t.isLogicalExpression(node)) { visit(node.left); visit(node.right); return; } if (!(t.isBinaryExpression(node) && t.EQUALITY_BINARY_OPERATORS.indexOf(node.operator) > -1)) { // Binary expressions wouldn't hurut because we know how to flip them savings--; } } }, flip(node, resultNotUsed) { let lastNodeDesc; const ret = visit(node); ret[flipSeen] = true; if (resultNotUsed && lastNodeDesc) { const _lastNodeDesc = lastNodeDesc, parent = _lastNodeDesc.parent, key = _lastNodeDesc.key; if (parent && key && t.isUnaryExpression(parent[key], { operator: "!" })) { parent[key] = parent[key].argument; } } return ret; function visit(node, parent, key) { lastNodeDesc = { parent, key }; if (t.isUnaryExpression(node, { operator: "!" })) { return node.argument; } if (t.isLogicalExpression(node)) { node.operator = node.operator === "&&" ? "||" : "&&"; node.left = visit(node.left, node, "left"); node.right = visit(node.right, node, "right"); return node; } if (t.isBinaryExpression(node)) { let operator; switch (node.operator) { case "!==": operator = "==="; break; case "===": operator = "!=="; break; case "!=": operator = "=="; break; case "==": operator = "!="; break; } if (operator) { node.operator = operator; return node; } // Falls through to unary expression } return t.unaryExpression("!", node, true); } } }; }; /***/ }), /***/ "./node_modules/babel-helper-is-void-0/lib/index.js": /*!**********************************************************!*\ !*** ./node_modules/babel-helper-is-void-0/lib/index.js ***! \**********************************************************/ /***/ ((module) => { "use strict"; module.exports = function (t) { return function isVoid0(expr) { return t.isUnaryExpression(expr, { operator: "void" }) && t.isNumericLiteral(expr.argument, { value: 0 }); }; }; /***/ }), /***/ "./node_modules/babel-helper-mark-eval-scopes/lib/index.js": /*!*****************************************************************!*\ !*** ./node_modules/babel-helper-mark-eval-scopes/lib/index.js ***! \*****************************************************************/ /***/ ((module) => { "use strict"; const EVAL_SCOPE_MARKER = Symbol("evalInScope"); module.exports = { EVAL_SCOPE_MARKER, getEvalScopes, markEvalScopes, isMarked, hasEval }; function getEvalScopes(path) { const evalScopes = new Set(); function add(scope) { let evalScope = scope; do { evalScopes.add(evalScope); } while (evalScope = evalScope.parent); } path.traverse({ CallExpression(evalPath) { const callee = evalPath.get("callee"); if (callee.isIdentifier() && callee.node.name === "eval" && !callee.scope.getBinding("eval")) { add(callee.scope); } } }); return evalScopes; } function markEvalScopes(path, key = EVAL_SCOPE_MARKER) { const evalScopes = getEvalScopes(path); [...evalScopes].forEach(scope => { scope[key] = true; }); } function isMarked(scope, key = EVAL_SCOPE_MARKER) { return Object.prototype.hasOwnProperty.call(scope, key); } function hasEval(scope, key = EVAL_SCOPE_MARKER) { if (!isMarked(scope, key)) { markEvalScopes(scope, key); } return scope[key]; } /***/ }), /***/ "./node_modules/babel-helper-remove-or-void/lib/index.js": /*!***************************************************************!*\ !*** ./node_modules/babel-helper-remove-or-void/lib/index.js ***! \***************************************************************/ /***/ ((module) => { "use strict"; module.exports = function (t) { // If we can't remove the expression we'll just replace it with an empty statement. function removeOrVoid(path) { // If we are working with the expression of an expression statement we want to deal // with the expression statement instead. if (path.parentPath.isExpressionStatement({ expression: path.node })) { path = path.parentPath; } // If we are working with a variable declarator and there is only one then // we need to look at the parent. if (path.isVariableDeclarator() && path.parent.declarations[0] === path.node && path.parent.declarations.length === 1) { path = path.parentPath; } if (!path.inList && path.scope.path.type !== "ForStatement") { path.replaceWith(t.emptyStatement()); } else { path.remove(); } } return removeOrVoid; }; /***/ }), /***/ "./node_modules/babel-helper-to-multiple-sequence-expressions/lib/index.js": /*!*********************************************************************************!*\ !*** ./node_modules/babel-helper-to-multiple-sequence-expressions/lib/index.js ***! \*********************************************************************************/ /***/ ((module) => { "use strict"; module.exports = function (t) { return function toMultipleSequenceExpressions(statements) { const retStatements = []; let bailed; do { const res = convert(statements); bailed = res.bailed; const seq = res.seq, bailedAtIndex = res.bailedAtIndex; if (seq) { retStatements.push(t.expressionStatement(seq)); } if (bailed && statements[bailedAtIndex]) { retStatements.push(statements[bailedAtIndex]); } if (bailed) { statements = statements.slice(bailedAtIndex + 1); if (!statements.length) { bailed = false; } } } while (bailed); return retStatements; function convert(nodes) { const exprs = []; const comments = []; for (let i = 0; i < nodes.length; i++) { const bail = () => { let seq; if (exprs.length === 1) { seq = exprs[0]; } else if (exprs.length) { seq = t.sequenceExpression(exprs); } return { seq, bailed: true, bailedAtIndex: i }; }; const node = nodes[i]; if (t.isExpression(node)) { exprs.push(node); } else if (t.isExpressionStatement(node)) { if (node.leadingComments) { comments.push(...node.leadingComments); } if (node.expression) exprs.push(node.expression); } else if (t.isIfStatement(node)) { let consequent; if (node.consequent) { const res = convert([node.consequent]); if (res.bailed) { return bail(); } consequent = res.seq; } let alternate; if (node.alternate) { const res = convert([node.alternate]); if (res.bailed) { return bail(); } alternate = res.seq; } if (!alternate && !consequent) { exprs.push(node.test); } else if (!alternate) { exprs.push(t.logicalExpression("&&", node.test, consequent)); } else if (!consequent) { exprs.push(t.logicalExpression("||", node.test, alternate)); } else { exprs.push(t.conditionalExpression(node.test, consequent, alternate)); } } else if (t.isBlockStatement(node)) { const res = convert(node.body); if (res.bailed) { return bail(); } if (res.seq) { exprs.push(res.seq); } } else { return bail(); } } let seq; if (exprs.length === 1) { seq = exprs[0]; } else if (exprs.length) { seq = t.sequenceExpression(exprs); } /** * collect all the comment ast nodes that are before expression * statments and add it to the new generated node */ if (seq) { seq.leadingComments = comments; } /* eslint-disable no-self-assign */ seq = seq; return { seq }; } }; }; /***/ }), /***/ "./node_modules/babel-minify/lib/index.js": /*!************************************************!*\ !*** ./node_modules/babel-minify/lib/index.js ***! \************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const babelCore = __webpack_require__(/*! @babel/core */ "./node_modules/@babel/core/lib/index.js"); const babelPresetMinify = __webpack_require__(/*! babel-preset-minify */ "./node_modules/babel-preset-minify/lib/index.js"); module.exports = function babelMinify(input, // Minify options passed to minifyPreset // defaults are handled in preset minifyOptions = {}, // overrides and other options { minified = true, inputSourceMap, sourceMaps = false, sourceType = "script", comments = /^\**!|@preserve|@licen[sc]e|@cc_on/, // to override the default babelCore used babel = babelCore, // to override the default minify preset used minifyPreset = babelPresetMinify, // passthrough to babel filename, filenameRelative } = {}) { return babel.transformSync(input, { babelrc: false, configFile: false, presets: [[minifyPreset, minifyOptions]], shouldPrintComment(contents) { return shouldPrintComment(contents, comments); }, inputSourceMap, sourceMaps, minified, sourceType, filename, filenameRelative }); }; function shouldPrintComment(contents, predicate) { switch (typeof predicate) { case "function": return predicate(contents); case "object": return predicate.test(contents); default: return !!predicate; } } /***/ }), /***/ "./node_modules/babel-plugin-minify-builtins/lib/index.js": /*!****************************************************************!*\ !*** ./node_modules/babel-plugin-minify-builtins/lib/index.js ***! \****************************************************************/ /***/ ((module) => { "use strict"; // Assuming all the static methods from below array are side effect free evaluation // except Math.random function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } const VALID_CALLEES = ["String", "Number", "Math"]; const INVALID_METHODS = ["random"]; const newIssueUrl = "https://github.com/babel/minify/issues/new"; module.exports = function ({ types: t }) { class BuiltInReplacer { constructor() { // map; this.pathsToUpdate = new Map(); } getCollectVisitor() { const context = this; const collectVisitor = { AssignmentExpression(path) { const left = path.node.left; // Should bail and not run the plugin // when builtin is polyfilled if (t.isMemberExpression(left) && isBuiltInComputed(left)) { let parent = path; do { parent.stop(); } while (parent = parent.parentPath); } }, MemberExpression(path) { if (path.parentPath.isCallExpression()) { return; } const node = path.node; if (!isComputed(node) && isBuiltin(node) && !getFunctionParent(path).isProgram()) { const expName = memberToString(node); addToMap(context.pathsToUpdate, expName, path); } }, CallExpression: { exit(path) { const callee = path.get("callee"); if (!callee.isMemberExpression()) { return; } const node = callee.node; // computed property should not be optimized // Math[max]() -> Math.max() if (!isComputed(node) && isBuiltin(node) && !getFunctionParent(callee).isProgram()) { const expName = memberToString(node); addToMap(context.pathsToUpdate, expName, callee); } } } }; return collectVisitor; } replace() { var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = this.pathsToUpdate[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { const _step$value = _slicedToArray(_step.value, 2), expName = _step$value[0], paths = _step$value[1]; // transform only if there is more than 1 occurence if (paths.length <= 1) { continue; } const segmentsMap = getSegmentedSubPaths(paths); var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = segmentsMap[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { const _step2$value = _slicedToArray(_step2.value, 2), parent = _step2$value[0], subpaths = _step2$value[1]; if (subpaths.length <= 1) { continue; } const uniqueIdentifier = parent.scope.generateUidIdentifier(expName); const newNode = t.variableDeclaration("var", [t.variableDeclarator(uniqueIdentifier, subpaths[0].node)]); var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = subpaths[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { const path = _step3.value; path.replaceWith(t.clone(uniqueIdentifier)); } // hoist the created var to the top of the function scope } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return != null) { _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } const target = parent.get("body"); /** * Here, we validate a case where there is a local binding of * one of Math, String or Number. Here we have to get the * global Math instead of using the local one - so we do the * following transformation * * var _Mathmax = Math.max; * * to * * var _Mathmax = (0, eval)("this").Math.max; */ for (var _i2 = 0; _i2 < VALID_CALLEES.length; _i2++) { const builtin = VALID_CALLEES[_i2]; if (target.scope.getBinding(builtin)) { const prev = newNode.declarations[0].init; if (!t.isMemberExpression(prev)) { throw new Error(`minify-builtins expected a MemberExpression. ` + `Found ${prev.type}. ` + `Please report this at ${newIssueUrl}`); } if (!t.isMemberExpression(prev.object)) { newNode.declarations[0].init = t.memberExpression(t.memberExpression(getGlobalThis(), prev.object), prev.property); } } } target.unshiftContainer("body", newNode); } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return != null) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } } const builtInReplacer = new BuiltInReplacer(); return { name: "minify-builtins", visitor: Object.assign({}, builtInReplacer.getCollectVisitor(), { Program: { exit() { builtInReplacer.replace(); } } }) }; function memberToString(memberExprNode) { const object = memberExprNode.object, property = memberExprNode.property; let result = ""; if (t.isIdentifier(object)) result += object.name; if (t.isMemberExpression(object)) result += memberToString(object); if (t.isIdentifier(property)) result += property.name; return result; } function isBuiltInComputed(memberExprNode) { const object = memberExprNode.object, computed = memberExprNode.computed; return computed && t.isIdentifier(object) && VALID_CALLEES.indexOf(object.name) >= 0; } function isBuiltin(memberExprNode) { const object = memberExprNode.object, property = memberExprNode.property; if (t.isIdentifier(object) && t.isIdentifier(property) && VALID_CALLEES.indexOf(object.name) >= 0 && INVALID_METHODS.indexOf(property.name) < 0) { return true; } return false; } // Creates a segmented map that contains the earliest common Ancestor // as the key and array of subpaths that are descendats of the LCA as value function getSegmentedSubPaths(paths) { let segments = new Map(); // Get earliest Path in tree where paths intersect paths[0].getDeepestCommonAncestorFrom(paths, (lastCommon, index, ancestries) => { // found the LCA if (!lastCommon.isProgram()) { let fnParent; if (lastCommon.isFunction() && t.isBlockStatement(lastCommon.node.body)) { segments.set(lastCommon, paths); return; } else if (!(fnParent = getFunctionParent(lastCommon)).isProgram() && t.isBlockStatement(fnParent.node.body)) { segments.set(fnParent, paths); return; } } // Deopt and construct segments otherwise var _iteratorNormalCompletion4 = true; var _didIteratorError4 = false; var _iteratorError4 = undefined; try { for (var _iterator4 = ancestries[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { const ancestor = _step4.value; const fnPath = getChildFuncion(ancestor); if (fnPath === void 0) { continue; } const validDescendants = paths.filter(p => { return p.isDescendant(fnPath); }); segments.set(fnPath, validDescendants); } } catch (err) { _didIteratorError4 = true; _iteratorError4 = err; } finally { try { if (!_iteratorNormalCompletion4 && _iterator4.return != null) { _iterator4.return(); } } finally { if (_didIteratorError4) { throw _iteratorError4; } } } }); return segments; } function getChildFuncion(ancestors = []) { var _iteratorNormalCompletion5 = true; var _didIteratorError5 = false; var _iteratorError5 = undefined; try { for (var _iterator5 = ancestors[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { const path = _step5.value; if (path.isFunction() && t.isBlockStatement(path.node.body)) { return path; } } } catch (err) { _didIteratorError5 = true; _iteratorError5 = err; } finally { try { if (!_iteratorNormalCompletion5 && _iterator5.return != null) { _iterator5.return(); } } finally { if (_didIteratorError5) { throw _iteratorError5; } } } } /** * returns * * (0, eval)("this") */ function getGlobalThis() { return t.callExpression(t.sequenceExpression([t.valueToNode(0), t.identifier("eval")]), [t.valueToNode("this")]); } }; function addToMap(map, key, value) { if (!map.has(key)) { map.set(key, []); } map.get(key).push(value); } function isComputed(node) { return node.computed; } /** * Babel-7 returns null if there is no function parent * and uses getProgramParent to get Program */ function getFunctionParent(path) { return (path.scope.getFunctionParent() || path.scope.getProgramParent()).path; } /***/ }), /***/ "./node_modules/babel-plugin-minify-constant-folding/lib/index.js": /*!************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-constant-folding/lib/index.js ***! \************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const evaluate = __webpack_require__(/*! babel-helper-evaluate-path */ "./node_modules/babel-helper-evaluate-path/lib/index.js"); const _require = __webpack_require__(/*! ./replacements */ "./node_modules/babel-plugin-minify-constant-folding/lib/replacements.js"), FALLBACK_HANDLER = _require.FALLBACK_HANDLER; function getName(member) { if (member.computed) { switch (member.property.type) { case "StringLiteral": case "NumericLiteral": return member.property.value; case "TemplateLiteral": return; } } else { return member.property.name; } } function swap(path, member, handlers, ...args) { const key = getName(member.node); if (key === void 0) return false; let handler; if (hop(handlers, key) && typeof handlers[key] === "function") { handler = handlers[key]; } else if (typeof handlers[FALLBACK_HANDLER] === "function") { handler = handlers[FALLBACK_HANDLER].bind(member.get("object"), key); } else { return false; } const replacement = handler.apply(member.get("object"), args); if (replacement) { path.replaceWith(replacement); return true; } return false; } module.exports = babel => { const replacements = __webpack_require__(/*! ./replacements.js */ "./node_modules/babel-plugin-minify-constant-folding/lib/replacements.js")(babel); const seen = Symbol("seen"); const t = babel.types; return { name: "minify-constant-folding", visitor: { // Evaluate string expressions that are next to each other // but are not actually a binary expression. // "a" + b + "c" + "d" -> "a" + b + "cd" BinaryExpression(path) { if (!path.isBinaryExpression({ operator: "+" })) { return; } let literal, bin; const left = path.get("left"); const right = path.get("right"); if (right.isStringLiteral()) { literal = right; if (left.isBinaryExpression({ operator: "+" })) { bin = left; } else { return; } } else if (left.isStringLiteral()) { literal = left; if (right.isBinaryExpression({ operator: "+" })) { bin = right; } else { return; } } else { return; } const relevant = getLeaf(bin, literal.key); if (!relevant) { return; } const value = literal.key === "right" ? relevant.node.value + literal.node.value : literal.node.value + relevant.node.value; relevant.replaceWith(t.stringLiteral(value)); path.replaceWith(bin.node); function getLeaf(path, direction) { if (path.isStringLiteral()) { return path; } else if (path.isBinaryExpression({ operator: "+" })) { return getLeaf(path.get(direction), direction); } } }, // TODO: look into evaluating binding too (could result in more code, but gzip?) Expression(path, { opts: { tdz = false } = {} }) { const node = path.node, parent = path.parent; if (node[seen]) { return; } if (path.isLiteral()) { return; } if (!path.isPure()) { return; } // Avoid replacing the values for identifiers in exports if (t.isExportSpecifier(parent)) { return; } // -0 maybe compared via dividing and then checking against -Infinity // Also -X will always be -X. if (t.isUnaryExpression(node, { operator: "-" }) && t.isNumericLiteral(node.argument)) { return; } // We have a transform that converts true/false to !0/!1 if (t.isUnaryExpression(node, { operator: "!" }) && t.isNumericLiteral(node.argument)) { if (node.argument.value === 0 || node.argument.value === 1) { return; } } // void 0 is used for undefined. if (t.isUnaryExpression(node, { operator: "void" }) && t.isNumericLiteral(node.argument, { value: 0 })) { return; } const res = evaluate(path, { tdz }); if (res.confident) { // Avoid fractions because they can be longer than the original expression. // There is also issues with number precision? if (typeof res.value === "number" && !Number.isInteger(res.value)) { return; } // Preserve -0 if (typeof res.value === "number" && res.value === 0) { if (1 / res.value === -Infinity) { const node = t.unaryExpression("-", t.numericLiteral(0), true); node[seen] = true; path.replaceWith(node); return; } } // this will convert object to object but // t.valueToNode has other effects where property name // is not treated for the respective environment. // So we bail here for objects and let other plugins // take care of converting String literal to Identifier if (typeof res.value === "object") { return; } const node = t.valueToNode(res.value); node[seen] = true; path.replaceWith(node); } }, CallExpression(path) { const node = path.node; const member = path.get("callee"); if (t.isMemberExpression(member)) { const helpers = replacements[member.node.object.type]; if (!helpers || !helpers.calls) return; // find if the input can be constant folded if (typeof helpers.canReplace === "function" && !helpers.canReplace.call(member.get("object"))) { return; } swap(path, member, helpers.calls, ...node.arguments); } }, MemberExpression(path) { const node = path.node; const helpers = replacements[node.object.type]; if (!helpers || !helpers.members) return; swap(path, path, helpers.members); } } }; }; function hop(o, key) { return Object.prototype.hasOwnProperty.call(o, key); } /***/ }), /***/ "./node_modules/babel-plugin-minify-constant-folding/lib/replacements.js": /*!*******************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-constant-folding/lib/replacements.js ***! \*******************************************************************************/ /***/ ((module) => { "use strict"; const FALLBACK_HANDLER = Symbol("fallback handler"); module.exports = ({ types: t }) => { const undef = t.unaryExpression("void", t.numericLiteral(0)); function isUndef(ob) { return ob === undefined || t.isIdentifier(ob, { name: "undefined" }) || t.isUnaryExpression(ob, { operator: "void" }); } function defaultZero(cb) { return function (i = t.numericLiteral(0), ...args) { if (t.isNumericLiteral(i)) { return cb.call(this.node, this.node, i.value, ...args); } }; } function hasSpread(node) { return node.elements.some(el => t.isSpreadElement(el)); } return { ArrayExpression: { canReplace() { return !hasSpread(this.node); }, members: { length() { if (hasSpread(this.node)) { return; } return t.numericLiteral(this.node.elements.length); }, [FALLBACK_HANDLER](i) { if (hasSpread(this.node)) { return; } if (typeof i === "number" || i.match(/^\d+$/)) { return this.node.elements[i] || undef; } } }, calls: { join(sep = t.stringLiteral(",")) { if (!t.isStringLiteral(sep)) return; let bad = false; const str = this.get("elements").map(el => { const evaled = el.evaluate(); if (!evaled.confident) { bad = true; return; } return evaled.value; }).join(sep.value); return bad ? void 0 : t.stringLiteral(str); }, push(...args) { return t.numericLiteral(this.node.elements.length + args.length); }, shift() { if (this.node.elements.length === 0) { return undef; } return t.numericLiteral(this.node.elements.length - 1); }, slice(start = t.numericLiteral(0), end) { if (!t.isNumericLiteral(start) || end && !t.isNumericLiteral(end)) { return; } return t.arrayExpression(this.node.elements.slice(start.value, end && end.value)); }, pop() { return this.node.elements[this.node.elements.length - 1] || undef; }, reverse() { return t.arrayExpression(this.node.elements.reverse()); }, splice(start, end, ...args) { if (!t.isNumericLiteral(start) || end && !t.isNumericLiteral(end)) { return; } if (end) { args.unshift(end.value); } return t.arrayExpression(this.node.elements.slice().splice(start.value, ...args)); } } }, StringLiteral: { members: { length() { return t.numericLiteral(this.node.value.length); }, [FALLBACK_HANDLER](i) { if (typeof i === "number" || i.match(/^\d+$/)) { const ch = this.node.value[i]; return ch ? t.stringLiteral(ch) : undef; } } }, calls: { split(sep = undef) { let realSep = null; if (t.isStringLiteral(sep)) { realSep = sep.value; } if (isUndef(sep)) { realSep = sep; } if (realSep !== null) { return t.arrayExpression(this.node.value.split(realSep).map(str => t.stringLiteral(str))); } }, charAt: defaultZero(({ value }, i) => t.stringLiteral(value.charAt(i))), charCodeAt: defaultZero(({ value }, i) => t.numericLiteral(value.charCodeAt(i))), codePointAt: defaultZero(({ value }, i) => t.numericLiteral(value.codePointAt(i))) } } }; }; module.exports.FALLBACK_HANDLER = FALLBACK_HANDLER; /***/ }), /***/ "./node_modules/babel-plugin-minify-dead-code-elimination/lib/index.js": /*!*****************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-dead-code-elimination/lib/index.js ***! \*****************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } const some = __webpack_require__(/*! lodash/some */ "./node_modules/lodash/some.js"); const _require = __webpack_require__(/*! babel-helper-mark-eval-scopes */ "./node_modules/babel-helper-mark-eval-scopes/lib/index.js"), markEvalScopes = _require.markEvalScopes, hasEval = _require.hasEval; const removeUseStrict = __webpack_require__(/*! ./remove-use-strict */ "./node_modules/babel-plugin-minify-dead-code-elimination/lib/remove-use-strict.js"); const evaluate = __webpack_require__(/*! babel-helper-evaluate-path */ "./node_modules/babel-helper-evaluate-path/lib/index.js"); function evaluateTruthy(path) { const res = evaluate(path); if (res.confident) return !!res.value; } function prevSiblings(path) { const parentPath = path.parentPath; const siblings = []; let key = parentPath.key; while ((path = parentPath.getSibling(--key)).type) { siblings.push(path); } return siblings; } function forEachAncestor(path, callback) { while (path = path.parentPath) { callback(path); } } module.exports = ({ types: t, traverse }) => { const removeOrVoid = __webpack_require__(/*! babel-helper-remove-or-void */ "./node_modules/babel-helper-remove-or-void/lib/index.js")(t); const shouldRevisit = Symbol("shouldRevisit"); // this is used for tracking fn params that can be removed // as traversal takes place from left and // unused params can be removed only on the right const markForRemoval = Symbol("markForRemoval"); const main = { // remove side effectless statement ExpressionStatement(path) { if (path.get("expression").isPure()) { removeOrVoid(path); } }, Function: { // Let's take all the vars in a function that are not in the top level scope and hoist them // with the first var declaration in the top-level scope. This transform in itself may // not yield much returns (or even can be marginally harmful to size). However it's great // for taking away statements from blocks that can be only expressions which the `simplify` // plugin can turn into other things (e.g. if => conditional). exit(path) { // This hurts gzip size. if (!this.optimizeRawSize) { return; } const node = path.node, scope = path.scope; const seen = new Set(); const declars = []; const mutations = []; for (const name in scope.bindings) { const binding = scope.bindings[name]; if (!binding.path.isVariableDeclarator()) { continue; } const declarPath = binding.path.parentPath; if (seen.has(declarPath)) { continue; } seen.add(declarPath); if (declarPath.parentPath.isForInStatement()) { continue; } if (declarPath.parentPath.parentPath.isFunction()) { continue; } if (!declarPath.node || !declarPath.node.declarations) { continue; } const assignmentSequence = []; var _iterator = _createForOfIteratorHelper(declarPath.node.declarations), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { const declar = _step.value; declars.push(declar); if (declar.init) { assignmentSequence.push(t.assignmentExpression("=", declar.id, declar.init)); mutations.push(() => { declar.init = null; }); } } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } if (assignmentSequence.length) { mutations.push(() => declarPath.replaceWith(t.sequenceExpression(assignmentSequence))); } else { mutations.push(() => removeOrVoid(declarPath)); } } if (declars.length) { mutations.forEach(f => f()); var _iterator2 = _createForOfIteratorHelper(node.body.body), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { const statement = _step2.value; if (t.isVariableDeclaration(statement)) { statement.declarations.push(...declars); return; } } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } const varDecl = t.variableDeclaration("var", declars); node.body.body.unshift(varDecl); } } }, // Remove bindings with no references. Scope: { exit(path) { if (path.node[shouldRevisit]) { delete path.node[shouldRevisit]; path.visit(); } }, enter(path) { if (path.isProgram()) { return; } if (hasEval(path.scope)) { return; } const scope = path.scope; // if the scope is created by a function, we obtain its // parameter list const canRemoveParams = path.isFunction() && path.node.kind !== "set"; const paramsList = canRemoveParams ? path.get("params") : []; for (let i = paramsList.length - 1; i >= 0; i--) { const param = paramsList[i]; if (param.isIdentifier()) { const binding = scope.bindings[param.node.name]; if (!binding) continue; if (binding.referenced) { // when the first binding is referenced (right to left) // exit without marking anything after this break; } binding[markForRemoval] = true; continue; } else if (param.isAssignmentPattern()) { const left = param.get("left"); const right = param.get("right"); if (left.isIdentifier() && right.isPure()) { const binding = scope.bindings[left.node.name]; if (binding.referenced) { // when the first binding is referenced (right to left) // exit without marking anything after this break; } binding[markForRemoval] = true; continue; } } // other patterns - assignment, object have side-effects // and cannot be safely removed break; } for (const name in scope.bindings) { const binding = scope.bindings[name]; if (!binding.referenced && binding.kind !== "module") { if (binding.kind === "param" && (this.keepFnArgs || !binding[markForRemoval])) { continue; } else if (binding.path.isVariableDeclarator()) { const declaration = binding.path.parentPath; const maybeBlockParent = declaration.parentPath; if (maybeBlockParent && maybeBlockParent.isForXStatement({ left: declaration.node })) { // Can't remove if in a for-in/for-of/for-await statement `for (var x in wat)`. continue; } } else if (!scope.isPure(binding.path.node)) { // TODO: AssignmentPattern are marked as impure and unused ids aren't removed yet continue; } else if (binding.path.isFunctionExpression() || binding.path.isClassExpression()) { // `bar(function foo() {})` foo is not referenced but it's used. continue; } else if ( // ClassDeclaration has binding in two scopes // 1. The scope in which it is declared // 2. The class's own scope binding.path.isClassDeclaration() && binding.path === scope.path) { continue; } const mutations = []; let bail = false; // Make sure none of the assignments value is used binding.constantViolations.forEach(p => { if (bail || p === binding.path) { return; } if (!p.parentPath.isExpressionStatement()) { bail = true; } if (p.isAssignmentExpression()) { if (t.isArrayPattern(p.node.left) || t.isObjectPattern(p.node.left)) { bail = true; } else if (p.get("right").isPure()) { mutations.push(() => removeOrVoid(p)); } else { mutations.push(() => p.replaceWith(p.get("right"))); } } }); if (bail) { continue; } if (binding.path.isVariableDeclarator()) { if (!binding.path.get("id").isIdentifier()) { // deopt for object and array pattern continue; } // if declarator has some impure init expression // var x = foo(); // => foo(); if (binding.path.node.init && !scope.isPure(binding.path.node.init) && binding.path.parentPath.node.declarations) { // binding path has more than one declarations if (binding.path.parentPath.node.declarations.length !== 1) { continue; } binding.path.parentPath.replaceWith(binding.path.node.init); } else { updateReferences(binding.path, this); removeOrVoid(binding.path); } } else { updateReferences(binding.path, this); removeOrVoid(binding.path); } mutations.forEach(f => f()); scope.removeBinding(name); } else if (binding.constant) { if (binding.path.isFunctionDeclaration() || binding.path.isVariableDeclarator() && binding.path.get("init").isFunction()) { const fun = binding.path.isFunctionDeclaration() ? binding.path : binding.path.get("init"); let allInside = true; var _iterator3 = _createForOfIteratorHelper(binding.referencePaths), _step3; try { for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { const ref = _step3.value; if (!ref.find(p => p.node === fun.node)) { allInside = false; break; } } } catch (err) { _iterator3.e(err); } finally { _iterator3.f(); } if (allInside) { scope.removeBinding(name); updateReferences(binding.path, this); removeOrVoid(binding.path); continue; } } if (binding.references === 1 && binding.kind !== "param" && binding.kind !== "module" && binding.constant) { let replacement = binding.path.node; let replacementPath = binding.path; let isReferencedBefore = false; const refPath = binding.referencePaths[0]; if (t.isVariableDeclarator(replacement)) { const _prevSiblings = prevSiblings(replacementPath); // traverse ancestors of a reference checking if it's before declaration forEachAncestor(refPath, ancestor => { if (_prevSiblings.indexOf(ancestor) > -1) { isReferencedBefore = true; } }); // deopt if reference is in different scope than binding // since we don't know if it's sync or async execution // (i.e. whether value has been assigned to a reference or not) if (isReferencedBefore && refPath.scope !== binding.scope) { continue; } // simulate hoisting by replacing value // with undefined if declaration is after reference replacement = isReferencedBefore ? t.unaryExpression("void", t.numericLiteral(0), true) : replacement.init; // Bail out for ArrayPattern and ObjectPattern // TODO: maybe a more intelligent approach instead of simply bailing out if (!replacementPath.get("id").isIdentifier()) { continue; } replacementPath = replacementPath.get("init"); } if (!replacement) { continue; } if (!scope.isPure(replacement, true) && !isReferencedBefore) { continue; } let bail = false; if (replacementPath.isIdentifier()) { const binding = scope.getBinding(replacement.name); // the reference should be in the same scope // and the replacement should be a constant - this is to // ensure that the duplication of replacement is not affected // https://github.com/babel/minify/issues/685 bail = !(binding && refPath.scope.getBinding(replacement.name) === binding && binding.constantViolations.length === 0); } else if (replacementPath.isThisExpression()) { bail = true; } else { replacementPath.traverse({ Function(path) { path.skip(); }, ThisExpression(path) { bail = true; path.stop(); }, ReferencedIdentifier({ node }) { const binding = scope.getBinding(node.name); if (binding && refPath.scope.getBinding(node.name) === binding) { bail = binding.constantViolations.length > 0; if (bail) { path.stop(); } } } }); } if (bail) { continue; } let parent = binding.path.parent; if (t.isVariableDeclaration(parent)) { parent = binding.path.parentPath.parent; } // 1. Make sure we share the parent with the node. In other words it's lexically defined // and not in an if statement or otherwise. // 2. If the replacement is an object then we have to make sure we are not in a loop or a function // because otherwise we'll be inlining and doing a lot more allocation than we have to // which would also could affect correctness in that they are not the same reference. let mayLoop = false; const sharesRoot = refPath.find(({ node }) => { if (!mayLoop) { mayLoop = t.isWhileStatement(node) || t.isFor(node) || t.isFunction(node); } return node === parent; }); // Anything that inherits from Object. const isObj = n => t.isFunction(n) || t.isObjectExpression(n) || t.isArrayExpression(n) || t.isRegExpLiteral(n); const isReplacementObj = isObj(replacement) || some(replacement, isObj); if (!sharesRoot || isReplacementObj && mayLoop) { continue; } // check if it's safe to replace // To solve https://github.com/babel/minify/issues/691 // Here we bail for property checks using the "in" operator // This is because - `in` is a side-effect-free operation but the property // could be deleted between the replacementPath and referencePath // It is expensive to compute the delete operation and we bail for // all the binary "in" operations let inExpression = replacementPath.isBinaryExpression({ operator: "in" }); if (!inExpression) { replacementPath.traverse({ Function(path) { path.skip(); }, BinaryExpression(path) { if (path.node.operator === "in") { inExpression = true; path.stop(); } } }); } if (inExpression) { continue; } const replaced = replace(binding.referencePaths[0], { binding, scope, replacement, replacementPath }); if (replaced) { scope.removeBinding(name); if (binding.path.node) { removeOrVoid(binding.path); } } } } } // end-for-of } }, // Remove unreachable code. BlockStatement(path) { const paths = path.get("body"); let purge = false; for (let i = 0; i < paths.length; i++) { const p = paths[i]; if (!purge && p.isCompletionStatement()) { purge = true; continue; } if (purge && !canExistAfterCompletion(p)) { removeOrVoid(p); } } }, // Double check unreachable code and remove return statements that // have no semantic meaning ReturnStatement(path) { const node = path.node; if (!path.inList) { return; } // Not last in its block? (See BlockStatement visitor) if (path.container.length - 1 !== path.key && !canExistAfterCompletion(path.getSibling(path.key + 1)) && path.parentPath.isBlockStatement()) { // This is probably a new oppurtinity by some other transform // let's call the block visitor on this again before proceeding. path.parentPath.pushContext(path.context); path.parentPath.visit(); path.parentPath.popContext(); return; } if (node.argument) { return; } let noNext = true; let parentPath = path.parentPath; while (parentPath && !parentPath.isFunction() && noNext) { // https://github.com/babel/minify/issues/265 if (hasLoopParent(parentPath)) { noNext = false; break; } const nextPath = parentPath.getSibling(parentPath.key + 1); if (nextPath.node) { if (nextPath.isReturnStatement()) { nextPath.pushContext(path.context); nextPath.visit(); nextPath.popContext(); if (parentPath.getSibling(parentPath.key + 1).node) { noNext = false; break; } } else { noNext = false; break; } } parentPath = parentPath.parentPath; } if (noNext) { removeOrVoid(path); } }, ConditionalExpression(path) { const node = path.node; const evaluateTest = evaluateTruthy(path.get("test")); if (evaluateTest === true) { path.replaceWith(node.consequent); } else if (evaluateTest === false) { path.replaceWith(node.alternate); } }, SwitchStatement: { exit(path) { const discriminantPath = path.get("discriminant"); const evaluated = evaluate(discriminantPath, { tdz: this.tdz }); if (!evaluated.confident) return; // the simplify transformation might have brought in the previous // expressions into the switch's test expression and instead of // bailing out of impure path, we collect the impurities of it's // a sequence expression and bail out if the primary test itself // is impure let beforeTest = []; if (t.isSequenceExpression(discriminantPath.node)) { const expressions = discriminantPath.get("expressions"); const lastExpression = expressions[expressions.length - 1]; if (!lastExpression.isPure()) { return; } beforeTest = [t.expressionStatement(t.sequenceExpression(expressions.slice(0, expressions.length - 1).map(path => path.node)))]; } else if (!discriminantPath.isPure()) { return; } const discriminant = evaluated.value; const cases = path.get("cases"); let matchingCaseIndex = -1; let defaultCaseIndex = -1; for (let i = 0; i < cases.length; i++) { const test = cases[i].get("test"); // handle default case if (test.node === null) { defaultCaseIndex = i; continue; } const testResult = evaluate(test, { tdz: this.tdz }); // if we are not able to deternine a test during // compile time, we terminate immediately if (!testResult.confident) return; if (testResult.value === discriminant) { matchingCaseIndex = i; break; } } let result; if (matchingCaseIndex === -1) { if (defaultCaseIndex === -1) { path.skip(); path.replaceWithMultiple(extractVars(path)); return; } else { result = getStatementsUntilBreak(defaultCaseIndex); } } else { result = getStatementsUntilBreak(matchingCaseIndex); } if (result.bail) return; // we extract vars from the entire switch statement // and there will be duplicates which // will be again removed by DCE replaceSwitch([...extractVars(path), ...beforeTest, ...result.statements]); function getStatementsUntilBreak(start) { const result = { bail: false, statements: [] }; for (let i = start; i < cases.length; i++) { const consequent = cases[i].get("consequent"); for (let j = 0; j < consequent.length; j++) { const _isBreaking = isBreaking(consequent[j], path); if (_isBreaking.bail) { result.bail = true; return result; } if (_isBreaking.break) { // compute no more // exit out of the loop return result; } else { result.statements.push(consequent[j].node); } } } return result; } function replaceSwitch(statements) { let isBlockRequired = false; for (let i = 0; i < statements.length; i++) { if (t.isVariableDeclaration(statements[i], { kind: "let" })) { isBlockRequired = true; break; } if (t.isVariableDeclaration(statements[i], { kind: "const" })) { isBlockRequired = true; break; } } if (isBlockRequired) { path.replaceWith(t.BlockStatement(statements)); } else { path.replaceWithMultiple(statements); } } } }, WhileStatement(path) { const test = path.get("test"); const result = evaluate(test, { tdz: this.tdz }); if (result.confident && test.isPure() && !result.value) { path.replaceWithMultiple(extractVars(path.get("body"))); } }, ForStatement(path) { const test = path.get("test"); if (!test.isPure()) return; const result = evaluate(test, { tdz: this.tdz }); if (result.confident) { if (result.value) { test.remove(); } else { const init = path.get("init"); if (init.node && !init.isPure()) { path.replaceWith(init); } else { path.remove(); } } } }, DoWhileStatement(path) { const test = path.get("test"); const result = evaluate(test, { tdz: this.tdz }); if (result.confident && test.isPure() && !result.value) { const body = path.get("body"); if (body.isBlockStatement()) { const stmts = body.get("body"); var _iterator4 = _createForOfIteratorHelper(stmts), _step4; try { for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { const stmt = _step4.value; const _isBreaking = isBreaking(stmt, path); if (_isBreaking.bail || _isBreaking.break) return; const _isContinuing = isContinuing(stmt, path); if (_isContinuing.bail || isContinuing.continue) return; } } catch (err) { _iterator4.e(err); } finally { _iterator4.f(); } path.replaceWith(body.node); } else if (body.isBreakStatement()) { const _isBreaking = isBreaking(body, path); if (_isBreaking.bail) return; if (_isBreaking.break) path.remove(); } else if (body.isContinueStatement()) { return; } else { path.replaceWith(body.node); } } }, // Join assignment and definition when in sequence. // var x; x = 1; -> var x = 1; AssignmentExpression(path) { if (!path.get("left").isIdentifier() || !path.parentPath.isExpressionStatement()) { return; } const prev = path.parentPath.getSibling(path.parentPath.key - 1); if (!(prev && prev.isVariableDeclaration())) { return; } const declars = prev.node.declarations; if (declars.length !== 1 || declars[0].init || declars[0].id.name !== path.get("left").node.name) { return; } declars[0].init = path.node.right; removeOrVoid(path); }, // Remove named function expression name. While this is dangerous as it changes // `function.name` all minifiers do it and hence became a standard. FunctionExpression(path) { if (!this.keepFnName) { removeUnreferencedId(path); } }, // remove class names ClassExpression(path) { if (!this.keepClassName) { removeUnreferencedId(path); } }, // Put the `var` in the left if feasible. ForInStatement(path) { const left = path.get("left"); if (!left.isIdentifier()) { return; } const binding = path.scope.getBinding(left.node.name); if (!binding) { return; } if (binding.scope.getFunctionParent() !== path.scope.getFunctionParent()) { return; } if (!binding.path.isVariableDeclarator()) { return; } if (binding.path.parentPath.parentPath.isForInStatement({ left: binding.path.parent })) { return; } // If it has company then it's probably more efficient to keep. if (binding.path.parent.declarations.length > 1) { return; } // meh if (binding.path.node.init) { return; } removeOrVoid(binding.path); path.node.left = t.variableDeclaration("var", [t.variableDeclarator(left.node)]); binding.path = path.get("left").get("declarations")[0]; } }; return { name: "minify-dead-code-elimination", visitor: { Function: { exit(path) { /** * Use exit handler to traverse in a dfs post-order fashion * to remove use strict */ const body = path.get("body"); if (body.isBlockStatement()) { removeUseStrict(body); } } }, IfStatement: { exit(path, { opts: { tdz = false } = {} }) { const consequent = path.get("consequent"); const alternate = path.get("alternate"); const test = path.get("test"); const evalResult = evaluate(test, { tdz }); const isPure = test.isPure(); const replacements = []; if (evalResult.confident && !isPure && test.isSequenceExpression()) { replacements.push(t.expressionStatement(extractSequenceImpure(test))); } // we can check if a test will be truthy 100% and if so then we can inline // the consequent and completely ignore the alternate // // if (true) { foo; } -> { foo; } // if ("foo") { foo; } -> { foo; } // if (evalResult.confident && evalResult.value) { path.replaceWithMultiple([...replacements, ...toStatements(consequent), ...extractVars(alternate)]); return; } // we can check if a test will be falsy 100% and if so we can inline the // alternate if there is one and completely remove the consequent // // if ("") { bar; } else { foo; } -> { foo; } // if ("") { bar; } -> // if (evalResult.confident && !evalResult.value) { if (alternate.node) { path.replaceWithMultiple([...replacements, ...toStatements(alternate), ...extractVars(consequent)]); return; } else { path.replaceWithMultiple([...replacements, ...extractVars(consequent)]); } } // remove alternate blocks that are empty // // if (foo) { foo; } else {} -> if (foo) { foo; } // if (alternate.isBlockStatement() && !alternate.node.body.length) { alternate.remove(); // For if-statements babel-traverse replaces with an empty block path.node.alternate = null; } // if the consequent block is empty turn alternate blocks into a consequent // and flip the test // // if (foo) {} else { bar; } -> if (!foo) { bar; } // if (consequent.isBlockStatement() && !consequent.node.body.length && alternate.isBlockStatement() && alternate.node.body.length) { consequent.replaceWith(alternate.node); alternate.remove(); // For if-statements babel-traverse replaces with an empty block path.node.alternate = null; test.replaceWith(t.unaryExpression("!", test.node, true)); } } }, EmptyStatement(path) { if (path.parentPath.isBlockStatement() || path.parentPath.isProgram()) { path.remove(); } }, Program: { exit(path, { opts: { // set defaults optimizeRawSize = false, keepFnName = false, keepClassName = false, keepFnArgs = false, tdz = false } = {} } = {}) { (traverse.clearCache || traverse.cache.clear)(); path.scope.crawl(); markEvalScopes(path); // We need to run this plugin in isolation. path.traverse(main, { functionToBindings: new Map(), optimizeRawSize, keepFnName, keepClassName, keepFnArgs, tdz }); } } } }; function toStatements(path) { const node = path.node; if (path.isBlockStatement()) { let hasBlockScoped = false; for (let i = 0; i < node.body.length; i++) { const bodyNode = node.body[i]; if (t.isBlockScoped(bodyNode)) { hasBlockScoped = true; } } if (!hasBlockScoped) { return node.body; } } return [node]; } // Extracts vars from a path // Useful for removing blocks or paths that can contain // variable declarations inside them // Note: // drops are inits // extractVars({ var x = 5, y = x }) => var x, y; function extractVars(path) { const declarators = []; if (path.isVariableDeclaration({ kind: "var" })) { var _iterator5 = _createForOfIteratorHelper(path.node.declarations), _step5; try { for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) { const decl = _step5.value; const bindingIds = Object.keys(t.getBindingIdentifiers(decl.id)); declarators.push(...bindingIds.map(name => t.variableDeclarator(t.identifier(name)))); } } catch (err) { _iterator5.e(err); } finally { _iterator5.f(); } } else { path.traverse({ VariableDeclaration(varPath) { if (!varPath.isVariableDeclaration({ kind: "var" })) return; if (!isSameFunctionScope(varPath, path)) return; var _iterator6 = _createForOfIteratorHelper(varPath.node.declarations), _step6; try { for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) { const decl = _step6.value; const bindingIds = Object.keys(t.getBindingIdentifiers(decl.id)); declarators.push(...bindingIds.map(name => t.variableDeclarator(t.identifier(name)))); } } catch (err) { _iterator6.e(err); } finally { _iterator6.f(); } } }); } if (declarators.length <= 0) return []; return [t.variableDeclaration("var", declarators)]; } function replace(path, options) { const replacement = options.replacement, replacementPath = options.replacementPath, scope = options.scope, binding = options.binding; // Same name, different binding. if (scope.getBinding(path.node.name) !== binding) { return; } // We don't want to move code around to different scopes because: // 1. Original bindings that is referenced could be shadowed // 2. Moving defintions to potentially hot code is bad if (scope !== path.scope) { if (t.isClass(replacement) || t.isFunction(replacement)) { return; } let bail = false; traverse(replacement, { Function(path) { if (bail) { return; } bail = true; path.stop(); } }, scope); if (bail) { return; } } // Avoid recursion. if (path.find(({ node }) => node === replacement)) { return; } // https://github.com/babel/minify/issues/611 // this is valid only for FunctionDeclaration where we convert // function declaration to expression in the next step if (replacementPath.isFunctionDeclaration()) { const fnName = replacementPath.get("id").node.name; for (let name in replacementPath.scope.bindings) { if (name === fnName) { return; } } } // https://github.com/babel/minify/issues/130 if (!t.isExpression(replacement)) { t.toExpression(replacement); } // We don't remove fn name here, we let the FnExpr & ClassExpr visitors // check its references and remove unreferenced ones // if (t.isFunction(replacement)) { // replacement.id = null; // } path.replaceWith(replacement); return true; } function updateReferences(fnToDeletePath) { if (!fnToDeletePath.isFunction()) { return; } fnToDeletePath.traverse({ ReferencedIdentifier(path) { const node = path.node, scope = path.scope; const binding = scope.getBinding(node.name); if (!binding || !binding.path.isFunction() || binding.scope === scope || !binding.constant) { return; } const index = binding.referencePaths.indexOf(path); if (index === -1) { return; } binding.references--; binding.referencePaths.splice(index, 1); if (binding.references === 0) { binding.referenced = false; } if (binding.references <= 1 && binding.scope.path.node) { binding.scope.path.node[shouldRevisit] = true; } } }); } function removeUnreferencedId(path) { const id = path.get("id").node; if (!id) { return; } const node = path.node, scope = path.scope; const binding = scope.getBinding(id.name); // Check if shadowed or is not referenced. if (binding && (binding.path.node !== node || !binding.referenced)) { node.id = null; } } // path1 -> path2 // is path1 an ancestor of path2 function isAncestor(path1, path2) { return !!path2.findParent(parent => parent === path1); } function isSameFunctionScope(path1, path2) { return path1.scope.getFunctionParent() === path2.scope.getFunctionParent(); } function isBreaking(stmt, path) { return isControlTransfer(stmt, path, "break"); } function isContinuing(stmt, path) { return isControlTransfer(stmt, path, "continue"); } // tells if a "stmt" is a break/continue statement function isControlTransfer(stmt, path, control = "break") { const _break$continue = { break: "BreakStatement", continue: "ContinueStatement" }, type = _break$continue[control]; if (!type) { throw new Error("Can only handle break and continue statements"); } const checker = `is${type}`; if (stmt[checker]()) { return _isControlTransfer(stmt, path); } let isTransferred = false; let result = { [control]: false, bail: false }; stmt.traverse({ [type](cPath) { // if we already detected a break/continue statement, if (isTransferred) return; result = _isControlTransfer(cPath, path); if (result.bail || result[control]) { isTransferred = true; } } }); return result; function _isControlTransfer(cPath, path) { const label = cPath.get("label"); if (label.node !== null) { // labels are fn scoped and not accessible by inner functions // path is the switch statement if (!isSameFunctionScope(path, cPath)) { // we don't have to worry about this break statement return { break: false, bail: false }; } // here we handle the break labels // if they are outside switch, we bail out // if they are within the case, we keep them let labelPath; if (path.scope.getLabel) { labelPath = getLabel(label.node.name, path); } else { labelPath = path.scope.getBinding(label.node.name).path; } const _isAncestor = isAncestor(labelPath, path); return { bail: _isAncestor, [control]: _isAncestor }; } // set the flag that it is indeed breaking let isCTransfer = true; // this flag is to capture // switch(0) { case 0: while(1) if (x) break; } let possibleRunTimeControlTransfer = false; // and compute if it's breaking the correct thing let parent = cPath.parentPath; while (parent !== stmt.parentPath) { // loops and nested switch cases if (parent.isLoop() || parent.isSwitchCase()) { // invalidate all the possible runtime breaks captured // while (1) { if (x) break; } possibleRunTimeControlTransfer = false; // and set that it's not breaking our switch statement isCTransfer = false; break; } // // this is a special case and depends on // the fact that SwitchStatement is handled in the // exit hook of the traverse // // switch (0) { // case 0: if (x) break; // } // // here `x` is runtime only. // in this case, we need to bail out. So we depend on exit hook // of switch so that, it would have visited the IfStatement first // before the SwitchStatement and would have removed the // IfStatement if it was a compile time determined // if (parent.isIfStatement()) { possibleRunTimeControlTransfer = true; } parent = parent.parentPath; } return { [control]: possibleRunTimeControlTransfer || isCTransfer, bail: possibleRunTimeControlTransfer }; } } // things that are hoisted function canExistAfterCompletion(path) { return path.isFunctionDeclaration() || path.isVariableDeclaration({ kind: "var" }); } function getLabel(name, _path) { let label, path = _path; do { label = path.scope.getLabel(name); if (label) { return label; } } while (path = path.parentPath); return null; } function hasLoopParent(path) { let parent = path; do { if (parent.isLoop()) { return true; } } while (parent = parent.parentPath); return false; } function extractSequenceImpure(seq) { const expressions = seq.get("expressions"); const result = []; for (let i = 0; i < expressions.length; i++) { if (!expressions[i].isPure()) { result.push(expressions[i].node); } } return t.sequenceExpression(result); } }; /***/ }), /***/ "./node_modules/babel-plugin-minify-dead-code-elimination/lib/remove-use-strict.js": /*!*****************************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-dead-code-elimination/lib/remove-use-strict.js ***! \*****************************************************************************************/ /***/ ((module) => { "use strict"; module.exports = removeUseStrict; const newIssueUrl = "https://github.com/babel/minify/issues/new"; const useStrict = "use strict"; /** * Remove redundant use strict * If the parent has a "use strict" directive, it is not required in * the children * * @param {NodePath} block BlockStatement */ function removeUseStrict(block) { if (!block.isBlockStatement()) { throw new Error(`Received ${block.type}. Expected BlockStatement. ` + `Please report at ${newIssueUrl}`); } const useStricts = getUseStrictDirectives(block); // early exit if (useStricts.length < 1) return; // only keep the first use strict if (useStricts.length > 1) { for (let i = 1; i < useStricts.length; i++) { useStricts[i].remove(); } } // check if parent has an use strict if (hasStrictParent(block)) { useStricts[0].remove(); } } function hasStrictParent(path) { return path.findParent(parent => parent.isBlockStatement() && isStrict(parent)); } function isStrict(block) { return getUseStrictDirectives(block).length > 0; } function getUseStrictDirectives(block) { var dir = block.get("directives"); return Array.isArray(dir) ? dir.filter(function (directive) { return directive.node.value.value === useStrict; }) : []; } /***/ }), /***/ "./node_modules/babel-plugin-minify-flip-comparisons/lib/index.js": /*!************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-flip-comparisons/lib/index.js ***! \************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = function ({ types: t }) { const isVoid0 = __webpack_require__(/*! babel-helper-is-void-0 */ "./node_modules/babel-helper-is-void-0/lib/index.js")(t); return { name: "minify-flip-comparisons", visitor: { // flip comparisons with a pure right hand value, this ensures // consistency with comparisons and increases the length of // strings that gzip can match // typeof blah === 'function' -> 'function' === typeof blah BinaryExpression(path) { const node = path.node; const right = node.right, left = node.left; // Make sure we have a constant on the right. if (!t.isLiteral(right) && !isVoid0(right) && !(t.isUnaryExpression(right) && t.isLiteral(right.argument)) && !t.isObjectExpression(right) && !t.isArrayExpression(right)) { return; } // Commutative operators. if (t.EQUALITY_BINARY_OPERATORS.indexOf(node.operator) >= 0 || ["*", "^", "&", "|"].indexOf(node.operator) >= 0) { node.left = right; node.right = left; return; } if (t.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(node.operator) >= 0) { node.left = right; node.right = left; let operator; switch (node.operator) { case ">": operator = "<"; break; case "<": operator = ">"; break; case ">=": operator = "<="; break; case "<=": operator = ">="; break; } node.operator = operator; return; } } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-minify-guarded-expressions/lib/index.js": /*!***************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-guarded-expressions/lib/index.js ***! \***************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const evaluate = __webpack_require__(/*! babel-helper-evaluate-path */ "./node_modules/babel-helper-evaluate-path/lib/index.js"); function evaluateTruthy(path) { const res = evaluate(path); if (res.confident) return !!res.value; } module.exports = function ({ types: t }) { const flipExpressions = __webpack_require__(/*! babel-helper-flip-expressions */ "./node_modules/babel-helper-flip-expressions/lib/index.js")(t); return { name: "minify-guarded-expressions", visitor: { // Convert guarded expressions // !a && b() --> a || b(); // This could change the return result of the expression so we only do it // on things where the result is ignored. LogicalExpression: { enter: [function (path) { const node = path.node; const left = path.get("left"); const right = path.get("right"); // issues - 171, 174, 176 // we assume that it is returned/assigned/part of a bigger expression // or utilized somehow // we check if we shouldBail only when evaluating // the rightside of the expression; // if the left side is evaluated to be deterministic, // we can safely replace the entire expression const shouldBail = !path.parentPath.isExpressionStatement(); if (node.operator === "&&") { const leftTruthy = evaluateTruthy(left); if (leftTruthy === false) { // Short-circuit path.replaceWith(node.left); } else if (leftTruthy === true && left.isPure()) { path.replaceWith(node.right); } else if (evaluateTruthy(right) === false && right.isPure() && !shouldBail) { path.replaceWith(node.left); } } else if (node.operator === "||") { const leftTruthy = evaluateTruthy(left); if (leftTruthy === false && left.isPure()) { path.replaceWith(node.right); } else if (leftTruthy === true) { // Short-circuit path.replaceWith(node.left); } else if (evaluateTruthy(right) === false && right.isPure() && !shouldBail) { path.replaceWith(node.left); } } }, function (path) { const node = path.node; if (flipExpressions.hasSeen(node)) { return; } if (!path.parentPath.isExpressionStatement() && !(path.parentPath.isSequenceExpression() && path.parentPath.parentPath.isExpressionStatement())) { return; } // Start counting savings from one since we can ignore the last // expression. if (flipExpressions.shouldFlip(node, 1)) { const newNode = flipExpressions.flip(node, true); path.replaceWith(newNode); } }] } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-minify-infinity/lib/index.js": /*!****************************************************************!*\ !*** ./node_modules/babel-plugin-minify-infinity/lib/index.js ***! \****************************************************************/ /***/ ((module) => { "use strict"; module.exports = function ({ types: t }) { const INFINITY = t.binaryExpression("/", t.numericLiteral(1), t.numericLiteral(0)); return { name: "minify-infinity", visitor: { // Infinity -> 1 / 0 Identifier(path) { if (path.node.name !== "Infinity") { return; } // It's a referenced identifier if (path.scope.getBinding("Infinity")) { return; } if (path.parentPath.isObjectProperty({ key: path.node })) { return; } if (path.parentPath.isMemberExpression()) { return; } const bindingIds = path.parentPath.getBindingIdentifierPaths(); if (bindingIds["Infinity"] === path && // ObjectProperty is common for ObjectExpression and ObjectPattern and only // one of them is a Binding, the other is simply a reference !path.parentPath.parentPath.isObjectExpression()) { return; } path.replaceWith(INFINITY); } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-minify-mangle-names/lib/bfs-traverse.js": /*!***************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-mangle-names/lib/bfs-traverse.js ***! \***************************************************************************/ /***/ ((module) => { "use strict"; function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } module.exports = function bfsTraverseCreator({ types: t, traverse }) { function getFields(path) { return t.VISITOR_KEYS[path.type]; } return function bfsTraverse(path, _visitor) { if (!path.node) { throw new Error("Not a valid path"); } const visitor = traverse.explode(_visitor); const queue = [path]; let current; while (queue.length > 0) { current = queue.shift(); // call if (visitor && visitor[current.type] && Array.isArray(visitor[current.type].enter)) { const fns = visitor[current.type].enter; var _iterator = _createForOfIteratorHelper(fns), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { const fn = _step.value; if (typeof fn === "function") fn(current); } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } } const fields = getFields(current); var _iterator2 = _createForOfIteratorHelper(fields), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { const field = _step2.value; const child = current.get(field); if (Array.isArray(child)) { // visit container left to right var _iterator3 = _createForOfIteratorHelper(child), _step3; try { for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { const c = _step3.value; if (c.node) queue.push(c); } } catch (err) { _iterator3.e(err); } finally { _iterator3.f(); } } else { if (child.node) queue.push(child); } } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-minify-mangle-names/lib/charset.js": /*!**********************************************************************!*\ !*** ./node_modules/babel-plugin-minify-mangle-names/lib/charset.js ***! \**********************************************************************/ /***/ ((module) => { "use strict"; const CHARSET = ("abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ$_").split(""); module.exports = class Charset { constructor(shouldConsider) { this.shouldConsider = shouldConsider; this.chars = CHARSET.slice(); this.frequency = {}; this.chars.forEach(c => { this.frequency[c] = 0; }); this.finalized = false; } consider(str) { if (!this.shouldConsider) { return; } str.split("").forEach(c => { if (this.frequency[c] != null) { this.frequency[c]++; } }); } sort() { if (this.shouldConsider) { this.chars = this.chars.sort((a, b) => this.frequency[b] - this.frequency[a]); } this.finalized = true; } getIdentifier(num) { if (!this.finalized) { throw new Error("Should sort first"); } let ret = ""; num++; do { num--; ret += this.chars[num % this.chars.length]; num = Math.floor(num / this.chars.length); } while (num > 0); return ret; } }; /***/ }), /***/ "./node_modules/babel-plugin-minify-mangle-names/lib/counted-set.js": /*!**************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-mangle-names/lib/counted-set.js ***! \**************************************************************************/ /***/ ((module) => { "use strict"; // Set that counts module.exports = class CountedSet { constructor() { // because you can't simply extend Builtins yet this.map = new Map(); } keys() { return [...this.map.keys()]; } has(value) { return this.map.has(value); } add(value) { if (!this.has(value)) { this.map.set(value, 0); } this.map.set(value, this.map.get(value) + 1); } delete(value) { if (!this.has(value)) return; const count = this.map.get(value); if (count <= 1) { this.map.delete(value); } else { this.map.set(value, count - 1); } } }; /***/ }), /***/ "./node_modules/babel-plugin-minify-mangle-names/lib/fixup-var-scoping.js": /*!********************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-mangle-names/lib/fixup-var-scoping.js ***! \********************************************************************************/ /***/ ((module) => { "use strict"; // this fixes a bug where converting let to var // doesn't change the binding's scope to function scope // https://github.com/babel/babel/issues/4818 module.exports = function (mangler) { mangler.program.traverse({ VariableDeclaration(path) { if (path.node.kind !== "var") { return; } const fnScope = path.scope.getFunctionParent() || path.scope.getProgramParent(); const bindingIds = path.getOuterBindingIdentifierPaths(); for (const name in bindingIds) { const binding = path.scope.getBinding(name); // var isn't hoisted to fnScope if (binding.scope !== fnScope) { const existingBinding = fnScope.bindings[name]; // make sure we are clear that the fnScope doesn't already have // an existing binding if (!existingBinding) { // move binding to the function scope // update our scopeTracker first before // we mutate the scope mangler.scopeTracker.moveBinding(binding, fnScope); fnScope.bindings[name] = binding; binding.scope = fnScope; delete binding.scope.bindings[name]; } else { // we need a new binding that's valid in both the scopes // binding.scope and fnScope const newName = fnScope.generateUid(binding.scope.generateUid(name)); // rename binding in the original scope mangler.rename(binding.scope, binding, name, newName); // move binding to fnScope as newName // update our scopeTracker first before // we mutate the scope mangler.scopeTracker.moveBinding(binding, fnScope); fnScope.bindings[newName] = binding; binding.scope = fnScope; delete binding.scope.bindings[newName]; } } } } }); }; /***/ }), /***/ "./node_modules/babel-plugin-minify-mangle-names/lib/index.js": /*!********************************************************************!*\ !*** ./node_modules/babel-plugin-minify-mangle-names/lib/index.js ***! \********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } const Charset = __webpack_require__(/*! ./charset */ "./node_modules/babel-plugin-minify-mangle-names/lib/charset.js"); const ScopeTracker = __webpack_require__(/*! ./scope-tracker */ "./node_modules/babel-plugin-minify-mangle-names/lib/scope-tracker.js"); const isLabelIdentifier = __webpack_require__(/*! ./is-label-identifier */ "./node_modules/babel-plugin-minify-mangle-names/lib/is-label-identifier.js"); const bfsTraverseCreator = __webpack_require__(/*! ./bfs-traverse */ "./node_modules/babel-plugin-minify-mangle-names/lib/bfs-traverse.js"); const fixupVarScoping = __webpack_require__(/*! ./fixup-var-scoping */ "./node_modules/babel-plugin-minify-mangle-names/lib/fixup-var-scoping.js"); const _require = __webpack_require__(/*! babel-helper-mark-eval-scopes */ "./node_modules/babel-helper-mark-eval-scopes/lib/index.js"), markEvalScopes = _require.markEvalScopes, isEvalScopesMarked = _require.isMarked, hasEval = _require.hasEval; const newIssueUrl = "https://github.com/babel/minify/issues/new"; module.exports = babel => { const t = babel.types, traverse = babel.traverse; const bfsTraverse = bfsTraverseCreator(babel); const hop = Object.prototype.hasOwnProperty; class Mangler { constructor(charset, program, { exclude = {}, keepFnName = false, keepClassName = false, eval: _eval = false, topLevel = false } = {}) { this.charset = charset; this.program = program; // user passed options this.exclude = toObject(exclude); this.keepFnName = keepFnName; this.keepClassName = keepClassName; this.topLevel = topLevel; this.eval = _eval; // tracking this.visitedScopes = new Set(); this.scopeTracker = new ScopeTracker(); this.renamedNodes = new Set(); } /** * Run the mangler */ run() { this.crawlScope(); this.collect(); this.fixup(); this.charset.sort(); this.mangle(); } /** * Tells if a variable name is excluded * @param {String} name */ isExcluded(name) { return hop.call(this.exclude, name) && this.exclude[name]; } /** * Clears traverse cache and recrawls the AST * * to recompute the bindings, references, other scope information * and paths because the other transformations in the same pipeline * (other plugins and presets) changes the AST and does NOT update * the scope objects */ crawlScope() { (traverse.clearCache || traverse.cache.clear)(); this.program.scope.crawl(); } /** * Re-crawling comes with a side-effect that let->var conversion * reverts the update of the binding information (block to fn scope). * This function takes care of it by updating it again. * * TODO: This is unnecessary work and needs to be fixed in babel. * https://github.com/babel/babel/issues/4818 * * When this is removed, remember to remove fixup's dependency in * ScopeTracker */ fixup() { fixupVarScoping(this); } /** * A single pass through the AST to collect info for * * 1. Scope Tracker * 2. Unsafe Scopes (direct eval scopes) * 3. Charset considerations for better gzip compression * * Traversed in the same fashion(BFS) the mangling is done */ collect() { const mangler = this; const scopeTracker = mangler.scopeTracker; scopeTracker.addScope(this.program.scope); /** * Same usage as in DCE, whichever runs first */ if (!isEvalScopesMarked(mangler.program)) { markEvalScopes(mangler.program); } /** * The visitors to be used in traversal. * * Note: BFS traversal supports only the `enter` handlers, `exit` * handlers are simply dropped without Errors * * Collects items defined in the ScopeTracker */ const collectVisitor = { Scopable({ scope }) { scopeTracker.addScope(scope); // Collect bindings defined in the scope Object.keys(scope.bindings).forEach(name => { scopeTracker.addBinding(scope.bindings[name]); // add all constant violations as references scope.bindings[name].constantViolations.forEach(() => { scopeTracker.addReference(scope, scope.bindings[name], name); }); }); }, /** * This is required because after function name transformation * plugin (part of es2015), the function name is NOT added to the * scope's bindings. So to fix this issue, we simply add a hack to * handle that case - fix it to the scope tree. * * Related: * - https://github.com/babel/minify/issues/829 */ BindingIdentifier(path) { if ( // the parent has this id as the name (path.parentPath.isFunctionExpression({ id: path.node }) || path.parentPath.isClassExpression({ id: path.node })) && // and the id isn't yet added to the scope !hop.call(path.parentPath.scope.bindings, path.node.name)) { path.parentPath.scope.registerBinding("local", path.parentPath); } }, /** * This is necessary because, in Babel, the scope.references * does NOT contain the references in that scope. Only the program * scope (top most level) contains all the references. * * We collect the references in a fashion where all the scopes between * and including the referenced scope and scope where it is declared * is considered as scope referencing that identifier */ ReferencedIdentifier(path) { if (isLabelIdentifier(path)) { return; } const scope = path.scope, name = path.node.name; const binding = scope.getBinding(name); if (!binding) { // Do not collect globals as they are already available via // babel's API if (scope.hasGlobal(name)) { return; } // This should NOT happen ultimately. Panic if this code block is // reached throw new Error(`Binding not found for ReferencedIdentifier "${name}" ` + `present in "${path.parentPath.type}". ` + `Please report this at ${newIssueUrl}`); } else { // Add it to our scope tracker if everything is fine scopeTracker.addReference(scope, binding, name); } } }; /** * These visitors are for collecting the Characters used in the program * to measure the frequency and generate variable names for mangling so * as to improve the gzip compression - as gzip likes repetition */ if (this.charset.shouldConsider) { collectVisitor.Identifier = function Identifer(path) { const node = path.node; // We don't mangle properties, so we collect them as they contribute // to the frequency of characters if (path.parentPath.isMemberExpression({ property: node }) || path.parentPath.isObjectProperty({ key: node })) { mangler.charset.consider(node.name); } }; collectVisitor.Literal = function Literal({ node }) { mangler.charset.consider(String(node.value)); }; } // Traverse the AST bfsTraverse(mangler.program, collectVisitor); } /** * Tells if a binding is exported as a NamedExport - so as to NOT mangle * * Babel treats NamedExports as a binding referenced by this NamedExport decl * @param {Binding} binding */ isExportedWithName(binding) { // short circuit if (!this.topLevel) { return false; } const refs = binding.referencePaths; var _iterator = _createForOfIteratorHelper(refs), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { const ref = _step.value; if (ref.isExportNamedDeclaration()) { return true; } } // default } catch (err) { _iterator.e(err); } finally { _iterator.f(); } return false; } /** * Tells if the name can be mangled in the current observed scope with * the input binding * * @param {string} oldName the old name that needs to be mangled * @param {Binding} binding Binding of the name * @param {Scope} scope The current scope the mangler is run */ canMangle(oldName, binding, scope) { const cannotMangle = // arguments - for non-strict mode oldName === "arguments" || // labels binding.path.isLabeledStatement() || // ClassDeclaration has binding in two scopes // 1. The scope in which it is declared // 2. The class's own scope binding.path.isClassDeclaration() && binding.path === scope.path || // excluded this.isExcluded(oldName) || ( // function names this.keepFnName ? isFunction(binding.path) : false) || ( // class names this.keepClassName ? isClass(binding.path) : false) || // named export this.isExportedWithName(binding); return !cannotMangle; } /** * Tells if the newName can be used as a valid name for the input binding * in the input scope * * @param {string} newName the old name that needs to be mangled * @param {Binding} binding Binding of the name that this new name will replace * @param {Scope} scope The current scope the mangler is run */ isValidName(newName, binding, scope) { return t.isValidIdentifier(newName) && !this.scopeTracker.hasBinding(scope, newName) && !scope.hasGlobal(newName) && !this.scopeTracker.hasReference(scope, newName) && this.scopeTracker.canUseInReferencedScopes(binding, newName); } /** * Mangle the scope * @param {Scope} scope */ mangleScope(scope) { const mangler = this; const scopeTracker = mangler.scopeTracker; // Unsafe Scope if (!mangler.eval && hasEval(scope)) { return; } // Already visited // This is because for a function, in Babel, the function and // the function body's BlockStatement has the same scope, and will // be visited twice by the Scopable handler, and we want to mangle // it only once if (mangler.visitedScopes.has(scope)) { return; } mangler.visitedScopes.add(scope); const bindings = scopeTracker.bindings.get(scope); const names = [...bindings.keys()]; // A counter to generate names and reset // so we can reuse removed names let counter = 0; /** * 1. Iterate through the list of BindingIdentifiers * 2. Rename each of them in-place * 3. Update the scope tree. * * We cannot use a for..of loop over bindings.keys() * because (2) we rename in place and update the bindings * as we traverse through the keys */ for (var _i = 0, _names = names; _i < _names.length; _i++) { const oldName = _names[_i]; const binding = bindings.get(oldName); if (mangler.canMangle(oldName, binding, scope)) { let next; do { next = mangler.charset.getIdentifier(counter++); } while (!mangler.isValidName(next, binding, scope)); // Reset so variables which are removed can be reused // // the following is an assumtion (for perf) // the length 3 is an assumption that if the oldName isn't // 1 or 2 characters, then probably we are not going to find // a name - because for almost all usecases we have 1 or 2 // character new names only. And for the edge cases where // one scope has lots and lots of variables, it's okay to // name something with 3 characters instead of 1 if (oldName.length < 3) { counter = 0; } // Once we detected a valid `next` Identifier which could be used, // call the renamer mangler.rename(scope, binding, oldName, next); } } } /** * The mangle function that traverses through all the Scopes in a BFS * fashion - calls mangleScope */ mangle() { const mangler = this; bfsTraverse(this.program, { Scopable(path) { if (!path.isProgram() || mangler.topLevel) mangler.mangleScope(path.scope); } }); } /** * Given a NodePath, collects all the Identifiers which are BindingIdentifiers * and replaces them with the new name * * For example, * var a = 1, { b } = c; // a and b are BindingIdentifiers * * @param {NodePath} path * @param {String} oldName * @param {String} newName * @param {Function} predicate */ renameBindingIds(path, oldName, newName, predicate = () => true) { const bindingIds = path.getBindingIdentifierPaths(true, false); for (const name in bindingIds) { if (name !== oldName) continue; var _iterator2 = _createForOfIteratorHelper(bindingIds[name]), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { const idPath = _step2.value; if (predicate(idPath)) { idPath.node.name = newName; // babel-7 don't requeue // idPath.replaceWith(t.identifier(newName)); this.renamedNodes.add(idPath.node); } } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } } } /** * The Renamer: * Renames the following for one Binding in a Scope * * 1. Binding in that Scope * 2. All the Binding's constant violations * 3. All its References * 4. Updates mangler.scopeTracker * 5. Updates Babel's Scope tracking * * @param {Scope} scope * @param {Binding} binding * @param {String} oldName * @param {String} newName */ rename(scope, binding, oldName, newName) { const mangler = this; const scopeTracker = mangler.scopeTracker; // rename at the declaration level this.renameBindingIds(binding.path, oldName, newName, idPath => idPath.node === binding.identifier); // update mangler's ScopeTracker scopeTracker.renameBinding(scope, oldName, newName); // update all constant violations const violations = binding.constantViolations; for (let i = 0; i < violations.length; i++) { if (violations[i].isLabeledStatement()) continue; this.renameBindingIds(violations[i], oldName, newName); scopeTracker.updateReference(violations[i].scope, binding, oldName, newName); } // update all referenced places const refs = binding.referencePaths; for (let i = 0; i < refs.length; i++) { const path = refs[i]; const node = path.node; if (!path.isIdentifier()) { // Ideally, this should not happen // it happens in these places now - // case 1: Export Statements // This is a bug in babel // https://github.com/babel/babel/pull/3629 // case 2: Replacements in other plugins // eg: https://github.com/babel/minify/issues/122 // replacement in dce from `x` to `!x` gives referencePath as `!x` path.traverse({ ReferencedIdentifier(refPath) { if (refPath.node.name !== oldName) { return; } const actualBinding = refPath.scope.getBinding(oldName); if (actualBinding !== binding) { return; } refPath.node.name = newName; // babel-7 don't requeue // refPath.replaceWith(t.identifier(newName)); mangler.renamedNodes.add(refPath.node); scopeTracker.updateReference(refPath.scope, binding, oldName, newName); } }); } else if (!isLabelIdentifier(path)) { if (path.node.name === oldName) { path.node.name = newName; // babel-7 don't requeue // path.replaceWith(t.identifier(newName)); mangler.renamedNodes.add(path.node); scopeTracker.updateReference(path.scope, binding, oldName, newName); } else if (mangler.renamedNodes.has(path.node)) { // already renamed, // just update the references scopeTracker.updateReference(path.scope, binding, oldName, newName); } else { throw new Error(`Unexpected Rename Error: ` + `Trying to replace "${node.name}": from "${oldName}" to "${newName}". ` + `Please report it at ${newIssueUrl}`); } } // else label identifier - silently ignore } // update babel's internal tracking binding.identifier.name = newName; // update babel's internal scope tracking const bindings = scope.bindings; bindings[newName] = binding; delete bindings[oldName]; } } return { name: "minify-mangle-names", visitor: { /** * Mangler is run as a single pass. It's the same pattern as used in DCE */ Program: { exit(path) { // If the source code is small then we're going to assume that the user // is running on this on single files before bundling. Therefore we // need to achieve as much determinisim and we will not do any frequency // sorting on the character set. Currently the number is pretty arbitrary. const shouldConsiderSource = path.getSource().length > 70000; const charset = new Charset(shouldConsiderSource); const mangler = new Mangler(charset, path, this.opts); mangler.run(); } } } }; }; // convert value to object function toObject(value) { if (!Array.isArray(value)) { return value; } const map = {}; for (let i = 0; i < value.length; i++) { map[value[i]] = true; } return map; } // for keepFnName function isFunction(path) { return path.isFunctionExpression() || path.isFunctionDeclaration(); } // for keepClassName function isClass(path) { return path.isClassExpression() || path.isClassDeclaration(); } /***/ }), /***/ "./node_modules/babel-plugin-minify-mangle-names/lib/is-label-identifier.js": /*!**********************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-mangle-names/lib/is-label-identifier.js ***! \**********************************************************************************/ /***/ ((module) => { "use strict"; module.exports = isLabelIdentifier; function isLabelIdentifier(path) { const node = path.node; return path.parentPath.isLabeledStatement({ label: node }) || path.parentPath.isBreakStatement({ label: node }) || path.parentPath.isContinueStatement({ label: node }); } /***/ }), /***/ "./node_modules/babel-plugin-minify-mangle-names/lib/scope-tracker.js": /*!****************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-mangle-names/lib/scope-tracker.js ***! \****************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const CountedSet = __webpack_require__(/*! ./counted-set */ "./node_modules/babel-plugin-minify-mangle-names/lib/counted-set.js"); const isLabelIdentifier = __webpack_require__(/*! ./is-label-identifier */ "./node_modules/babel-plugin-minify-mangle-names/lib/is-label-identifier.js"); const newIssueUrl = "https://github.com/babel/minify/issues/new"; /** * ScopeTracker * references: Map > * bindings: Map > */ module.exports = class ScopeTracker { constructor() { this.references = new Map(); this.bindings = new Map(); } /** * Register a new Scope and initiliaze it with empty sets * @param {Scope} scope */ addScope(scope) { if (!this.references.has(scope)) { this.references.set(scope, new CountedSet()); } if (!this.bindings.has(scope)) { this.bindings.set(scope, new Map()); } } /** * Add reference to all Scopes between and including the ReferencedScope * and Binding's Scope * @param {Scope} scope * @param {Binding} binding * @param {String} name */ addReference(scope, binding, name) { let parent = scope; do { this.references.get(parent).add(name); if (!binding) { throw new Error(`Binding Not Found for ${name} during scopeTracker.addRefernce. ` + `Please report at ${newIssueUrl}`); } if (binding.scope === parent) break; } while (parent = parent.parent); } /** * has a Reference in the given {Scope} or a child Scope * * Refer {addReference} to know why the following call will be valid * for detecting references in child Scopes * * @param {Scope} scope * @param {String} name */ hasReference(scope, name) { return this.references.get(scope).has(name); } /** * Update reference count in all scopes between and including the * Referenced Scope and the Binding's Scope * * @param {Scope} scope * @param {Binding} binding * @param {String} oldName * @param {String} newName */ updateReference(scope, binding, oldName, newName) { let parent = scope; do { const ref = this.references.get(parent); ref.delete(oldName); ref.add(newName); if (!binding) { // Something went wrong - panic throw new Error("Binding Not Found during scopeTracker.updateRefernce " + `while updating "${oldName}" to "${newName}". ` + `Please report at ${newIssueUrl}`); } if (binding.scope === parent) break; } while (parent = parent.parent); } /** * has either a Binding or a Reference * @param {Scope} scope * @param {Binding} binding * @param {String} name */ hasBindingOrReference(scope, binding, name) { return this.hasReference(scope, name) || this.hasBinding(scope, name); } /** * For a Binding visit all places where the Binding is used and detect * if the newName {next} can be used in all these places * * 1. binding's own scope * 2. constant violations' scopes * 3. referencePaths' scopes * * @param {Binding} binding * @param {String} next */ canUseInReferencedScopes(binding, next) { const tracker = this; if (tracker.hasBindingOrReference(binding.scope, binding, next)) { return false; } // Safari raises a syntax error for a `let` or `const` declaration in a // `for` loop initialization that shadows a parent function's parameter. // https://github.com/babel/minify/issues/559 // https://bugs.webkit.org/show_bug.cgi?id=171041 // https://trac.webkit.org/changeset/217200/webkit/trunk/Source const maybeDecl = binding.path.parentPath; const isBlockScoped = maybeDecl.isVariableDeclaration({ kind: "let" }) || maybeDecl.isVariableDeclaration({ kind: "const" }); if (isBlockScoped) { const maybeFor = maybeDecl.parentPath; const isForLoopBinding = maybeFor.isForStatement({ init: maybeDecl.node }) || maybeFor.isForXStatement({ left: maybeDecl.node }); if (isForLoopBinding) { const fnParent = getFunctionParent(maybeFor); if (fnParent.isFunction({ body: maybeFor.parent })) { const parentFunctionBinding = this.bindings.get(fnParent.scope).get(next); if (parentFunctionBinding) { const parentFunctionHasParamBinding = parentFunctionBinding.kind === "param"; if (parentFunctionHasParamBinding) { return false; } } } } } for (let i = 0; i < binding.constantViolations.length; i++) { const violation = binding.constantViolations[i]; if (tracker.hasBindingOrReference(violation.scope, binding, next)) { return false; } } for (let i = 0; i < binding.referencePaths.length; i++) { const ref = binding.referencePaths[i]; if (!ref.isIdentifier()) { let canUse = true; ref.traverse({ ReferencedIdentifier(path) { if (path.node.name !== next) return; if (tracker.hasBindingOrReference(path.scope, binding, next)) { canUse = false; } } }); if (!canUse) { return canUse; } } else if (!isLabelIdentifier(ref)) { if (tracker.hasBindingOrReference(ref.scope, binding, next)) { return false; } } } return true; } /** * Add a binding to Tracker in binding's own Scope * @param {Binding} binding */ addBinding(binding) { if (!binding) { return; } const bindings = this.bindings.get(binding.scope); const existingBinding = bindings.get(binding.identifier.name); if (existingBinding && existingBinding !== binding) { throw new Error(`scopeTracker.addBinding: ` + `Binding "${existingBinding.identifier.name}" already exists. ` + `Trying to add "${binding.identifier.name}" again.`); } bindings.set(binding.identifier.name, binding); } /** * Moves Binding from it's own Scope to {@param toScope} * * required for fixup-var-scope * * @param {Binding} binding * @param {Scope} toScope */ moveBinding(binding, toScope) { this.bindings.get(binding.scope).delete(binding.identifier.name); this.bindings.get(toScope).set(binding.identifier.name, binding); } /** * has a Binding in the current {Scope} * @param {Scope} scope * @param {String} name */ hasBinding(scope, name) { return this.bindings.get(scope).has(name); } /** * Update the ScopeTracker on rename * @param {Scope} scope * @param {String} oldName * @param {String} newName */ renameBinding(scope, oldName, newName) { const bindings = this.bindings.get(scope); bindings.set(newName, bindings.get(oldName)); bindings.delete(oldName); } }; /** * Babel-7 returns null if there is no function parent * and uses getProgramParent to get Program */ function getFunctionParent(path) { return (path.scope.getFunctionParent() || path.scope.getProgramParent()).path; } /***/ }), /***/ "./node_modules/babel-plugin-minify-numeric-literals/lib/index.js": /*!************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-numeric-literals/lib/index.js ***! \************************************************************************/ /***/ ((module) => { "use strict"; module.exports = function () { return { name: "minify-numeric-literals", visitor: { NumericLiteral(path) { if (!path.node.extra) return; const normal = path.node.value.toString().replace(/^0\./, "."); let exponential = path.node.value.toExponential().replace(/\+/g, ""); if (exponential.indexOf(".") >= 0 && exponential.indexOf("e") >= 0) { const lastChar = exponential.substr(exponential.lastIndexOf("e") + 1); const dotIndex = exponential.lastIndexOf(".") + 1; const subLength = exponential.substr(dotIndex, exponential.lastIndexOf("e") - dotIndex).length; exponential = (exponential.substr(0, exponential.lastIndexOf("e") + 1) + (lastChar - subLength)).replace(".", "").replace(/e0/, ""); } const replacement = normal.length > exponential.length ? exponential : normal; if (path.node.extra.raw.length > replacement.length) { path.node.extra.raw = replacement; } } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-minify-replace/lib/index.js": /*!***************************************************************!*\ !*** ./node_modules/babel-plugin-minify-replace/lib/index.js ***! \***************************************************************/ /***/ ((module) => { "use strict"; module.exports = ({ types: t }) => { const NO_MEMBER = Symbol("no member"); const replaceVisitor = { ReferencedIdentifier(path) { const _path = path, node = _path.node; const optionsMap = this.replacements[node.name]; if (!optionsMap) { return; } let options; if (path.parentPath.isMemberExpression({ object: node })) { const property = path.parent.property; const key = t.isIdentifier(property) && property.name; if (typeof key === "string") { options = optionsMap[key]; path = path.parentPath; } } if (!options) { options = optionsMap[NO_MEMBER]; } if (!options) { return; } path.replaceWith(options.node); } }; return { name: "minify-replace", visitor: { Program(path) { /** Replacements is an array of objects like this: { identifierName: 'console', member: 'log', // optional replacement: { type: 'identifier', value: '', }, } **/ if (!this.opts.replacements) { // No replacements. Bail. return; } const map = Object.create(null); this.opts.replacements.forEach(({ identifierName, replacement, member }) => { if (path.scope.globals[identifierName]) { // Convert to a node, we only allow identifiers and literals as replacements if (!replacement.type.match(/literal|identifier/i)) { throw new Error("Only literals and identifier are supported as replacements"); } const node = t[replacement.type](replacement.value); const options = { identifierName, node, member }; if (!map[identifierName]) { map[identifierName] = {}; } if (member && map[identifierName][member]) { throw new Error(`Replacement collision ${identifierName}.${member}`); } map[identifierName][member || NO_MEMBER] = options; } }); path.traverse(replaceVisitor, { replacements: map }); } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-minify-simplify/lib/assignment-expression.js": /*!********************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-simplify/lib/assignment-expression.js ***! \********************************************************************************/ /***/ ((module) => { "use strict"; const operators = new Set(["+", "-", "*", "%", "<<", ">>", ">>>", "&", "|", "^", "/", "**"]); const updateOperators = new Set(["+", "-"]); module.exports = t => { function simplify(path) { const rightExpr = path.get("right"); const leftExpr = path.get("left"); if (path.node.operator !== "=") { return; } const canBeUpdateExpression = rightExpr.get("right").isNumericLiteral() && rightExpr.get("right").node.value === 1 && updateOperators.has(rightExpr.node.operator); if (leftExpr.isMemberExpression()) { const leftPropNames = getPropNames(leftExpr); const rightPropNames = getPropNames(rightExpr.get("left")); if (!leftPropNames || leftPropNames.indexOf(undefined) > -1 || !rightPropNames || rightPropNames.indexOf(undefined) > -1 || !operators.has(rightExpr.node.operator) || !areArraysEqual(leftPropNames, rightPropNames)) { return; } } else { if (!rightExpr.isBinaryExpression() || !operators.has(rightExpr.node.operator) || leftExpr.node.name !== rightExpr.node.left.name) { return; } } let newExpression; // special case x=x+1 --> ++x if (canBeUpdateExpression) { newExpression = t.updateExpression(rightExpr.node.operator + rightExpr.node.operator, t.clone(leftExpr.node), true /* prefix */ ); } else { newExpression = t.assignmentExpression(rightExpr.node.operator + "=", t.clone(leftExpr.node), t.clone(rightExpr.node.right)); } path.replaceWith(newExpression); } return { simplify }; }; function areArraysEqual(arr1, arr2) { return arr1.every((value, index) => { return String(value) === String(arr2[index]); }); } function getPropNames(path) { if (!path.isMemberExpression()) { return; } let obj = path.get("object"); const prop = path.get("property"); const propNames = [getName(prop.node)]; while (obj.type === "MemberExpression") { const node = obj.get("property").node; if (node) { propNames.push(getName(node)); } obj = obj.get("object"); } propNames.push(getName(obj.node)); return propNames; } function getName(node) { if (node.type === "ThisExpression") { return "this"; } if (node.type === "Super") { return "super"; } if (node.type === "NullLiteral") { return "null"; } // augment identifiers so that they don't match // string/number literals // but still match against each other return node.name ? node.name + "_" : node.value /* Literal */ ; } /***/ }), /***/ "./node_modules/babel-plugin-minify-simplify/lib/conditional-expression.js": /*!*********************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-simplify/lib/conditional-expression.js ***! \*********************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const h = __webpack_require__(/*! ./helpers */ "./node_modules/babel-plugin-minify-simplify/lib/helpers.js"); const PatternMatch = __webpack_require__(/*! ./pattern-match */ "./node_modules/babel-plugin-minify-simplify/lib/pattern-match.js"); module.exports = t => { // small abstractions const not = node => t.unaryExpression("!", node); const notnot = node => not(not(node)); const or = (a, b) => t.logicalExpression("||", a, b); const and = (a, b) => t.logicalExpression("&&", a, b); function simplifyPatterns(path) { const test = path.get("test"); const consequent = path.get("consequent"); const alternate = path.get("alternate"); const _h$typeSymbols = h.typeSymbols(t), EX = _h$typeSymbols.Expression; // Convention: // =============== // for each pattern [test, consequent, alternate, handler(expr, cons, alt)] const matcher = new PatternMatch([[EX, true, false, e => notnot(e)], [EX, false, true, e => not(e)], [EX, true, EX, (e, c, a) => or(notnot(e), a)], [EX, false, EX, (e, c, a) => and(not(e), a)], [EX, EX, true, (e, c) => or(not(e), c)], [EX, EX, false, (e, c) => and(notnot(e), c)]]); const result = matcher.match([test, consequent, alternate], h.isPatternMatchesPath(t)); if (result.match) { path.replaceWith(result.value(test.node, consequent.node, alternate.node)); } } return { simplifyPatterns }; }; /***/ }), /***/ "./node_modules/babel-plugin-minify-simplify/lib/helpers.js": /*!******************************************************************!*\ !*** ./node_modules/babel-plugin-minify-simplify/lib/helpers.js ***! \******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const VOID_0 = t => t.unaryExpression("void", t.numericLiteral(0), true); const evaluate = __webpack_require__(/*! babel-helper-evaluate-path */ "./node_modules/babel-helper-evaluate-path/lib/index.js"); // Types as Symbols - for comparing types const types = {}; // This is a test key which is used to avoid Object.keys check // Object.keys() check is really expensive // https://gist.github.com/vigneshshanmugam/c766550ecd02292dcdfbf0bf013b9d3d const testKey = "Expression"; const typeSymbols = t => { // don't recompute if (types[testKey] !== undefined) { return types; } t.TYPES.forEach(type => { types[type] = Symbol.for(type); }); return types; }; const isNodeOfType = (t, node, typeSymbol) => typeof typeSymbol !== "symbol" ? false : t["is" + Symbol.keyFor(typeSymbol)](node); const isPatternMatchesPath = t => function _isPatternMatchesPath(patternValue, inputPath) { if (Array.isArray(patternValue)) { for (let i = 0; i < patternValue.length; i++) { if (_isPatternMatchesPath(patternValue[i], inputPath)) { return true; } } return false; } if (typeof patternValue === "function") { return patternValue(inputPath); } if (isNodeOfType(t, inputPath.node, patternValue)) return true; const evalResult = evaluate(inputPath); if (!evalResult.confident || !inputPath.isPure()) return false; return evalResult.value === patternValue; }; module.exports = { VOID_0, // Types as Symbols typeSymbols, // This is required for resolving type aliases isNodeOfType, isPatternMatchesPath }; /***/ }), /***/ "./node_modules/babel-plugin-minify-simplify/lib/if-statement.js": /*!***********************************************************************!*\ !*** ./node_modules/babel-plugin-minify-simplify/lib/if-statement.js ***! \***********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const REPLACED = Symbol("replaced"); const h = __webpack_require__(/*! ./helpers */ "./node_modules/babel-plugin-minify-simplify/lib/helpers.js"); module.exports = t => { function mergeNestedIfs(path) { const consequent = path.get("consequent"); const alternate = path.get("alternate"); // not nested if if (!consequent.isIfStatement()) return; // there are no alternate nodes in both the if statements (nested) if (alternate.node || consequent.get("alternate").node) return; const test = path.get("test"); test.replaceWith(t.logicalExpression("&&", test.node, consequent.get("test").node)); consequent.replaceWith(t.clone(consequent.get("consequent").node)); } // No alternate, make into a guarded expression function toGuardedExpression(path) { const node = path.node; if (node.consequent && !node.alternate && node.consequent.type === "ExpressionStatement") { let op = "&&"; if (t.isUnaryExpression(node.test, { operator: "!" })) { node.test = node.test.argument; op = "||"; } path.replaceWith(t.expressionStatement(t.logicalExpression(op, node.test, node.consequent.expression))); return REPLACED; } } // both consequent and alternate are expressions, turn into ternary function toTernary(path) { const node = path.node; if (t.isExpressionStatement(node.consequent) && t.isExpressionStatement(node.alternate)) { path.replaceWith(t.conditionalExpression(node.test, node.consequent.expression, node.alternate.expression)); return REPLACED; } } // consequent and alternate are return -- conditional. function toConditional(path) { const node = path.node; if (t.isReturnStatement(node.consequent) && t.isReturnStatement(node.alternate)) { if (!node.consequent.argument && !node.alternate.argument) { path.replaceWith(t.expressionStatement(node.test)); return REPLACED; } path.replaceWith(t.returnStatement(t.conditionalExpression(node.test, node.consequent.argument || h.VOID_0(t), node.alternate.argument || h.VOID_0(t)))); return REPLACED; } } // There is nothing after this If block. And one or both // of the consequent and alternate are either expression statment // or return statements. function toReturn(path) { const node = path.node; if (!path.getSibling(path.key + 1).node && path.parentPath && path.parentPath.parentPath && path.parentPath.parentPath.isFunction()) { // Only the consequent is a return, void the alternate. if (t.isReturnStatement(node.consequent) && t.isExpressionStatement(node.alternate)) { if (!node.consequent.argument) { path.replaceWith(t.expressionStatement(t.logicalExpression("||", node.test, node.alternate.expression))); return REPLACED; } path.replaceWith(t.returnStatement(t.conditionalExpression(node.test, node.consequent.argument || h.VOID_0(t), t.unaryExpression("void", node.alternate.expression, true)))); return REPLACED; } // Only the alternate is a return, void the consequent. if (t.isReturnStatement(node.alternate) && t.isExpressionStatement(node.consequent)) { if (!node.alternate.argument) { path.replaceWith(t.expressionStatement(t.logicalExpression("&&", node.test, node.consequent.expression))); return REPLACED; } path.replaceWith(t.returnStatement(t.conditionalExpression(node.test, t.unaryExpression("void", node.consequent.expression, true), node.alternate.argument || h.VOID_0(t)))); return REPLACED; } if (t.isReturnStatement(node.consequent) && !node.alternate) { if (!node.consequent.argument) { path.replaceWith(t.expressionStatement(node.test)); return REPLACED; } // This would only be worth it if the previous statement was an if // because then we may merge to create a conditional. if (path.getSibling(path.key - 1).isIfStatement()) { path.replaceWith(t.returnStatement(t.conditionalExpression(node.test, node.consequent.argument || h.VOID_0(t), h.VOID_0(t)))); return REPLACED; } } if (t.isReturnStatement(node.alternate) && !node.consequent) { if (!node.alternate.argument) { path.replaceWith(t.expressionStatement(node.test)); return REPLACED; } // Same as above. if (path.getSibling(path.key - 1).isIfStatement()) { path.replaceWith(t.returnStatement(t.conditionalExpression(node.test, node.alternate.argument || h.VOID_0(t), h.VOID_0(t)))); return REPLACED; } } } let next = path.getSibling(path.key + 1); // If the next satatement(s) is an if statement and we can simplify that // to potentailly be an expression (or a return) then this will make it // easier merge. if (next.isIfStatement()) { next.pushContext(path.context); next.visit(); next.popContext(); next = path.getSibling(path.key + 1); } // Some other visitor might have deleted our node. OUR NODE ;_; if (!path.node) { return; } // No alternate but the next statement is a return // also turn into a return conditional if (t.isReturnStatement(node.consequent) && !node.alternate && next.isReturnStatement()) { const nextArg = next.node.argument || h.VOID_0(t); next.remove(); path.replaceWith(t.returnStatement(t.conditionalExpression(node.test, node.consequent.argument || h.VOID_0(t), nextArg))); return REPLACED; } // Next is the last expression, turn into a return while void'ing the exprs if (path.parentPath && path.parentPath.parentPath && path.parentPath.parentPath.isFunction() && !path.getSibling(path.key + 2).node && t.isReturnStatement(node.consequent) && !node.alternate && next.isExpressionStatement()) { const nextExpr = next.node.expression; next.remove(); if (node.consequent.argument) { path.replaceWith(t.returnStatement(t.conditionalExpression(node.test, node.consequent.argument, t.unaryExpression("void", nextExpr, true)))); return REPLACED; } path.replaceWith(t.logicalExpression("||", node.test, nextExpr)); return REPLACED; } } // Remove else for if-return function removeUnnecessaryElse(path) { const node = path.node; const consequent = path.get("consequent"); const alternate = path.get("alternate"); if (consequent.node && alternate.node && (consequent.isReturnStatement() || consequent.isBlockStatement() && t.isReturnStatement(consequent.node.body[consequent.node.body.length - 1])) && ( // don't hoist declarations // TODO: validate declarations after fixing scope issues alternate.isBlockStatement() ? !alternate.get("body").some(stmt => stmt.isVariableDeclaration({ kind: "let" }) || stmt.isVariableDeclaration({ kind: "const" })) : true)) { path.insertAfter(alternate.isBlockStatement() ? alternate.node.body.map(el => t.clone(el)) : t.clone(alternate.node)); node.alternate = null; return REPLACED; } } function runTransforms(path) { // ordered const transforms = [toGuardedExpression, toTernary, toConditional, toReturn, removeUnnecessaryElse]; // run each of the replacement till we replace something // which is identified by the Symbol(REPLACED) that each of the // functions return when they replace something for (var _i = 0; _i < transforms.length; _i++) { const transform = transforms[_i]; if (transform(path) === REPLACED) { break; } } } // If the consequent is if and the altenrate is not then // switch them out. That way we know we don't have to print // a block.x function switchConsequent(path) { const node = path.node; if (!node.alternate) { return; } if (!t.isIfStatement(node.consequent)) { return; } if (t.isIfStatement(node.alternate)) { return; } node.test = t.unaryExpression("!", node.test, true); var _ref = [node.consequent, node.alternate]; node.alternate = _ref[0]; node.consequent = _ref[1]; } // Make if statements with conditional returns in the body into // an if statement that guards the rest of the block. function conditionalReturnToGuards(path) { const node = path.node; if (!path.inList || !path.get("consequent").isBlockStatement() || node.alternate) { return; } let ret; let test; const exprs = []; const statements = node.consequent.body; for (let i = 0, statement; statement = statements[i]; i++) { if (t.isExpressionStatement(statement)) { exprs.push(statement.expression); } else if (t.isIfStatement(statement)) { if (i < statements.length - 1) { // This isn't the last statement. Bail. return; } if (statement.alternate) { return; } if (!t.isReturnStatement(statement.consequent)) { return; } ret = statement.consequent; test = statement.test; } else { return; } } if (!test || !ret) { return; } exprs.push(test); const expr = exprs.length === 1 ? exprs[0] : t.sequenceExpression(exprs); const replacement = t.logicalExpression("&&", node.test, expr); path.replaceWith(t.ifStatement(replacement, ret, null)); } return { mergeNestedIfs, simplify: runTransforms, switchConsequent, conditionalReturnToGuards }; }; /***/ }), /***/ "./node_modules/babel-plugin-minify-simplify/lib/index.js": /*!****************************************************************!*\ !*** ./node_modules/babel-plugin-minify-simplify/lib/index.js ***! \****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } module.exports = ({ types: t }) => { const flipExpressions = __webpack_require__(/*! babel-helper-flip-expressions */ "./node_modules/babel-helper-flip-expressions/lib/index.js")(t); const toMultipleSequenceExpressions = __webpack_require__(/*! babel-helper-to-multiple-sequence-expressions */ "./node_modules/babel-helper-to-multiple-sequence-expressions/lib/index.js")(t); const ifStatement = __webpack_require__(/*! ./if-statement */ "./node_modules/babel-plugin-minify-simplify/lib/if-statement.js")(t); const conditionalExpression = __webpack_require__(/*! ./conditional-expression */ "./node_modules/babel-plugin-minify-simplify/lib/conditional-expression.js")(t); const logicalExpression = __webpack_require__(/*! ./logical-expression */ "./node_modules/babel-plugin-minify-simplify/lib/logical-expression.js")(t); const assignmentExpression = __webpack_require__(/*! ./assignment-expression */ "./node_modules/babel-plugin-minify-simplify/lib/assignment-expression.js")(t); const VOID_0 = t.unaryExpression("void", t.numericLiteral(0), true); const condExprSeen = Symbol("condExprSeen"); const seqExprSeen = Symbol("seqExprSeen"); const shouldRevisit = Symbol("shouldRevisit"); return { name: "minify-simplify", visitor: { Statement: { exit(path) { if (path.node[shouldRevisit]) { delete path.node[shouldRevisit]; path.visit(); } } }, // CallExpression(path) { // const { node } = path; /* (function() {})() -> !function() {}() There is a bug in babel in printing this. Disabling for now. if (t.isFunctionExpression(node.callee) && (t.isExpressionStatement(parent) || (t.isSequenceExpression(parent) && parent.expressions[0] === node)) ) { path.replaceWith( t.callExpression( t.unaryExpression("!", node.callee, true), node.arguments ) ); return; }*/ // }, UnaryExpression: { enter: [// Demorgans. function (path) { const node = path.node; if (node.operator !== "!" || flipExpressions.hasSeen(node)) { return; } const expr = node.argument; // We need to make sure that the return type will always be boolean. if (!(t.isLogicalExpression(expr) || t.isConditionalExpression(expr) || t.isBinaryExpression(expr))) { return; } if (t.isBinaryExpression(expr) && t.COMPARISON_BINARY_OPERATORS.indexOf(expr.operator) === -1) { return; } if (flipExpressions.shouldFlip(expr, 1)) { const newNode = flipExpressions.flip(expr); path.replaceWith(newNode); } }, // !(a, b, c) -> a, b, !c function (path) { const node = path.node; if (node.operator !== "!") { return; } if (!t.isSequenceExpression(node.argument)) { return; } const seq = node.argument.expressions; const expr = seq[seq.length - 1]; seq[seq.length - 1] = t.unaryExpression("!", expr, true); path.replaceWith(node.argument); }, // !(a ? b : c) -> a ? !b : !c function (path) { const node = path.node; if (node.operator !== "!") { return; } if (!t.isConditional(node.argument)) { return; } const cond = node.argument; cond.alternate = t.unaryExpression("!", cond.alternate, true); cond.consequent = t.unaryExpression("!", cond.consequent, true); path.replaceWith(node.argument); }] }, BinaryExpression(path) { if (["!=", "=="].indexOf(path.node.operator) !== -1) { undefinedToNull(path.get("left")); undefinedToNull(path.get("right")); } }, LogicalExpression: { exit: logicalExpression.simplifyPatterns }, AssignmentExpression: assignmentExpression.simplify, ConditionalExpression: { enter: [// !foo ? 'foo' : 'bar' -> foo ? 'bar' : 'foo' // foo !== 'lol' ? 'foo' : 'bar' -> foo === 'lol' ? 'bar' : 'foo' function flipIfOrConditional(path) { const node = path.node; if (!path.get("test").isLogicalExpression()) { flipNegation(node); return; } if (flipExpressions.shouldFlip(node.test)) { node.test = flipExpressions.flip(node.test); var _ref = [node.consequent, node.alternate]; node.alternate = _ref[0]; node.consequent = _ref[1]; } }, conditionalExpression.simplifyPatterns], exit: [// a ? x = foo : b ? x = bar : x = baz; // x = a ? foo : b ? bar : baz; function (topPath) { if (!topPath.parentPath.isExpressionStatement() && !topPath.parentPath.isSequenceExpression()) { return; } const mutations = []; let firstLeft = null; let operator = null; function visit(path) { if (path.isConditionalExpression()) { let bail = visit(path.get("consequent")); if (bail) { return true; } bail = visit(path.get("alternate")); return bail; } if (operator == null) { operator = path.node.operator; } else if (path.node.operator !== operator) { return true; } if (!path.isAssignmentExpression() || !(path.get("left").isIdentifier() || path.get("left").isMemberExpression())) { return true; } const left = path.get("left").node; if (firstLeft == null) { firstLeft = left; } else if (!t.isNodesEquivalent(left, firstLeft)) { return true; } mutations.push(() => path.replaceWith(path.get("right").node)); } const bail = visit(topPath); if (bail) { return; } mutations.forEach(f => f()); topPath.replaceWith(t.assignmentExpression(operator, firstLeft, topPath.node)); }, // bar ? void 0 : void 0 // (bar, void 0) // TODO: turn this into general equiv check function (path) { const node = path.node; if (isVoid0(node.consequent) && isVoid0(node.alternate)) { path.replaceWith(t.sequenceExpression([path.node.test, VOID_0])); } }, // bar ? void 0 : foo ? void 0 : // bar || foo : void 0 // TODO: turn this into general equiv check function (path) { const node = path.node; if (node[condExprSeen] || !isVoid0(node.consequent)) { return; } node[condExprSeen] = true; const tests = [node.test]; const mutations = []; let alt; for (let next = path.get("alternate"); next.isConditionalExpression(); next = next.get("alternate")) { next.node[condExprSeen] = true; alt = next.node.alternate; if (isVoid0(next.node.consequent)) { tests.push(next.node.test); mutations.push(() => next.remove()); } else { alt = next.node; break; } } if (tests.length === 1) { return; } const test = tests.reduce((expr, curTest) => t.logicalExpression("||", expr, curTest)); path.replaceWith(t.conditionalExpression(test, VOID_0, alt)); }] }, // concat VariableDeclaration: { enter: [// Put vars with no init at the top. function (path) { const node = path.node; if (node.declarations.length < 2) { return; } const inits = []; const empty = []; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = node.declarations[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { const decl = _step.value; if (!decl.init) { empty.push(decl); } else { inits.push(decl); } } // This is based on exprimintation but there is a significant // imrpovement when we place empty vars at the top in smaller // files. Whereas it hurts in larger files. } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } if (this.fitsInSlidingWindow) { node.declarations = empty.concat(inits); } else { node.declarations = inits.concat(empty); } }] }, Function: { exit(path) { earlyReturnTransform(path); if (!path.node[shouldRevisit]) { return; } delete path.node[shouldRevisit]; path.visit(); } }, For: { enter: earlyContinueTransform, exit: earlyContinueTransform }, ForStatement: { // Merge previous expressions in the init part of the for. enter(path) { const node = path.node; if (!path.inList || node.init && !t.isExpression(node.init)) { return; } const prev = path.getSibling(path.key - 1); let consumed = false; if (prev.isVariableDeclaration()) { let referencedOutsideLoop = false; // we don't care if vars are referenced outside the loop as they are fn scope if (prev.node.kind === "let" || prev.node.kind === "const") { const ids = Object.keys(prev.getBindingIdentifiers()); idloop: for (let i = 0; i < ids.length; i++) { const binding = prev.scope.bindings[ids[i]]; // TODO // Temporary Fix // if there is no binding, we assume it is referenced outside // and deopt to avoid bugs if (!binding) { referencedOutsideLoop = true; break idloop; } const refs = binding.referencePaths; for (let j = 0; j < refs.length; j++) { if (!isAncestor(path, refs[j])) { referencedOutsideLoop = true; break idloop; } } } } if (!node.init && !referencedOutsideLoop) { node.init = prev.node; consumed = true; } } else if (prev.isExpressionStatement()) { const expr = prev.node.expression; if (node.init) { if (t.isSequenceExpression(expr)) { expr.expressions.push(node.init); node.init = expr; } else { node.init = t.sequenceExpression([expr, node.init]); } } else { node.init = expr; } consumed = true; } if (consumed) { prev.remove(); } }, exit(path) { const node = path.node; if (!node.test) { return; } if (!path.get("body").isBlockStatement()) { const bodyNode = path.get("body").node; if (!t.isIfStatement(bodyNode)) { return; } if (t.isBreakStatement(bodyNode.consequent, { label: null })) { node.test = t.logicalExpression("&&", node.test, t.unaryExpression("!", bodyNode.test, true)); node.body = bodyNode.alternate || t.emptyStatement(); return; } if (t.isBreakStatement(bodyNode.alternate, { label: null })) { node.test = t.logicalExpression("&&", node.test, bodyNode.test); node.body = bodyNode.consequent || t.emptyStatement(); return; } return; } const statements = node.body.body; const exprs = []; let ifStatement = null; let breakAt = null; let i = 0; for (let statement; statement = statements[i]; i++) { if (t.isIfStatement(statement)) { if (t.isBreakStatement(statement.consequent, { label: null })) { ifStatement = statement; breakAt = "consequent"; } else if (t.isBreakStatement(statement.alternate, { label: null })) { ifStatement = statement; breakAt = "alternate"; } break; } // A statement appears before the break statement then bail. if (!t.isExpressionStatement(statement)) { return; } exprs.push(statement.expression); } if (!ifStatement) { return; } const rest = []; if (breakAt === "consequent") { if (t.isBlockStatement(ifStatement.alternate)) { rest.push(...ifStatement.alternate.body); } else if (ifStatement.alternate) { rest.push(ifStatement.alternate); } } else { if (t.isBlockStatement(ifStatement.consequent)) { rest.push(...ifStatement.consequent.body); } else if (ifStatement.consequent) { rest.push(ifStatement.consequent); } } rest.push(...statements.slice(i + 1)); const test = breakAt === "consequent" ? t.unaryExpression("!", ifStatement.test, true) : ifStatement.test; let expr; if (exprs.length === 1) { expr = t.sequenceExpression([exprs[0], test]); } else if (exprs.length) { exprs.push(test); expr = t.sequenceExpression(exprs); } else { expr = test; } node.test = t.logicalExpression("&&", node.test, expr); if (rest.length === 1) { node.body = rest[0]; } else if (rest.length) { node.body = t.blockStatement(rest); } else { node.body = t.emptyStatement(); } } }, Program(path) { // An approximation of the resultant gzipped code after minification this.fitsInSlidingWindow = path.getSource().length / 10 < 33000; const node = path.node; const statements = toMultipleSequenceExpressions(node.body); if (!statements.length) { return; } node.body = statements; }, BlockStatement: { enter(path) { const node = path.node, parent = path.parent; const top = []; const bottom = []; for (let i = 0; i < node.body.length; i++) { const bodyNode = node.body[i]; if (t.isFunctionDeclaration(bodyNode)) { top.push(bodyNode); } else { bottom.push(bodyNode); } } const statements = top.concat(toMultipleSequenceExpressions(bottom)); if (!statements.length) { return; } if (statements.length > 1 || needsBlock(node, parent) || node.directives) { node.body = statements; return; } if (statements.length) { path.replaceWith(statements[0]); return; } }, exit(path) { const node = path.node, parent = path.parent; if (t.isArrowFunctionExpression(parent) && node.body.length === 1 && t.isReturnStatement(node.body[0]) && node.body[0].argument !== null) { path.replaceWith(node.body[0].argument); return; } if (needsBlock(node, parent)) { return; } if (node.body.length === 1) { path.get("body")[0].inList = false; path.replaceWith(node.body[0]); return; } if (node.body.length === 0) { path.replaceWith(t.emptyStatement()); return; } // Check if oppurtinties to merge statements are available. const statements = node.body; if (!statements.length) { return; } var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = statements[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { const statement = _step2.value; if (!t.isExpressionStatement(statement)) { return; } } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return != null) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } path.visit(); } }, ThrowStatement: createPrevExpressionEater("throw"), // Try to merge previous statements into a sequence ReturnStatement: { enter: [createPrevExpressionEater("return"), // Remove return if last statement with no argument. // Replace return with `void` argument with argument. function (path) { const node = path.node; if (!path.parentPath.parentPath.isFunction() || path.getSibling(path.key + 1).node) { return; } if (!node.argument) { path.remove(); return; } if (t.isUnaryExpression(node.argument, { operator: "void" })) { path.replaceWith(node.argument.argument); } }] }, // turn blocked ifs into single statements IfStatement: { exit: [ifStatement.mergeNestedIfs, ifStatement.simplify, ifStatement.switchConsequent, ifStatement.conditionalReturnToGuards, createPrevExpressionEater("if")] }, WhileStatement(path) { const node = path.node; path.replaceWith(t.forStatement(null, node.test, null, node.body)); }, ForInStatement: createPrevExpressionEater("for-in"), // Flatten sequence expressions. SequenceExpression: { exit(path) { if (path.node[seqExprSeen]) { return; } function flatten(node) { node[seqExprSeen] = true; const ret = []; var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = node.expressions[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { const n = _step3.value; if (t.isSequenceExpression(n)) { ret.push(...flatten(n)); } else { ret.push(n); } } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return != null) { _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } return ret; } path.node.expressions = flatten(path.node); } }, SwitchCase(path) { const node = path.node; if (!node.consequent.length) { return; } node.consequent = toMultipleSequenceExpressions(node.consequent); }, SwitchStatement: { exit: [// Convert switch statements with all returns in their cases // to return conditional. function (path) { const node = path.node; // Need to be careful of side-effects. if (!t.isIdentifier(node.discriminant)) { return; } if (!node.cases.length) { return; } const consTestPairs = []; let fallThru = []; let defaultRet; var _iteratorNormalCompletion4 = true; var _didIteratorError4 = false; var _iteratorError4 = undefined; try { for (var _iterator4 = node.cases[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { const switchCase = _step4.value; if (switchCase.consequent.length > 1) { return; } const cons = switchCase.consequent[0]; // default case if (!switchCase.test) { if (!t.isReturnStatement(cons)) { return; } defaultRet = cons; continue; } if (!switchCase.consequent.length) { fallThru.push(switchCase.test); continue; } // TODO: can we void it? if (!t.isReturnStatement(cons)) { return; } let test = t.binaryExpression("===", node.discriminant, switchCase.test); if (fallThru.length && !defaultRet) { test = fallThru.reduceRight((right, test) => t.logicalExpression("||", t.binaryExpression("===", node.discriminant, test), right), test); } fallThru = []; consTestPairs.push([test, cons.argument || VOID_0]); } // Bail if we have any remaining fallthrough } catch (err) { _didIteratorError4 = true; _iteratorError4 = err; } finally { try { if (!_iteratorNormalCompletion4 && _iterator4.return != null) { _iterator4.return(); } } finally { if (_didIteratorError4) { throw _iteratorError4; } } } if (fallThru.length) { return; } // We need the default to be there to make sure there is an oppurtinity // not to return. if (!defaultRet) { if (path.inList) { const nextPath = path.getSibling(path.key + 1); if (nextPath.isReturnStatement()) { defaultRet = nextPath.node; nextPath.remove(); } else if (!nextPath.node && path.parentPath.parentPath.isFunction()) { // If this is the last statement in a function we just fake a void return. defaultRet = t.returnStatement(VOID_0); } else { return; } } else { return; } } const cond = consTestPairs.reduceRight((alt, [test, cons]) => t.conditionalExpression(test, cons, alt), defaultRet.argument || VOID_0); path.replaceWith(t.returnStatement(cond)); // Maybe now we can merge with some previous switch statement. if (path.inList) { const prev = path.getSibling(path.key - 1); if (prev.isSwitchStatement()) { prev.visit(); } } }, // Convert switches into conditionals. function (path) { const node = path.node; // Need to be careful of side-effects. if (!t.isIdentifier(node.discriminant)) { return; } if (!node.cases.length) { return; } const exprTestPairs = []; let fallThru = []; let defaultExpr; var _iteratorNormalCompletion5 = true; var _didIteratorError5 = false; var _iteratorError5 = undefined; try { for (var _iterator5 = node.cases[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { const switchCase = _step5.value; if (!switchCase.test) { if (switchCase.consequent.length !== 1) { return; } if (!t.isExpressionStatement(switchCase.consequent[0])) { return; } defaultExpr = switchCase.consequent[0].expression; continue; } if (!switchCase.consequent.length) { fallThru.push(switchCase.test); continue; } const _switchCase$consequen = _slicedToArray(switchCase.consequent, 2), cons = _switchCase$consequen[0], breakStatement = _switchCase$consequen[1]; if (switchCase === node.cases[node.cases.length - 1]) { if (breakStatement && !t.isBreakStatement(breakStatement)) { return; } } else if (!t.isBreakStatement(breakStatement)) { return; } if (!t.isExpressionStatement(cons) || switchCase.consequent.length > 2) { return; } let test = t.binaryExpression("===", node.discriminant, switchCase.test); if (fallThru.length && !defaultExpr) { test = fallThru.reduceRight((right, test) => t.logicalExpression("||", t.binaryExpression("===", node.discriminant, test), right), test); } fallThru = []; exprTestPairs.push([test, cons.expression]); } } catch (err) { _didIteratorError5 = true; _iteratorError5 = err; } finally { try { if (!_iteratorNormalCompletion5 && _iterator5.return != null) { _iterator5.return(); } } finally { if (_didIteratorError5) { throw _iteratorError5; } } } if (fallThru.length) { return; } const cond = exprTestPairs.reduceRight((alt, [test, cons]) => t.conditionalExpression(test, cons, alt), defaultExpr || VOID_0); path.replaceWith(cond); }, function (path) { const node = path.node; if (!node.cases.length) { return; } const lastCase = path.get("cases")[node.cases.length - 1]; if (!lastCase.node.consequent.length) { return; } const potentialBreak = lastCase.get("consequent")[lastCase.node.consequent.length - 1]; if (t.isBreakStatement(potentialBreak) && potentialBreak.node.label === null) { potentialBreak.remove(); } }, createPrevExpressionEater("switch")] } } }; function flipNegation(node) { if (!node.consequent || !node.alternate) { return; } const test = node.test; let flip = false; if (t.isBinaryExpression(test)) { if (test.operator === "!==") { test.operator = "==="; flip = true; } if (test.operator === "!=") { test.operator = "=="; flip = true; } } if (t.isUnaryExpression(test, { operator: "!" })) { node.test = test.argument; flip = true; } if (flip) { const consequent = node.consequent; node.consequent = node.alternate; node.alternate = consequent; } } function needsBlock(node, parent) { return t.isFunction(parent) && node === parent.body || t.isTryStatement(parent) || t.isCatchClause(parent) || t.isSwitchStatement(parent) || isSingleBlockScopeDeclaration(node) && (t.isIfStatement(parent) || t.isLoop(parent)); } function isSingleBlockScopeDeclaration(block) { return t.isBlockStatement(block) && block.body.length === 1 && (t.isVariableDeclaration(block.body[0], { kind: "let" }) || t.isVariableDeclaration(block.body[0], { kind: "const" }) || t.isFunctionDeclaration(block.body[0])); } function isVoid0(expr) { return expr === VOID_0 || t.isUnaryExpression(expr, { operator: "void" }) && t.isNumericLiteral(expr.argument, { value: 0 }); } function earlyReturnTransform(path) { const block = path.get("body"); if (!block.isBlockStatement()) { return; } const body = block.get("body"); for (let i = body.length - 1; i >= 0; i--) { const statement = body[i]; if (t.isIfStatement(statement.node) && !statement.node.alternate && t.isReturnStatement(statement.node.consequent) && !statement.node.consequent.argument) { genericEarlyExitTransform(statement); } } } function earlyContinueTransform(path) { const block = path.get("body"); if (!block.isBlockStatement()) { return; } let body = block.get("body"); for (let i = body.length - 1; i >= 0; i--) { const statement = body[i]; if (t.isIfStatement(statement.node) && !statement.node.alternate && t.isContinueStatement(statement.node.consequent) && !statement.node.consequent.label) { genericEarlyExitTransform(statement); } } // because we might have folded or removed statements body = block.get("body"); // We may have reduced the body to a single statement. if (body.length === 1 && !needsBlock(block.node, path.node)) { block.replaceWith(body[0].node); } } function genericEarlyExitTransform(path) { const node = path.node; const statements = path.parentPath.get(path.listKey).slice(path.key + 1).filter(stmt => !stmt.isFunctionDeclaration()); // deopt for any block scoped bindings // issue#399 const deopt = !statements.every(stmt => { if (!(stmt.isVariableDeclaration({ kind: "let" }) || stmt.isVariableDeclaration({ kind: "const" }))) { return true; } const ids = Object.keys(stmt.getBindingIdentifiers()); for (var _i2 = 0; _i2 < ids.length; _i2++) { const id = ids[_i2]; const binding = path.scope.getBinding(id); // TODO // Temporary Fix // if there is no binding, we assume it is referenced outside // and deopt to avoid bugs if (!binding) { return false; } const refs = [...binding.referencePaths, ...binding.constantViolations]; for (var _i3 = 0; _i3 < refs.length; _i3++) { const ref = refs[_i3]; if (!ref.isIdentifier()) return false; const fnParent = ref.getFunctionParent(); // TODO // Usage of scopes and bindings in simplify plugin results in // undefined bindings because scope changes are not updated in the // scope tree. So, we deopt whenever we encounter one such issue // and not perform the transformation if (!fnParent) { return false; } if (fnParent.scope !== path.scope) return false; } } return true; }); if (deopt) { path.visit(); return false; } if (!statements.length) { path.replaceWith(t.expressionStatement(node.test)); return; } const test = node.test; if (t.isBinaryExpression(test) && test.operator === "!==") { test.operator = "==="; } else if (t.isBinaryExpression(test) && test.operator === "!=") { test.operator = "=="; } else if (t.isUnaryExpression(test, { operator: "!" })) { node.test = test.argument; } else { node.test = t.unaryExpression("!", node.test, true); } path.get("consequent").replaceWith(t.blockStatement(statements.map(stmt => t.clone(stmt.node)))); let l = statements.length; while (l-- > 0) { if (!statements[l].isFunctionDeclaration()) { path.getSibling(path.key + 1).remove(); } } // this should take care of removing the block path.visit(); } function createPrevExpressionEater(keyword) { let key; switch (keyword) { case "switch": key = "discriminant"; break; case "throw": case "return": key = "argument"; break; case "if": key = "test"; break; case "for-in": key = "right"; break; } return function (path) { if (!path.inList) { return; } const node = path.node; const prev = path.getSibling(path.key - 1); if (!prev.isExpressionStatement()) { return; } let seq = prev.node.expression; if (node[key]) { if (t.isSequenceExpression(seq)) { seq.expressions.push(node[key]); } else { seq = t.sequenceExpression([seq, node[key]]); } } else { if (t.isSequenceExpression(seq)) { const lastExpr = seq.expressions[seq.expressions.length - 1]; seq.expressions[seq.expressions.length - 1] = t.unaryExpression("void", lastExpr, true); } else { seq = t.unaryExpression("void", seq, true); } } if (seq) { node[key] = seq; prev.remove(); // Since we were able to merge some stuff it's possible that this has opened // oppurtinties for other transforms to happen. // TODO: Look into changing the traversal order from bottom to up to avoid // having to revisit things. if (path.parentPath.parent) { path.parentPath.parent[shouldRevisit] = true; } } }; } // path1 -> path2 // is path1 an ancestor of path2 function isAncestor(path1, path2) { return !!path2.findParent(parent => parent === path1); } function isPureVoid(path) { return path.isUnaryExpression({ operator: "void" }) && path.isPure(); } function isGlobalUndefined(path) { return path.isIdentifier({ name: "undefined" }) && !path.scope.getBinding("undefined"); } function undefinedToNull(path) { if (isGlobalUndefined(path) || isPureVoid(path)) { path.replaceWith(t.nullLiteral()); } } }; /***/ }), /***/ "./node_modules/babel-plugin-minify-simplify/lib/logical-expression.js": /*!*****************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-simplify/lib/logical-expression.js ***! \*****************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const h = __webpack_require__(/*! ./helpers */ "./node_modules/babel-plugin-minify-simplify/lib/helpers.js"); const PatternMatch = __webpack_require__(/*! ./pattern-match */ "./node_modules/babel-plugin-minify-simplify/lib/pattern-match.js"); const evaluate = __webpack_require__(/*! babel-helper-evaluate-path */ "./node_modules/babel-helper-evaluate-path/lib/index.js"); module.exports = t => { const OP_AND = input => input === "&&"; const OP_OR = input => input === "||"; function simplifyPatterns(path) { // cache of evaluate(path) const evaluateMemo = new Map(); const TRUTHY = input => { // !NaN and !undefined are truthy // separate check here as they are considered impure by babel if (input.isUnaryExpression() && input.get("argument").isIdentifier()) { if (input.node.argument.name === "NaN" || input.node.argument.name === "undefined") { return true; } } const evalResult = evaluate(input); evaluateMemo.set(input, evalResult); return evalResult.confident && input.isPure() && evalResult.value; }; const FALSY = input => { // NaN and undefined are falsy // separate check here as they are considered impure by babel if (input.isIdentifier()) { if (input.node.name === "NaN" || input.node.name === "undefined") { return true; } } const evalResult = evaluate(input); evaluateMemo.set(input, evalResult); return evalResult.confident && input.isPure() && !evalResult.value; }; const _h$typeSymbols = h.typeSymbols(t), EX = _h$typeSymbols.Expression; // Convention: // [left, operator, right, handler(leftNode, rightNode)] const matcher = new PatternMatch([[TRUTHY, OP_AND, EX, (l, r) => r], [FALSY, OP_AND, EX, l => l], [TRUTHY, OP_OR, EX, l => l], [FALSY, OP_OR, EX, (l, r) => r]]); const left = path.get("left"); const right = path.get("right"); const operator = path.node.operator; const result = matcher.match([left, operator, right], h.isPatternMatchesPath(t)); if (result.match) { // here we are sure that left.evaluate is always confident becuase // it satisfied one of TRUTHY/FALSY paths let value; if (evaluateMemo.has(left)) { value = evaluateMemo.get(left).value; } else { value = evaluate(left).value; } path.replaceWith(result.value(t.valueToNode(value), right.node)); } } return { simplifyPatterns }; }; /***/ }), /***/ "./node_modules/babel-plugin-minify-simplify/lib/pattern-match.js": /*!************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-simplify/lib/pattern-match.js ***! \************************************************************************/ /***/ ((module) => { "use strict"; function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } const LEAF_NODE = Symbol("LEAF_NODE"); module.exports = class PatternMatch { constructor(patterns) { this.decisionTree = this.makeDecisionTree(patterns); } handle(input, isMatch) { const result = this.match(input, isMatch); if (!result.match) { throw new Error("No Match Found for " + input.toString()); } if (typeof result.value !== "function") { throw new Error("Expecting a function. Instead got - " + result.value.toString()); } result.value.call(null, input, result.keys); } match(input, isMatch = (a, b) => a === b) { let current = this.decisionTree; const result = { match: false, value: void 0, keys: [] }; // to handle falsy keys const NO_MATCH = Symbol("NO_MATCH"); for (let i = 0; i < input.length; i++) { let matchedKey = NO_MATCH; // because map doesn't support custom key equal function var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = current.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { const key = _step.value; if (isMatch(key, input[i])) { matchedKey = key; result.keys.push(matchedKey); break; } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } if (matchedKey !== NO_MATCH) { current = current.get(matchedKey); if (i === input.length - 1) { if (current.has(LEAF_NODE)) { result.match = true; result.value = current.get(LEAF_NODE); } break; } } else { break; } } return result; } makeDecisionTree(patterns) { // order of keys in a Map is the order of insertion const root = new Map(); var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = patterns[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { const pattern = _step2.value; make(root, pattern); } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return != null) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } return root; function make(parent, pattern) { if (pattern.length < 2) { throw new Error("at least 2 elements required in a pattern"); } if (pattern.length === 2) { if (parent.has(pattern[0])) { const pattern0 = parent.get(pattern[0]); if (!pattern0.has(LEAF_NODE)) { pattern0.set(LEAF_NODE, pattern[1]); } // here we don't handle duplicates // this pattern would have already been matched } else { parent.set(pattern[0], new Map([[LEAF_NODE, pattern[1]]])); } return parent; } const _pattern = _toArray(pattern), current = _pattern[0], rest = _pattern.slice(1); if (parent.has(current)) { make(parent.get(current), rest); } else { parent.set(current, make(new Map(), rest)); } return parent; } } }; /***/ }), /***/ "./node_modules/babel-plugin-minify-type-constructors/lib/index.js": /*!*************************************************************************!*\ !*** ./node_modules/babel-plugin-minify-type-constructors/lib/index.js ***! \*************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; function replaceArray(t, path) { const node = path.node; // arguments is taken :( const constructorArgs = path.get("arguments"); if (t.isIdentifier(node.callee, { name: "Array" }) && !path.scope.getBinding("Array")) { if (constructorArgs.length === 0) { // Array() -> [] path.replaceWith(t.arrayExpression([])); } else if (constructorArgs.length === 1) { const arg = constructorArgs[0]; const result = arg.evaluate(); if (result.confident) { if (typeof result.value === "number") { if (result.value >= 0 && result.value <= 6 && result.value % 1 === 0) { // "Array(7)" is shorter than "[,,,,,,,]" path.replaceWith(t.arrayExpression(Array(result.value).fill(null))); } else { dropNewIfPresent(); } } else { // Array("Asdf"), Array(true), Array(false) path.replaceWith(t.arrayExpression([t.valueToNode(result.value)])); } } else { const transformables = ["ArrayExpression", "ObjectExpression", "FunctionExpression", "ArrowFunctionExpression", "ClassExpression"]; if (transformables.indexOf(arg.node.type) !== -1) { // Array([]), Array({}) // Array(()=>{}), Array(class{}), Array(function(){}) path.replaceWith(t.arrayExpression([arg.node])); } else { // Array(x); Array(a.b); dropNewIfPresent(); } } } else { // Array(2,3), Array(a,b) => [2,3], [a,b] path.replaceWith(t.arrayExpression(node.arguments)); } return true; } function dropNewIfPresent() { if (path.isNewExpression()) { path.replaceWith(t.callExpression(node.callee, node.arguments)); } } } function replaceObject(t, path) { const node = path.node; if (t.isIdentifier(node.callee, { name: "Object" }) && !path.scope.getBinding("Object")) { const isVoid0 = __webpack_require__(/*! babel-helper-is-void-0 */ "./node_modules/babel-helper-is-void-0/lib/index.js")(t); const arg = node.arguments[0]; const binding = arg && t.isIdentifier(arg) && path.scope.getBinding(arg.name); // Object() -> {} if (node.arguments.length === 0) { path.replaceWith(t.objectExpression([])); // Object([]) -> [] } else if (arg.type === "ArrayExpression" || t.isFunctionExpression(arg)) { path.replaceWith(arg); // Object(null) -> {} } else if (isVoid0(arg) || arg.name === "undefined" || arg.type === "NullLiteral" || arg.type === "ObjectExpression" && arg.properties.length === 0) { path.replaceWith(t.objectExpression([])); // Object(localFn) -> localFn } else if (binding && binding.path.isFunction()) { path.replaceWith(arg); // Object({a:b}) -> {a:b} } else if (arg.type === "ObjectExpression") { path.replaceWith(arg); // new Object(a) -> Object(a) } else if (node.type === "NewExpression") { path.replaceWith(t.callExpression(node.callee, node.arguments)); } return true; } } function defaults({ boolean = true, number = true, string = true, array = true, object = true } = {}) { return { boolean, number, string, array, object }; } module.exports = function ({ types: t }) { return { name: "minify-type-constructors", visitor: { CallExpression(path) { const node = path.node; const opts = defaults(this.opts); // Boolean(foo) -> !!foo if (opts.boolean && t.isIdentifier(node.callee, { name: "Boolean" }) && node.arguments.length === 1 && !path.scope.getBinding("Boolean")) { path.replaceWith(t.unaryExpression("!", t.unaryExpression("!", node.arguments[0], true), true)); return; } // Number(foo) -> +foo if (opts.number && t.isIdentifier(node.callee, { name: "Number" }) && node.arguments.length === 1 && !path.scope.getBinding("Number")) { path.replaceWith(t.unaryExpression("+", node.arguments[0], true)); return; } // String(foo) -> foo + '' if (opts.string && t.isIdentifier(node.callee, { name: "String" }) && node.arguments.length === 1 && !path.scope.getBinding("String")) { path.replaceWith(t.binaryExpression("+", node.arguments[0], t.stringLiteral(""))); return; } // Array() -> [] if (opts.array && replaceArray(t, path)) { return; } // Object() -> {} if (opts.object && replaceObject(t, path)) { return; } }, NewExpression(path) { const opts = defaults(this.opts); // new Array() -> [] if (opts.array && replaceArray(t, path)) { return; } // new Object() -> {} if (opts.object && replaceObject(t, path)) { return; } } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/array-collapser.js": /*!********************************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/array-collapser.js ***! \********************************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const Collapser = __webpack_require__(/*! ./collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/collapser.js"); class ArrayCollapser extends Collapser { isInitTypeValid(init) { return init.isArrayExpression(); } isExpressionTypeValid(expr) { return expr.isCallExpression(); } getExpressionChecker(objName, checkReference) { return expr => { // checks expr is of form: // foo.push(rval1, ...nrvals) const callee = expr.get("callee"); if (!callee.isMemberExpression()) { return false; } const obj = callee.get("object"), prop = callee.get("property"); if (!obj.isIdentifier() || obj.node.name !== objName || !prop.isIdentifier() || prop.node.name !== "push") { return false; } const args = expr.get("arguments"); if (args.some(checkReference)) { return false; } return true; }; } extractAssignment(expr) { return expr.node.arguments; } addSuccessfully(t, args, init) { args.map(a => init.elements.push(a)); return true; } } module.exports = ArrayCollapser; /***/ }), /***/ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/array-property-collapser.js": /*!*****************************************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/array-property-collapser.js ***! \*****************************************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const Collapser = __webpack_require__(/*! ./collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/collapser.js"); class ArrayPropertyCollapser extends Collapser { isInitTypeValid(init) { return init.isArrayExpression(); } isExpressionTypeValid(expr) { return expr.isAssignmentExpression(); } getExpressionChecker(objName, checkReference) { return expr => { // checks expr is of form: // foo[num] = rval const left = expr.get("left"); if (!left.isMemberExpression()) { return false; } const obj = left.get("object"), prop = left.get("property"); if (!obj.isIdentifier() || obj.node.name !== objName) { return false; } const checkIndex = num => Number.isInteger(num) && num >= 0; if (!(prop.isNumericLiteral() || prop.isStringLiteral()) || !checkIndex(Number(prop.node.value))) { return false; } const right = expr.get("right"); if (checkReference(right)) { return false; } return true; }; } extractAssignment(expr) { return [expr.node.left.property.value, expr.get("right")]; } addSuccessfully(t, [index, rval], init) { const elements = init.elements; for (let i = elements.length; i <= index; i++) { elements.push(null); } if (elements[index] !== null) { return false; } elements[index] = rval.node; return true; } isSizeSmaller({ newInit, oldInit, varDecl, assignments, statements }) { const anyUndefined = args => args.some(a => a === undefined); // We make an inexact calculation of how much space we save. // It's inexact because we don't know how whitespaces will get minimized, // and other factors. if (anyUndefined([statements[statements.length - 1].node.end, varDecl.node.end])) { return false; } const statementsLength = statements[statements.length - 1].node.end - varDecl.node.end; // Approx. formula of the change in `init`'s length = // (# commas added) + (size of all the new rvals added), where // # commas added = (difference between the lengths of the old and new arrays) const numCommaAdded = newInit.elements.length - oldInit.elements.length; if (anyUndefined(assignments.map(([, rval]) => rval.node.end)) || anyUndefined(assignments.map(([, rval]) => rval.node.start))) { return false; } const sizeOfRvals = assignments.map(([, rval]) => rval.node.end - rval.node.start + 1).reduce((a, b) => a + b, 0); // add 1 for space in front // sum return numCommaAdded + sizeOfRvals < statementsLength; } } module.exports = ArrayPropertyCollapser; /***/ }), /***/ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/collapser.js": /*!**************************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/collapser.js ***! \**************************************************************************************/ /***/ ((module) => { "use strict"; const NotImplementedError = Error("NotImplementedError"); class Collapser { isInitTypeValid() { throw NotImplementedError; } isExpressionTypeValid() { throw NotImplementedError; } getExpressionChecker() { throw NotImplementedError; } extractAssignment() { throw NotImplementedError; } addSuccessfully() { throw NotImplementedError; } isSizeSmaller() { return true; } } module.exports = Collapser; /***/ }), /***/ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/index.js": /*!**********************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/index.js ***! \**********************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } const COLLAPSERS = [__webpack_require__(/*! ./object-collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/object-collapser.js"), __webpack_require__(/*! ./array-collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/array-collapser.js"), __webpack_require__(/*! ./array-property-collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/array-property-collapser.js"), __webpack_require__(/*! ./set-collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/set-collapser.js")].map(Collapser => { return new Collapser(); }); function getFunctionParent(path, scopeParent) { const parent = path.findParent(p => p.isFunction()); // don"t traverse higher than the function the var is defined in. return parent === scopeParent ? null : parent; } function getFunctionReferences(path, scopeParent, references = new Set()) { for (let func = getFunctionParent(path, scopeParent); func; func = getFunctionParent(func, scopeParent)) { const id = func.node.id; const binding = id && func.scope.getBinding(id.name); if (!binding) { continue; } binding.referencePaths.forEach(path => { if (!references.has(path)) { references.add(path); getFunctionReferences(path, scopeParent, references); } }); } return references; } function getIdAndFunctionReferences(name, parent) { // Returns false if there's an error. Otherwise returns a list of references. const binding = parent.scope.getBinding(name); if (!binding) { return false; } const references = binding.referencePaths.reduce((references, ref) => { references.add(ref); getFunctionReferences(ref, parent, references); return references; }, new Set()); return Array.from(references); } function validateTopLevel(path) { // Ensures the structure is of the form (roughly): // { // ... // var foo = expr; // ... // } // returns null if not of this form // otherwise returns [foo as string, ?rval, index of the variable declaration] const declarations = path.get("declarations"); if (declarations.length !== 1) { return; } const declaration = declarations[0]; const id = declaration.get("id"), init = declaration.get("init"); if (!id.isIdentifier()) { return; } const parent = path.parentPath; if (!parent.isBlockParent() || !parent.isScopable()) { return; } const body = parent.get("body"); if (!Array.isArray(body)) { return; } const startIndex = body.indexOf(path); if (startIndex === -1) { return; } return [id.node.name, init, startIndex]; } function collectExpressions(path, isExprTypeValid) { // input: ExprStatement => 'a | SequenceExpression // SequenceExpression => 'a list // Validates 'a is of the right type // returns null if found inconsistency, else returns Array<"a> if (path.isExpressionStatement()) { const exprs = collectExpressions(path.get("expression"), isExprTypeValid); return exprs !== null ? exprs : null; } if (path.isSequenceExpression()) { const exprs = path.get("expressions").map(p => collectExpressions(p, isExprTypeValid)); if (exprs.some(e => e === null)) { return null; } else { return exprs.reduce((s, n) => s.concat(n), []); // === Array.flatten } } if (isExprTypeValid(path)) { return [path]; } return null; } function getContiguousStatementsAndExpressions(body, start, end, isExprTypeValid, checkExpr) { const statements = []; let allExprs = []; for (let i = start; i < end; i++) { const exprs = collectExpressions(body[i], isExprTypeValid); if (exprs === null || !exprs.every(e => checkExpr(e))) { break; } statements.push(body[i]); allExprs = allExprs.concat(exprs); } return [statements, allExprs]; } function getReferenceChecker(references) { // returns a function s.t. given an expr, returns true iff expr is an ancestor of a reference return expr => references.some(r => r === expr || r.isDescendant(expr)); } function tryUseCollapser(t, collapser, varDecl, topLevel, checkReference) { // Returns true iff successfully used the collapser. Otherwise returns undefined. const _topLevel = _slicedToArray(topLevel, 3), name = _topLevel[0], init = _topLevel[1], startIndex = _topLevel[2]; if (!collapser.isInitTypeValid(init)) { return; } const body = varDecl.parentPath.get("body"); const _getContiguousStateme = getContiguousStatementsAndExpressions(body, startIndex + 1, body.length, collapser.isExpressionTypeValid, collapser.getExpressionChecker(name, checkReference)), _getContiguousStateme2 = _slicedToArray(_getContiguousStateme, 2), statements = _getContiguousStateme2[0], exprs = _getContiguousStateme2[1]; if (statements.length === 0) { return; } const assignments = exprs.map(e => collapser.extractAssignment(e)); const oldInit = init.node; const newInit = t.cloneDeep(oldInit); if (!assignments.every(assignment => collapser.addSuccessfully(t, assignment, newInit))) { return; } // some collapses may increase the size if (!collapser.isSizeSmaller({ newInit, oldInit, varDecl, assignments, statements })) { return; } init.replaceWith(newInit); statements.forEach(s => s.remove()); return true; } module.exports = function ({ types: t }) { return { name: "transform-inline-consecutive-adds", visitor: { VariableDeclaration(varDecl) { const topLevel = validateTopLevel(varDecl); if (!topLevel) { return; } const _topLevel2 = _slicedToArray(topLevel, 1), name = _topLevel2[0]; const references = getIdAndFunctionReferences(name, varDecl.parentPath); if (references === false) { return; } const checkReference = getReferenceChecker(references); if (COLLAPSERS.some(c => tryUseCollapser(t, c, varDecl, topLevel, checkReference))) { return; } } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/object-collapser.js": /*!*********************************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/object-collapser.js ***! \*********************************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const Collapser = __webpack_require__(/*! ./collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/collapser.js"); class ObjectCollapser extends Collapser { isInitTypeValid(init) { return init.isObjectExpression(); } isExpressionTypeValid(expr) { return expr.isAssignmentExpression(); } getExpressionChecker(objName, checkReference) { return expr => { // checks expr is of form: // foo.a = rval | foo[a] = rval const left = expr.get("left"); if (!left.isMemberExpression()) { return false; } const obj = left.get("object"), prop = left.get("property"); if (!obj.isIdentifier() || obj.node.name !== objName) { return false; } if (!prop.isIdentifier() && checkReference(prop)) { return false; } if (left.node.computed && !(prop.isStringLiteral() || prop.isNumericLiteral())) { return false; } const right = expr.get("right"); if (checkReference(right)) { return false; } return true; }; } extractAssignment(expr) { return [expr.node.left.property, expr.node.right]; } addSuccessfully(t, [left, right], init) { init.properties.push(t.objectProperty(left, right)); return true; } } module.exports = ObjectCollapser; /***/ }), /***/ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/set-collapser.js": /*!******************************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/set-collapser.js ***! \******************************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const Collapser = __webpack_require__(/*! ./collapser */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/collapser.js"); class SetCollapser extends Collapser { isInitTypeValid(init) { return init.isNewExpression() && init.get("callee").isIdentifier() && init.node.callee.name === "Set" && ( // other iterables might not be append-able init.node.arguments.length === 0 || init.node.arguments.length === 1 && init.get("arguments")[0].isArrayExpression()); } isExpressionTypeValid(expr) { return expr.isCallExpression(); } getExpressionChecker(objName, checkReference) { return expr => { // checks expr is of form: // foo.add(rval) const callee = expr.get("callee"); if (!callee.isMemberExpression()) { return false; } const obj = callee.get("object"), prop = callee.get("property"); if (!obj.isIdentifier() || obj.node.name !== objName || !prop.isIdentifier() || prop.node.name !== "add") { return false; } const args = expr.get("arguments"); if (args.length !== 1) { return false; } if (checkReference(args[0])) { return false; } return true; }; } extractAssignment(expr) { return expr.node.arguments[0]; } addSuccessfully(t, arg, init) { if (init.arguments.length === 0) { init.arguments.push(t.arrayExpression()); } init.arguments[0].elements.push(arg); return true; } } module.exports = SetCollapser; /***/ }), /***/ "./node_modules/babel-plugin-transform-member-expression-literals/lib/index.js": /*!*************************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-member-expression-literals/lib/index.js ***! \*************************************************************************************/ /***/ ((module) => { "use strict"; module.exports = function ({ types: t }) { return { name: "transform-member-expression-literals", visitor: { // foo['bar'] -> foo.bar MemberExpression: { exit({ node }) { const prop = node.property; if (!node.computed || !t.isStringLiteral(prop)) { return; } if (prop.value.match(/^\d+$/)) { const newProp = parseInt(prop.value, 10); if (newProp.toString() === prop.value) { node.property = t.numericLiteral(newProp); node.computed = false; } } else if (t.isValidIdentifier(prop.value)) { node.property = t.identifier(prop.value); node.computed = false; } } } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-transform-merge-sibling-variables/lib/index.js": /*!**********************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-merge-sibling-variables/lib/index.js ***! \**********************************************************************************/ /***/ ((module) => { "use strict"; module.exports = function ({ types: t }) { function liftDeclaration(path, body, kind) { if (body[0] && body[0].isVariableDeclaration({ kind: kind })) { if (body[0].node.declarations.length > 1) { return; } if (body[1] && body[1].isVariableDeclaration({ kind: kind })) { return; } const firstNode = body[0].node.declarations[0]; if (!t.isIdentifier(firstNode.id) || !firstNode.init) { return; } const init = path.get("init"); if (!init.isVariableDeclaration({ kind: kind })) { return; } init.pushContainer("declarations", t.variableDeclarator(firstNode.id)); body[0].replaceWith(t.assignmentExpression("=", t.clone(firstNode.id), t.clone(firstNode.init))); } } return { name: "transform-merge-sibling-variables", visitor: { ForStatement(path) { // Lift declarations to the loop initializer let body = path.get("body"); body = body.isBlockStatement() ? body.get("body") : [body]; liftDeclaration(path, body, "var"); liftDeclaration(path, body, "let"); }, VariableDeclaration: { enter: [// concat variables of the same kind with their siblings function (path) { if (!path.inList) { return; } const node = path.node; let sibling = path.getSibling(path.key + 1); let declarations = []; while (sibling.isVariableDeclaration({ kind: node.kind })) { declarations = declarations.concat(sibling.node.declarations); sibling.remove(); sibling = path.getSibling(path.key + 1); } if (declarations.length > 0) { path.replaceWith(t.variableDeclaration(node.kind, [...node.declarations, ...declarations])); } }, // concat `var` declarations next to for loops with it's initialisers. // block-scoped `let` and `const` are not moved because the for loop // is a different block scope. function (path) { if (!path.inList) { return; } const node = path.node; if (node.kind !== "var") { return; } const next = path.getSibling(path.key + 1); if (!next.isForStatement()) { return; } const init = next.get("init"); if (!init.isVariableDeclaration({ kind: node.kind })) { return; } const declarations = node.declarations.concat(init.node.declarations); // temporary workaround to forces babel recalculate scope, // references and binding until babel/babel#4818 resolved path.remove(); init.replaceWith(t.variableDeclaration("var", declarations)); }] } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-transform-minify-booleans/lib/index.js": /*!**************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-minify-booleans/lib/index.js ***! \**************************************************************************/ /***/ ((module) => { "use strict"; module.exports = function ({ types: t }) { const TRUE = t.unaryExpression("!", t.numericLiteral(0), true); const FALSE = t.unaryExpression("!", t.numericLiteral(1), true); return { name: "transform-minify-booleans", visitor: { // shorten booleans to a negation // true -> !0 // false -> !1 BooleanLiteral(path) { path.replaceWith(path.node.value ? TRUE : FALSE); } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-transform-property-literals/lib/escape-string-literal.js": /*!********************************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-property-literals/lib/escape-string-literal.js ***! \********************************************************************************************/ /***/ ((module) => { "use strict"; /** * Original Source: * https://github.com/shapesecurity/shift-codegen-js/blob/0d09bd8a/src/coderep.js#L122 * * The following function is an exact copy of the original implementation * * LICENSE Copyright 2014 Shape Security, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ module.exports = function escapeStringLiteral(stringValue) { let result = ""; let nSingle = 0, nDouble = 0; for (let i = 0, l = stringValue.length; i < l; ++i) { let ch = stringValue[i]; if (ch === '"') { ++nDouble; } else if (ch === "'") { ++nSingle; } } let delim = nDouble > nSingle ? "'" : '"'; result += delim; for (let i = 0; i < stringValue.length; i++) { let ch = stringValue.charAt(i); switch (ch) { case delim: result += "\\" + delim; break; case "\n": result += "\\n"; break; case "\r": result += "\\r"; break; case "\\": result += "\\\\"; break; case "\u2028": result += "\\u2028"; break; case "\u2029": result += "\\u2029"; break; default: result += ch; break; } } result += delim; return result; }; /***/ }), /***/ "./node_modules/babel-plugin-transform-property-literals/lib/index.js": /*!****************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-property-literals/lib/index.js ***! \****************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const _require = __webpack_require__(/*! ./property-name */ "./node_modules/babel-plugin-transform-property-literals/lib/property-name.js"), reduceStaticPropertyNameES5 = _require.reduceStaticPropertyNameES5; module.exports = function ({ types: t }) { return { name: "transform-property-literals", visitor: { // { 'foo': 'bar' } -> { foo: 'bar' } ObjectProperty: { exit(path) { const key = path.get("key"); if (!key.isStringLiteral()) { return; } const newNode = t.clone(path.node); newNode.key = reduceStaticPropertyNameES5(t, key.node); newNode.computed = false; path.replaceWith(newNode); } } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-transform-property-literals/lib/property-name.js": /*!************************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-property-literals/lib/property-name.js ***! \************************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const _require = __webpack_require__(/*! esutils */ "./node_modules/esutils/lib/utils.js"), keyword = _require.keyword; const escapeStringLiteral = __webpack_require__(/*! ./escape-string-literal */ "./node_modules/babel-plugin-transform-property-literals/lib/escape-string-literal.js"); module.exports = { reduceStaticPropertyNameES5 }; /** * * Original Source: * https://github.com/shapesecurity/shift-codegen-js/blob/0d09bd8a/src/minimal-codegen.js#L635 * * This implementation modifies the original source in the following ways * + Check for ES5 Identifier name instead of ES6 Identifier name * + Use Babel-Types & Babel's AST instead of ShiftAST * * LICENSE Copyright 2014 Shape Security, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ function reduceStaticPropertyNameES5(t, node) { if (keyword.isIdentifierNameES5(node.value)) { return t.Identifier(node.value); } let n = parseFloat(node.value); if (n >= 0 && n.toString() === node.value) { return t.NumericLiteral(n); } return t.Identifier(escapeStringLiteral(node.value)); } /***/ }), /***/ "./node_modules/babel-plugin-transform-regexp-constructors/lib/index.js": /*!******************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-regexp-constructors/lib/index.js ***! \******************************************************************************/ /***/ ((module) => { "use strict"; function createRegExpLiteral(args, prettify, t) { const evaluatedArgs = args.map(a => a.evaluate()); if (!evaluatedArgs.every(a => a.confident && typeof a.value === "string")) { return; } let pattern = evaluatedArgs.length >= 1 && evaluatedArgs[0].value !== "" ? evaluatedArgs[0].value : "(?:)"; const flags = evaluatedArgs.length >= 2 ? evaluatedArgs[1].value : ""; pattern = new RegExp(pattern).source; if (prettify) { pattern = pattern.replace(/\n/g, "\\n").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/[\b]/g, "[\\b]").replace(/\v/g, "\\v").replace(/\f/g, "\\f").replace(/\r/g, "\\r"); } pattern = pattern.replace(/\0/g, "\\0"); return t.regExpLiteral(pattern, flags); } function maybeReplaceWithRegExpLiteral(path, t) { if (!t.isIdentifier(path.node.callee, { name: "RegExp" })) { return; } const regExpLiteral = createRegExpLiteral(path.get("arguments"), true, t); if (regExpLiteral) { path.replaceWith(regExpLiteral); } } module.exports = function ({ types: t }) { return { name: "transform-regexp-constructors", visitor: { NewExpression(path) { maybeReplaceWithRegExpLiteral(path, t); }, CallExpression(path) { // equivalent to `new RegExp()` according to §21.2.3 maybeReplaceWithRegExpLiteral(path, t); } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-transform-remove-console/lib/index.js": /*!*************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-remove-console/lib/index.js ***! \*************************************************************************/ /***/ ((module) => { "use strict"; module.exports = function ({ types: t }) { return { name: "transform-remove-console", visitor: { CallExpression(path, state) { const callee = path.get("callee"); if (!callee.isMemberExpression()) return; if (isIncludedConsole(callee, state.opts.exclude)) { // console.log() if (path.parentPath.isExpressionStatement()) { path.remove(); } else { path.replaceWith(createVoid0()); } } else if (isIncludedConsoleBind(callee, state.opts.exclude)) { // console.log.bind() path.replaceWith(createNoop()); } }, MemberExpression: { exit(path, state) { if (isIncludedConsole(path, state.opts.exclude) && !path.parentPath.isMemberExpression()) { if (path.parentPath.isAssignmentExpression() && path.parentKey === "left") { path.parentPath.get("right").replaceWith(createNoop()); } else { path.replaceWith(createNoop()); } } } } } }; function isGlobalConsoleId(id) { const name = "console"; return id.isIdentifier({ name }) && !id.scope.getBinding(name) && id.scope.hasGlobal(name); } function isExcluded(property, excludeArray) { return excludeArray && excludeArray.some(name => property.isIdentifier({ name })); } function isIncludedConsole(memberExpr, excludeArray) { const object = memberExpr.get("object"); const property = memberExpr.get("property"); if (isExcluded(property, excludeArray)) return false; if (isGlobalConsoleId(object)) return true; return isGlobalConsoleId(object.get("object")) && (property.isIdentifier({ name: "call" }) || property.isIdentifier({ name: "apply" })); } function isIncludedConsoleBind(memberExpr, excludeArray) { const object = memberExpr.get("object"); if (!object.isMemberExpression()) return false; if (isExcluded(object.get("property"), excludeArray)) return false; return isGlobalConsoleId(object.get("object")) && memberExpr.get("property").isIdentifier({ name: "bind" }); } function createNoop() { return t.functionExpression(null, [], t.blockStatement([])); } function createVoid0() { return t.unaryExpression("void", t.numericLiteral(0)); } }; /***/ }), /***/ "./node_modules/babel-plugin-transform-remove-debugger/lib/index.js": /*!**************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-remove-debugger/lib/index.js ***! \**************************************************************************/ /***/ ((module) => { "use strict"; module.exports = function () { return { name: "transform-remove-debugger", visitor: { DebuggerStatement(path) { path.remove(); } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-transform-remove-undefined/lib/index.js": /*!***************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-remove-undefined/lib/index.js ***! \***************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const evaluate = __webpack_require__(/*! babel-helper-evaluate-path */ "./node_modules/babel-helper-evaluate-path/lib/index.js"); function isPureAndUndefined(rval, { tdz, scope = { hasBinding: () => false } } = {}) { if (rval.isIdentifier() && rval.node.name === "undefined") { // deopt right away if undefined is a local binding if (scope.hasBinding(rval.node.name, true /* no globals */ )) { return false; } return true; } if (!rval.isPure()) { return false; } const evaluation = evaluate(rval, { tdz }); return evaluation.confident === true && evaluation.value === undefined; } function getLoopParent(path, scopeParent) { const parent = path.findParent(p => p.isLoop() || p === scopeParent); // don't traverse higher than the function the var is defined in. return parent === scopeParent ? null : parent; } function getFunctionParent(path, scopeParent) { const parent = path.findParent(p => p.isFunction()); // don't traverse higher than the function the var is defined in. return parent === scopeParent ? null : parent; } function getFunctionReferences(path, scopeParent, references = new Set()) { for (let func = getFunctionParent(path, scopeParent); func; func = getFunctionParent(func, scopeParent)) { const id = func.node.id; const binding = id && func.scope.getBinding(id.name); if (!binding) { continue; } binding.referencePaths.forEach(path => { if (!references.has(path)) { references.add(path); getFunctionReferences(path, scopeParent, references); } }); } return references; } function hasViolation(declarator, scope, start) { const binding = scope.getBinding(declarator.node.id.name); if (!binding) { return true; } const scopeParent = declarator.getFunctionParent(); const violation = binding.constantViolations.some(v => { // https://github.com/babel/minify/issues/630 if (!v.node) { return false; } // return 'true' if we cannot guarantee the violation references // the initialized identifier after const violationStart = v.node.start; if (violationStart === undefined || violationStart < start) { return true; } const references = getFunctionReferences(v, scopeParent); var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = references[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { const ref = _step.value; if (ref.node.start === undefined || ref.node.start < start) { return true; } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } for (let loop = getLoopParent(declarator, scopeParent); loop; loop = getLoopParent(loop, scopeParent)) { if (loop.node.end === undefined || loop.node.end > violationStart) { return true; } } }); return violation; } module.exports = function () { return { name: "transform-remove-undefined", visitor: { SequenceExpression(path, { opts: { tdz } = {} }) { const expressions = path.get("expressions"); for (let i = 0; i < expressions.length; i++) { const expr = expressions[i]; if (!isPureAndUndefined(expr, { tdz, scope: path.scope })) continue; // last value if (i === expressions.length - 1) { if (path.parentPath.isExpressionStatement()) { expr.remove(); } } else { expr.remove(); } } }, ReturnStatement(path, { opts: { tdz } = {} }) { if (path.node.argument !== null) { if (isPureAndUndefined(path.get("argument"), { tdz, scope: path.scope })) { path.node.argument = null; } } }, VariableDeclaration(path, { opts: { tdz } = {} }) { switch (path.node.kind) { case "const": break; case "let": var _iteratorNormalCompletion2 = true; var _didIteratorError2 = false; var _iteratorError2 = undefined; try { for (var _iterator2 = path.get("declarations")[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { const declarator = _step2.value; if (isPureAndUndefined(declarator.get("init"), { tdz })) { declarator.node.init = null; } } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (!_iteratorNormalCompletion2 && _iterator2.return != null) { _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } break; case "var": const start = path.node.start; if (start === undefined) { // This is common for plugin-generated nodes break; } const scope = path.scope; var _iteratorNormalCompletion3 = true; var _didIteratorError3 = false; var _iteratorError3 = undefined; try { for (var _iterator3 = path.get("declarations")[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { const declarator = _step3.value; if (isPureAndUndefined(declarator.get("init")) && !hasViolation(declarator, scope, start)) { declarator.node.init = null; } } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (!_iteratorNormalCompletion3 && _iterator3.return != null) { _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } break; } } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-transform-simplify-comparison-operators/lib/index.js": /*!****************************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-simplify-comparison-operators/lib/index.js ***! \****************************************************************************************/ /***/ ((module) => { "use strict"; module.exports = function ({ types: t }) { // custom implementation of getTypeAnnotation that fixes // the type information that is lost during sequence expression transformation // https://github.com/babel/minify/issues/323 function customTypeAnnotation(path) { if (path.typeAnnotation) { return path.typeAnnotation; } // We are not handling the case of literals and other base types // since they are already handled via getTypeAnnotation const node = path.node; const binding = path.parentPath.scope.getBinding(node.name); const types = []; if (binding && binding.constantViolations) { if (binding.identifier.typeAnnotation) { return binding.identifier.typeAnnotation; } if (binding.constantViolations) { const violations = binding.constantViolations; var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = violations[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { let violation = _step.value; types.push(violation.getTypeAnnotation()); } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } } if (types.length > 0) { return t.createUnionTypeAnnotation(types); } return types; } // Based on the type inference in Babel function baseTypeStrictlyMatches(left, right) { let leftTypes, rightTypes; if (t.isIdentifier(left)) { leftTypes = customTypeAnnotation(left); } else if (t.isIdentifier(right)) { rightTypes = customTypeAnnotation(right); } // Early exit if (t.isAnyTypeAnnotation(leftTypes) || t.isAnyTypeAnnotation(rightTypes)) { return false; } leftTypes = [].concat(leftTypes, left.getTypeAnnotation()); rightTypes = [].concat(rightTypes, right.getTypeAnnotation()); leftTypes = t.createUnionTypeAnnotation(leftTypes); rightTypes = t.createUnionTypeAnnotation(rightTypes); if (!t.isAnyTypeAnnotation(leftTypes) && t.isFlowBaseAnnotation(leftTypes)) { return leftTypes.type === rightTypes.type; } } return { name: "transform-simplify-comparison-operators", visitor: { // simplify comparison operations if we're 100% certain // that each value will always be of the same type BinaryExpression(path) { const node = path.node; const op = node.operator; if (op !== "===" && op !== "!==") { return; } const left = path.get("left"); const right = path.get("right"); const strictMatch = baseTypeStrictlyMatches(left, right); if (strictMatch) { node.operator = node.operator.slice(0, -1); } } } }; }; /***/ }), /***/ "./node_modules/babel-plugin-transform-undefined-to-void/lib/index.js": /*!****************************************************************************!*\ !*** ./node_modules/babel-plugin-transform-undefined-to-void/lib/index.js ***! \****************************************************************************/ /***/ ((module) => { "use strict"; module.exports = function ({ types: t }) { const VOID_0 = t.unaryExpression("void", t.numericLiteral(0), true); return { name: "transform-undefined-to-void", visitor: { ReferencedIdentifier(path) { if (path.node.name === "undefined") { path.replaceWith(VOID_0); } } } }; }; /***/ }), /***/ "./node_modules/babel-preset-minify/lib/index.js": /*!*******************************************************!*\ !*** ./node_modules/babel-preset-minify/lib/index.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } const isPlainObject = __webpack_require__(/*! lodash/isPlainObject */ "./node_modules/lodash/isPlainObject.js"); // the flat plugin map // This is to prevent dynamic requires - require('babel-plugin-' + name); // as it suffers during bundling of this code with webpack/browserify // sorted by option name // prettier-ignore const PLUGINS = [// [optionname, plugin, default], ["booleans", __webpack_require__(/*! babel-plugin-transform-minify-booleans */ "./node_modules/babel-plugin-transform-minify-booleans/lib/index.js"), true], ["builtIns", __webpack_require__(/*! babel-plugin-minify-builtins */ "./node_modules/babel-plugin-minify-builtins/lib/index.js"), true], ["consecutiveAdds", __webpack_require__(/*! babel-plugin-transform-inline-consecutive-adds */ "./node_modules/babel-plugin-transform-inline-consecutive-adds/lib/index.js"), true], ["deadcode", __webpack_require__(/*! babel-plugin-minify-dead-code-elimination */ "./node_modules/babel-plugin-minify-dead-code-elimination/lib/index.js"), true], ["evaluate", __webpack_require__(/*! babel-plugin-minify-constant-folding */ "./node_modules/babel-plugin-minify-constant-folding/lib/index.js"), true], ["flipComparisons", __webpack_require__(/*! babel-plugin-minify-flip-comparisons */ "./node_modules/babel-plugin-minify-flip-comparisons/lib/index.js"), true], ["guards", __webpack_require__(/*! babel-plugin-minify-guarded-expressions */ "./node_modules/babel-plugin-minify-guarded-expressions/lib/index.js"), true], ["infinity", __webpack_require__(/*! babel-plugin-minify-infinity */ "./node_modules/babel-plugin-minify-infinity/lib/index.js"), true], ["mangle", __webpack_require__(/*! babel-plugin-minify-mangle-names */ "./node_modules/babel-plugin-minify-mangle-names/lib/index.js"), true], ["memberExpressions", __webpack_require__(/*! babel-plugin-transform-member-expression-literals */ "./node_modules/babel-plugin-transform-member-expression-literals/lib/index.js"), true], ["mergeVars", __webpack_require__(/*! babel-plugin-transform-merge-sibling-variables */ "./node_modules/babel-plugin-transform-merge-sibling-variables/lib/index.js"), true], ["numericLiterals", __webpack_require__(/*! babel-plugin-minify-numeric-literals */ "./node_modules/babel-plugin-minify-numeric-literals/lib/index.js"), true], ["propertyLiterals", __webpack_require__(/*! babel-plugin-transform-property-literals */ "./node_modules/babel-plugin-transform-property-literals/lib/index.js"), true], ["regexpConstructors", __webpack_require__(/*! babel-plugin-transform-regexp-constructors */ "./node_modules/babel-plugin-transform-regexp-constructors/lib/index.js"), true], ["removeConsole", __webpack_require__(/*! babel-plugin-transform-remove-console */ "./node_modules/babel-plugin-transform-remove-console/lib/index.js"), false], ["removeDebugger", __webpack_require__(/*! babel-plugin-transform-remove-debugger */ "./node_modules/babel-plugin-transform-remove-debugger/lib/index.js"), false], ["removeUndefined", __webpack_require__(/*! babel-plugin-transform-remove-undefined */ "./node_modules/babel-plugin-transform-remove-undefined/lib/index.js"), true], ["replace", __webpack_require__(/*! babel-plugin-minify-replace */ "./node_modules/babel-plugin-minify-replace/lib/index.js"), true], ["simplify", __webpack_require__(/*! babel-plugin-minify-simplify */ "./node_modules/babel-plugin-minify-simplify/lib/index.js"), true], ["simplifyComparisons", __webpack_require__(/*! babel-plugin-transform-simplify-comparison-operators */ "./node_modules/babel-plugin-transform-simplify-comparison-operators/lib/index.js"), true], ["typeConstructors", __webpack_require__(/*! babel-plugin-minify-type-constructors */ "./node_modules/babel-plugin-minify-type-constructors/lib/index.js"), true], ["undefinedToVoid", __webpack_require__(/*! babel-plugin-transform-undefined-to-void */ "./node_modules/babel-plugin-transform-undefined-to-void/lib/index.js"), true]]; const PROXIES = { keepFnName: ["mangle", "deadcode"], keepClassName: ["mangle", "deadcode"], tdz: ["builtIns", "evaluate", "deadcode", "removeUndefined"] }; module.exports = preset; function preset(context, _opts = {}) { const opts = isPlainObject(_opts) ? _opts : {}; // validate options const validOptions = [...PLUGINS.map(p => p[0]), ...Object.keys(PROXIES)]; for (let name in opts) { if (validOptions.indexOf(name) < 0) { throw new Error(`Invalid option "${name}"`); } } // build a plugins map from the plugin table above const pluginsMap = PLUGINS.reduce((acc, [name, plugin, defaultValue]) => Object.assign(acc, { [name]: { plugin, options: null, enabled: defaultValue } }), {}); // handle plugins and their options var _iterator = _createForOfIteratorHelper(PLUGINS), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { const _step$value = _slicedToArray(_step.value, 1), name = _step$value[0]; if (isPlainObject(opts[name])) { // for plugins disabled by default pluginsMap[name].enabled = true; pluginsMap[name].options = opts[name]; } else if (opts[name] !== void 0) { pluginsMap[name].enabled = !!opts[name]; } } // handle proxies } catch (err) { _iterator.e(err); } finally { _iterator.f(); } for (let proxyname in PROXIES) { if (opts[proxyname] !== void 0) { var _iterator2 = _createForOfIteratorHelper(PROXIES[proxyname]), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { const to = _step2.value; if (!pluginsMap[to].options) { pluginsMap[to].options = {}; } if (!hop(pluginsMap[to].options, proxyname)) { pluginsMap[to].options[proxyname] = opts[proxyname]; } } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } } } // get the array of plugins const plugins = Object.keys(pluginsMap).map(name => pluginsMap[name]).filter(plugin => plugin.enabled).map(plugin => plugin.options ? [plugin.plugin, plugin.options] : plugin.plugin); return { minified: true, presets: [{ plugins }], passPerPreset: true }; } function hop(o, key) { return Object.prototype.hasOwnProperty.call(o, key); } /***/ }), /***/ "./node_modules/browserslist/browser.js": /*!**********************************************!*\ !*** ./node_modules/browserslist/browser.js ***! \**********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var BrowserslistError = __webpack_require__(/*! ./error */ "./node_modules/browserslist/error.js") function noop() {} module.exports = { loadQueries: function loadQueries() { throw new BrowserslistError( 'Sharable configs are not supported in client-side build of Browserslist' ) }, getStat: function getStat(opts) { return opts.stats }, loadConfig: function loadConfig(opts) { if (opts.config) { throw new BrowserslistError( 'Browserslist config are not supported in client-side build' ) } }, loadCountry: function loadCountry() { throw new BrowserslistError( 'Country statistics are not supported ' + 'in client-side build of Browserslist' ) }, loadFeature: function loadFeature() { throw new BrowserslistError( 'Supports queries are not available in client-side build of Browserslist' ) }, currentNode: function currentNode(resolve, context) { return resolve(['maintained node versions'], context)[0] }, parseConfig: noop, readConfig: noop, findConfig: noop, findConfigFile: noop, clearCaches: noop, oldDataWarning: noop, env: {} } /***/ }), /***/ "./node_modules/browserslist/error.js": /*!********************************************!*\ !*** ./node_modules/browserslist/error.js ***! \********************************************/ /***/ ((module) => { function BrowserslistError(message) { this.name = 'BrowserslistError' this.message = message this.browserslist = true if (Error.captureStackTrace) { Error.captureStackTrace(this, BrowserslistError) } } BrowserslistError.prototype = Error.prototype module.exports = BrowserslistError /***/ }), /***/ "./node_modules/browserslist/index.js": /*!********************************************!*\ !*** ./node_modules/browserslist/index.js ***! \********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var jsReleases = __webpack_require__(/*! node-releases/data/processed/envs.json */ "./node_modules/node-releases/data/processed/envs.json") var agents = (__webpack_require__(/*! caniuse-lite/dist/unpacker/agents */ "./node_modules/caniuse-lite/dist/unpacker/agents.js").agents) var e2c = __webpack_require__(/*! electron-to-chromium/versions */ "./node_modules/electron-to-chromium/versions.js") var jsEOL = __webpack_require__(/*! node-releases/data/release-schedule/release-schedule.json */ "./node_modules/node-releases/data/release-schedule/release-schedule.json") var path = __webpack_require__(/*! path */ "?3465") var BrowserslistError = __webpack_require__(/*! ./error */ "./node_modules/browserslist/error.js") var env = __webpack_require__(/*! ./node */ "./node_modules/browserslist/browser.js") var parseWithoutCache = __webpack_require__(/*! ./parse */ "./node_modules/browserslist/parse.js") // Will load browser.js in webpack var YEAR = 365.259641 * 24 * 60 * 60 * 1000 var ANDROID_EVERGREEN_FIRST = '37' var OP_MOB_BLINK_FIRST = 14 // Helpers function isVersionsMatch(versionA, versionB) { return (versionA + '.').indexOf(versionB + '.') === 0 } function isEolReleased(name) { var version = name.slice(1) return browserslist.nodeVersions.some(function (i) { return isVersionsMatch(i, version) }) } function normalize(versions) { return versions.filter(function (version) { return typeof version === 'string' }) } function normalizeElectron(version) { var versionToUse = version if (version.split('.').length === 3) { versionToUse = version.split('.').slice(0, -1).join('.') } return versionToUse } function nameMapper(name) { return function mapName(version) { return name + ' ' + version } } function getMajor(version) { return parseInt(version.split('.')[0]) } function getMajorVersions(released, number) { if (released.length === 0) return [] var majorVersions = uniq(released.map(getMajor)) var minimum = majorVersions[majorVersions.length - number] if (!minimum) { return released } var selected = [] for (var i = released.length - 1; i >= 0; i--) { if (minimum > getMajor(released[i])) break selected.unshift(released[i]) } return selected } function uniq(array) { var filtered = [] for (var i = 0; i < array.length; i++) { if (filtered.indexOf(array[i]) === -1) filtered.push(array[i]) } return filtered } function fillUsage(result, name, data) { for (var i in data) { result[name + ' ' + i] = data[i] } } function generateFilter(sign, version) { version = parseFloat(version) if (sign === '>') { return function (v) { return parseLatestFloat(v) > version } } else if (sign === '>=') { return function (v) { return parseLatestFloat(v) >= version } } else if (sign === '<') { return function (v) { return parseFloat(v) < version } } else { return function (v) { return parseFloat(v) <= version } } function parseLatestFloat(v) { return parseFloat(v.split('-')[1] || v) } } function generateSemverFilter(sign, version) { version = version.split('.').map(parseSimpleInt) version[1] = version[1] || 0 version[2] = version[2] || 0 if (sign === '>') { return function (v) { v = v.split('.').map(parseSimpleInt) return compareSemver(v, version) > 0 } } else if (sign === '>=') { return function (v) { v = v.split('.').map(parseSimpleInt) return compareSemver(v, version) >= 0 } } else if (sign === '<') { return function (v) { v = v.split('.').map(parseSimpleInt) return compareSemver(version, v) > 0 } } else { return function (v) { v = v.split('.').map(parseSimpleInt) return compareSemver(version, v) >= 0 } } } function parseSimpleInt(x) { return parseInt(x) } function compare(a, b) { if (a < b) return -1 if (a > b) return +1 return 0 } function compareSemver(a, b) { return ( compare(parseInt(a[0]), parseInt(b[0])) || compare(parseInt(a[1] || '0'), parseInt(b[1] || '0')) || compare(parseInt(a[2] || '0'), parseInt(b[2] || '0')) ) } // this follows the npm-like semver behavior function semverFilterLoose(operator, range) { range = range.split('.').map(parseSimpleInt) if (typeof range[1] === 'undefined') { range[1] = 'x' } // ignore any patch version because we only return minor versions // range[2] = 'x' switch (operator) { case '<=': return function (version) { version = version.split('.').map(parseSimpleInt) return compareSemverLoose(version, range) <= 0 } case '>=': default: return function (version) { version = version.split('.').map(parseSimpleInt) return compareSemverLoose(version, range) >= 0 } } } // this follows the npm-like semver behavior function compareSemverLoose(version, range) { if (version[0] !== range[0]) { return version[0] < range[0] ? -1 : +1 } if (range[1] === 'x') { return 0 } if (version[1] !== range[1]) { return version[1] < range[1] ? -1 : +1 } return 0 } function resolveVersion(data, version) { if (data.versions.indexOf(version) !== -1) { return version } else if (browserslist.versionAliases[data.name][version]) { return browserslist.versionAliases[data.name][version] } else { return false } } function normalizeVersion(data, version) { var resolved = resolveVersion(data, version) if (resolved) { return resolved } else if (data.versions.length === 1) { return data.versions[0] } else { return false } } function filterByYear(since, context) { since = since / 1000 return Object.keys(agents).reduce(function (selected, name) { var data = byName(name, context) if (!data) return selected var versions = Object.keys(data.releaseDate).filter(function (v) { var date = data.releaseDate[v] return date !== null && date >= since }) return selected.concat(versions.map(nameMapper(data.name))) }, []) } function cloneData(data) { return { name: data.name, versions: data.versions, released: data.released, releaseDate: data.releaseDate } } function byName(name, context) { name = name.toLowerCase() name = browserslist.aliases[name] || name if (context.mobileToDesktop && browserslist.desktopNames[name]) { var desktop = browserslist.data[browserslist.desktopNames[name]] if (name === 'android') { return normalizeAndroidData(cloneData(browserslist.data[name]), desktop) } else { var cloned = cloneData(desktop) cloned.name = name return cloned } } return browserslist.data[name] } function normalizeAndroidVersions(androidVersions, chromeVersions) { var iFirstEvergreen = chromeVersions.indexOf(ANDROID_EVERGREEN_FIRST) return androidVersions .filter(function (version) { return /^(?:[2-4]\.|[34]$)/.test(version) }) .concat(chromeVersions.slice(iFirstEvergreen)) } function copyObject(obj) { var copy = {} for (var key in obj) { copy[key] = obj[key] } return copy } function normalizeAndroidData(android, chrome) { android.released = normalizeAndroidVersions(android.released, chrome.released) android.versions = normalizeAndroidVersions(android.versions, chrome.versions) android.releaseDate = copyObject(android.releaseDate) android.released.forEach(function (v) { if (android.releaseDate[v] === undefined) { android.releaseDate[v] = chrome.releaseDate[v] } }) return android } function checkName(name, context) { var data = byName(name, context) if (!data) throw new BrowserslistError('Unknown browser ' + name) return data } function unknownQuery(query) { return new BrowserslistError( 'Unknown browser query `' + query + '`. ' + 'Maybe you are using old Browserslist or made typo in query.' ) } // Adjusts last X versions queries for some mobile browsers, // where caniuse data jumps from a legacy version to the latest function filterJumps(list, name, nVersions, context) { var jump = 1 switch (name) { case 'android': if (context.mobileToDesktop) return list var released = browserslist.data.chrome.released jump = released.length - released.indexOf(ANDROID_EVERGREEN_FIRST) break case 'op_mob': var latest = browserslist.data.op_mob.released.slice(-1)[0] jump = getMajor(latest) - OP_MOB_BLINK_FIRST + 1 break default: return list } if (nVersions <= jump) { return list.slice(-1) } return list.slice(jump - 1 - nVersions) } function isSupported(flags, withPartial) { return ( typeof flags === 'string' && (flags.indexOf('y') >= 0 || (withPartial && flags.indexOf('a') >= 0)) ) } function resolve(queries, context) { return parseQueries(queries).reduce(function (result, node, index) { if (node.not && index === 0) { throw new BrowserslistError( 'Write any browsers query (for instance, `defaults`) ' + 'before `' + node.query + '`' ) } var type = QUERIES[node.type] var array = type.select.call(browserslist, context, node).map(function (j) { var parts = j.split(' ') if (parts[1] === '0') { return parts[0] + ' ' + byName(parts[0], context).versions[0] } else { return j } }) if (node.compose === 'and') { if (node.not) { return result.filter(function (j) { return array.indexOf(j) === -1 }) } else { return result.filter(function (j) { return array.indexOf(j) !== -1 }) } } else { if (node.not) { var filter = {} array.forEach(function (j) { filter[j] = true }) return result.filter(function (j) { return !filter[j] }) } return result.concat(array) } }, []) } function prepareOpts(opts) { if (typeof opts === 'undefined') opts = {} if (typeof opts.path === 'undefined') { opts.path = path.resolve ? path.resolve('.') : '.' } return opts } function prepareQueries(queries, opts) { if (typeof queries === 'undefined' || queries === null) { var config = browserslist.loadConfig(opts) if (config) { queries = config } else { queries = browserslist.defaults } } return queries } function checkQueries(queries) { if (!(typeof queries === 'string' || Array.isArray(queries))) { throw new BrowserslistError( 'Browser queries must be an array or string. Got ' + typeof queries + '.' ) } } var cache = {} var parseCache = {} function browserslist(queries, opts) { opts = prepareOpts(opts) queries = prepareQueries(queries, opts) checkQueries(queries) var needsPath = parseQueries(queries).some(function (node) { return QUERIES[node.type].needsPath }) var context = { ignoreUnknownVersions: opts.ignoreUnknownVersions, dangerousExtend: opts.dangerousExtend, mobileToDesktop: opts.mobileToDesktop, env: opts.env } // Removing to avoid using context.path without marking query as needsPath if (needsPath) { context.path = opts.path } env.oldDataWarning(browserslist.data) var stats = env.getStat(opts, browserslist.data) if (stats) { context.customUsage = {} for (var browser in stats) { fillUsage(context.customUsage, browser, stats[browser]) } } var cacheKey = JSON.stringify([queries, context]) if (cache[cacheKey]) return cache[cacheKey] var result = uniq(resolve(queries, context)).sort(function (name1, name2) { name1 = name1.split(' ') name2 = name2.split(' ') if (name1[0] === name2[0]) { // assumptions on caniuse data // 1) version ranges never overlaps // 2) if version is not a range, it never contains `-` var version1 = name1[1].split('-')[0] var version2 = name2[1].split('-')[0] return compareSemver(version2.split('.'), version1.split('.')) } else { return compare(name1[0], name2[0]) } }) if (!env.env.BROWSERSLIST_DISABLE_CACHE) { cache[cacheKey] = result } return result } function parseQueries(queries) { var cacheKey = JSON.stringify(queries) if (cacheKey in parseCache) return parseCache[cacheKey] var result = parseWithoutCache(QUERIES, queries) if (!env.env.BROWSERSLIST_DISABLE_CACHE) { parseCache[cacheKey] = result } return result } function loadCustomUsage(context, config) { var stats = env.loadStat(context, config, browserslist.data) if (stats) { context.customUsage = {} for (var browser in stats) { fillUsage(context.customUsage, browser, stats[browser]) } } if (!context.customUsage) { throw new BrowserslistError('Custom usage statistics was not provided') } return context.customUsage } browserslist.parse = function (queries, opts) { opts = prepareOpts(opts) queries = prepareQueries(queries, opts) checkQueries(queries) return parseQueries(queries) } // Will be filled by Can I Use data below browserslist.cache = {} browserslist.data = {} browserslist.usage = { global: {}, custom: null } // Default browsers query browserslist.defaults = ['> 0.5%', 'last 2 versions', 'Firefox ESR', 'not dead'] // Browser names aliases browserslist.aliases = { fx: 'firefox', ff: 'firefox', ios: 'ios_saf', explorer: 'ie', blackberry: 'bb', explorermobile: 'ie_mob', operamini: 'op_mini', operamobile: 'op_mob', chromeandroid: 'and_chr', firefoxandroid: 'and_ff', ucandroid: 'and_uc', qqandroid: 'and_qq' } // Can I Use only provides a few versions for some browsers (e.g. and_chr). // Fallback to a similar browser for unknown versions // Note op_mob is not included as its chromium versions are not in sync with Opera desktop browserslist.desktopNames = { and_chr: 'chrome', and_ff: 'firefox', ie_mob: 'ie', android: 'chrome' // has extra processing logic } // Aliases to work with joined versions like `ios_saf 7.0-7.1` browserslist.versionAliases = {} browserslist.clearCaches = env.clearCaches browserslist.parseConfig = env.parseConfig browserslist.readConfig = env.readConfig browserslist.findConfigFile = env.findConfigFile browserslist.findConfig = env.findConfig browserslist.loadConfig = env.loadConfig browserslist.coverage = function (browsers, stats) { var data if (typeof stats === 'undefined') { data = browserslist.usage.global } else if (stats === 'my stats') { var opts = {} opts.path = path.resolve ? path.resolve('.') : '.' var customStats = env.getStat(opts) if (!customStats) { throw new BrowserslistError('Custom usage statistics was not provided') } data = {} for (var browser in customStats) { fillUsage(data, browser, customStats[browser]) } } else if (typeof stats === 'string') { if (stats.length > 2) { stats = stats.toLowerCase() } else { stats = stats.toUpperCase() } env.loadCountry(browserslist.usage, stats, browserslist.data) data = browserslist.usage[stats] } else { if ('dataByBrowser' in stats) { stats = stats.dataByBrowser } data = {} for (var name in stats) { for (var version in stats[name]) { data[name + ' ' + version] = stats[name][version] } } } return browsers.reduce(function (all, i) { var usage = data[i] if (usage === undefined) { usage = data[i.replace(/ \S+$/, ' 0')] } return all + (usage || 0) }, 0) } function nodeQuery(context, node) { var matched = browserslist.nodeVersions.filter(function (i) { return isVersionsMatch(i, node.version) }) if (matched.length === 0) { if (context.ignoreUnknownVersions) { return [] } else { throw new BrowserslistError( 'Unknown version ' + node.version + ' of Node.js' ) } } return ['node ' + matched[matched.length - 1]] } function sinceQuery(context, node) { var year = parseInt(node.year) var month = parseInt(node.month || '01') - 1 var day = parseInt(node.day || '01') return filterByYear(Date.UTC(year, month, day, 0, 0, 0), context) } function coverQuery(context, node) { var coverage = parseFloat(node.coverage) var usage = browserslist.usage.global if (node.place) { if (node.place.match(/^my\s+stats$/i)) { if (!context.customUsage) { throw new BrowserslistError('Custom usage statistics was not provided') } usage = context.customUsage } else { var place if (node.place.length === 2) { place = node.place.toUpperCase() } else { place = node.place.toLowerCase() } env.loadCountry(browserslist.usage, place, browserslist.data) usage = browserslist.usage[place] } } else if (node.config) { usage = loadCustomUsage(context, node.config) } var versions = Object.keys(usage).sort(function (a, b) { return usage[b] - usage[a] }) var covered = 0 var result = [] var version for (var i = 0; i < versions.length; i++) { version = versions[i] if (usage[version] === 0) break covered += usage[version] result.push(version) if (covered >= coverage) break } return result } var QUERIES = { last_major_versions: { matches: ['versions'], regexp: /^last\s+(\d+)\s+major\s+versions?$/i, select: function (context, node) { return Object.keys(agents).reduce(function (selected, name) { var data = byName(name, context) if (!data) return selected var list = getMajorVersions(data.released, node.versions) list = list.map(nameMapper(data.name)) list = filterJumps(list, data.name, node.versions, context) return selected.concat(list) }, []) } }, last_versions: { matches: ['versions'], regexp: /^last\s+(\d+)\s+versions?$/i, select: function (context, node) { return Object.keys(agents).reduce(function (selected, name) { var data = byName(name, context) if (!data) return selected var list = data.released.slice(-node.versions) list = list.map(nameMapper(data.name)) list = filterJumps(list, data.name, node.versions, context) return selected.concat(list) }, []) } }, last_electron_major_versions: { matches: ['versions'], regexp: /^last\s+(\d+)\s+electron\s+major\s+versions?$/i, select: function (context, node) { var validVersions = getMajorVersions(Object.keys(e2c), node.versions) return validVersions.map(function (i) { return 'chrome ' + e2c[i] }) } }, last_node_major_versions: { matches: ['versions'], regexp: /^last\s+(\d+)\s+node\s+major\s+versions?$/i, select: function (context, node) { return getMajorVersions(browserslist.nodeVersions, node.versions).map( function (version) { return 'node ' + version } ) } }, last_browser_major_versions: { matches: ['versions', 'browser'], regexp: /^last\s+(\d+)\s+(\w+)\s+major\s+versions?$/i, select: function (context, node) { var data = checkName(node.browser, context) var validVersions = getMajorVersions(data.released, node.versions) var list = validVersions.map(nameMapper(data.name)) list = filterJumps(list, data.name, node.versions, context) return list } }, last_electron_versions: { matches: ['versions'], regexp: /^last\s+(\d+)\s+electron\s+versions?$/i, select: function (context, node) { return Object.keys(e2c) .slice(-node.versions) .map(function (i) { return 'chrome ' + e2c[i] }) } }, last_node_versions: { matches: ['versions'], regexp: /^last\s+(\d+)\s+node\s+versions?$/i, select: function (context, node) { return browserslist.nodeVersions .slice(-node.versions) .map(function (version) { return 'node ' + version }) } }, last_browser_versions: { matches: ['versions', 'browser'], regexp: /^last\s+(\d+)\s+(\w+)\s+versions?$/i, select: function (context, node) { var data = checkName(node.browser, context) var list = data.released.slice(-node.versions).map(nameMapper(data.name)) list = filterJumps(list, data.name, node.versions, context) return list } }, unreleased_versions: { matches: [], regexp: /^unreleased\s+versions$/i, select: function (context) { return Object.keys(agents).reduce(function (selected, name) { var data = byName(name, context) if (!data) return selected var list = data.versions.filter(function (v) { return data.released.indexOf(v) === -1 }) list = list.map(nameMapper(data.name)) return selected.concat(list) }, []) } }, unreleased_electron_versions: { matches: [], regexp: /^unreleased\s+electron\s+versions?$/i, select: function () { return [] } }, unreleased_browser_versions: { matches: ['browser'], regexp: /^unreleased\s+(\w+)\s+versions?$/i, select: function (context, node) { var data = checkName(node.browser, context) return data.versions .filter(function (v) { return data.released.indexOf(v) === -1 }) .map(nameMapper(data.name)) } }, last_years: { matches: ['years'], regexp: /^last\s+((\d+\.)?\d+)\s+years?$/i, select: function (context, node) { return filterByYear(Date.now() - YEAR * node.years, context) } }, since_y: { matches: ['year'], regexp: /^since (\d+)$/i, select: sinceQuery }, since_y_m: { matches: ['year', 'month'], regexp: /^since (\d+)-(\d+)$/i, select: sinceQuery }, since_y_m_d: { matches: ['year', 'month', 'day'], regexp: /^since (\d+)-(\d+)-(\d+)$/i, select: sinceQuery }, popularity: { matches: ['sign', 'popularity'], regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%$/, select: function (context, node) { var popularity = parseFloat(node.popularity) var usage = browserslist.usage.global return Object.keys(usage).reduce(function (result, version) { if (node.sign === '>') { if (usage[version] > popularity) { result.push(version) } } else if (node.sign === '<') { if (usage[version] < popularity) { result.push(version) } } else if (node.sign === '<=') { if (usage[version] <= popularity) { result.push(version) } } else if (usage[version] >= popularity) { result.push(version) } return result }, []) } }, popularity_in_my_stats: { matches: ['sign', 'popularity'], regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+my\s+stats$/, select: function (context, node) { var popularity = parseFloat(node.popularity) if (!context.customUsage) { throw new BrowserslistError('Custom usage statistics was not provided') } var usage = context.customUsage return Object.keys(usage).reduce(function (result, version) { var percentage = usage[version] if (percentage == null) { return result } if (node.sign === '>') { if (percentage > popularity) { result.push(version) } } else if (node.sign === '<') { if (percentage < popularity) { result.push(version) } } else if (node.sign === '<=') { if (percentage <= popularity) { result.push(version) } } else if (percentage >= popularity) { result.push(version) } return result }, []) } }, popularity_in_config_stats: { matches: ['sign', 'popularity', 'config'], regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+(\S+)\s+stats$/, select: function (context, node) { var popularity = parseFloat(node.popularity) var usage = loadCustomUsage(context, node.config) return Object.keys(usage).reduce(function (result, version) { var percentage = usage[version] if (percentage == null) { return result } if (node.sign === '>') { if (percentage > popularity) { result.push(version) } } else if (node.sign === '<') { if (percentage < popularity) { result.push(version) } } else if (node.sign === '<=') { if (percentage <= popularity) { result.push(version) } } else if (percentage >= popularity) { result.push(version) } return result }, []) } }, popularity_in_place: { matches: ['sign', 'popularity', 'place'], regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+((alt-)?\w\w)$/, select: function (context, node) { var popularity = parseFloat(node.popularity) var place = node.place if (place.length === 2) { place = place.toUpperCase() } else { place = place.toLowerCase() } env.loadCountry(browserslist.usage, place, browserslist.data) var usage = browserslist.usage[place] return Object.keys(usage).reduce(function (result, version) { var percentage = usage[version] if (percentage == null) { return result } if (node.sign === '>') { if (percentage > popularity) { result.push(version) } } else if (node.sign === '<') { if (percentage < popularity) { result.push(version) } } else if (node.sign === '<=') { if (percentage <= popularity) { result.push(version) } } else if (percentage >= popularity) { result.push(version) } return result }, []) } }, cover: { matches: ['coverage'], regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%$/i, select: coverQuery }, cover_in: { matches: ['coverage', 'place'], regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%\s+in\s+(my\s+stats|(alt-)?\w\w)$/i, select: coverQuery }, cover_config: { matches: ['coverage', 'config'], regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%\s+in\s+(\S+)\s+stats$/i, select: coverQuery }, supports: { matches: ['supportType', 'feature'], regexp: /^(?:(fully|partially)\s+)?supports\s+([\w-]+)$/, select: function (context, node) { env.loadFeature(browserslist.cache, node.feature) var withPartial = node.supportType !== 'fully' var features = browserslist.cache[node.feature] var result = [] for (var name in features) { var data = byName(name, context) // Only check desktop when latest released mobile has support var iMax = data.released.length - 1 while (iMax >= 0) { if (data.released[iMax] in features[name]) break iMax-- } var checkDesktop = context.mobileToDesktop && name in browserslist.desktopNames && isSupported(features[name][data.released[iMax]], withPartial) data.versions.forEach(function (version) { var flags = features[name][version] if (flags === undefined && checkDesktop) { flags = features[browserslist.desktopNames[name]][version] } if (isSupported(flags, withPartial)) { result.push(name + ' ' + version) } }) } return result } }, electron_range: { matches: ['from', 'to'], regexp: /^electron\s+([\d.]+)\s*-\s*([\d.]+)$/i, select: function (context, node) { var fromToUse = normalizeElectron(node.from) var toToUse = normalizeElectron(node.to) var from = parseFloat(node.from) var to = parseFloat(node.to) if (!e2c[fromToUse]) { throw new BrowserslistError('Unknown version ' + from + ' of electron') } if (!e2c[toToUse]) { throw new BrowserslistError('Unknown version ' + to + ' of electron') } return Object.keys(e2c) .filter(function (i) { var parsed = parseFloat(i) return parsed >= from && parsed <= to }) .map(function (i) { return 'chrome ' + e2c[i] }) } }, node_range: { matches: ['from', 'to'], regexp: /^node\s+([\d.]+)\s*-\s*([\d.]+)$/i, select: function (context, node) { return browserslist.nodeVersions .filter(semverFilterLoose('>=', node.from)) .filter(semverFilterLoose('<=', node.to)) .map(function (v) { return 'node ' + v }) } }, browser_range: { matches: ['browser', 'from', 'to'], regexp: /^(\w+)\s+([\d.]+)\s*-\s*([\d.]+)$/i, select: function (context, node) { var data = checkName(node.browser, context) var from = parseFloat(normalizeVersion(data, node.from) || node.from) var to = parseFloat(normalizeVersion(data, node.to) || node.to) function filter(v) { var parsed = parseFloat(v) return parsed >= from && parsed <= to } return data.released.filter(filter).map(nameMapper(data.name)) } }, electron_ray: { matches: ['sign', 'version'], regexp: /^electron\s*(>=?|<=?)\s*([\d.]+)$/i, select: function (context, node) { var versionToUse = normalizeElectron(node.version) return Object.keys(e2c) .filter(generateFilter(node.sign, versionToUse)) .map(function (i) { return 'chrome ' + e2c[i] }) } }, node_ray: { matches: ['sign', 'version'], regexp: /^node\s*(>=?|<=?)\s*([\d.]+)$/i, select: function (context, node) { return browserslist.nodeVersions .filter(generateSemverFilter(node.sign, node.version)) .map(function (v) { return 'node ' + v }) } }, browser_ray: { matches: ['browser', 'sign', 'version'], regexp: /^(\w+)\s*(>=?|<=?)\s*([\d.]+)$/, select: function (context, node) { var version = node.version var data = checkName(node.browser, context) var alias = browserslist.versionAliases[data.name][version] if (alias) version = alias return data.released .filter(generateFilter(node.sign, version)) .map(function (v) { return data.name + ' ' + v }) } }, firefox_esr: { matches: [], regexp: /^(firefox|ff|fx)\s+esr$/i, select: function () { return ['firefox 128', 'firefox 140'] } }, opera_mini_all: { matches: [], regexp: /(operamini|op_mini)\s+all/i, select: function () { return ['op_mini all'] } }, electron_version: { matches: ['version'], regexp: /^electron\s+([\d.]+)$/i, select: function (context, node) { var versionToUse = normalizeElectron(node.version) var chrome = e2c[versionToUse] if (!chrome) { throw new BrowserslistError( 'Unknown version ' + node.version + ' of electron' ) } return ['chrome ' + chrome] } }, node_major_version: { matches: ['version'], regexp: /^node\s+(\d+)$/i, select: nodeQuery }, node_minor_version: { matches: ['version'], regexp: /^node\s+(\d+\.\d+)$/i, select: nodeQuery }, node_patch_version: { matches: ['version'], regexp: /^node\s+(\d+\.\d+\.\d+)$/i, select: nodeQuery }, current_node: { matches: [], regexp: /^current\s+node$/i, select: function (context) { return [env.currentNode(resolve, context)] } }, maintained_node: { matches: [], regexp: /^maintained\s+node\s+versions$/i, select: function (context) { var now = Date.now() var queries = Object.keys(jsEOL) .filter(function (key) { return ( now < Date.parse(jsEOL[key].end) && now > Date.parse(jsEOL[key].start) && isEolReleased(key) ) }) .map(function (key) { return 'node ' + key.slice(1) }) return resolve(queries, context) } }, phantomjs_1_9: { matches: [], regexp: /^phantomjs\s+1.9$/i, select: function () { return ['safari 5'] } }, phantomjs_2_1: { matches: [], regexp: /^phantomjs\s+2.1$/i, select: function () { return ['safari 6'] } }, browser_version: { matches: ['browser', 'version'], regexp: /^(\w+)\s+(tp|[\d.]+)$/i, select: function (context, node) { var version = node.version if (/^tp$/i.test(version)) version = 'TP' var data = checkName(node.browser, context) var alias = normalizeVersion(data, version) if (alias) { version = alias } else { if (version.indexOf('.') === -1) { alias = version + '.0' } else { alias = version.replace(/\.0$/, '') } alias = normalizeVersion(data, alias) if (alias) { version = alias } else if (context.ignoreUnknownVersions) { return [] } else { throw new BrowserslistError( 'Unknown version ' + version + ' of ' + node.browser ) } } return [data.name + ' ' + version] } }, browserslist_config: { matches: [], regexp: /^browserslist config$/i, needsPath: true, select: function (context) { return browserslist(undefined, context) } }, extends: { matches: ['config'], regexp: /^extends (.+)$/i, needsPath: true, select: function (context, node) { return resolve(env.loadQueries(context, node.config), context) } }, defaults: { matches: [], regexp: /^defaults$/i, select: function (context) { return resolve(browserslist.defaults, context) } }, dead: { matches: [], regexp: /^dead$/i, select: function (context) { var dead = [ 'Baidu >= 0', 'ie <= 11', 'ie_mob <= 11', 'bb <= 10', 'op_mob <= 12.1', 'samsung 4' ] return resolve(dead, context) } }, unknown: { matches: [], regexp: /^(\w+)$/i, select: function (context, node) { if (byName(node.query, context)) { throw new BrowserslistError( 'Specify versions in Browserslist query for browser ' + node.query ) } else { throw unknownQuery(node.query) } } } } // Get and convert Can I Use data ;(function () { for (var name in agents) { var browser = agents[name] browserslist.data[name] = { name: name, versions: normalize(agents[name].versions), released: normalize(agents[name].versions.slice(0, -3)), releaseDate: agents[name].release_date } fillUsage(browserslist.usage.global, name, browser.usage_global) browserslist.versionAliases[name] = {} for (var i = 0; i < browser.versions.length; i++) { var full = browser.versions[i] if (!full) continue if (full.indexOf('-') !== -1) { var interval = full.split('-') for (var j = 0; j < interval.length; j++) { browserslist.versionAliases[name][interval[j]] = full } } } } browserslist.nodeVersions = jsReleases.map(function (release) { return release.version }) })() module.exports = browserslist /***/ }), /***/ "./node_modules/browserslist/parse.js": /*!********************************************!*\ !*** ./node_modules/browserslist/parse.js ***! \********************************************/ /***/ ((module) => { var AND_REGEXP = /^\s+and\s+(.*)/i var OR_REGEXP = /^(?:,\s*|\s+or\s+)(.*)/i function flatten(array) { if (!Array.isArray(array)) return [array] return array.reduce(function (a, b) { return a.concat(flatten(b)) }, []) } function find(string, predicate) { for (var max = string.length, n = 1; n <= max; n++) { var parsed = string.substr(-n, n) if (predicate(parsed, n, max)) { return string.slice(0, -n) } } return '' } function matchQuery(all, query) { var node = { query: query } if (query.indexOf('not ') === 0) { node.not = true query = query.slice(4) } for (var name in all) { var type = all[name] var match = query.match(type.regexp) if (match) { node.type = name for (var i = 0; i < type.matches.length; i++) { node[type.matches[i]] = match[i + 1] } return node } } node.type = 'unknown' return node } function matchBlock(all, string, qs) { var node return find(string, function (parsed, n, max) { if (AND_REGEXP.test(parsed)) { node = matchQuery(all, parsed.match(AND_REGEXP)[1]) node.compose = 'and' qs.unshift(node) return true } else if (OR_REGEXP.test(parsed)) { node = matchQuery(all, parsed.match(OR_REGEXP)[1]) node.compose = 'or' qs.unshift(node) return true } else if (n === max) { node = matchQuery(all, parsed.trim()) node.compose = 'or' qs.unshift(node) return true } return false }) } module.exports = function parse(all, queries) { if (!Array.isArray(queries)) queries = [queries] return flatten( queries.map(function (block) { var qs = [] do { block = matchBlock(all, block, qs) } while (block) return qs }) ) } /***/ }), /***/ "./node_modules/call-bind-apply-helpers/actualApply.js": /*!*************************************************************!*\ !*** ./node_modules/call-bind-apply-helpers/actualApply.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js"); var $apply = __webpack_require__(/*! ./functionApply */ "./node_modules/call-bind-apply-helpers/functionApply.js"); var $call = __webpack_require__(/*! ./functionCall */ "./node_modules/call-bind-apply-helpers/functionCall.js"); var $reflectApply = __webpack_require__(/*! ./reflectApply */ "./node_modules/call-bind-apply-helpers/reflectApply.js"); /** @type {import('./actualApply')} */ module.exports = $reflectApply || bind.call($call, $apply); /***/ }), /***/ "./node_modules/call-bind-apply-helpers/applyBind.js": /*!***********************************************************!*\ !*** ./node_modules/call-bind-apply-helpers/applyBind.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js"); var $apply = __webpack_require__(/*! ./functionApply */ "./node_modules/call-bind-apply-helpers/functionApply.js"); var actualApply = __webpack_require__(/*! ./actualApply */ "./node_modules/call-bind-apply-helpers/actualApply.js"); /** @type {import('./applyBind')} */ module.exports = function applyBind() { return actualApply(bind, $apply, arguments); }; /***/ }), /***/ "./node_modules/call-bind-apply-helpers/functionApply.js": /*!***************************************************************!*\ !*** ./node_modules/call-bind-apply-helpers/functionApply.js ***! \***************************************************************/ /***/ ((module) => { "use strict"; /** @type {import('./functionApply')} */ module.exports = Function.prototype.apply; /***/ }), /***/ "./node_modules/call-bind-apply-helpers/functionCall.js": /*!**************************************************************!*\ !*** ./node_modules/call-bind-apply-helpers/functionCall.js ***! \**************************************************************/ /***/ ((module) => { "use strict"; /** @type {import('./functionCall')} */ module.exports = Function.prototype.call; /***/ }), /***/ "./node_modules/call-bind-apply-helpers/index.js": /*!*******************************************************!*\ !*** ./node_modules/call-bind-apply-helpers/index.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js"); var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js"); var $call = __webpack_require__(/*! ./functionCall */ "./node_modules/call-bind-apply-helpers/functionCall.js"); var $actualApply = __webpack_require__(/*! ./actualApply */ "./node_modules/call-bind-apply-helpers/actualApply.js"); /** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ module.exports = function callBindBasic(args) { if (args.length < 1 || typeof args[0] !== 'function') { throw new $TypeError('a function is required'); } return $actualApply(bind, $call, args); }; /***/ }), /***/ "./node_modules/call-bind-apply-helpers/reflectApply.js": /*!**************************************************************!*\ !*** ./node_modules/call-bind-apply-helpers/reflectApply.js ***! \**************************************************************/ /***/ ((module) => { "use strict"; /** @type {import('./reflectApply')} */ module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; /***/ }), /***/ "./node_modules/call-bind/callBound.js": /*!*********************************************!*\ !*** ./node_modules/call-bind/callBound.js ***! \*********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var callBind = __webpack_require__(/*! ./ */ "./node_modules/call-bind/index.js"); var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); module.exports = function callBoundIntrinsic(name, allowMissing) { var intrinsic = GetIntrinsic(name, !!allowMissing); if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { return callBind(intrinsic); } return intrinsic; }; /***/ }), /***/ "./node_modules/call-bind/index.js": /*!*****************************************!*\ !*** ./node_modules/call-bind/index.js ***! \*****************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var setFunctionLength = __webpack_require__(/*! set-function-length */ "./node_modules/set-function-length/index.js"); var $defineProperty = __webpack_require__(/*! es-define-property */ "./node_modules/es-define-property/index.js"); var callBindBasic = __webpack_require__(/*! call-bind-apply-helpers */ "./node_modules/call-bind-apply-helpers/index.js"); var applyBind = __webpack_require__(/*! call-bind-apply-helpers/applyBind */ "./node_modules/call-bind-apply-helpers/applyBind.js"); module.exports = function callBind(originalFunction) { var func = callBindBasic(arguments); var adjustedLength = originalFunction.length - (arguments.length - 1); return setFunctionLength( func, 1 + (adjustedLength > 0 ? adjustedLength : 0), true ); }; if ($defineProperty) { $defineProperty(module.exports, 'apply', { value: applyBind }); } else { module.exports.apply = applyBind; } /***/ }), /***/ "./node_modules/call-bound/index.js": /*!******************************************!*\ !*** ./node_modules/call-bound/index.js ***! \******************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var callBindBasic = __webpack_require__(/*! call-bind-apply-helpers */ "./node_modules/call-bind-apply-helpers/index.js"); /** @type {(thisArg: string, searchString: string, position?: number) => number} */ var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]); /** @type {import('.')} */ module.exports = function callBoundIntrinsic(name, allowMissing) { /* eslint no-extra-parens: 0 */ var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing)); if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { return callBindBasic(/** @type {const} */ ([intrinsic])); } return intrinsic; }; /***/ }), /***/ "./node_modules/caniuse-lite/data/agents.js": /*!**************************************************!*\ !*** ./node_modules/caniuse-lite/data/agents.js ***! \**************************************************/ /***/ ((module) => { module.exports={A:{A:{K:0,D:0,E:0.0331526,F:0.0248644,A:0.00828815,B:0.605035,sC:0},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","sC","K","D","E","F","A","B","","",""],E:"IE",F:{sC:962323200,K:998870400,D:1161129600,E:1237420800,F:1300060800,A:1346716800,B:1381968000}},B:{A:{"0":0,C:0,L:0,M:0,G:0,N:0,O:0,P:0.04422,Q:0,H:0,R:0,S:0,T:0,U:0,V:0,W:0,X:0,Y:0,Z:0,a:0,b:0.01206,c:0,d:0,e:0,f:0,g:0,h:0,i:0,j:0,k:0,l:0,m:0.00402,n:0,o:0,p:0,q:0,r:0,s:0.0402,t:0,u:0,v:0,w:0.00804,x:0.01206,y:0.00402,z:0,AB:0,BB:0,CB:0.02814,DB:0.00804,EB:0.01206,FB:0.00402,GB:0.00402,HB:0.00402,IB:0.01206,JB:0.01206,KB:0.00804,LB:0.0201,MB:0.01206,NB:0.02814,OB:0.01608,PB:0.01608,QB:0.04824,RB:0.02814,SB:0.04824,TB:0.21306,I:4.0602},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","C","L","M","G","N","O","P","Q","H","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","I","","",""],E:"Edge",F:{"0":1694649600,C:1438128000,L:1447286400,M:1470096000,G:1491868800,N:1508198400,O:1525046400,P:1542067200,Q:1579046400,H:1581033600,R:1586736000,S:1590019200,T:1594857600,U:1598486400,V:1602201600,W:1605830400,X:1611360000,Y:1614816000,Z:1618358400,a:1622073600,b:1626912000,c:1630627200,d:1632441600,e:1634774400,f:1637539200,g:1641427200,h:1643932800,i:1646265600,j:1649635200,k:1651190400,l:1653955200,m:1655942400,n:1659657600,o:1661990400,p:1664755200,q:1666915200,r:1670198400,s:1673481600,t:1675900800,u:1678665600,v:1680825600,w:1683158400,x:1685664000,y:1689897600,z:1692576000,AB:1697155200,BB:1698969600,CB:1701993600,DB:1706227200,EB:1708732800,FB:1711152000,GB:1713398400,HB:1715990400,IB:1718841600,JB:1721865600,KB:1724371200,LB:1726704000,MB:1729123200,NB:1731542400,OB:1737417600,PB:1740614400,QB:1741219200,RB:1743984000,SB:1746316800,TB:1748476800,I:1750896000},D:{C:"ms",L:"ms",M:"ms",G:"ms",N:"ms",O:"ms",P:"ms"}},C:{A:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,tC:0,PC:0,J:0,UB:0,K:0,D:0,E:0,F:0,A:0,B:0.04824,C:0,L:0,M:0,G:0,N:0,O:0,P:0,VB:0,WB:0,XB:0,YB:0,ZB:0,aB:0,bB:0,cB:0,dB:0,eB:0,fB:0,gB:0,hB:0,iB:0,jB:0,kB:0.00804,lB:0,mB:0.00402,nB:0,oB:0,pB:0,qB:0,rB:0,sB:0,tB:0.03216,uB:0,vB:0,wB:0,xB:0,yB:0,zB:0,QC:0.00804,"0B":0,RC:0,"1B":0,"2B":0,"3B":0,"4B":0,"5B":0,"6B":0,"7B":0,"8B":0,"9B":0.01206,AC:0,BC:0.01608,CC:0,DC:0,EC:0,FC:0,GC:0,HC:0.01206,Q:0,H:0,R:0,SC:0,S:0,T:0,U:0,V:0,W:0,X:0,Y:0,Z:0,a:0,b:0,c:0,d:0,e:0,f:0,g:0,h:0,i:0,j:0,k:0,l:0,m:0,n:0,o:0,p:0,q:0,r:0,s:0.00402,t:0,u:0,v:0,w:0.00402,x:0,y:0.17286,z:0,AB:0.11658,BB:0,CB:0,DB:0,EB:0,FB:0,GB:0,HB:0.01206,IB:0.01206,JB:0.00402,KB:0.1005,LB:0.00804,MB:0,NB:0,OB:0,PB:0.01206,QB:0.00804,RB:0.00804,SB:0.01608,TB:0.01206,I:0.01608,TC:0.09648,IC:1.01304,UC:0.31356,VC:0,uC:0,vC:0,wC:0,xC:0},B:"moz",C:["tC","PC","wC","xC","J","UB","K","D","E","F","A","B","C","L","M","G","N","O","P","VB","1","2","3","4","5","6","7","8","9","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","QC","0B","RC","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","DC","EC","FC","GC","HC","Q","H","R","SC","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","I","TC","IC","UC","VC","uC","vC"],E:"Firefox",F:{"0":1693267200,"1":1361232000,"2":1364860800,"3":1368489600,"4":1372118400,"5":1375747200,"6":1379376000,"7":1386633600,"8":1391472000,"9":1395100800,tC:1161648000,PC:1213660800,wC:1246320000,xC:1264032000,J:1300752000,UB:1308614400,K:1313452800,D:1317081600,E:1317081600,F:1320710400,A:1324339200,B:1327968000,C:1331596800,L:1335225600,M:1338854400,G:1342483200,N:1346112000,O:1349740800,P:1353628800,VB:1357603200,WB:1398729600,XB:1402358400,YB:1405987200,ZB:1409616000,aB:1413244800,bB:1417392000,cB:1421107200,dB:1424736000,eB:1428278400,fB:1431475200,gB:1435881600,hB:1439251200,iB:1442880000,jB:1446508800,kB:1450137600,lB:1453852800,mB:1457395200,nB:1461628800,oB:1465257600,pB:1470096000,qB:1474329600,rB:1479168000,sB:1485216000,tB:1488844800,uB:1492560000,vB:1497312000,wB:1502150400,xB:1506556800,yB:1510617600,zB:1516665600,QC:1520985600,"0B":1525824000,RC:1529971200,"1B":1536105600,"2B":1540252800,"3B":1544486400,"4B":1548720000,"5B":1552953600,"6B":1558396800,"7B":1562630400,"8B":1567468800,"9B":1571788800,AC:1575331200,BC:1578355200,CC:1581379200,DC:1583798400,EC:1586304000,FC:1588636800,GC:1591056000,HC:1593475200,Q:1595894400,H:1598313600,R:1600732800,SC:1603152000,S:1605571200,T:1607990400,U:1611619200,V:1614038400,W:1616457600,X:1618790400,Y:1622505600,Z:1626134400,a:1628553600,b:1630972800,c:1633392000,d:1635811200,e:1638835200,f:1641859200,g:1644364800,h:1646697600,i:1649116800,j:1651536000,k:1653955200,l:1656374400,m:1658793600,n:1661212800,o:1663632000,p:1666051200,q:1668470400,r:1670889600,s:1673913600,t:1676332800,u:1678752000,v:1681171200,w:1683590400,x:1686009600,y:1688428800,z:1690848000,AB:1695686400,BB:1698105600,CB:1700524800,DB:1702944000,EB:1705968000,FB:1708387200,GB:1710806400,HB:1713225600,IB:1715644800,JB:1718064000,KB:1720483200,LB:1722902400,MB:1725321600,NB:1727740800,OB:1730160000,PB:1732579200,QB:1736208000,RB:1738627200,SB:1741046400,TB:1743465600,I:1745884800,TC:1748304000,IC:1750723200,UC:1753142400,VC:null,uC:null,vC:null}},D:{A:{"0":0.09648,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,J:0,UB:0,K:0,D:0,E:0,F:0,A:0,B:0,C:0,L:0,M:0,G:0,N:0,O:0,P:0,VB:0,WB:0,XB:0,YB:0,ZB:0,aB:0,bB:0,cB:0,dB:0,eB:0,fB:0,gB:0.00804,hB:0.00804,iB:0.00804,jB:0.00804,kB:0.00804,lB:0.00804,mB:0.01206,nB:0.00804,oB:0.00804,pB:0.0201,qB:0.01608,rB:0.00804,sB:0.00804,tB:0.01206,uB:0.00804,vB:0.00804,wB:0.00804,xB:0.0201,yB:0.00804,zB:0.00804,QC:0.00804,"0B":0.00804,RC:0,"1B":0,"2B":0,"3B":0,"4B":0,"5B":0.02412,"6B":0,"7B":0.00402,"8B":0.01206,"9B":0.01608,AC:0,BC:0,CC:0.00402,DC:0.00804,EC:0.00402,FC:0.00402,GC:0,HC:0.00804,Q:0.07236,H:0.01206,R:0.02412,S:0.04824,T:0,U:0.00804,V:0.01206,W:0.03618,X:0.00804,Y:0.00402,Z:0.00804,a:0.02814,b:0.00804,c:0.00804,d:0.00804,e:0.00402,f:0.00804,g:0.0201,h:0.04422,i:0.01608,j:0.00804,k:0.02412,l:0.0201,m:0.0804,n:0.03618,o:0.03216,p:0.01206,q:0.01608,r:0.03216,s:0.7638,t:0.01608,u:0.02814,v:4.78782,w:0.05226,x:0.04824,y:0.0201,z:0.06834,AB:0.05226,BB:0.04422,CB:0.06834,DB:0.06834,EB:0.07236,FB:0.07236,GB:0.0603,HB:0.41808,IB:0.0603,JB:0.03216,KB:0.08442,LB:0.06834,MB:0.10854,NB:0.49446,OB:0.1407,PB:0.13668,QB:0.1206,RB:0.21306,SB:0.30552,TB:3.23208,I:11.855,TC:0.0201,IC:0.01608,UC:0,VC:0},B:"webkit",C:["","","","","","","","J","UB","K","D","E","F","A","B","C","L","M","G","N","O","P","VB","1","2","3","4","5","6","7","8","9","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","QC","0B","RC","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","DC","EC","FC","GC","HC","Q","H","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","AB","BB","CB","DB","EB","FB","GB","HB","IB","JB","KB","LB","MB","NB","OB","PB","QB","RB","SB","TB","I","TC","IC","UC","VC"],E:"Chrome",F:{"0":1694476800,"1":1337040000,"2":1340668800,"3":1343692800,"4":1348531200,"5":1352246400,"6":1357862400,"7":1361404800,"8":1364428800,"9":1369094400,J:1264377600,UB:1274745600,K:1283385600,D:1287619200,E:1291248000,F:1296777600,A:1299542400,B:1303862400,C:1307404800,L:1312243200,M:1316131200,G:1316131200,N:1319500800,O:1323734400,P:1328659200,VB:1332892800,WB:1374105600,XB:1376956800,YB:1384214400,ZB:1389657600,aB:1392940800,bB:1397001600,cB:1400544000,dB:1405468800,eB:1409011200,fB:1412640000,gB:1416268800,hB:1421798400,iB:1425513600,jB:1429401600,kB:1432080000,lB:1437523200,mB:1441152000,nB:1444780800,oB:1449014400,pB:1453248000,qB:1456963200,rB:1460592000,sB:1464134400,tB:1469059200,uB:1472601600,vB:1476230400,wB:1480550400,xB:1485302400,yB:1489017600,zB:1492560000,QC:1496707200,"0B":1500940800,RC:1504569600,"1B":1508198400,"2B":1512518400,"3B":1516752000,"4B":1520294400,"5B":1523923200,"6B":1527552000,"7B":1532390400,"8B":1536019200,"9B":1539648000,AC:1543968000,BC:1548720000,CC:1552348800,DC:1555977600,EC:1559606400,FC:1564444800,GC:1568073600,HC:1571702400,Q:1575936000,H:1580860800,R:1586304000,S:1589846400,T:1594684800,U:1598313600,V:1601942400,W:1605571200,X:1611014400,Y:1614556800,Z:1618272000,a:1621987200,b:1626739200,c:1630368000,d:1632268800,e:1634601600,f:1637020800,g:1641340800,h:1643673600,i:1646092800,j:1648512000,k:1650931200,l:1653350400,m:1655769600,n:1659398400,o:1661817600,p:1664236800,q:1666656000,r:1669680000,s:1673308800,t:1675728000,u:1678147200,v:1680566400,w:1682985600,x:1685404800,y:1689724800,z:1692057600,AB:1696896000,BB:1698710400,CB:1701993600,DB:1705968000,EB:1708387200,FB:1710806400,GB:1713225600,HB:1715644800,IB:1718064000,JB:1721174400,KB:1724112000,LB:1726531200,MB:1728950400,NB:1731369600,OB:1736812800,PB:1738627200,QB:1741046400,RB:1743465600,SB:1745884800,TB:1748304000,I:1750723200,TC:1754352000,IC:null,UC:null,VC:null}},E:{A:{J:0,UB:0,K:0,D:0,E:0,F:0,A:0,B:0.00402,C:0,L:0.00804,M:0.01206,G:0,yC:0,WC:0,zC:0,"0C":0,"1C":0,"2C":0,XC:0,JC:0.00402,KC:0.00402,"3C":0.02814,"4C":0.03216,"5C":0.03216,YC:0,ZC:0.00804,LC:0.00804,"6C":0.11658,MC:0.02412,aC:0.01608,bC:0.01206,cC:0.02814,dC:0.01206,eC:0.01608,"7C":0.16482,NC:0.00804,fC:0.11256,gC:0.01206,hC:0.01608,iC:0.02814,jC:0.04422,"8C":0.1608,OC:0.0201,kC:0.03618,lC:0.01608,mC:0.0804,nC:0.0603,oC:1.37484,pC:0.01206,"9C":0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","yC","WC","J","UB","zC","K","0C","D","1C","E","F","2C","A","XC","B","JC","C","KC","L","3C","M","4C","G","5C","YC","ZC","LC","6C","MC","aC","bC","cC","dC","eC","7C","NC","fC","gC","hC","iC","jC","8C","OC","kC","lC","mC","nC","oC","pC","9C",""],E:"Safari",F:{yC:1205798400,WC:1226534400,J:1244419200,UB:1275868800,zC:1311120000,K:1343174400,"0C":1382400000,D:1382400000,"1C":1410998400,E:1413417600,F:1443657600,"2C":1458518400,A:1474329600,XC:1490572800,B:1505779200,JC:1522281600,C:1537142400,KC:1553472000,L:1568851200,"3C":1585008000,M:1600214400,"4C":1619395200,G:1632096000,"5C":1635292800,YC:1639353600,ZC:1647216000,LC:1652745600,"6C":1658275200,MC:1662940800,aC:1666569600,bC:1670889600,cC:1674432000,dC:1679875200,eC:1684368000,"7C":1690156800,NC:1695686400,fC:1698192000,gC:1702252800,hC:1705881600,iC:1709596800,jC:1715558400,"8C":1722211200,OC:1726444800,kC:1730073600,lC:1733875200,mC:1737936000,nC:1743379200,oC:1747008000,pC:null,"9C":null}},F:{A:{"0":0,"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,F:0,B:0,C:0,G:0,N:0,O:0,P:0,VB:0,WB:0,XB:0,YB:0,ZB:0,aB:0,bB:0,cB:0,dB:0,eB:0,fB:0,gB:0,hB:0.00402,iB:0,jB:0,kB:0,lB:0,mB:0,nB:0.00804,oB:0,pB:0,qB:0,rB:0,sB:0,tB:0,uB:0,vB:0,wB:0,xB:0,yB:0,zB:0,"0B":0,"1B":0,"2B":0,"3B":0,"4B":0,"5B":0,"6B":0,"7B":0,"8B":0,"9B":0,AC:0,BC:0,CC:0,DC:0,EC:0,FC:0,GC:0,HC:0,Q:0,H:0,R:0,SC:0,S:0,T:0,U:0,V:0,W:0,X:0,Y:0.00402,Z:0.05226,a:0,b:0,c:0,d:0,e:0.02814,f:0,g:0,h:0,i:0,j:0,k:0,l:0,m:0,n:0,o:0,p:0,q:0,r:0,s:0,t:0,u:0,v:0,w:0.00402,x:0,y:0,z:0,AD:0,BD:0,CD:0,DD:0,JC:0,qC:0,ED:0,KC:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","F","AD","BD","CD","DD","B","JC","qC","ED","C","KC","G","N","O","P","VB","1","2","3","4","5","6","7","8","9","WB","XB","YB","ZB","aB","bB","cB","dB","eB","fB","gB","hB","iB","jB","kB","lB","mB","nB","oB","pB","qB","rB","sB","tB","uB","vB","wB","xB","yB","zB","0B","1B","2B","3B","4B","5B","6B","7B","8B","9B","AC","BC","CC","DC","EC","FC","GC","HC","Q","H","R","SC","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","","",""],E:"Opera",F:{"0":1739404800,"1":1393891200,"2":1399334400,"3":1401753600,"4":1405987200,"5":1409616000,"6":1413331200,"7":1417132800,"8":1422316800,"9":1425945600,F:1150761600,AD:1223424000,BD:1251763200,CD:1267488000,DD:1277942400,B:1292457600,JC:1302566400,qC:1309219200,ED:1323129600,C:1323129600,KC:1352073600,G:1372723200,N:1377561600,O:1381104000,P:1386288000,VB:1390867200,WB:1430179200,XB:1433808000,YB:1438646400,ZB:1442448000,aB:1445904000,bB:1449100800,cB:1454371200,dB:1457308800,eB:1462320000,fB:1465344000,gB:1470096000,hB:1474329600,iB:1477267200,jB:1481587200,kB:1486425600,lB:1490054400,mB:1494374400,nB:1498003200,oB:1502236800,pB:1506470400,qB:1510099200,rB:1515024000,sB:1517961600,tB:1521676800,uB:1525910400,vB:1530144000,wB:1534982400,xB:1537833600,yB:1543363200,zB:1548201600,"0B":1554768000,"1B":1561593600,"2B":1566259200,"3B":1570406400,"4B":1573689600,"5B":1578441600,"6B":1583971200,"7B":1587513600,"8B":1592956800,"9B":1595894400,AC:1600128000,BC:1603238400,CC:1613520000,DC:1612224000,EC:1616544000,FC:1619568000,GC:1623715200,HC:1627948800,Q:1631577600,H:1633392000,R:1635984000,SC:1638403200,S:1642550400,T:1644969600,U:1647993600,V:1650412800,W:1652745600,X:1654646400,Y:1657152000,Z:1660780800,a:1663113600,b:1668816000,c:1668643200,d:1671062400,e:1675209600,f:1677024000,g:1679529600,h:1681948800,i:1684195200,j:1687219200,k:1690329600,l:1692748800,m:1696204800,n:1699920000,o:1699920000,p:1702944000,q:1707264000,r:1710115200,s:1711497600,t:1716336000,u:1719273600,v:1721088000,w:1724284800,x:1727222400,y:1732665600,z:1736294400},D:{F:"o",B:"o",C:"o",AD:"o",BD:"o",CD:"o",DD:"o",JC:"o",qC:"o",ED:"o",KC:"o"}},G:{A:{E:0,WC:0,FD:0,rC:0.0013461,GD:0,HD:0.00673049,ID:0.00403829,JD:0,KD:0.0026922,LD:0.0148071,MD:0.0013461,ND:0.0228837,OD:0.200569,PD:0.00942269,QD:0.0026922,RD:0.082112,SD:0,TD:0.0026922,UD:0.0026922,VD:0.013461,WD:0.0578822,XD:0.0309603,YD:0.026922,YC:0.0215376,ZC:0.0242298,LC:0.0282681,ZD:0.371523,MC:0.0498056,aC:0.095573,bC:0.0498056,cC:0.0942269,dC:0.0201915,eC:0.0376907,aD:0.477865,NC:0.0242298,fC:0.0457673,gC:0.0336525,hC:0.0498056,iC:0.095573,jC:0.173647,bD:0.442866,OC:0.111726,kC:0.234221,lC:0.126533,mC:0.46575,nC:0.301526,oC:9.39442,pC:0.0215376},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","WC","FD","rC","GD","HD","ID","E","JD","KD","LD","MD","ND","OD","PD","QD","RD","SD","TD","UD","VD","WD","XD","YD","YC","ZC","LC","ZD","MC","aC","bC","cC","dC","eC","aD","NC","fC","gC","hC","iC","jC","bD","OC","kC","lC","mC","nC","oC","pC","",""],E:"Safari on iOS",F:{WC:1270252800,FD:1283904000,rC:1299628800,GD:1331078400,HD:1359331200,ID:1394409600,E:1410912000,JD:1413763200,KD:1442361600,LD:1458518400,MD:1473724800,ND:1490572800,OD:1505779200,PD:1522281600,QD:1537142400,RD:1553472000,SD:1568851200,TD:1572220800,UD:1580169600,VD:1585008000,WD:1600214400,XD:1619395200,YD:1632096000,YC:1639353600,ZC:1647216000,LC:1652659200,ZD:1658275200,MC:1662940800,aC:1666569600,bC:1670889600,cC:1674432000,dC:1679875200,eC:1684368000,aD:1690156800,NC:1694995200,fC:1698192000,gC:1702252800,hC:1705881600,iC:1709596800,jC:1715558400,bD:1722211200,OC:1726444800,kC:1730073600,lC:1733875200,mC:1737936000,nC:1743379200,oC:1747008000,pC:null}},H:{A:{cD:0.04},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","cD","","",""],E:"Opera Mini",F:{cD:1426464000}},I:{A:{PC:0,J:0,I:0.794067,dD:0,eD:0,fD:0,gD:0.000159068,rC:0.000159068,hD:0,iD:0.000636272},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","dD","eD","fD","PC","J","gD","rC","hD","iD","I","","",""],E:"Android Browser",F:{dD:1256515200,eD:1274313600,fD:1291593600,PC:1298332800,J:1318896000,gD:1341792000,rC:1374624000,hD:1386547200,iD:1401667200,I:1750723200}},J:{A:{D:0,A:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","D","A","","",""],E:"Blackberry Browser",F:{D:1325376000,A:1359504000}},K:{A:{A:0,B:0,C:0,H:0.95866,JC:0,qC:0,KC:0},B:"o",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","JC","qC","C","KC","H","","",""],E:"Opera Mobile",F:{A:1287100800,B:1300752000,JC:1314835200,qC:1318291200,C:1330300800,KC:1349740800,H:1709769600},D:{H:"webkit"}},L:{A:{I:43.5564},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","I","","",""],E:"Chrome for Android",F:{I:1750723200}},M:{A:{IC:0.3289},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","IC","","",""],E:"Firefox for Android",F:{IC:1750723200}},N:{A:{A:0,B:0},B:"ms",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","A","B","","",""],E:"IE Mobile",F:{A:1340150400,B:1353456000}},O:{A:{LC:0.81328},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","LC","","",""],E:"UC Browser for Android",F:{LC:1710115200},D:{LC:"webkit"}},P:{A:{"1":0,"2":0.0218021,"3":0.0218021,"4":0.0218021,"5":0.0327031,"6":0.0327031,"7":0.0545052,"8":0.0872083,"9":1.80957,J:0,jD:0,kD:0,lD:0.010901,mD:0,nD:0,XC:0,oD:0,pD:0,qD:0,rD:0,sD:0,MC:0,NC:0,OC:0,tD:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","J","jD","kD","lD","mD","nD","XC","oD","pD","qD","rD","sD","MC","NC","OC","tD","1","2","3","4","5","6","7","8","9","","",""],E:"Samsung Internet",F:{"1":1677369600,"2":1684454400,"3":1689292800,"4":1697587200,"5":1711497600,"6":1715126400,"7":1717718400,"8":1725667200,"9":1746057600,J:1461024000,jD:1481846400,kD:1509408000,lD:1528329600,mD:1546128000,nD:1554163200,XC:1567900800,oD:1582588800,pD:1593475200,qD:1605657600,rD:1618531200,sD:1629072000,MC:1640736000,NC:1651708800,OC:1659657600,tD:1667260800}},Q:{A:{uD:0.18538},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","uD","","",""],E:"QQ Browser",F:{uD:1710288000}},R:{A:{vD:0},B:"webkit",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","vD","","",""],E:"Baidu Browser",F:{vD:1710201600}},S:{A:{wD:0.01196,xD:0},B:"moz",C:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","wD","xD","","",""],E:"KaiOS Browser",F:{wD:1527811200,xD:1631664000}}}; /***/ }), /***/ "./node_modules/caniuse-lite/data/browserVersions.js": /*!***********************************************************!*\ !*** ./node_modules/caniuse-lite/data/browserVersions.js ***! \***********************************************************/ /***/ ((module) => { module.exports={"0":"117","1":"20","2":"21","3":"22","4":"23","5":"24","6":"25","7":"26","8":"27","9":"28",A:"10",B:"11",C:"12",D:"7",E:"8",F:"9",G:"15",H:"80",I:"138",J:"4",K:"6",L:"13",M:"14",N:"16",O:"17",P:"18",Q:"79",R:"81",S:"83",T:"84",U:"85",V:"86",W:"87",X:"88",Y:"89",Z:"90",a:"91",b:"92",c:"93",d:"94",e:"95",f:"96",g:"97",h:"98",i:"99",j:"100",k:"101",l:"102",m:"103",n:"104",o:"105",p:"106",q:"107",r:"108",s:"109",t:"110",u:"111",v:"112",w:"113",x:"114",y:"115",z:"116",AB:"118",BB:"119",CB:"120",DB:"121",EB:"122",FB:"123",GB:"124",HB:"125",IB:"126",JB:"127",KB:"128",LB:"129",MB:"130",NB:"131",OB:"132",PB:"133",QB:"134",RB:"135",SB:"136",TB:"137",UB:"5",VB:"19",WB:"29",XB:"30",YB:"31",ZB:"32",aB:"33",bB:"34",cB:"35",dB:"36",eB:"37",fB:"38",gB:"39",hB:"40",iB:"41",jB:"42",kB:"43",lB:"44",mB:"45",nB:"46",oB:"47",pB:"48",qB:"49",rB:"50",sB:"51",tB:"52",uB:"53",vB:"54",wB:"55",xB:"56",yB:"57",zB:"58","0B":"60","1B":"62","2B":"63","3B":"64","4B":"65","5B":"66","6B":"67","7B":"68","8B":"69","9B":"70",AC:"71",BC:"72",CC:"73",DC:"74",EC:"75",FC:"76",GC:"77",HC:"78",IC:"140",JC:"11.1",KC:"12.1",LC:"15.5",MC:"16.0",NC:"17.0",OC:"18.0",PC:"3",QC:"59",RC:"61",SC:"82",TC:"139",UC:"141",VC:"142",WC:"3.2",XC:"10.1",YC:"15.2-15.3",ZC:"15.4",aC:"16.1",bC:"16.2",cC:"16.3",dC:"16.4",eC:"16.5",fC:"17.1",gC:"17.2",hC:"17.3",iC:"17.4",jC:"17.5",kC:"18.1",lC:"18.2",mC:"18.3",nC:"18.4",oC:"18.5-18.6",pC:"26.0",qC:"11.5",rC:"4.2-4.3",sC:"5.5",tC:"2",uC:"143",vC:"144",wC:"3.5",xC:"3.6",yC:"3.1",zC:"5.1","0C":"6.1","1C":"7.1","2C":"9.1","3C":"13.1","4C":"14.1","5C":"15.1","6C":"15.6","7C":"16.6","8C":"17.6","9C":"TP",AD:"9.5-9.6",BD:"10.0-10.1",CD:"10.5",DD:"10.6",ED:"11.6",FD:"4.0-4.1",GD:"5.0-5.1",HD:"6.0-6.1",ID:"7.0-7.1",JD:"8.1-8.4",KD:"9.0-9.2",LD:"9.3",MD:"10.0-10.2",ND:"10.3",OD:"11.0-11.2",PD:"11.3-11.4",QD:"12.0-12.1",RD:"12.2-12.5",SD:"13.0-13.1",TD:"13.2",UD:"13.3",VD:"13.4-13.7",WD:"14.0-14.4",XD:"14.5-14.8",YD:"15.0-15.1",ZD:"15.6-15.8",aD:"16.6-16.7",bD:"17.6-17.7",cD:"all",dD:"2.1",eD:"2.2",fD:"2.3",gD:"4.1",hD:"4.4",iD:"4.4.3-4.4.4",jD:"5.0-5.4",kD:"6.2-6.4",lD:"7.2-7.4",mD:"8.2",nD:"9.2",oD:"11.1-11.2",pD:"12.0",qD:"13.0",rD:"14.0",sD:"15.0",tD:"19.0",uD:"14.9",vD:"13.52",wD:"2.5",xD:"3.0-3.1"}; /***/ }), /***/ "./node_modules/caniuse-lite/data/browsers.js": /*!****************************************************!*\ !*** ./node_modules/caniuse-lite/data/browsers.js ***! \****************************************************/ /***/ ((module) => { module.exports={A:"ie",B:"edge",C:"firefox",D:"chrome",E:"safari",F:"opera",G:"ios_saf",H:"op_mini",I:"android",J:"bb",K:"op_mob",L:"and_chr",M:"and_ff",N:"ie_mob",O:"and_uc",P:"samsung",Q:"and_qq",R:"baidu",S:"kaios"}; /***/ }), /***/ "./node_modules/caniuse-lite/dist/unpacker/agents.js": /*!***********************************************************!*\ !*** ./node_modules/caniuse-lite/dist/unpacker/agents.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; const browsers = (__webpack_require__(/*! ./browsers */ "./node_modules/caniuse-lite/dist/unpacker/browsers.js").browsers) const versions = (__webpack_require__(/*! ./browserVersions */ "./node_modules/caniuse-lite/dist/unpacker/browserVersions.js").browserVersions) const agentsData = __webpack_require__(/*! ../../data/agents */ "./node_modules/caniuse-lite/data/agents.js") function unpackBrowserVersions(versionsData) { return Object.keys(versionsData).reduce((usage, version) => { usage[versions[version]] = versionsData[version] return usage }, {}) } module.exports.agents = Object.keys(agentsData).reduce((map, key) => { let versionsData = agentsData[key] map[browsers[key]] = Object.keys(versionsData).reduce((data, entry) => { if (entry === 'A') { data.usage_global = unpackBrowserVersions(versionsData[entry]) } else if (entry === 'C') { data.versions = versionsData[entry].reduce((list, version) => { if (version === '') { list.push(null) } else { list.push(versions[version]) } return list }, []) } else if (entry === 'D') { data.prefix_exceptions = unpackBrowserVersions(versionsData[entry]) } else if (entry === 'E') { data.browser = versionsData[entry] } else if (entry === 'F') { data.release_date = Object.keys(versionsData[entry]).reduce( (map2, key2) => { map2[versions[key2]] = versionsData[entry][key2] return map2 }, {} ) } else { // entry is B data.prefix = versionsData[entry] } return data }, {}) return map }, {}) /***/ }), /***/ "./node_modules/caniuse-lite/dist/unpacker/browserVersions.js": /*!********************************************************************!*\ !*** ./node_modules/caniuse-lite/dist/unpacker/browserVersions.js ***! \********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports.browserVersions = __webpack_require__(/*! ../../data/browserVersions */ "./node_modules/caniuse-lite/data/browserVersions.js") /***/ }), /***/ "./node_modules/caniuse-lite/dist/unpacker/browsers.js": /*!*************************************************************!*\ !*** ./node_modules/caniuse-lite/dist/unpacker/browsers.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports.browsers = __webpack_require__(/*! ../../data/browsers */ "./node_modules/caniuse-lite/data/browsers.js") /***/ }), /***/ "./node_modules/convert-source-map/index.js": /*!**************************************************!*\ !*** ./node_modules/convert-source-map/index.js ***! \**************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "commentRegex", ({ get: function getCommentRegex () { // Groups: 1: media type, 2: MIME type, 3: charset, 4: encoding, 5: data. return /^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/mg; } })); Object.defineProperty(exports, "mapFileCommentRegex", ({ get: function getMapFileCommentRegex () { // Matches sourceMappingURL in either // or /* comment styles. return /(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/mg; } })); var decodeBase64; if (typeof Buffer !== 'undefined') { if (typeof Buffer.from === 'function') { decodeBase64 = decodeBase64WithBufferFrom; } else { decodeBase64 = decodeBase64WithNewBuffer; } } else { decodeBase64 = decodeBase64WithAtob; } function decodeBase64WithBufferFrom(base64) { return Buffer.from(base64, 'base64').toString(); } function decodeBase64WithNewBuffer(base64) { if (typeof value === 'number') { throw new TypeError('The value to decode must not be of type number.'); } return new Buffer(base64, 'base64').toString(); } function decodeBase64WithAtob(base64) { return decodeURIComponent(escape(atob(base64))); } function stripComment(sm) { return sm.split(',').pop(); } function readFromFileMap(sm, read) { var r = exports.mapFileCommentRegex.exec(sm); // for some odd reason //# .. captures in 1 and /* .. */ in 2 var filename = r[1] || r[2]; try { var sm = read(filename); if (sm != null && typeof sm.catch === 'function') { return sm.catch(throwError); } else { return sm; } } catch (e) { throwError(e); } function throwError(e) { throw new Error('An error occurred while trying to read the map file at ' + filename + '\n' + e.stack); } } function Converter (sm, opts) { opts = opts || {}; if (opts.hasComment) { sm = stripComment(sm); } if (opts.encoding === 'base64') { sm = decodeBase64(sm); } else if (opts.encoding === 'uri') { sm = decodeURIComponent(sm); } if (opts.isJSON || opts.encoding) { sm = JSON.parse(sm); } this.sourcemap = sm; } Converter.prototype.toJSON = function (space) { return JSON.stringify(this.sourcemap, null, space); }; if (typeof Buffer !== 'undefined') { if (typeof Buffer.from === 'function') { Converter.prototype.toBase64 = encodeBase64WithBufferFrom; } else { Converter.prototype.toBase64 = encodeBase64WithNewBuffer; } } else { Converter.prototype.toBase64 = encodeBase64WithBtoa; } function encodeBase64WithBufferFrom() { var json = this.toJSON(); return Buffer.from(json, 'utf8').toString('base64'); } function encodeBase64WithNewBuffer() { var json = this.toJSON(); if (typeof json === 'number') { throw new TypeError('The json to encode must not be of type number.'); } return new Buffer(json, 'utf8').toString('base64'); } function encodeBase64WithBtoa() { var json = this.toJSON(); return btoa(unescape(encodeURIComponent(json))); } Converter.prototype.toURI = function () { var json = this.toJSON(); return encodeURIComponent(json); }; Converter.prototype.toComment = function (options) { var encoding, content, data; if (options != null && options.encoding === 'uri') { encoding = ''; content = this.toURI(); } else { encoding = ';base64'; content = this.toBase64(); } data = 'sourceMappingURL=data:application/json;charset=utf-8' + encoding + ',' + content; return options != null && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; }; // returns copy instead of original Converter.prototype.toObject = function () { return JSON.parse(this.toJSON()); }; Converter.prototype.addProperty = function (key, value) { if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead'); return this.setProperty(key, value); }; Converter.prototype.setProperty = function (key, value) { this.sourcemap[key] = value; return this; }; Converter.prototype.getProperty = function (key) { return this.sourcemap[key]; }; exports.fromObject = function (obj) { return new Converter(obj); }; exports.fromJSON = function (json) { return new Converter(json, { isJSON: true }); }; exports.fromURI = function (uri) { return new Converter(uri, { encoding: 'uri' }); }; exports.fromBase64 = function (base64) { return new Converter(base64, { encoding: 'base64' }); }; exports.fromComment = function (comment) { var m, encoding; comment = comment .replace(/^\/\*/g, '//') .replace(/\*\/$/g, ''); m = exports.commentRegex.exec(comment); encoding = m && m[4] || 'uri'; return new Converter(comment, { encoding: encoding, hasComment: true }); }; function makeConverter(sm) { return new Converter(sm, { isJSON: true }); } exports.fromMapFileComment = function (comment, read) { if (typeof read === 'string') { throw new Error( 'String directory paths are no longer supported with `fromMapFileComment`\n' + 'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading' ) } var sm = readFromFileMap(comment, read); if (sm != null && typeof sm.then === 'function') { return sm.then(makeConverter); } else { return makeConverter(sm); } }; // Finds last sourcemap comment in file or returns null if none was found exports.fromSource = function (content) { var m = content.match(exports.commentRegex); return m ? exports.fromComment(m.pop()) : null; }; // Finds last sourcemap comment in file or returns null if none was found exports.fromMapFileSource = function (content, read) { if (typeof read === 'string') { throw new Error( 'String directory paths are no longer supported with `fromMapFileSource`\n' + 'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading' ) } var m = content.match(exports.mapFileCommentRegex); return m ? exports.fromMapFileComment(m.pop(), read) : null; }; exports.removeComments = function (src) { return src.replace(exports.commentRegex, ''); }; exports.removeMapFileComments = function (src) { return src.replace(exports.mapFileCommentRegex, ''); }; exports.generateMapFileComment = function (file, options) { var data = 'sourceMappingURL=' + file; return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; }; /***/ }), /***/ "./node_modules/debug/src/browser.js": /*!*******************************************!*\ !*** ./node_modules/debug/src/browser.js ***! \*******************************************/ /***/ ((module, exports, __webpack_require__) => { /* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); exports.destroy = (() => { 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`.'); } }; })(); /** * Colors. */ exports.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' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } let m; // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 // eslint-disable-next-line no-return-assign 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+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.debug()` when available. * No-op when `console.debug` is not a "function". * If `console.debug` is not available, falls back * to `console.log`. * * @api public */ exports.log = console.debug || console.log || (() => {}); /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = __webpack_require__(/*! ./common */ "./node_modules/debug/src/common.js")(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /***/ }), /***/ "./node_modules/debug/src/common.js": /*!******************************************!*\ !*** ./node_modules/debug/src/common.js ***! \******************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/ms/index.js"); createDebug.destroy = destroy; Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; let enableOverride = null; let namespacesCache; let enabledCache; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(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') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return '%'; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); debug.extend = extend; debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. Object.defineProperty(debug, '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; } }); // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } return debug; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; const split = (typeof namespaces === 'string' ? namespaces : '') .trim() .replace(/\s+/g, ',') .split(',') .filter(Boolean); for (const ns of split) { if (ns[0] === '-') { createDebug.skips.push(ns.slice(1)); } else { createDebug.names.push(ns); } } } /** * Checks if the given string matches a namespace template, honoring * asterisks as wildcards. * * @param {String} search * @param {String} template * @return {Boolean} */ 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] === '*')) { // Match character or proceed with wildcard if (template[templateIndex] === '*') { starIndex = templateIndex; matchIndex = searchIndex; templateIndex++; // Skip the '*' } else { searchIndex++; templateIndex++; } } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition // Backtrack to the last '*' and try to match more characters templateIndex = starIndex + 1; matchIndex++; searchIndex = matchIndex; } else { return false; // No match } } // Handle trailing '*' in template while (templateIndex < template.length && template[templateIndex] === '*') { templateIndex++; } return templateIndex === template.length; } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names, ...createDebug.skips.map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { for (const skip of createDebug.skips) { if (matchesTemplate(name, skip)) { return false; } } for (const ns of createDebug.names) { if (matchesTemplate(name, ns)) { return true; } } return false; } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } /** * XXX DO NOT USE. This is a temporary stub function. * XXX It WILL be removed in the next major release. */ 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; } module.exports = setup; /***/ }), /***/ "./node_modules/define-data-property/index.js": /*!****************************************************!*\ !*** ./node_modules/define-data-property/index.js ***! \****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $defineProperty = __webpack_require__(/*! es-define-property */ "./node_modules/es-define-property/index.js"); var $SyntaxError = __webpack_require__(/*! es-errors/syntax */ "./node_modules/es-errors/syntax.js"); var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js"); var gopd = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); /** @type {import('.')} */ module.exports = function defineDataProperty( obj, property, value ) { if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { throw new $TypeError('`obj` must be an object or a function`'); } if (typeof property !== 'string' && typeof property !== 'symbol') { throw new $TypeError('`property` must be a string or a symbol`'); } if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) { throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null'); } if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) { throw new $TypeError('`nonWritable`, if provided, must be a boolean or null'); } if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) { throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null'); } if (arguments.length > 6 && typeof arguments[6] !== 'boolean') { throw new $TypeError('`loose`, if provided, must be a boolean'); } var nonEnumerable = arguments.length > 3 ? arguments[3] : null; var nonWritable = arguments.length > 4 ? arguments[4] : null; var nonConfigurable = arguments.length > 5 ? arguments[5] : null; var loose = arguments.length > 6 ? arguments[6] : false; /* @type {false | TypedPropertyDescriptor} */ var desc = !!gopd && gopd(obj, property); if ($defineProperty) { $defineProperty(obj, property, { configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, value: value, writable: nonWritable === null && desc ? desc.writable : !nonWritable }); } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) { // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable obj[property] = value; // eslint-disable-line no-param-reassign } else { throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.'); } }; /***/ }), /***/ "./node_modules/define-properties/index.js": /*!*************************************************!*\ !*** ./node_modules/define-properties/index.js ***! \*************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var keys = __webpack_require__(/*! object-keys */ "./node_modules/object-keys/index.js"); var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; var toStr = Object.prototype.toString; var concat = Array.prototype.concat; var defineDataProperty = __webpack_require__(/*! define-data-property */ "./node_modules/define-data-property/index.js"); var isFunction = function (fn) { return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; }; var supportsDescriptors = __webpack_require__(/*! has-property-descriptors */ "./node_modules/has-property-descriptors/index.js")(); var defineProperty = function (object, name, value, predicate) { if (name in object) { if (predicate === true) { if (object[name] === value) { return; } } else if (!isFunction(predicate) || !predicate()) { return; } } if (supportsDescriptors) { defineDataProperty(object, name, value, true); } else { defineDataProperty(object, name, value); } }; var defineProperties = function (object, map) { var predicates = arguments.length > 2 ? arguments[2] : {}; var props = keys(map); if (hasSymbols) { props = concat.call(props, Object.getOwnPropertySymbols(map)); } for (var i = 0; i < props.length; i += 1) { defineProperty(object, props[i], map[props[i]], predicates[props[i]]); } }; defineProperties.supportsDescriptors = !!supportsDescriptors; module.exports = defineProperties; /***/ }), /***/ "./node_modules/dunder-proto/get.js": /*!******************************************!*\ !*** ./node_modules/dunder-proto/get.js ***! \******************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var callBind = __webpack_require__(/*! call-bind-apply-helpers */ "./node_modules/call-bind-apply-helpers/index.js"); var gOPD = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); var hasProtoAccessor; try { // eslint-disable-next-line no-extra-parens, no-proto hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype; } catch (e) { if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { throw e; } } // eslint-disable-next-line no-extra-parens var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); var $Object = Object; var $getPrototypeOf = $Object.getPrototypeOf; /** @type {import('./get')} */ module.exports = desc && typeof desc.get === 'function' ? callBind([desc.get]) : typeof $getPrototypeOf === 'function' ? /** @type {import('./get')} */ function getDunder(value) { // eslint-disable-next-line eqeqeq return $getPrototypeOf(value == null ? value : $Object(value)); } : false; /***/ }), /***/ "./node_modules/electron-to-chromium/versions.js": /*!*******************************************************!*\ !*** ./node_modules/electron-to-chromium/versions.js ***! \*******************************************************/ /***/ ((module) => { module.exports = { "0.20": "39", "0.21": "41", "0.22": "41", "0.23": "41", "0.24": "41", "0.25": "42", "0.26": "42", "0.27": "43", "0.28": "43", "0.29": "43", "0.30": "44", "0.31": "45", "0.32": "45", "0.33": "45", "0.34": "45", "0.35": "45", "0.36": "47", "0.37": "49", "1.0": "49", "1.1": "50", "1.2": "51", "1.3": "52", "1.4": "53", "1.5": "54", "1.6": "56", "1.7": "58", "1.8": "59", "2.0": "61", "2.1": "61", "3.0": "66", "3.1": "66", "4.0": "69", "4.1": "69", "4.2": "69", "5.0": "73", "6.0": "76", "6.1": "76", "7.0": "78", "7.1": "78", "7.2": "78", "7.3": "78", "8.0": "80", "8.1": "80", "8.2": "80", "8.3": "80", "8.4": "80", "8.5": "80", "9.0": "83", "9.1": "83", "9.2": "83", "9.3": "83", "9.4": "83", "10.0": "85", "10.1": "85", "10.2": "85", "10.3": "85", "10.4": "85", "11.0": "87", "11.1": "87", "11.2": "87", "11.3": "87", "11.4": "87", "11.5": "87", "12.0": "89", "12.1": "89", "12.2": "89", "13.0": "91", "13.1": "91", "13.2": "91", "13.3": "91", "13.4": "91", "13.5": "91", "13.6": "91", "14.0": "93", "14.1": "93", "14.2": "93", "15.0": "94", "15.1": "94", "15.2": "94", "15.3": "94", "15.4": "94", "15.5": "94", "16.0": "96", "16.1": "96", "16.2": "96", "17.0": "98", "17.1": "98", "17.2": "98", "17.3": "98", "17.4": "98", "18.0": "100", "18.1": "100", "18.2": "100", "18.3": "100", "19.0": "102", "19.1": "102", "20.0": "104", "20.1": "104", "20.2": "104", "20.3": "104", "21.0": "106", "21.1": "106", "21.2": "106", "21.3": "106", "21.4": "106", "22.0": "108", "22.1": "108", "22.2": "108", "22.3": "108", "23.0": "110", "23.1": "110", "23.2": "110", "23.3": "110", "24.0": "112", "24.1": "112", "24.2": "112", "24.3": "112", "24.4": "112", "24.5": "112", "24.6": "112", "24.7": "112", "24.8": "112", "25.0": "114", "25.1": "114", "25.2": "114", "25.3": "114", "25.4": "114", "25.5": "114", "25.6": "114", "25.7": "114", "25.8": "114", "25.9": "114", "26.0": "116", "26.1": "116", "26.2": "116", "26.3": "116", "26.4": "116", "26.5": "116", "26.6": "116", "27.0": "118", "27.1": "118", "27.2": "118", "27.3": "118", "28.0": "120", "28.1": "120", "28.2": "120", "28.3": "120", "29.0": "122", "29.1": "122", "29.2": "122", "29.3": "122", "29.4": "122", "30.0": "124", "30.1": "124", "30.2": "124", "30.3": "124", "30.4": "124", "30.5": "124", "31.0": "126", "31.1": "126", "31.2": "126", "31.3": "126", "31.4": "126", "31.5": "126", "31.6": "126", "31.7": "126", "32.0": "128", "32.1": "128", "32.2": "128", "32.3": "128", "33.0": "130", "33.1": "130", "33.2": "130", "33.3": "130", "33.4": "130", "34.0": "132", "34.1": "132", "34.2": "132", "34.3": "132", "34.4": "132", "34.5": "132", "35.0": "134", "35.1": "134", "35.2": "134", "35.3": "134", "35.4": "134", "35.5": "134", "35.6": "134", "35.7": "134", "36.0": "136", "36.1": "136", "36.2": "136", "36.3": "136", "36.4": "136", "36.5": "136", "36.6": "136", "36.7": "136", "36.8": "136", "37.0": "138", "37.1": "138", "37.2": "138", "37.3": "138", "38.0": "140" }; /***/ }), /***/ "./node_modules/es-define-property/index.js": /*!**************************************************!*\ !*** ./node_modules/es-define-property/index.js ***! \**************************************************/ /***/ ((module) => { "use strict"; /** @type {import('.')} */ var $defineProperty = Object.defineProperty || false; if ($defineProperty) { try { $defineProperty({}, 'a', { value: 1 }); } catch (e) { // IE 8 has a broken defineProperty $defineProperty = false; } } module.exports = $defineProperty; /***/ }), /***/ "./node_modules/es-errors/eval.js": /*!****************************************!*\ !*** ./node_modules/es-errors/eval.js ***! \****************************************/ /***/ ((module) => { "use strict"; /** @type {import('./eval')} */ module.exports = EvalError; /***/ }), /***/ "./node_modules/es-errors/index.js": /*!*****************************************!*\ !*** ./node_modules/es-errors/index.js ***! \*****************************************/ /***/ ((module) => { "use strict"; /** @type {import('.')} */ module.exports = Error; /***/ }), /***/ "./node_modules/es-errors/range.js": /*!*****************************************!*\ !*** ./node_modules/es-errors/range.js ***! \*****************************************/ /***/ ((module) => { "use strict"; /** @type {import('./range')} */ module.exports = RangeError; /***/ }), /***/ "./node_modules/es-errors/ref.js": /*!***************************************!*\ !*** ./node_modules/es-errors/ref.js ***! \***************************************/ /***/ ((module) => { "use strict"; /** @type {import('./ref')} */ module.exports = ReferenceError; /***/ }), /***/ "./node_modules/es-errors/syntax.js": /*!******************************************!*\ !*** ./node_modules/es-errors/syntax.js ***! \******************************************/ /***/ ((module) => { "use strict"; /** @type {import('./syntax')} */ module.exports = SyntaxError; /***/ }), /***/ "./node_modules/es-errors/type.js": /*!****************************************!*\ !*** ./node_modules/es-errors/type.js ***! \****************************************/ /***/ ((module) => { "use strict"; /** @type {import('./type')} */ module.exports = TypeError; /***/ }), /***/ "./node_modules/es-errors/uri.js": /*!***************************************!*\ !*** ./node_modules/es-errors/uri.js ***! \***************************************/ /***/ ((module) => { "use strict"; /** @type {import('./uri')} */ module.exports = URIError; /***/ }), /***/ "./node_modules/es-object-atoms/index.js": /*!***********************************************!*\ !*** ./node_modules/es-object-atoms/index.js ***! \***********************************************/ /***/ ((module) => { "use strict"; /** @type {import('.')} */ module.exports = Object; /***/ }), /***/ "./node_modules/esutils/lib/ast.js": /*!*****************************************!*\ !*** ./node_modules/esutils/lib/ast.js ***! \*****************************************/ /***/ ((module) => { /* Copyright (C) 2013 Yusuke Suzuki Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ (function () { 'use strict'; function isExpression(node) { if (node == null) { return false; } switch (node.type) { case 'ArrayExpression': case 'AssignmentExpression': case 'BinaryExpression': case 'CallExpression': case 'ConditionalExpression': case 'FunctionExpression': case 'Identifier': case 'Literal': case 'LogicalExpression': case 'MemberExpression': case 'NewExpression': case 'ObjectExpression': case 'SequenceExpression': case 'ThisExpression': case 'UnaryExpression': case 'UpdateExpression': return true; } return false; } function isIterationStatement(node) { if (node == null) { return false; } switch (node.type) { case 'DoWhileStatement': case 'ForInStatement': case 'ForStatement': case 'WhileStatement': return true; } return false; } function isStatement(node) { if (node == null) { return false; } switch (node.type) { case 'BlockStatement': case 'BreakStatement': case 'ContinueStatement': case 'DebuggerStatement': case 'DoWhileStatement': case 'EmptyStatement': case 'ExpressionStatement': case 'ForInStatement': case 'ForStatement': case 'IfStatement': case 'LabeledStatement': case 'ReturnStatement': case 'SwitchStatement': case 'ThrowStatement': case 'TryStatement': case 'VariableDeclaration': case 'WhileStatement': case 'WithStatement': return true; } return false; } function isSourceElement(node) { return isStatement(node) || node != null && node.type === 'FunctionDeclaration'; } function trailingStatement(node) { switch (node.type) { case 'IfStatement': if (node.alternate != null) { return node.alternate; } return node.consequent; case 'LabeledStatement': case 'ForStatement': case 'ForInStatement': case 'WhileStatement': case 'WithStatement': return node.body; } return null; } function isProblematicIfStatement(node) { var current; if (node.type !== 'IfStatement') { return false; } if (node.alternate == null) { return false; } current = node.consequent; do { if (current.type === 'IfStatement') { if (current.alternate == null) { return true; } } current = trailingStatement(current); } while (current); return false; } module.exports = { isExpression: isExpression, isStatement: isStatement, isIterationStatement: isIterationStatement, isSourceElement: isSourceElement, isProblematicIfStatement: isProblematicIfStatement, trailingStatement: trailingStatement }; }()); /* vim: set sw=4 ts=4 et tw=80 : */ /***/ }), /***/ "./node_modules/esutils/lib/code.js": /*!******************************************!*\ !*** ./node_modules/esutils/lib/code.js ***! \******************************************/ /***/ ((module) => { /* Copyright (C) 2013-2014 Yusuke Suzuki Copyright (C) 2014 Ivan Nikulin Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ (function () { 'use strict'; var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; // See `tools/generate-identifier-regex.js`. ES5Regex = { // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart: NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart: NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ }; ES6Regex = { // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart: NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart: NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ }; function isDecimalDigit(ch) { return 0x30 <= ch && ch <= 0x39; // 0..9 } function isHexDigit(ch) { return 0x30 <= ch && ch <= 0x39 || // 0..9 0x61 <= ch && ch <= 0x66 || // a..f 0x41 <= ch && ch <= 0x46; // A..F } function isOctalDigit(ch) { return ch >= 0x30 && ch <= 0x37; // 0..7 } // 7.2 White Space NON_ASCII_WHITESPACES = [ 0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF ]; function isWhiteSpace(ch) { return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0; } // 7.3 Line Terminators function isLineTerminator(ch) { return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029; } // 7.6 Identifier Names and Identifiers function fromCodePoint(cp) { if (cp <= 0xFFFF) { return String.fromCharCode(cp); } var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800); var cu2 = String.fromCharCode(((cp - 0x10000) % 0x400) + 0xDC00); return cu1 + cu2; } IDENTIFIER_START = new Array(0x80); for(ch = 0; ch < 0x80; ++ch) { IDENTIFIER_START[ch] = ch >= 0x61 && ch <= 0x7A || // a..z ch >= 0x41 && ch <= 0x5A || // A..Z ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) } IDENTIFIER_PART = new Array(0x80); for(ch = 0; ch < 0x80; ++ch) { IDENTIFIER_PART[ch] = ch >= 0x61 && ch <= 0x7A || // a..z ch >= 0x41 && ch <= 0x5A || // A..Z ch >= 0x30 && ch <= 0x39 || // 0..9 ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) } function isIdentifierStartES5(ch) { return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); } function isIdentifierPartES5(ch) { return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); } function isIdentifierStartES6(ch) { return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); } function isIdentifierPartES6(ch) { return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); } module.exports = { isDecimalDigit: isDecimalDigit, isHexDigit: isHexDigit, isOctalDigit: isOctalDigit, isWhiteSpace: isWhiteSpace, isLineTerminator: isLineTerminator, isIdentifierStartES5: isIdentifierStartES5, isIdentifierPartES5: isIdentifierPartES5, isIdentifierStartES6: isIdentifierStartES6, isIdentifierPartES6: isIdentifierPartES6 }; }()); /* vim: set sw=4 ts=4 et tw=80 : */ /***/ }), /***/ "./node_modules/esutils/lib/keyword.js": /*!*********************************************!*\ !*** ./node_modules/esutils/lib/keyword.js ***! \*********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /* Copyright (C) 2013 Yusuke Suzuki Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ (function () { 'use strict'; var code = __webpack_require__(/*! ./code */ "./node_modules/esutils/lib/code.js"); function isStrictModeReservedWordES6(id) { switch (id) { case 'implements': case 'interface': case 'package': case 'private': case 'protected': case 'public': case 'static': case 'let': return true; default: return false; } } function isKeywordES5(id, strict) { // yield should not be treated as keyword under non-strict mode. if (!strict && id === 'yield') { return false; } return isKeywordES6(id, strict); } function isKeywordES6(id, strict) { if (strict && isStrictModeReservedWordES6(id)) { return true; } switch (id.length) { case 2: return (id === 'if') || (id === 'in') || (id === 'do'); case 3: return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try'); case 4: return (id === 'this') || (id === 'else') || (id === 'case') || (id === 'void') || (id === 'with') || (id === 'enum'); case 5: return (id === 'while') || (id === 'break') || (id === 'catch') || (id === 'throw') || (id === 'const') || (id === 'yield') || (id === 'class') || (id === 'super'); case 6: return (id === 'return') || (id === 'typeof') || (id === 'delete') || (id === 'switch') || (id === 'export') || (id === 'import'); case 7: return (id === 'default') || (id === 'finally') || (id === 'extends'); case 8: return (id === 'function') || (id === 'continue') || (id === 'debugger'); case 10: return (id === 'instanceof'); default: return false; } } function isReservedWordES5(id, strict) { return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict); } function isReservedWordES6(id, strict) { return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict); } function isRestrictedWord(id) { return id === 'eval' || id === 'arguments'; } function isIdentifierNameES5(id) { var i, iz, ch; if (id.length === 0) { return false; } ch = id.charCodeAt(0); if (!code.isIdentifierStartES5(ch)) { return false; } for (i = 1, iz = id.length; i < iz; ++i) { ch = id.charCodeAt(i); if (!code.isIdentifierPartES5(ch)) { return false; } } return true; } function decodeUtf16(lead, trail) { return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; } function isIdentifierNameES6(id) { var i, iz, ch, lowCh, check; if (id.length === 0) { return false; } check = code.isIdentifierStartES6; for (i = 0, iz = id.length; i < iz; ++i) { ch = id.charCodeAt(i); if (0xD800 <= ch && ch <= 0xDBFF) { ++i; if (i >= iz) { return false; } lowCh = id.charCodeAt(i); if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) { return false; } ch = decodeUtf16(ch, lowCh); } if (!check(ch)) { return false; } check = code.isIdentifierPartES6; } return true; } function isIdentifierES5(id, strict) { return isIdentifierNameES5(id) && !isReservedWordES5(id, strict); } function isIdentifierES6(id, strict) { return isIdentifierNameES6(id) && !isReservedWordES6(id, strict); } module.exports = { isKeywordES5: isKeywordES5, isKeywordES6: isKeywordES6, isReservedWordES5: isReservedWordES5, isReservedWordES6: isReservedWordES6, isRestrictedWord: isRestrictedWord, isIdentifierNameES5: isIdentifierNameES5, isIdentifierNameES6: isIdentifierNameES6, isIdentifierES5: isIdentifierES5, isIdentifierES6: isIdentifierES6 }; }()); /* vim: set sw=4 ts=4 et tw=80 : */ /***/ }), /***/ "./node_modules/esutils/lib/utils.js": /*!*******************************************!*\ !*** ./node_modules/esutils/lib/utils.js ***! \*******************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* Copyright (C) 2013 Yusuke Suzuki Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ (function () { 'use strict'; exports.ast = __webpack_require__(/*! ./ast */ "./node_modules/esutils/lib/ast.js"); exports.code = __webpack_require__(/*! ./code */ "./node_modules/esutils/lib/code.js"); exports.keyword = __webpack_require__(/*! ./keyword */ "./node_modules/esutils/lib/keyword.js"); }()); /* vim: set sw=4 ts=4 et tw=80 : */ /***/ }), /***/ "./node_modules/for-each/index.js": /*!****************************************!*\ !*** ./node_modules/for-each/index.js ***! \****************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var isCallable = __webpack_require__(/*! is-callable */ "./node_modules/is-callable/index.js"); var toStr = Object.prototype.toString; var hasOwnProperty = Object.prototype.hasOwnProperty; /** @type {(arr: A, iterator: (this: This | void, value: A[number], index: number, arr: A) => void, receiver: This | undefined) => void} */ var forEachArray = function forEachArray(array, iterator, receiver) { for (var i = 0, len = array.length; i < len; i++) { if (hasOwnProperty.call(array, i)) { if (receiver == null) { iterator(array[i], i, array); } else { iterator.call(receiver, array[i], i, array); } } } }; /** @type {(string: S, iterator: (this: This | void, value: S[number], index: number, string: S) => void, receiver: This | undefined) => void} */ var forEachString = function forEachString(string, iterator, receiver) { for (var i = 0, len = string.length; i < len; i++) { // no such thing as a sparse string. if (receiver == null) { iterator(string.charAt(i), i, string); } else { iterator.call(receiver, string.charAt(i), i, string); } } }; /** @type {(obj: O, iterator: (this: This | void, value: O[keyof O], index: keyof O, obj: O) => void, receiver: This | undefined) => void} */ var forEachObject = function forEachObject(object, iterator, receiver) { for (var k in object) { if (hasOwnProperty.call(object, k)) { if (receiver == null) { iterator(object[k], k, object); } else { iterator.call(receiver, object[k], k, object); } } } }; /** @type {(x: unknown) => x is readonly unknown[]} */ function isArray(x) { return toStr.call(x) === '[object Array]'; } /** @type {import('.')._internal} */ module.exports = function forEach(list, iterator, thisArg) { if (!isCallable(iterator)) { throw new TypeError('iterator must be a function'); } var receiver; if (arguments.length >= 3) { receiver = thisArg; } if (isArray(list)) { forEachArray(list, iterator, receiver); } else if (typeof list === 'string') { forEachString(list, iterator, receiver); } else { forEachObject(list, iterator, receiver); } }; /***/ }), /***/ "./node_modules/function-bind/implementation.js": /*!******************************************************!*\ !*** ./node_modules/function-bind/implementation.js ***! \******************************************************/ /***/ ((module) => { "use strict"; /* eslint no-invalid-this: 1 */ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; var toStr = Object.prototype.toString; var max = Math.max; var funcType = '[object Function]'; var concatty = function concatty(a, b) { var arr = []; for (var i = 0; i < a.length; i += 1) { arr[i] = a[i]; } for (var j = 0; j < b.length; j += 1) { arr[j + a.length] = b[j]; } return arr; }; var slicy = function slicy(arrLike, offset) { var arr = []; for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) { arr[j] = arrLike[i]; } return arr; }; var joiny = function (arr, joiner) { var str = ''; for (var i = 0; i < arr.length; i += 1) { str += arr[i]; if (i + 1 < arr.length) { str += joiner; } } return str; }; module.exports = function bind(that) { var target = this; if (typeof target !== 'function' || toStr.apply(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target); } var args = slicy(arguments, 1); var bound; var binder = function () { if (this instanceof bound) { var result = target.apply( this, concatty(args, arguments) ); if (Object(result) === result) { return result; } return this; } return target.apply( that, concatty(args, arguments) ); }; var boundLength = max(0, target.length - args.length); var boundArgs = []; for (var i = 0; i < boundLength; i++) { boundArgs[i] = '$' + i; } bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder); if (target.prototype) { var Empty = function Empty() {}; Empty.prototype = target.prototype; bound.prototype = new Empty(); Empty.prototype = null; } return bound; }; /***/ }), /***/ "./node_modules/function-bind/index.js": /*!*********************************************!*\ !*** ./node_modules/function-bind/index.js ***! \*********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/function-bind/implementation.js"); module.exports = Function.prototype.bind || implementation; /***/ }), /***/ "./node_modules/gensync/index.js": /*!***************************************!*\ !*** ./node_modules/gensync/index.js ***! \***************************************/ /***/ ((module) => { "use strict"; // These use the global symbol registry so that multiple copies of this // library can work together in case they are not deduped. const GENSYNC_START = Symbol.for("gensync:v1:start"); const GENSYNC_SUSPEND = Symbol.for("gensync:v1:suspend"); const GENSYNC_EXPECTED_START = "GENSYNC_EXPECTED_START"; const GENSYNC_EXPECTED_SUSPEND = "GENSYNC_EXPECTED_SUSPEND"; const GENSYNC_OPTIONS_ERROR = "GENSYNC_OPTIONS_ERROR"; const GENSYNC_RACE_NONEMPTY = "GENSYNC_RACE_NONEMPTY"; const GENSYNC_ERRBACK_NO_CALLBACK = "GENSYNC_ERRBACK_NO_CALLBACK"; module.exports = Object.assign( function gensync(optsOrFn) { let genFn = optsOrFn; if (typeof optsOrFn !== "function") { genFn = newGenerator(optsOrFn); } else { genFn = wrapGenerator(optsOrFn); } return Object.assign(genFn, makeFunctionAPI(genFn)); }, { all: buildOperation({ name: "all", arity: 1, sync: function(args) { const items = Array.from(args[0]); return items.map(item => evaluateSync(item)); }, async: function(args, resolve, reject) { const items = Array.from(args[0]); if (items.length === 0) { Promise.resolve().then(() => resolve([])); return; } let count = 0; const results = items.map(() => undefined); items.forEach((item, i) => { evaluateAsync( item, val => { results[i] = val; count += 1; if (count === results.length) resolve(results); }, reject ); }); }, }), race: buildOperation({ name: "race", arity: 1, sync: function(args) { const items = Array.from(args[0]); if (items.length === 0) { throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY); } return evaluateSync(items[0]); }, async: function(args, resolve, reject) { const items = Array.from(args[0]); if (items.length === 0) { throw makeError("Must race at least 1 item", GENSYNC_RACE_NONEMPTY); } for (const item of items) { evaluateAsync(item, resolve, reject); } }, }), } ); /** * Given a generator function, return the standard API object that executes * the generator and calls the callbacks. */ function makeFunctionAPI(genFn) { const fns = { sync: function(...args) { return evaluateSync(genFn.apply(this, args)); }, async: function(...args) { return new Promise((resolve, reject) => { evaluateAsync(genFn.apply(this, args), resolve, reject); }); }, errback: function(...args) { const cb = args.pop(); if (typeof cb !== "function") { throw makeError( "Asynchronous function called without callback", GENSYNC_ERRBACK_NO_CALLBACK ); } let gen; try { gen = genFn.apply(this, args); } catch (err) { cb(err); return; } evaluateAsync(gen, val => cb(undefined, val), err => cb(err)); }, }; return fns; } function assertTypeof(type, name, value, allowUndefined) { if ( typeof value === type || (allowUndefined && typeof value === "undefined") ) { return; } let msg; if (allowUndefined) { msg = `Expected opts.${name} to be either a ${type}, or undefined.`; } else { msg = `Expected opts.${name} to be a ${type}.`; } throw makeError(msg, GENSYNC_OPTIONS_ERROR); } function makeError(msg, code) { return Object.assign(new Error(msg), { code }); } /** * Given an options object, return a new generator that dispatches the * correct handler based on sync or async execution. */ function newGenerator({ name, arity, sync, async, errback }) { assertTypeof("string", "name", name, true /* allowUndefined */); assertTypeof("number", "arity", arity, true /* allowUndefined */); assertTypeof("function", "sync", sync); assertTypeof("function", "async", async, true /* allowUndefined */); assertTypeof("function", "errback", errback, true /* allowUndefined */); if (async && errback) { throw makeError( "Expected one of either opts.async or opts.errback, but got _both_.", GENSYNC_OPTIONS_ERROR ); } if (typeof name !== "string") { let fnName; if (errback && errback.name && errback.name !== "errback") { fnName = errback.name; } if (async && async.name && async.name !== "async") { fnName = async.name.replace(/Async$/, ""); } if (sync && sync.name && sync.name !== "sync") { fnName = sync.name.replace(/Sync$/, ""); } if (typeof fnName === "string") { name = fnName; } } if (typeof arity !== "number") { arity = sync.length; } return buildOperation({ name, arity, sync: function(args) { return sync.apply(this, args); }, async: function(args, resolve, reject) { if (async) { async.apply(this, args).then(resolve, reject); } else if (errback) { errback.call(this, ...args, (err, value) => { if (err == null) resolve(value); else reject(err); }); } else { resolve(sync.apply(this, args)); } }, }); } function wrapGenerator(genFn) { return setFunctionMetadata(genFn.name, genFn.length, function(...args) { return genFn.apply(this, args); }); } function buildOperation({ name, arity, sync, async }) { return setFunctionMetadata(name, arity, function*(...args) { const resume = yield GENSYNC_START; if (!resume) { // Break the tail call to avoid a bug in V8 v6.X with --harmony enabled. const res = sync.call(this, args); return res; } let result; try { async.call( this, args, value => { if (result) return; result = { value }; resume(); }, err => { if (result) return; result = { err }; resume(); } ); } catch (err) { result = { err }; resume(); } // Suspend until the callbacks run. Will resume synchronously if the // callback was already called. yield GENSYNC_SUSPEND; if (result.hasOwnProperty("err")) { throw result.err; } return result.value; }); } function evaluateSync(gen) { let value; while (!({ value } = gen.next()).done) { assertStart(value, gen); } return value; } function evaluateAsync(gen, resolve, reject) { (function step() { try { let value; while (!({ value } = gen.next()).done) { assertStart(value, gen); // If this throws, it is considered to have broken the contract // established for async handlers. If these handlers are called // synchronously, it is also considered bad behavior. let sync = true; let didSyncResume = false; const out = gen.next(() => { if (sync) { didSyncResume = true; } else { step(); } }); sync = false; assertSuspend(out, gen); if (!didSyncResume) { // Callback wasn't called synchronously, so break out of the loop // and let it call 'step' later. return; } } return resolve(value); } catch (err) { return reject(err); } })(); } function assertStart(value, gen) { if (value === GENSYNC_START) return; throwError( gen, makeError( `Got unexpected yielded value in gensync generator: ${JSON.stringify( value )}. Did you perhaps mean to use 'yield*' instead of 'yield'?`, GENSYNC_EXPECTED_START ) ); } function assertSuspend({ value, done }, gen) { if (!done && value === GENSYNC_SUSPEND) return; throwError( gen, makeError( done ? "Unexpected generator completion. If you get this, it is probably a gensync bug." : `Expected GENSYNC_SUSPEND, got ${JSON.stringify( value )}. If you get this, it is probably a gensync bug.`, GENSYNC_EXPECTED_SUSPEND ) ); } function throwError(gen, err) { // Call `.throw` so that users can step in a debugger to easily see which // 'yield' passed an unexpected value. If the `.throw` call didn't throw // back to the generator, we explicitly do it to stop the error // from being swallowed by user code try/catches. if (gen.throw) gen.throw(err); throw err; } function isIterable(value) { return ( !!value && (typeof value === "object" || typeof value === "function") && !value[Symbol.iterator] ); } function setFunctionMetadata(name, arity, fn) { if (typeof name === "string") { // This should always work on the supported Node versions, but for the // sake of users that are compiling to older versions, we check for // configurability so we don't throw. const nameDesc = Object.getOwnPropertyDescriptor(fn, "name"); if (!nameDesc || nameDesc.configurable) { Object.defineProperty( fn, "name", Object.assign(nameDesc || {}, { configurable: true, value: name, }) ); } } if (typeof arity === "number") { const lengthDesc = Object.getOwnPropertyDescriptor(fn, "length"); if (!lengthDesc || lengthDesc.configurable) { Object.defineProperty( fn, "length", Object.assign(lengthDesc || {}, { configurable: true, value: arity, }) ); } } return fn; } /***/ }), /***/ "./node_modules/get-intrinsic/index.js": /*!*********************************************!*\ !*** ./node_modules/get-intrinsic/index.js ***! \*********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var undefined; var $Object = __webpack_require__(/*! es-object-atoms */ "./node_modules/es-object-atoms/index.js"); var $Error = __webpack_require__(/*! es-errors */ "./node_modules/es-errors/index.js"); var $EvalError = __webpack_require__(/*! es-errors/eval */ "./node_modules/es-errors/eval.js"); var $RangeError = __webpack_require__(/*! es-errors/range */ "./node_modules/es-errors/range.js"); var $ReferenceError = __webpack_require__(/*! es-errors/ref */ "./node_modules/es-errors/ref.js"); var $SyntaxError = __webpack_require__(/*! es-errors/syntax */ "./node_modules/es-errors/syntax.js"); var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js"); var $URIError = __webpack_require__(/*! es-errors/uri */ "./node_modules/es-errors/uri.js"); var abs = __webpack_require__(/*! math-intrinsics/abs */ "./node_modules/math-intrinsics/abs.js"); var floor = __webpack_require__(/*! math-intrinsics/floor */ "./node_modules/math-intrinsics/floor.js"); var max = __webpack_require__(/*! math-intrinsics/max */ "./node_modules/math-intrinsics/max.js"); var min = __webpack_require__(/*! math-intrinsics/min */ "./node_modules/math-intrinsics/min.js"); var pow = __webpack_require__(/*! math-intrinsics/pow */ "./node_modules/math-intrinsics/pow.js"); var round = __webpack_require__(/*! math-intrinsics/round */ "./node_modules/math-intrinsics/round.js"); var sign = __webpack_require__(/*! math-intrinsics/sign */ "./node_modules/math-intrinsics/sign.js"); var $Function = Function; // eslint-disable-next-line consistent-return var getEvalledConstructor = function (expressionSyntax) { try { return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); } catch (e) {} }; var $gOPD = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); var $defineProperty = __webpack_require__(/*! es-define-property */ "./node_modules/es-define-property/index.js"); var throwTypeError = function () { throw new $TypeError(); }; var ThrowTypeError = $gOPD ? (function () { try { // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties arguments.callee; // IE 8 does not throw here return throwTypeError; } catch (calleeThrows) { try { // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') return $gOPD(arguments, 'callee').get; } catch (gOPDthrows) { return throwTypeError; } } }()) : throwTypeError; var hasSymbols = __webpack_require__(/*! has-symbols */ "./node_modules/has-symbols/index.js")(); var getProto = __webpack_require__(/*! get-proto */ "./node_modules/get-proto/index.js"); var $ObjectGPO = __webpack_require__(/*! get-proto/Object.getPrototypeOf */ "./node_modules/get-proto/Object.getPrototypeOf.js"); var $ReflectGPO = __webpack_require__(/*! get-proto/Reflect.getPrototypeOf */ "./node_modules/get-proto/Reflect.getPrototypeOf.js"); var $apply = __webpack_require__(/*! call-bind-apply-helpers/functionApply */ "./node_modules/call-bind-apply-helpers/functionApply.js"); var $call = __webpack_require__(/*! call-bind-apply-helpers/functionCall */ "./node_modules/call-bind-apply-helpers/functionCall.js"); var needsEval = {}; var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array); var INTRINSICS = { __proto__: null, '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, '%Array%': Array, '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined, '%AsyncFromSyncIteratorPrototype%': undefined, '%AsyncFunction%': needsEval, '%AsyncGenerator%': needsEval, '%AsyncGeneratorFunction%': needsEval, '%AsyncIteratorPrototype%': needsEval, '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array, '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array, '%Boolean%': Boolean, '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, '%Date%': Date, '%decodeURI%': decodeURI, '%decodeURIComponent%': decodeURIComponent, '%encodeURI%': encodeURI, '%encodeURIComponent%': encodeURIComponent, '%Error%': $Error, '%eval%': eval, // eslint-disable-line no-eval '%EvalError%': $EvalError, '%Float16Array%': typeof Float16Array === 'undefined' ? undefined : Float16Array, '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, '%Function%': $Function, '%GeneratorFunction%': needsEval, '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, '%isFinite%': isFinite, '%isNaN%': isNaN, '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined, '%JSON%': typeof JSON === 'object' ? JSON : undefined, '%Map%': typeof Map === 'undefined' ? undefined : Map, '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()), '%Math%': Math, '%Number%': Number, '%Object%': $Object, '%Object.getOwnPropertyDescriptor%': $gOPD, '%parseFloat%': parseFloat, '%parseInt%': parseInt, '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, '%RangeError%': $RangeError, '%ReferenceError%': $ReferenceError, '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, '%RegExp%': RegExp, '%Set%': typeof Set === 'undefined' ? undefined : Set, '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()), '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, '%String%': String, '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined, '%Symbol%': hasSymbols ? Symbol : undefined, '%SyntaxError%': $SyntaxError, '%ThrowTypeError%': ThrowTypeError, '%TypedArray%': TypedArray, '%TypeError%': $TypeError, '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, '%URIError%': $URIError, '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, '%Function.prototype.call%': $call, '%Function.prototype.apply%': $apply, '%Object.defineProperty%': $defineProperty, '%Object.getPrototypeOf%': $ObjectGPO, '%Math.abs%': abs, '%Math.floor%': floor, '%Math.max%': max, '%Math.min%': min, '%Math.pow%': pow, '%Math.round%': round, '%Math.sign%': sign, '%Reflect.getPrototypeOf%': $ReflectGPO }; if (getProto) { try { null.error; // eslint-disable-line no-unused-expressions } catch (e) { // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 var errorProto = getProto(getProto(e)); INTRINSICS['%Error.prototype%'] = errorProto; } } var doEval = function doEval(name) { var value; if (name === '%AsyncFunction%') { value = getEvalledConstructor('async function () {}'); } else if (name === '%GeneratorFunction%') { value = getEvalledConstructor('function* () {}'); } else if (name === '%AsyncGeneratorFunction%') { value = getEvalledConstructor('async function* () {}'); } else if (name === '%AsyncGenerator%') { var fn = doEval('%AsyncGeneratorFunction%'); if (fn) { value = fn.prototype; } } else if (name === '%AsyncIteratorPrototype%') { var gen = doEval('%AsyncGenerator%'); if (gen && getProto) { value = getProto(gen.prototype); } } INTRINSICS[name] = value; return value; }; var LEGACY_ALIASES = { __proto__: null, '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], '%ArrayPrototype%': ['Array', 'prototype'], '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], '%ArrayProto_values%': ['Array', 'prototype', 'values'], '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], '%BooleanPrototype%': ['Boolean', 'prototype'], '%DataViewPrototype%': ['DataView', 'prototype'], '%DatePrototype%': ['Date', 'prototype'], '%ErrorPrototype%': ['Error', 'prototype'], '%EvalErrorPrototype%': ['EvalError', 'prototype'], '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], '%FunctionPrototype%': ['Function', 'prototype'], '%Generator%': ['GeneratorFunction', 'prototype'], '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], '%JSONParse%': ['JSON', 'parse'], '%JSONStringify%': ['JSON', 'stringify'], '%MapPrototype%': ['Map', 'prototype'], '%NumberPrototype%': ['Number', 'prototype'], '%ObjectPrototype%': ['Object', 'prototype'], '%ObjProto_toString%': ['Object', 'prototype', 'toString'], '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], '%PromisePrototype%': ['Promise', 'prototype'], '%PromiseProto_then%': ['Promise', 'prototype', 'then'], '%Promise_all%': ['Promise', 'all'], '%Promise_reject%': ['Promise', 'reject'], '%Promise_resolve%': ['Promise', 'resolve'], '%RangeErrorPrototype%': ['RangeError', 'prototype'], '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], '%RegExpPrototype%': ['RegExp', 'prototype'], '%SetPrototype%': ['Set', 'prototype'], '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], '%StringPrototype%': ['String', 'prototype'], '%SymbolPrototype%': ['Symbol', 'prototype'], '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], '%TypedArrayPrototype%': ['TypedArray', 'prototype'], '%TypeErrorPrototype%': ['TypeError', 'prototype'], '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], '%URIErrorPrototype%': ['URIError', 'prototype'], '%WeakMapPrototype%': ['WeakMap', 'prototype'], '%WeakSetPrototype%': ['WeakSet', 'prototype'] }; var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js"); var hasOwn = __webpack_require__(/*! hasown */ "./node_modules/hasown/index.js"); var $concat = bind.call($call, Array.prototype.concat); var $spliceApply = bind.call($apply, Array.prototype.splice); var $replace = bind.call($call, String.prototype.replace); var $strSlice = bind.call($call, String.prototype.slice); var $exec = bind.call($call, RegExp.prototype.exec); /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ var stringToPath = function stringToPath(string) { var first = $strSlice(string, 0, 1); var last = $strSlice(string, -1); if (first === '%' && last !== '%') { throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); } else if (last === '%' && first !== '%') { throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); } var result = []; $replace(string, rePropName, function (match, number, quote, subString) { result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; }); return result; }; /* end adaptation */ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { var intrinsicName = name; var alias; if (hasOwn(LEGACY_ALIASES, intrinsicName)) { alias = LEGACY_ALIASES[intrinsicName]; intrinsicName = '%' + alias[0] + '%'; } if (hasOwn(INTRINSICS, intrinsicName)) { var value = INTRINSICS[intrinsicName]; if (value === needsEval) { value = doEval(intrinsicName); } if (typeof value === 'undefined' && !allowMissing) { throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); } return { alias: alias, name: intrinsicName, value: value }; } throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); }; module.exports = function GetIntrinsic(name, allowMissing) { if (typeof name !== 'string' || name.length === 0) { throw new $TypeError('intrinsic name must be a non-empty string'); } if (arguments.length > 1 && typeof allowMissing !== 'boolean') { throw new $TypeError('"allowMissing" argument must be a boolean'); } if ($exec(/^%?[^%]*%?$/, name) === null) { throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); } var parts = stringToPath(name); var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); var intrinsicRealName = intrinsic.name; var value = intrinsic.value; var skipFurtherCaching = false; var alias = intrinsic.alias; if (alias) { intrinsicBaseName = alias[0]; $spliceApply(parts, $concat([0, 1], alias)); } for (var i = 1, isOwn = true; i < parts.length; i += 1) { var part = parts[i]; var first = $strSlice(part, 0, 1); var last = $strSlice(part, -1); if ( ( (first === '"' || first === "'" || first === '`') || (last === '"' || last === "'" || last === '`') ) && first !== last ) { throw new $SyntaxError('property names with quotes must have matching quotes'); } if (part === 'constructor' || !isOwn) { skipFurtherCaching = true; } intrinsicBaseName += '.' + part; intrinsicRealName = '%' + intrinsicBaseName + '%'; if (hasOwn(INTRINSICS, intrinsicRealName)) { value = INTRINSICS[intrinsicRealName]; } else if (value != null) { if (!(part in value)) { if (!allowMissing) { throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); } return void undefined; } if ($gOPD && (i + 1) >= parts.length) { var desc = $gOPD(value, part); isOwn = !!desc; // By convention, when a data property is converted to an accessor // property to emulate a data property that does not suffer from // the override mistake, that accessor's getter is marked with // an `originalValue` property. Here, when we detect this, we // uphold the illusion by pretending to see that original data // property, i.e., returning the value rather than the getter // itself. if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { value = desc.get; } else { value = value[part]; } } else { isOwn = hasOwn(value, part); value = value[part]; } if (isOwn && !skipFurtherCaching) { INTRINSICS[intrinsicRealName] = value; } } } return value; }; /***/ }), /***/ "./node_modules/get-proto/Object.getPrototypeOf.js": /*!*********************************************************!*\ !*** ./node_modules/get-proto/Object.getPrototypeOf.js ***! \*********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $Object = __webpack_require__(/*! es-object-atoms */ "./node_modules/es-object-atoms/index.js"); /** @type {import('./Object.getPrototypeOf')} */ module.exports = $Object.getPrototypeOf || null; /***/ }), /***/ "./node_modules/get-proto/Reflect.getPrototypeOf.js": /*!**********************************************************!*\ !*** ./node_modules/get-proto/Reflect.getPrototypeOf.js ***! \**********************************************************/ /***/ ((module) => { "use strict"; /** @type {import('./Reflect.getPrototypeOf')} */ module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null; /***/ }), /***/ "./node_modules/get-proto/index.js": /*!*****************************************!*\ !*** ./node_modules/get-proto/index.js ***! \*****************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var reflectGetProto = __webpack_require__(/*! ./Reflect.getPrototypeOf */ "./node_modules/get-proto/Reflect.getPrototypeOf.js"); var originalGetProto = __webpack_require__(/*! ./Object.getPrototypeOf */ "./node_modules/get-proto/Object.getPrototypeOf.js"); var getDunderProto = __webpack_require__(/*! dunder-proto/get */ "./node_modules/dunder-proto/get.js"); /** @type {import('.')} */ module.exports = reflectGetProto ? function getProto(O) { // @ts-expect-error TS can't narrow inside a closure, for some reason return reflectGetProto(O); } : originalGetProto ? function getProto(O) { if (!O || (typeof O !== 'object' && typeof O !== 'function')) { throw new TypeError('getProto: not an object'); } // @ts-expect-error TS can't narrow inside a closure, for some reason return originalGetProto(O); } : getDunderProto ? function getProto(O) { // @ts-expect-error TS can't narrow inside a closure, for some reason return getDunderProto(O); } : null; /***/ }), /***/ "./node_modules/gopd/gOPD.js": /*!***********************************!*\ !*** ./node_modules/gopd/gOPD.js ***! \***********************************/ /***/ ((module) => { "use strict"; /** @type {import('./gOPD')} */ module.exports = Object.getOwnPropertyDescriptor; /***/ }), /***/ "./node_modules/gopd/index.js": /*!************************************!*\ !*** ./node_modules/gopd/index.js ***! \************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** @type {import('.')} */ var $gOPD = __webpack_require__(/*! ./gOPD */ "./node_modules/gopd/gOPD.js"); if ($gOPD) { try { $gOPD([], 'length'); } catch (e) { // IE 8 has a broken gOPD $gOPD = null; } } module.exports = $gOPD; /***/ }), /***/ "./node_modules/has-property-descriptors/index.js": /*!********************************************************!*\ !*** ./node_modules/has-property-descriptors/index.js ***! \********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var $defineProperty = __webpack_require__(/*! es-define-property */ "./node_modules/es-define-property/index.js"); var hasPropertyDescriptors = function hasPropertyDescriptors() { return !!$defineProperty; }; hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { // node v0.6 has a bug where array lengths can be Set but not Defined if (!$defineProperty) { return null; } try { return $defineProperty([], 'length', { value: 1 }).length !== 1; } catch (e) { // In Firefox 4-22, defining length on an array throws an exception. return true; } }; module.exports = hasPropertyDescriptors; /***/ }), /***/ "./node_modules/has-symbols/index.js": /*!*******************************************!*\ !*** ./node_modules/has-symbols/index.js ***! \*******************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var origSymbol = typeof Symbol !== 'undefined' && Symbol; var hasSymbolSham = __webpack_require__(/*! ./shams */ "./node_modules/has-symbols/shams.js"); /** @type {import('.')} */ module.exports = function hasNativeSymbols() { if (typeof origSymbol !== 'function') { return false; } if (typeof Symbol !== 'function') { return false; } if (typeof origSymbol('foo') !== 'symbol') { return false; } if (typeof Symbol('bar') !== 'symbol') { return false; } return hasSymbolSham(); }; /***/ }), /***/ "./node_modules/has-symbols/shams.js": /*!*******************************************!*\ !*** ./node_modules/has-symbols/shams.js ***! \*******************************************/ /***/ ((module) => { "use strict"; /** @type {import('./shams')} */ /* eslint complexity: [2, 18], max-statements: [2, 33] */ module.exports = function hasSymbols() { if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } if (typeof Symbol.iterator === 'symbol') { return true; } /** @type {{ [k in symbol]?: unknown }} */ var obj = {}; var sym = Symbol('test'); var symObj = Object(sym); if (typeof sym === 'string') { return false; } if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } // temp disabled per https://github.com/ljharb/object.assign/issues/17 // if (sym instanceof Symbol) { return false; } // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 // if (!(symObj instanceof Symbol)) { return false; } // if (typeof Symbol.prototype.toString !== 'function') { return false; } // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } var symVal = 42; obj[sym] = symVal; for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } var syms = Object.getOwnPropertySymbols(obj); if (syms.length !== 1 || syms[0] !== sym) { return false; } if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } if (typeof Object.getOwnPropertyDescriptor === 'function') { // eslint-disable-next-line no-extra-parens var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym)); if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } } return true; }; /***/ }), /***/ "./node_modules/has-tostringtag/shams.js": /*!***********************************************!*\ !*** ./node_modules/has-tostringtag/shams.js ***! \***********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var hasSymbols = __webpack_require__(/*! has-symbols/shams */ "./node_modules/has-symbols/shams.js"); /** @type {import('.')} */ module.exports = function hasToStringTagShams() { return hasSymbols() && !!Symbol.toStringTag; }; /***/ }), /***/ "./node_modules/hasown/index.js": /*!**************************************!*\ !*** ./node_modules/hasown/index.js ***! \**************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var call = Function.prototype.call; var $hasOwn = Object.prototype.hasOwnProperty; var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bind/index.js"); /** @type {import('.')} */ module.exports = bind.call(call, $hasOwn); /***/ }), /***/ "./node_modules/inherits/inherits_browser.js": /*!***************************************************!*\ !*** ./node_modules/inherits/inherits_browser.js ***! \***************************************************/ /***/ ((module) => { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }) } }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { if (superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } } /***/ }), /***/ "./node_modules/is-arguments/index.js": /*!********************************************!*\ !*** ./node_modules/is-arguments/index.js ***! \********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ "./node_modules/has-tostringtag/shams.js")(); var callBound = __webpack_require__(/*! call-bound */ "./node_modules/call-bound/index.js"); var $toString = callBound('Object.prototype.toString'); /** @type {import('.')} */ var isStandardArguments = function isArguments(value) { if ( hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value ) { return false; } return $toString(value) === '[object Arguments]'; }; /** @type {import('.')} */ var isLegacyArguments = function isArguments(value) { if (isStandardArguments(value)) { return true; } return value !== null && typeof value === 'object' && 'length' in value && typeof value.length === 'number' && value.length >= 0 && $toString(value) !== '[object Array]' && 'callee' in value && $toString(value.callee) === '[object Function]'; }; var supportsStandardArguments = (function () { return isStandardArguments(arguments); }()); // @ts-expect-error TODO make this not error isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests /** @type {import('.')} */ module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments; /***/ }), /***/ "./node_modules/is-callable/index.js": /*!*******************************************!*\ !*** ./node_modules/is-callable/index.js ***! \*******************************************/ /***/ ((module) => { "use strict"; var fnToStr = Function.prototype.toString; var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; var badArrayLike; var isCallableMarker; if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { try { badArrayLike = Object.defineProperty({}, 'length', { get: function () { throw isCallableMarker; } }); isCallableMarker = {}; // eslint-disable-next-line no-throw-literal reflectApply(function () { throw 42; }, null, badArrayLike); } catch (_) { if (_ !== isCallableMarker) { reflectApply = null; } } } else { reflectApply = null; } var constructorRegex = /^\s*class\b/; var isES6ClassFn = function isES6ClassFunction(value) { try { var fnStr = fnToStr.call(value); return constructorRegex.test(fnStr); } catch (e) { return false; // not a function } }; var tryFunctionObject = function tryFunctionToStr(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }; var toStr = Object.prototype.toString; var objectClass = '[object Object]'; var fnClass = '[object Function]'; var genClass = '[object GeneratorFunction]'; var ddaClass = '[object HTMLAllCollection]'; // IE 11 var ddaClass2 = '[object HTML document.all class]'; var ddaClass3 = '[object HTMLCollection]'; // IE 9-10 var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag` var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing var isDDA = function isDocumentDotAll() { return false; }; if (typeof document === 'object') { // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly var all = document.all; if (toStr.call(all) === toStr.call(document.all)) { isDDA = function isDocumentDotAll(value) { /* globals document: false */ // in IE 6-8, typeof document.all is "object" and it's truthy if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) { try { var str = toStr.call(value); return ( str === ddaClass || str === ddaClass2 || str === ddaClass3 // opera 12.16 || str === objectClass // IE 6-8 ) && value('') == null; // eslint-disable-line eqeqeq } catch (e) { /**/ } } return false; }; } } module.exports = reflectApply ? function isCallable(value) { if (isDDA(value)) { return true; } if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } try { reflectApply(value, null, badArrayLike); } catch (e) { if (e !== isCallableMarker) { return false; } } return !isES6ClassFn(value) && tryFunctionObject(value); } : function isCallable(value) { if (isDDA(value)) { return true; } if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = toStr.call(value); if (strClass !== fnClass && strClass !== genClass && !(/^\[object HTML/).test(strClass)) { return false; } return tryFunctionObject(value); }; /***/ }), /***/ "./node_modules/is-generator-function/index.js": /*!*****************************************************!*\ !*** ./node_modules/is-generator-function/index.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var callBound = __webpack_require__(/*! call-bound */ "./node_modules/call-bound/index.js"); var safeRegexTest = __webpack_require__(/*! safe-regex-test */ "./node_modules/safe-regex-test/index.js"); var isFnRegex = safeRegexTest(/^\s*(?:function)?\*/); var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ "./node_modules/has-tostringtag/shams.js")(); var getProto = __webpack_require__(/*! get-proto */ "./node_modules/get-proto/index.js"); var toStr = callBound('Object.prototype.toString'); var fnToStr = callBound('Function.prototype.toString'); var getGeneratorFunc = function () { // eslint-disable-line consistent-return if (!hasToStringTag) { return false; } try { return Function('return function*() {}')(); } catch (e) { } }; /** @type {undefined | false | null | GeneratorFunctionConstructor} */ var GeneratorFunction; /** @type {import('.')} */ module.exports = function isGeneratorFunction(fn) { if (typeof fn !== 'function') { return false; } if (isFnRegex(fnToStr(fn))) { return true; } if (!hasToStringTag) { var str = toStr(fn); return str === '[object GeneratorFunction]'; } if (!getProto) { return false; } if (typeof GeneratorFunction === 'undefined') { var generatorFunc = getGeneratorFunc(); GeneratorFunction = generatorFunc // eslint-disable-next-line no-extra-parens ? /** @type {GeneratorFunctionConstructor} */ (getProto(generatorFunc)) : false; } return getProto(fn) === GeneratorFunction; }; /***/ }), /***/ "./node_modules/is-nan/implementation.js": /*!***********************************************!*\ !*** ./node_modules/is-nan/implementation.js ***! \***********************************************/ /***/ ((module) => { "use strict"; /* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ module.exports = function isNaN(value) { return value !== value; }; /***/ }), /***/ "./node_modules/is-nan/index.js": /*!**************************************!*\ !*** ./node_modules/is-nan/index.js ***! \**************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var callBind = __webpack_require__(/*! call-bind */ "./node_modules/call-bind/index.js"); var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/is-nan/implementation.js"); var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/is-nan/polyfill.js"); var shim = __webpack_require__(/*! ./shim */ "./node_modules/is-nan/shim.js"); var polyfill = callBind(getPolyfill(), Number); /* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ define(polyfill, { getPolyfill: getPolyfill, implementation: implementation, shim: shim }); module.exports = polyfill; /***/ }), /***/ "./node_modules/is-nan/polyfill.js": /*!*****************************************!*\ !*** ./node_modules/is-nan/polyfill.js ***! \*****************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var implementation = __webpack_require__(/*! ./implementation */ "./node_modules/is-nan/implementation.js"); module.exports = function getPolyfill() { if (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN('a')) { return Number.isNaN; } return implementation; }; /***/ }), /***/ "./node_modules/is-nan/shim.js": /*!*************************************!*\ !*** ./node_modules/is-nan/shim.js ***! \*************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var define = __webpack_require__(/*! define-properties */ "./node_modules/define-properties/index.js"); var getPolyfill = __webpack_require__(/*! ./polyfill */ "./node_modules/is-nan/polyfill.js"); /* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ module.exports = function shimNumberIsNaN() { var polyfill = getPolyfill(); define(Number, { isNaN: polyfill }, { isNaN: function testIsNaN() { return Number.isNaN !== polyfill; } }); return polyfill; }; /***/ }), /***/ "./node_modules/is-regex/index.js": /*!****************************************!*\ !*** ./node_modules/is-regex/index.js ***! \****************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var callBound = __webpack_require__(/*! call-bound */ "./node_modules/call-bound/index.js"); var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ "./node_modules/has-tostringtag/shams.js")(); var hasOwn = __webpack_require__(/*! hasown */ "./node_modules/hasown/index.js"); var gOPD = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); /** @type {import('.')} */ var fn; if (hasToStringTag) { /** @type {(receiver: ThisParameterType, ...args: Parameters) => ReturnType} */ var $exec = callBound('RegExp.prototype.exec'); /** @type {object} */ var isRegexMarker = {}; var throwRegexMarker = function () { throw isRegexMarker; }; /** @type {{ toString(): never, valueOf(): never, [Symbol.toPrimitive]?(): never }} */ var badStringifier = { toString: throwRegexMarker, valueOf: throwRegexMarker }; if (typeof Symbol.toPrimitive === 'symbol') { badStringifier[Symbol.toPrimitive] = throwRegexMarker; } /** @type {import('.')} */ // @ts-expect-error TS can't figure out that the $exec call always throws // eslint-disable-next-line consistent-return fn = function isRegex(value) { if (!value || typeof value !== 'object') { return false; } // eslint-disable-next-line no-extra-parens var descriptor = /** @type {NonNullable} */ (gOPD)(/** @type {{ lastIndex?: unknown }} */ (value), 'lastIndex'); var hasLastIndexDataProperty = descriptor && hasOwn(descriptor, 'value'); if (!hasLastIndexDataProperty) { return false; } try { // eslint-disable-next-line no-extra-parens $exec(value, /** @type {string} */ (/** @type {unknown} */ (badStringifier))); } catch (e) { return e === isRegexMarker; } }; } else { /** @type {(receiver: ThisParameterType, ...args: Parameters) => ReturnType} */ var $toString = callBound('Object.prototype.toString'); /** @const @type {'[object RegExp]'} */ var regexClass = '[object RegExp]'; /** @type {import('.')} */ fn = function isRegex(value) { // In older browsers, typeof regex incorrectly returns 'function' if (!value || (typeof value !== 'object' && typeof value !== 'function')) { return false; } return $toString(value) === regexClass; }; } module.exports = fn; /***/ }), /***/ "./node_modules/is-typed-array/index.js": /*!**********************************************!*\ !*** ./node_modules/is-typed-array/index.js ***! \**********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var whichTypedArray = __webpack_require__(/*! which-typed-array */ "./node_modules/which-typed-array/index.js"); /** @type {import('.')} */ module.exports = function isTypedArray(value) { return !!whichTypedArray(value); }; /***/ }), /***/ "./node_modules/js-tokens/index.js": /*!*****************************************!*\ !*** ./node_modules/js-tokens/index.js ***! \*****************************************/ /***/ ((__unused_webpack_module, exports) => { // Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell // License: MIT. (See LICENSE.) Object.defineProperty(exports, "__esModule", ({ value: true })) // This regex comes from regex.coffee, and is inserted here by generate-index.js // (run `npm run build`). exports["default"] = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g exports.matchToToken = function(match) { var token = {type: "invalid", value: match[0], closed: undefined} if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) else if (match[ 5]) token.type = "comment" else if (match[ 6]) token.type = "comment", token.closed = !!match[7] else if (match[ 8]) token.type = "regex" else if (match[ 9]) token.type = "number" else if (match[10]) token.type = "name" else if (match[11]) token.type = "punctuator" else if (match[12]) token.type = "whitespace" return token } /***/ }), /***/ "./node_modules/jsesc/jsesc.js": /*!*************************************!*\ !*** ./node_modules/jsesc/jsesc.js ***! \*************************************/ /***/ ((module) => { "use strict"; const object = {}; const hasOwnProperty = object.hasOwnProperty; const forOwn = (object, callback) => { for (const key in object) { if (hasOwnProperty.call(object, key)) { callback(key, object[key]); } } }; const extend = (destination, source) => { if (!source) { return destination; } forOwn(source, (key, value) => { destination[key] = value; }); return destination; }; const forEach = (array, callback) => { const length = array.length; let index = -1; while (++index < length) { callback(array[index]); } }; const fourHexEscape = (hex) => { return '\\u' + ('0000' + hex).slice(-4); } const hexadecimal = (code, lowercase) => { let hexadecimal = code.toString(16); if (lowercase) return hexadecimal; return hexadecimal.toUpperCase(); }; const toString = object.toString; const isArray = Array.isArray; const isBuffer = (value) => { return typeof Buffer === 'function' && Buffer.isBuffer(value); }; const isObject = (value) => { // This is a very simple check, but it’s good enough for what we need. return toString.call(value) == '[object Object]'; }; const isString = (value) => { return typeof value == 'string' || toString.call(value) == '[object String]'; }; const isNumber = (value) => { return typeof value == 'number' || toString.call(value) == '[object Number]'; }; const isBigInt = (value) => { return typeof value == 'bigint'; }; const isFunction = (value) => { return typeof value == 'function'; }; const isMap = (value) => { return toString.call(value) == '[object Map]'; }; const isSet = (value) => { return toString.call(value) == '[object Set]'; }; /*--------------------------------------------------------------------------*/ // https://mathiasbynens.be/notes/javascript-escapes#single const singleEscapes = { '\\': '\\\\', '\b': '\\b', '\f': '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t' // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'. // '\v': '\\x0B' }; const regexSingleEscape = /[\\\b\f\n\r\t]/; const regexDigit = /[0-9]/; const regexWhitespace = /[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/; const escapeEverythingRegex = /([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g; const escapeNonAsciiRegex = /([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g; const jsesc = (argument, options) => { const increaseIndentation = () => { oldIndent = indent; ++options.indentLevel; indent = options.indent.repeat(options.indentLevel) }; // Handle options const defaults = { 'escapeEverything': false, 'minimal': false, 'isScriptContext': false, 'quotes': 'single', 'wrap': false, 'es6': false, 'json': false, 'compact': true, 'lowercaseHex': false, 'numbers': 'decimal', 'indent': '\t', '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 && isFunction(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(' + jsesc(Array.from(argument), options) + ')'; } if (isSet(argument)) { if (argument.size == 0) { return 'new Set()'; } return 'new Set(' + jsesc(Array.from(argument), options) + ')'; } if (isBuffer(argument)) { if (argument.length == 0) { return 'Buffer.from([])'; } return 'Buffer.from(' + jsesc(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) + jsesc(value, options) ); }); if (isEmpty) { return '[]'; } if (inline2) { return '[' + result.join(', ') + ']'; } return '[' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + ']'; } else if (isNumber(argument) || isBigInt(argument)) { if (json) { // Some number values (e.g. `Infinity`) cannot be represented in JSON. // `BigInt` values less than `-Number.MAX_VALUE` or greater than // `Number.MAX_VALUE` cannot be represented in JSON so they will become // `-Infinity` or `Infinity`, respectively, and then become `null` when // stringified. return JSON.stringify(Number(argument)); } let result; if (useDecNumbers) { result = String(argument); } else if (useHexNumbers) { let hexadecimal = argument.toString(16); if (!lowercaseHex) { hexadecimal = hexadecimal.toUpperCase(); } result = '0x' + hexadecimal; } else if (useBinNumbers) { result = '0b' + argument.toString(2); } else if (useOctNumbers) { result = '0o' + argument.toString(8); } if (isBigInt(argument)) { return result + 'n'; } return result; } else if (isBigInt(argument)) { if (json) { // `BigInt` values less than `-Number.MAX_VALUE` or greater than // `Number.MAX_VALUE` will become `-Infinity` or `Infinity`, // respectively, and cannot be represented in JSON. return JSON.stringify(Number(argument)); } return argument + 'n'; } else if (!isObject(argument)) { if (json) { // For some values (e.g. `undefined`, `function` objects), // `JSON.stringify(value)` returns `undefined` (which isn’t valid // JSON) instead of `'null'`. return JSON.stringify(argument) || 'null'; } return String(argument); } else { // it’s an object result = []; options.wrap = true; increaseIndentation(); forOwn(argument, (key, value) => { isEmpty = false; result.push( (compact ? '' : indent) + jsesc(key, options) + ':' + (compact ? '' : ' ') + jsesc(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, index, string) => { if (pair) { if (options.minimal) return pair; const first = pair.charCodeAt(0); const second = pair.charCodeAt(1); if (options.es6) { // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae const codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; const hex = hexadecimal(codePoint, lowercaseHex); return '\\u{' + hex + '}'; } 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(index + 1)) ) { return '\\0'; } if (quoteChar) { if (quoteChar == quote || options.escapeEverything) { return '\\' + quoteChar; } return quoteChar; } if (regexSingleEscape.test(char)) { // no need for a `hasOwnProperty` check here 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) { // https://mathiasbynens.be/notes/etago result = result .replace(/<\/(script|style)/gi, '<\\/$1') .replace(/ * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 function replaceTildes (comp, options) { return comp.trim().split(/\s+/).map(function (comp) { return replaceTilde(comp, options) }).join(' ') } function replaceTilde (comp, options) { var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE] return comp.replace(r, function (_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr) var ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' } else if (isX(p)) { // ~1.2 == >=1.2.0 <1.3.0 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' } else if (pr) { debug('replaceTilde pr', pr) ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0' } else { // ~1.2.3 == >=1.2.3 <1.3.0 ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0' } debug('tilde return', ret) return ret }) } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 // ^1.2.3 --> >=1.2.3 <2.0.0 // ^1.2.0 --> >=1.2.0 <2.0.0 function replaceCarets (comp, options) { return comp.trim().split(/\s+/).map(function (comp) { return replaceCaret(comp, options) }).join(' ') } function replaceCaret (comp, options) { debug('caret', comp, options) var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET] return comp.replace(r, function (_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr) var ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' } else if (isX(p)) { if (M === '0') { ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' } else { ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' } } else if (pr) { debug('replaceCaret pr', pr) if (M === '0') { if (m === '0') { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + m + '.' + (+p + 1) } else { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0' } } else { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + (+M + 1) + '.0.0' } } else { debug('no pr') if (M === '0') { if (m === '0') { ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + m + '.' + (+p + 1) } else { ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0' } } else { ret = '>=' + M + '.' + m + '.' + p + ' <' + (+M + 1) + '.0.0' } } debug('caret return', ret) return ret }) } function replaceXRanges (comp, options) { debug('replaceXRanges', comp, options) return comp.split(/\s+/).map(function (comp) { return replaceXRange(comp, options) }).join(' ') } function replaceXRange (comp, options) { comp = comp.trim() var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE] return comp.replace(r, function (ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr) var xM = isX(M) var xm = xM || isX(m) var xp = xm || isX(p) var anyX = xp if (gtlt === '=' && anyX) { gtlt = '' } // if we're including prereleases in the match, then we need // to fix this to -0, the lowest possible prerelease value pr = options.includePrerelease ? '-0' : '' if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0-0' } else { // nothing is forbidden ret = '*' } } else if (gtlt && anyX) { // we know patch is an x, because we have any x at all. // replace X with 0 if (xm) { m = 0 } p = 0 if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 // >1.2.3 => >= 1.2.4 gtlt = '>=' if (xm) { M = +M + 1 m = 0 p = 0 } else { m = +m + 1 p = 0 } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<' if (xm) { M = +M + 1 } else { m = +m + 1 } } ret = gtlt + M + '.' + m + '.' + p + pr } else if (xm) { ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr } else if (xp) { ret = '>=' + M + '.' + m + '.0' + pr + ' <' + M + '.' + (+m + 1) + '.0' + pr } debug('xRange return', ret) return ret }) } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. function replaceStars (comp, options) { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(safeRe[t.STAR], '') } // This function is passed to string.replace(re[t.HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0 function hyphenReplace ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { if (isX(fM)) { from = '' } else if (isX(fm)) { from = '>=' + fM + '.0.0' } else if (isX(fp)) { from = '>=' + fM + '.' + fm + '.0' } else { from = '>=' + from } if (isX(tM)) { to = '' } else if (isX(tm)) { to = '<' + (+tM + 1) + '.0.0' } else if (isX(tp)) { to = '<' + tM + '.' + (+tm + 1) + '.0' } else if (tpr) { to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr } else { to = '<=' + to } return (from + ' ' + to).trim() } // if ANY of the sets match ALL of its comparators, then pass Range.prototype.test = function (version) { if (!version) { return false } if (typeof version === 'string') { try { version = new SemVer(version, this.options) } catch (er) { return false } } for (var i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) { return true } } return false } function testSet (set, version, options) { for (var i = 0; i < set.length; i++) { if (!set[i].test(version)) { return false } } if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (i = 0; i < set.length; i++) { debug(set[i].semver) if (set[i].semver === ANY) { continue } if (set[i].semver.prerelease.length > 0) { var allowed = set[i].semver if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true } } } // Version has a -pre, but it's not one of the ones we like. return false } return true } exports.satisfies = satisfies function satisfies (version, range, options) { try { range = new Range(range, options) } catch (er) { return false } return range.test(version) } exports.maxSatisfying = maxSatisfying function maxSatisfying (versions, range, options) { var max = null var maxSV = null try { var rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v maxSV = new SemVer(max, options) } } }) return max } exports.minSatisfying = minSatisfying function minSatisfying (versions, range, options) { var min = null var minSV = null try { var rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v minSV = new SemVer(min, options) } } }) return min } exports.minVersion = minVersion function minVersion (range, loose) { range = new Range(range, loose) var minver = new SemVer('0.0.0') if (range.test(minver)) { return minver } minver = new SemVer('0.0.0-0') if (range.test(minver)) { return minver } minver = null for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i] comparators.forEach(function (comparator) { // Clone to avoid manipulating the comparator's semver object. var compver = new SemVer(comparator.semver.version) switch (comparator.operator) { case '>': if (compver.prerelease.length === 0) { compver.patch++ } else { compver.prerelease.push(0) } compver.raw = compver.format() /* fallthrough */ case '': case '>=': if (!minver || gt(minver, compver)) { minver = compver } break case '<': case '<=': /* Ignore maximum versions */ break /* istanbul ignore next */ default: throw new Error('Unexpected operation: ' + comparator.operator) } }) } if (minver && range.test(minver)) { return minver } return null } exports.validRange = validRange function validRange (range, options) { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, options).range || '*' } catch (er) { return null } } // Determine if version is less than all the versions possible in the range exports.ltr = ltr function ltr (version, range, options) { return outside(version, range, '<', options) } // Determine if version is greater than all the versions possible in the range. exports.gtr = gtr function gtr (version, range, options) { return outside(version, range, '>', options) } exports.outside = outside function outside (version, range, hilo, options) { version = new SemVer(version, options) range = new Range(range, options) var gtfn, ltefn, ltfn, comp, ecomp switch (hilo) { case '>': gtfn = gt ltefn = lte ltfn = lt comp = '>' ecomp = '>=' break case '<': gtfn = lt ltefn = gte ltfn = gt comp = '<' ecomp = '<=' break default: throw new TypeError('Must provide a hilo val of "<" or ">"') } // If it satisifes the range it is not outside if (satisfies(version, range, options)) { return false } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i] var high = null var low = null comparators.forEach(function (comparator) { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator low = low || comparator if (gtfn(comparator.semver, high.semver, options)) { high = comparator } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator } }) // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false } } return true } exports.prerelease = prerelease function prerelease (version, options) { var parsed = parse(version, options) return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } exports.intersects = intersects function intersects (r1, r2, options) { r1 = new Range(r1, options) r2 = new Range(r2, options) return r1.intersects(r2) } exports.coerce = coerce function coerce (version, options) { if (version instanceof SemVer) { return version } if (typeof version === 'number') { version = String(version) } if (typeof version !== 'string') { return null } options = options || {} var match = null if (!options.rtl) { match = version.match(safeRe[t.COERCE]) } else { // Find the right-most coercible string that does not share // a terminus with a more left-ward coercible string. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' // // Walk through the string checking with a /g regexp // Manually set the index so as to pick up overlapping matches. // Stop when we get a match that ends at the string end, since no // coercible string can be more right-ward without the same terminus. var next while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length) ) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next } safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length } // leave it in a clean state safeRe[t.COERCERTL].lastIndex = -1 } if (match === null) { return null } return parse(match[2] + '.' + (match[3] || '0') + '.' + (match[4] || '0'), options) } /***/ }), /***/ "./node_modules/set-function-length/index.js": /*!***************************************************!*\ !*** ./node_modules/set-function-length/index.js ***! \***************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js"); var define = __webpack_require__(/*! define-data-property */ "./node_modules/define-data-property/index.js"); var hasDescriptors = __webpack_require__(/*! has-property-descriptors */ "./node_modules/has-property-descriptors/index.js")(); var gOPD = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js"); var $floor = GetIntrinsic('%Math.floor%'); /** @type {import('.')} */ module.exports = function setFunctionLength(fn, length) { if (typeof fn !== 'function') { throw new $TypeError('`fn` is not a function'); } if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) { throw new $TypeError('`length` must be a positive 32-bit integer'); } var loose = arguments.length > 2 && !!arguments[2]; var functionLengthIsConfigurable = true; var functionLengthIsWritable = true; if ('length' in fn && gOPD) { var desc = gOPD(fn, 'length'); if (desc && !desc.configurable) { functionLengthIsConfigurable = false; } if (desc && !desc.writable) { functionLengthIsWritable = false; } } if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { if (hasDescriptors) { define(/** @type {Parameters[0]} */ (fn), 'length', length, true, true); } else { define(/** @type {Parameters[0]} */ (fn), 'length', length); } } return fn; }; /***/ }), /***/ "./node_modules/text-encoder/index.js": /*!********************************************!*\ !*** ./node_modules/text-encoder/index.js ***! \********************************************/ /***/ ((module) => { var utf8Encodings = [ 'utf8', 'utf-8', 'unicode-1-1-utf-8' ]; function TextEncoder(encoding) { if (utf8Encodings.indexOf(encoding) < 0 && typeof encoding !== 'undefined' && encoding != null) { throw new RangeError('Invalid encoding type. Only utf-8 is supported'); } else { this.encoding = 'utf-8'; this.encode = function(str) { if (typeof str !== 'string') { throw new TypeError('passed argument must be of tye string'); } var binstr = unescape(encodeURIComponent(str)), arr = new Uint8Array(binstr.length); const split = binstr.split(''); for (let i = 0; i < split.length; i++) { arr[i] = split[i].charCodeAt(0); } return arr; }; } } function TextDecoder(encoding) { if (utf8Encodings.indexOf(encoding) < 0 && typeof encoding !== 'undefined' && encoding != null) { throw new RangeError('Invalid encoding type. Only utf-8 is supported'); } else { this.encoding = 'utf-8'; this.decode = function (view, options) { if (typeof view === 'undefined') { return ''; } var stream = (typeof options !== 'undefined' && stream in options) ? options.stream : false; if (typeof stream !== 'boolean') { throw new TypeError('stream option must be boolean'); } if (!ArrayBuffer.isView(view)) { throw new TypeError('passed argument must be an array buffer view'); } else { var arr = new Uint8Array(view.buffer, view.byteOffset, view.byteLength), charArr = new Array(arr.length); for (let i = 0; i < arr.length; i++) { charArr[i] = String.fromCharCode(arr[i]); } return decodeURIComponent(escape(charArr.join(''))); } } } } module.exports = { TextEncoder, TextDecoder, }; /***/ }), /***/ "./node_modules/util/support/isBufferBrowser.js": /*!******************************************************!*\ !*** ./node_modules/util/support/isBufferBrowser.js ***! \******************************************************/ /***/ ((module) => { module.exports = function isBuffer(arg) { return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; } /***/ }), /***/ "./node_modules/util/support/types.js": /*!********************************************!*\ !*** ./node_modules/util/support/types.js ***! \********************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; // Currently in sync with Node.js lib/internal/util/types.js // https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9 var isArgumentsObject = __webpack_require__(/*! is-arguments */ "./node_modules/is-arguments/index.js"); var isGeneratorFunction = __webpack_require__(/*! is-generator-function */ "./node_modules/is-generator-function/index.js"); var whichTypedArray = __webpack_require__(/*! which-typed-array */ "./node_modules/which-typed-array/index.js"); var isTypedArray = __webpack_require__(/*! is-typed-array */ "./node_modules/is-typed-array/index.js"); function uncurryThis(f) { return f.call.bind(f); } var BigIntSupported = typeof BigInt !== 'undefined'; var SymbolSupported = typeof Symbol !== 'undefined'; var ObjectToString = uncurryThis(Object.prototype.toString); var numberValue = uncurryThis(Number.prototype.valueOf); var stringValue = uncurryThis(String.prototype.valueOf); var booleanValue = uncurryThis(Boolean.prototype.valueOf); if (BigIntSupported) { var bigIntValue = uncurryThis(BigInt.prototype.valueOf); } if (SymbolSupported) { var symbolValue = uncurryThis(Symbol.prototype.valueOf); } function checkBoxedPrimitive(value, prototypeValueOf) { if (typeof value !== 'object') { return false; } try { prototypeValueOf(value); return true; } catch(e) { return false; } } exports.isArgumentsObject = isArgumentsObject; exports.isGeneratorFunction = isGeneratorFunction; exports.isTypedArray = isTypedArray; // Taken from here and modified for better browser support // https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js function isPromise(input) { return ( ( typeof Promise !== 'undefined' && input instanceof Promise ) || ( input !== null && typeof input === 'object' && typeof input.then === 'function' && typeof input.catch === 'function' ) ); } exports.isPromise = isPromise; function isArrayBufferView(value) { if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { return ArrayBuffer.isView(value); } return ( isTypedArray(value) || isDataView(value) ); } exports.isArrayBufferView = isArrayBufferView; function isUint8Array(value) { return whichTypedArray(value) === 'Uint8Array'; } exports.isUint8Array = isUint8Array; function isUint8ClampedArray(value) { return whichTypedArray(value) === 'Uint8ClampedArray'; } exports.isUint8ClampedArray = isUint8ClampedArray; function isUint16Array(value) { return whichTypedArray(value) === 'Uint16Array'; } exports.isUint16Array = isUint16Array; function isUint32Array(value) { return whichTypedArray(value) === 'Uint32Array'; } exports.isUint32Array = isUint32Array; function isInt8Array(value) { return whichTypedArray(value) === 'Int8Array'; } exports.isInt8Array = isInt8Array; function isInt16Array(value) { return whichTypedArray(value) === 'Int16Array'; } exports.isInt16Array = isInt16Array; function isInt32Array(value) { return whichTypedArray(value) === 'Int32Array'; } exports.isInt32Array = isInt32Array; function isFloat32Array(value) { return whichTypedArray(value) === 'Float32Array'; } exports.isFloat32Array = isFloat32Array; function isFloat64Array(value) { return whichTypedArray(value) === 'Float64Array'; } exports.isFloat64Array = isFloat64Array; function isBigInt64Array(value) { return whichTypedArray(value) === 'BigInt64Array'; } exports.isBigInt64Array = isBigInt64Array; function isBigUint64Array(value) { return whichTypedArray(value) === 'BigUint64Array'; } exports.isBigUint64Array = isBigUint64Array; function isMapToString(value) { return ObjectToString(value) === '[object Map]'; } isMapToString.working = ( typeof Map !== 'undefined' && isMapToString(new Map()) ); function isMap(value) { if (typeof Map === 'undefined') { return false; } return isMapToString.working ? isMapToString(value) : value instanceof Map; } exports.isMap = isMap; function isSetToString(value) { return ObjectToString(value) === '[object Set]'; } isSetToString.working = ( typeof Set !== 'undefined' && isSetToString(new Set()) ); function isSet(value) { if (typeof Set === 'undefined') { return false; } return isSetToString.working ? isSetToString(value) : value instanceof Set; } exports.isSet = isSet; function isWeakMapToString(value) { return ObjectToString(value) === '[object WeakMap]'; } isWeakMapToString.working = ( typeof WeakMap !== 'undefined' && isWeakMapToString(new WeakMap()) ); function isWeakMap(value) { if (typeof WeakMap === 'undefined') { return false; } return isWeakMapToString.working ? isWeakMapToString(value) : value instanceof WeakMap; } exports.isWeakMap = isWeakMap; function isWeakSetToString(value) { return ObjectToString(value) === '[object WeakSet]'; } isWeakSetToString.working = ( typeof WeakSet !== 'undefined' && isWeakSetToString(new WeakSet()) ); function isWeakSet(value) { return isWeakSetToString(value); } exports.isWeakSet = isWeakSet; function isArrayBufferToString(value) { return ObjectToString(value) === '[object ArrayBuffer]'; } isArrayBufferToString.working = ( typeof ArrayBuffer !== 'undefined' && isArrayBufferToString(new ArrayBuffer()) ); function isArrayBuffer(value) { if (typeof ArrayBuffer === 'undefined') { return false; } return isArrayBufferToString.working ? isArrayBufferToString(value) : value instanceof ArrayBuffer; } exports.isArrayBuffer = isArrayBuffer; function isDataViewToString(value) { return ObjectToString(value) === '[object DataView]'; } isDataViewToString.working = ( typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined' && isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1)) ); function isDataView(value) { if (typeof DataView === 'undefined') { return false; } return isDataViewToString.working ? isDataViewToString(value) : value instanceof DataView; } exports.isDataView = isDataView; // Store a copy of SharedArrayBuffer in case it's deleted elsewhere var SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined; function isSharedArrayBufferToString(value) { return ObjectToString(value) === '[object SharedArrayBuffer]'; } function isSharedArrayBuffer(value) { if (typeof SharedArrayBufferCopy === 'undefined') { return false; } if (typeof isSharedArrayBufferToString.working === 'undefined') { isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy()); } return isSharedArrayBufferToString.working ? isSharedArrayBufferToString(value) : value instanceof SharedArrayBufferCopy; } exports.isSharedArrayBuffer = isSharedArrayBuffer; function isAsyncFunction(value) { return ObjectToString(value) === '[object AsyncFunction]'; } exports.isAsyncFunction = isAsyncFunction; function isMapIterator(value) { return ObjectToString(value) === '[object Map Iterator]'; } exports.isMapIterator = isMapIterator; function isSetIterator(value) { return ObjectToString(value) === '[object Set Iterator]'; } exports.isSetIterator = isSetIterator; function isGeneratorObject(value) { return ObjectToString(value) === '[object Generator]'; } exports.isGeneratorObject = isGeneratorObject; function isWebAssemblyCompiledModule(value) { return ObjectToString(value) === '[object WebAssembly.Module]'; } exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule; function isNumberObject(value) { return checkBoxedPrimitive(value, numberValue); } exports.isNumberObject = isNumberObject; function isStringObject(value) { return checkBoxedPrimitive(value, stringValue); } exports.isStringObject = isStringObject; function isBooleanObject(value) { return checkBoxedPrimitive(value, booleanValue); } exports.isBooleanObject = isBooleanObject; function isBigIntObject(value) { return BigIntSupported && checkBoxedPrimitive(value, bigIntValue); } exports.isBigIntObject = isBigIntObject; function isSymbolObject(value) { return SymbolSupported && checkBoxedPrimitive(value, symbolValue); } exports.isSymbolObject = isSymbolObject; function isBoxedPrimitive(value) { return ( isNumberObject(value) || isStringObject(value) || isBooleanObject(value) || isBigIntObject(value) || isSymbolObject(value) ); } exports.isBoxedPrimitive = isBoxedPrimitive; function isAnyArrayBuffer(value) { return typeof Uint8Array !== 'undefined' && ( isArrayBuffer(value) || isSharedArrayBuffer(value) ); } exports.isAnyArrayBuffer = isAnyArrayBuffer; ['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) { Object.defineProperty(exports, method, { enumerable: false, value: function() { throw new Error(method + ' is not supported in userland'); } }); }); /***/ }), /***/ "./node_modules/util/util.js": /*!***********************************!*\ !*** ./node_modules/util/util.js ***! \***********************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { /* provided dependency */ var process = __webpack_require__(/*! process/browser.js */ "./node_modules/process/browser.js"); // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(obj) { var keys = Object.keys(obj); var descriptors = {}; for (var i = 0; i < keys.length; i++) { descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]); } return descriptors; }; var formatRegExp = /%[sdj%]/g; exports.format = function(f) { if (!isString(f)) { var objects = []; for (var i = 0; i < arguments.length; i++) { objects.push(inspect(arguments[i])); } return objects.join(' '); } var i = 1; var args = arguments; var len = args.length; var str = String(f).replace(formatRegExp, function(x) { if (x === '%%') return '%'; if (i >= len) return x; switch (x) { case '%s': return String(args[i++]); case '%d': return Number(args[i++]); case '%j': try { return JSON.stringify(args[i++]); } catch (_) { return '[Circular]'; } default: return x; } }); for (var x = args[i]; i < len; x = args[++i]) { if (isNull(x) || !isObject(x)) { str += ' ' + x; } else { str += ' ' + inspect(x); } } return str; }; // Mark that a method should not be used. // Returns a modified function which warns once by default. // If --no-deprecation is set, then it is a no-op. exports.deprecate = function(fn, msg) { if (typeof process !== 'undefined' && process.noDeprecation === true) { return fn; } // Allow for deprecating things in the process of starting up. if (typeof process === 'undefined') { return function() { return exports.deprecate(fn, msg).apply(this, arguments); }; } var warned = false; function deprecated() { if (!warned) { if (process.throwDeprecation) { throw new Error(msg); } else if (process.traceDeprecation) { console.trace(msg); } else { console.error(msg); } warned = true; } return fn.apply(this, arguments); } return deprecated; }; var debugs = {}; var debugEnvRegex = /^$/; if (process.env.NODE_DEBUG) { var debugEnv = process.env.NODE_DEBUG; debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&') .replace(/\*/g, '.*') .replace(/,/g, '$|^') .toUpperCase(); debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i'); } exports.debuglog = function(set) { set = set.toUpperCase(); if (!debugs[set]) { if (debugEnvRegex.test(set)) { var pid = process.pid; debugs[set] = function() { var msg = exports.format.apply(exports, arguments); console.error('%s %d: %s', set, pid, msg); }; } else { debugs[set] = function() {}; } } return debugs[set]; }; /** * Echos the value of a value. Trys to print the value out * in the best way possible given the different types. * * @param {Object} obj The object to print out. * @param {Object} opts Optional options object that alters the output. */ /* legacy: obj, showHidden, depth, colors*/ function inspect(obj, opts) { // default options var ctx = { seen: [], stylize: stylizeNoColor }; // legacy... if (arguments.length >= 3) ctx.depth = arguments[2]; if (arguments.length >= 4) ctx.colors = arguments[3]; if (isBoolean(opts)) { // legacy... ctx.showHidden = opts; } else if (opts) { // got an "options" object exports._extend(ctx, opts); } // set default options if (isUndefined(ctx.showHidden)) ctx.showHidden = false; if (isUndefined(ctx.depth)) ctx.depth = 2; if (isUndefined(ctx.colors)) ctx.colors = false; if (isUndefined(ctx.customInspect)) ctx.customInspect = true; if (ctx.colors) ctx.stylize = stylizeWithColor; return formatValue(ctx, obj, ctx.depth); } exports.inspect = inspect; // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics inspect.colors = { 'bold' : [1, 22], 'italic' : [3, 23], 'underline' : [4, 24], 'inverse' : [7, 27], 'white' : [37, 39], 'grey' : [90, 39], 'black' : [30, 39], 'blue' : [34, 39], 'cyan' : [36, 39], 'green' : [32, 39], 'magenta' : [35, 39], 'red' : [31, 39], 'yellow' : [33, 39] }; // Don't use 'blue' not visible on cmd.exe inspect.styles = { 'special': 'cyan', 'number': 'yellow', 'boolean': 'yellow', 'undefined': 'grey', 'null': 'bold', 'string': 'green', 'date': 'magenta', // "name": intentionally not styling 'regexp': 'red' }; function stylizeWithColor(str, styleType) { var style = inspect.styles[styleType]; if (style) { return '\u001b[' + inspect.colors[style][0] + 'm' + str + '\u001b[' + inspect.colors[style][1] + 'm'; } else { return str; } } function stylizeNoColor(str, styleType) { return str; } function arrayToHash(array) { var hash = {}; array.forEach(function(val, idx) { hash[val] = true; }); return hash; } function formatValue(ctx, value, recurseTimes) { // Provide a hook for user-specified inspect functions. // Check that value is an object with an inspect function on it if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special value.inspect !== exports.inspect && // Also filter out any prototype objects using the circular check. !(value.constructor && value.constructor.prototype === value)) { var ret = value.inspect(recurseTimes, ctx); if (!isString(ret)) { ret = formatValue(ctx, ret, recurseTimes); } return ret; } // Primitive types cannot have properties var primitive = formatPrimitive(ctx, value); if (primitive) { return primitive; } // Look up the keys of the object. var keys = Object.keys(value); var visibleKeys = arrayToHash(keys); if (ctx.showHidden) { keys = Object.getOwnPropertyNames(value); } // IE doesn't make error fields non-enumerable // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { return formatError(value); } // Some type of object without properties can be shortcutted. if (keys.length === 0) { if (isFunction(value)) { var name = value.name ? ': ' + value.name : ''; return ctx.stylize('[Function' + name + ']', 'special'); } if (isRegExp(value)) { return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); } if (isDate(value)) { return ctx.stylize(Date.prototype.toString.call(value), 'date'); } if (isError(value)) { return formatError(value); } } var base = '', array = false, braces = ['{', '}']; // Make Array say that they are Array if (isArray(value)) { array = true; braces = ['[', ']']; } // Make functions say that they are functions if (isFunction(value)) { var n = value.name ? ': ' + value.name : ''; base = ' [Function' + n + ']'; } // Make RegExps say that they are RegExps if (isRegExp(value)) { base = ' ' + RegExp.prototype.toString.call(value); } // Make dates with properties first say the date if (isDate(value)) { base = ' ' + Date.prototype.toUTCString.call(value); } // Make error with message first say the error if (isError(value)) { base = ' ' + formatError(value); } if (keys.length === 0 && (!array || value.length == 0)) { return braces[0] + base + braces[1]; } if (recurseTimes < 0) { if (isRegExp(value)) { return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); } else { return ctx.stylize('[Object]', 'special'); } } ctx.seen.push(value); var output; if (array) { output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); } else { output = keys.map(function(key) { return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); }); } ctx.seen.pop(); return reduceToSingleString(output, base, braces); } function formatPrimitive(ctx, value) { if (isUndefined(value)) return ctx.stylize('undefined', 'undefined'); if (isString(value)) { var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') .replace(/'/g, "\\'") .replace(/\\"/g, '"') + '\''; return ctx.stylize(simple, 'string'); } if (isNumber(value)) return ctx.stylize('' + value, 'number'); if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); // For some reason typeof null is "object", so special case here. if (isNull(value)) return ctx.stylize('null', 'null'); } function formatError(value) { return '[' + Error.prototype.toString.call(value) + ']'; } function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { var output = []; for (var i = 0, l = value.length; i < l; ++i) { if (hasOwnProperty(value, String(i))) { output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true)); } else { output.push(''); } } keys.forEach(function(key) { if (!key.match(/^\d+$/)) { output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); } }); return output; } function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { var name, str, desc; desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; if (desc.get) { if (desc.set) { str = ctx.stylize('[Getter/Setter]', 'special'); } else { str = ctx.stylize('[Getter]', 'special'); } } else { if (desc.set) { str = ctx.stylize('[Setter]', 'special'); } } if (!hasOwnProperty(visibleKeys, key)) { name = '[' + key + ']'; } if (!str) { if (ctx.seen.indexOf(desc.value) < 0) { if (isNull(recurseTimes)) { str = formatValue(ctx, desc.value, null); } else { str = formatValue(ctx, desc.value, recurseTimes - 1); } if (str.indexOf('\n') > -1) { if (array) { str = str.split('\n').map(function(line) { return ' ' + line; }).join('\n').slice(2); } else { str = '\n' + str.split('\n').map(function(line) { return ' ' + line; }).join('\n'); } } } else { str = ctx.stylize('[Circular]', 'special'); } } if (isUndefined(name)) { if (array && key.match(/^\d+$/)) { return str; } name = JSON.stringify('' + key); if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { name = name.slice(1, -1); name = ctx.stylize(name, 'name'); } else { name = name.replace(/'/g, "\\'") .replace(/\\"/g, '"') .replace(/(^"|"$)/g, "'"); name = ctx.stylize(name, 'string'); } } return name + ': ' + str; } function reduceToSingleString(output, base, braces) { var numLinesEst = 0; var length = output.reduce(function(prev, cur) { numLinesEst++; if (cur.indexOf('\n') >= 0) numLinesEst++; return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; }, 0); if (length > 60) { return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1]; } return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; } // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. exports.types = __webpack_require__(/*! ./support/types */ "./node_modules/util/support/types.js"); function isArray(ar) { return Array.isArray(ar); } exports.isArray = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } exports.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } exports.isNumber = isNumber; function isString(arg) { return typeof arg === 'string'; } exports.isString = isString; function isSymbol(arg) { return typeof arg === 'symbol'; } exports.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports.isUndefined = isUndefined; function isRegExp(re) { return isObject(re) && objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; exports.types.isRegExp = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; } exports.isObject = isObject; function isDate(d) { return isObject(d) && objectToString(d) === '[object Date]'; } exports.isDate = isDate; exports.types.isDate = isDate; function isError(e) { return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; exports.types.isNativeError = isError; function isFunction(arg) { return typeof arg === 'function'; } exports.isFunction = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol typeof arg === 'undefined'; } exports.isPrimitive = isPrimitive; exports.isBuffer = __webpack_require__(/*! ./support/isBuffer */ "./node_modules/util/support/isBufferBrowser.js"); function objectToString(o) { return Object.prototype.toString.call(o); } function pad(n) { return n < 10 ? '0' + n.toString(10) : n.toString(10); } var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; // 26 Feb 16:19:34 function timestamp() { var d = new Date(); var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(':'); return [d.getDate(), months[d.getMonth()], time].join(' '); } // log is just a thin wrapper to console.log that prepends a timestamp exports.log = function() { console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); }; /** * Inherit the prototype methods from one constructor into another. * * The Function.prototype.inherits from lang.js rewritten as a standalone * function (not on Function.prototype). NOTE: If this file is to be loaded * during bootstrapping this function needs to be rewritten using some native * functions as prototype setup using normal JavaScript does not work as * expected during bootstrapping (see mirror.js in r114903). * * @param {function} ctor Constructor function which needs to inherit the * prototype. * @param {function} superCtor Constructor function to inherit prototype from. */ exports.inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"); exports._extend = function(origin, add) { // Don't do anything if add isn't an object if (!add || !isObject(add)) return origin; var keys = Object.keys(add); var i = keys.length; while (i--) { origin[keys[i]] = add[keys[i]]; } return origin; }; function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } var kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined; exports.promisify = function promisify(original) { if (typeof original !== 'function') throw new TypeError('The "original" argument must be of type Function'); if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) { var fn = original[kCustomPromisifiedSymbol]; if (typeof fn !== 'function') { throw new TypeError('The "util.promisify.custom" argument must be of type Function'); } Object.defineProperty(fn, kCustomPromisifiedSymbol, { value: fn, enumerable: false, writable: false, configurable: true }); return fn; } function fn() { var promiseResolve, promiseReject; var promise = new Promise(function (resolve, reject) { promiseResolve = resolve; promiseReject = reject; }); var args = []; for (var i = 0; i < arguments.length; i++) { args.push(arguments[i]); } args.push(function (err, value) { if (err) { promiseReject(err); } else { promiseResolve(value); } }); try { original.apply(this, args); } catch (err) { promiseReject(err); } return promise; } Object.setPrototypeOf(fn, Object.getPrototypeOf(original)); if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, { value: fn, enumerable: false, writable: false, configurable: true }); return Object.defineProperties( fn, getOwnPropertyDescriptors(original) ); } exports.promisify.custom = kCustomPromisifiedSymbol function callbackifyOnRejected(reason, cb) { // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M). // Because `null` is a special error value in callbacks which means "no error // occurred", we error-wrap so the callback consumer can distinguish between // "the promise rejected with null" or "the promise fulfilled with undefined". if (!reason) { var newReason = new Error('Promise was rejected with a falsy value'); newReason.reason = reason; reason = newReason; } return cb(reason); } function callbackify(original) { if (typeof original !== 'function') { throw new TypeError('The "original" argument must be of type Function'); } // We DO NOT return the promise as it gives the user a false sense that // the promise is actually somehow related to the callback's execution // and that the callback throwing will reject the promise. function callbackified() { var args = []; for (var i = 0; i < arguments.length; i++) { args.push(arguments[i]); } var maybeCb = args.pop(); if (typeof maybeCb !== 'function') { throw new TypeError('The last argument must be of type Function'); } var self = this; var cb = function() { return maybeCb.apply(self, arguments); }; // In true node style we process the callback on `nextTick` with all the // implications (stack, `uncaughtException`, `async_hooks`) original.apply(this, args) .then(function(ret) { process.nextTick(cb.bind(null, null, ret)) }, function(rej) { process.nextTick(callbackifyOnRejected.bind(null, rej, cb)) }); } Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)); Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)); return callbackified; } exports.callbackify = callbackify; /***/ }), /***/ "./node_modules/which-typed-array/index.js": /*!*************************************************!*\ !*** ./node_modules/which-typed-array/index.js ***! \*************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var forEach = __webpack_require__(/*! for-each */ "./node_modules/for-each/index.js"); var availableTypedArrays = __webpack_require__(/*! available-typed-arrays */ "./node_modules/available-typed-arrays/index.js"); var callBind = __webpack_require__(/*! call-bind */ "./node_modules/call-bind/index.js"); var callBound = __webpack_require__(/*! call-bound */ "./node_modules/call-bound/index.js"); var gOPD = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js"); var getProto = __webpack_require__(/*! get-proto */ "./node_modules/get-proto/index.js"); var $toString = callBound('Object.prototype.toString'); var hasToStringTag = __webpack_require__(/*! has-tostringtag/shams */ "./node_modules/has-tostringtag/shams.js")(); var g = typeof globalThis === 'undefined' ? __webpack_require__.g : globalThis; var typedArrays = availableTypedArrays(); var $slice = callBound('String.prototype.slice'); /** @type {(array: readonly T[], value: unknown) => number} */ var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) { for (var i = 0; i < array.length; i += 1) { if (array[i] === value) { return i; } } return -1; }; /** @typedef {import('./types').Getter} Getter */ /** @type {import('./types').Cache} */ var cache = { __proto__: null }; if (hasToStringTag && gOPD && getProto) { forEach(typedArrays, function (typedArray) { var arr = new g[typedArray](); if (Symbol.toStringTag in arr && getProto) { var proto = getProto(arr); // @ts-expect-error TS won't narrow inside a closure var descriptor = gOPD(proto, Symbol.toStringTag); if (!descriptor && proto) { var superProto = getProto(proto); // @ts-expect-error TS won't narrow inside a closure descriptor = gOPD(superProto, Symbol.toStringTag); } // @ts-expect-error TODO: fix cache['$' + typedArray] = callBind(descriptor.get); } }); } else { forEach(typedArrays, function (typedArray) { var arr = new g[typedArray](); var fn = arr.slice || arr.set; if (fn) { cache[ /** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray) ] = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */ ( // @ts-expect-error TODO FIXME callBind(fn) ); } }); } /** @type {(value: object) => false | import('.').TypedArrayName} */ var tryTypedArrays = function tryAllTypedArrays(value) { /** @type {ReturnType} */ var found = false; forEach( /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */ (cache), /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ function (getter, typedArray) { if (!found) { try { // @ts-expect-error a throw is fine here if ('$' + getter(value) === typedArray) { found = /** @type {import('.').TypedArrayName} */ ($slice(typedArray, 1)); } } catch (e) { /**/ } } } ); return found; }; /** @type {(value: object) => false | import('.').TypedArrayName} */ var trySlices = function tryAllSlices(value) { /** @type {ReturnType} */ var found = false; forEach( /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */(cache), /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ function (getter, name) { if (!found) { try { // @ts-expect-error a throw is fine here getter(value); found = /** @type {import('.').TypedArrayName} */ ($slice(name, 1)); } catch (e) { /**/ } } } ); return found; }; /** @type {import('.')} */ module.exports = function whichTypedArray(value) { if (!value || typeof value !== 'object') { return false; } if (!hasToStringTag) { /** @type {string} */ var tag = $slice($toString(value), 8, -1); if ($indexOf(typedArrays, tag) > -1) { return tag; } if (tag !== 'Object') { return false; } // node < 0.6 hits here on real Typed Arrays return trySlices(value); } if (!gOPD) { return null; } // unknown engine return tryTypedArrays(value); }; /***/ }), /***/ "./node_modules/yallist/iterator.js": /*!******************************************!*\ !*** ./node_modules/yallist/iterator.js ***! \******************************************/ /***/ ((module) => { "use strict"; module.exports = function (Yallist) { Yallist.prototype[Symbol.iterator] = function* () { for (let walker = this.head; walker; walker = walker.next) { yield walker.value } } } /***/ }), /***/ "./node_modules/yallist/yallist.js": /*!*****************************************!*\ !*** ./node_modules/yallist/yallist.js ***! \*****************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; module.exports = Yallist Yallist.Node = Node Yallist.create = Yallist function Yallist (list) { var self = this if (!(self instanceof Yallist)) { self = new Yallist() } self.tail = null self.head = null self.length = 0 if (list && typeof list.forEach === 'function') { list.forEach(function (item) { self.push(item) }) } else if (arguments.length > 0) { for (var i = 0, l = arguments.length; i < l; i++) { self.push(arguments[i]) } } return self } Yallist.prototype.removeNode = function (node) { if (node.list !== this) { throw new Error('removing node which does not belong to this list') } var next = node.next var prev = node.prev if (next) { next.prev = prev } if (prev) { prev.next = next } if (node === this.head) { this.head = next } if (node === this.tail) { this.tail = prev } node.list.length-- node.next = null node.prev = null node.list = null return next } Yallist.prototype.unshiftNode = function (node) { if (node === this.head) { return } if (node.list) { node.list.removeNode(node) } var head = this.head node.list = this node.next = head if (head) { head.prev = node } this.head = node if (!this.tail) { this.tail = node } this.length++ } Yallist.prototype.pushNode = function (node) { if (node === this.tail) { return } if (node.list) { node.list.removeNode(node) } var tail = this.tail node.list = this node.prev = tail if (tail) { tail.next = node } this.tail = node if (!this.head) { this.head = node } this.length++ } Yallist.prototype.push = function () { for (var i = 0, l = arguments.length; i < l; i++) { push(this, arguments[i]) } return this.length } Yallist.prototype.unshift = function () { for (var i = 0, l = arguments.length; i < l; i++) { unshift(this, arguments[i]) } return this.length } Yallist.prototype.pop = function () { if (!this.tail) { return undefined } var res = this.tail.value this.tail = this.tail.prev if (this.tail) { this.tail.next = null } else { this.head = null } this.length-- return res } Yallist.prototype.shift = function () { if (!this.head) { return undefined } var res = this.head.value this.head = this.head.next if (this.head) { this.head.prev = null } else { this.tail = null } this.length-- return res } Yallist.prototype.forEach = function (fn, thisp) { thisp = thisp || this for (var walker = this.head, i = 0; walker !== null; i++) { fn.call(thisp, walker.value, i, this) walker = walker.next } } Yallist.prototype.forEachReverse = function (fn, thisp) { thisp = thisp || this for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { fn.call(thisp, walker.value, i, this) walker = walker.prev } } Yallist.prototype.get = function (n) { for (var i = 0, walker = this.head; walker !== null && i < n; i++) { // abort out of the list early if we hit a cycle walker = walker.next } if (i === n && walker !== null) { return walker.value } } Yallist.prototype.getReverse = function (n) { for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { // abort out of the list early if we hit a cycle walker = walker.prev } if (i === n && walker !== null) { return walker.value } } Yallist.prototype.map = function (fn, thisp) { thisp = thisp || this var res = new Yallist() for (var walker = this.head; walker !== null;) { res.push(fn.call(thisp, walker.value, this)) walker = walker.next } return res } Yallist.prototype.mapReverse = function (fn, thisp) { thisp = thisp || this var res = new Yallist() for (var walker = this.tail; walker !== null;) { res.push(fn.call(thisp, walker.value, this)) walker = walker.prev } return res } Yallist.prototype.reduce = function (fn, initial) { var acc var walker = this.head if (arguments.length > 1) { acc = initial } else if (this.head) { walker = this.head.next acc = this.head.value } else { throw new TypeError('Reduce of empty list with no initial value') } for (var i = 0; walker !== null; i++) { acc = fn(acc, walker.value, i) walker = walker.next } return acc } Yallist.prototype.reduceReverse = function (fn, initial) { var acc var walker = this.tail if (arguments.length > 1) { acc = initial } else if (this.tail) { walker = this.tail.prev acc = this.tail.value } else { throw new TypeError('Reduce of empty list with no initial value') } for (var i = this.length - 1; walker !== null; i--) { acc = fn(acc, walker.value, i) walker = walker.prev } return acc } Yallist.prototype.toArray = function () { var arr = new Array(this.length) for (var i = 0, walker = this.head; walker !== null; i++) { arr[i] = walker.value walker = walker.next } return arr } Yallist.prototype.toArrayReverse = function () { var arr = new Array(this.length) for (var i = 0, walker = this.tail; walker !== null; i++) { arr[i] = walker.value walker = walker.prev } return arr } Yallist.prototype.slice = function (from, to) { to = to || this.length if (to < 0) { to += this.length } from = from || 0 if (from < 0) { from += this.length } var ret = new Yallist() if (to < from || to < 0) { return ret } if (from < 0) { from = 0 } if (to > this.length) { to = this.length } for (var i = 0, walker = this.head; walker !== null && i < from; i++) { walker = walker.next } for (; walker !== null && i < to; i++, walker = walker.next) { ret.push(walker.value) } return ret } Yallist.prototype.sliceReverse = function (from, to) { to = to || this.length if (to < 0) { to += this.length } from = from || 0 if (from < 0) { from += this.length } var ret = new Yallist() if (to < from || to < 0) { return ret } if (from < 0) { from = 0 } if (to > this.length) { to = this.length } for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { walker = walker.prev } for (; walker !== null && i > from; i--, walker = walker.prev) { ret.push(walker.value) } return ret } Yallist.prototype.splice = function (start, deleteCount /*, ...nodes */) { if (start > this.length) { start = this.length - 1 } if (start < 0) { start = this.length + start; } for (var i = 0, walker = this.head; walker !== null && i < start; i++) { walker = walker.next } var ret = [] for (var i = 0; walker && i < deleteCount; i++) { ret.push(walker.value) walker = this.removeNode(walker) } if (walker === null) { walker = this.tail } if (walker !== this.head && walker !== this.tail) { walker = walker.prev } for (var i = 2; i < arguments.length; i++) { walker = insert(this, walker, arguments[i]) } return ret; } Yallist.prototype.reverse = function () { var head = this.head var tail = this.tail for (var walker = head; walker !== null; walker = walker.prev) { var p = walker.prev walker.prev = walker.next walker.next = p } this.head = tail this.tail = head return this } function insert (self, node, value) { var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self) if (inserted.next === null) { self.tail = inserted } if (inserted.prev === null) { self.head = inserted } self.length++ return inserted } function push (self, item) { self.tail = new Node(item, self.tail, null, self) if (!self.head) { self.head = self.tail } self.length++ } function unshift (self, item) { self.head = new Node(item, null, self.head, self) if (!self.tail) { self.tail = self.head } self.length++ } function Node (value, prev, next, list) { if (!(this instanceof Node)) { return new Node(value, prev, next, list) } this.list = list this.value = value if (prev) { prev.next = this this.prev = prev } else { this.prev = null } if (next) { next.prev = this this.next = next } else { this.next = null } } try { // add if support for Symbol.iterator is present __webpack_require__(/*! ./iterator.js */ "./node_modules/yallist/iterator.js")(Yallist) } catch (er) {} /***/ }), /***/ "?3465": /*!**********************!*\ !*** path (ignored) ***! \**********************/ /***/ (() => { /* (ignored) */ /***/ }), /***/ "?748e": /*!********************!*\ !*** fs (ignored) ***! \********************/ /***/ (() => { /* (ignored) */ /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ id: moduleId, /******/ loaded: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/global */ /******/ (() => { /******/ __webpack_require__.g = (function() { /******/ if (typeof globalThis === 'object') return globalThis; /******/ try { /******/ return this || new Function('return this')(); /******/ } catch (e) { /******/ if (typeof window === 'object') return window; /******/ } /******/ })(); /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/node module decorator */ /******/ (() => { /******/ __webpack_require__.nmd = (module) => { /******/ module.paths = []; /******/ if (!module.children) module.children = []; /******/ return module; /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. (() => { "use strict"; /*!******************************!*\ !*** ./src/babel-minify.mjs ***! \******************************/ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ runTest: () => (/* binding */ runTest) /* harmony export */ }); /* harmony import */ var babel_minify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babel-minify */ "./node_modules/babel-minify/lib/index.js"); // Copyright 2018 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. const payloads = [ { name: "speedometer-es2015-test-2.0.js", options: {}, }, ]; function runTest(fileData) { const testData = payloads.map(({ name, options }) => ({ payload: fileData[name], options, })); return testData.map(({ payload, options }) => babel_minify__WEBPACK_IMPORTED_MODULE_0__(payload, options)); } })(); self.WTBenchmark = __webpack_exports__; /******/ })() ;