Skip to content

Instantly share code, notes, and snippets.

@malerba118
Created July 15, 2018 00:12
Show Gist options
  • Select an option

  • Save malerba118/bae22da1c63875f6be84b97df0f005f8 to your computer and use it in GitHub Desktop.

Select an option

Save malerba118/bae22da1c63875f6be84b97df0f005f8 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom'), require('prop-types')) :
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom', 'prop-types'], factory) :
(factory((global['react-sandbox-editor'] = {}),global.React,global.ReactDOM,global.PropTypes));
}(this, (function (exports,React,require$$10,PropTypes) { 'use strict';
React = React && React.hasOwnProperty('default') ? React['default'] : React;
require$$10 = require$$10 && require$$10.hasOwnProperty('default') ? require$$10['default'] : require$$10;
PropTypes = PropTypes && PropTypes.hasOwnProperty('default') ? PropTypes['default'] : PropTypes;
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function unwrapExports (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
}
var babel = createCommonjsModule(function (module, exports) {
(function webpackUniversalModuleDefinition(root, factory) {
module.exports = factory();
})(typeof self !== 'undefined' ? self : commonjsGlobal, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 289);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;
(function (root) {
var freeExports = typeof exports == 'object' && exports;
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
root = freeGlobal;
}
var ERRORS = {
'rangeOrder': "A range\u2019s `stop` value must be greater than or equal " + 'to the `start` value.',
'codePointRange': 'Invalid code point value. Code points range from ' + 'U+000000 to U+10FFFF.'
};
var HIGH_SURROGATE_MIN = 0xD800;
var HIGH_SURROGATE_MAX = 0xDBFF;
var LOW_SURROGATE_MIN = 0xDC00;
var LOW_SURROGATE_MAX = 0xDFFF;
var regexNull = /\\x00([^0123456789]|$)/g;
var object = {};
var hasOwnProperty = object.hasOwnProperty;
var extend = function extend(destination, source) {
var key;
for (key in source) {
if (hasOwnProperty.call(source, key)) {
destination[key] = source[key];
}
}
return destination;
};
var forEach = function forEach(array, callback) {
var index = -1;
var length = array.length;
while (++index < length) {
callback(array[index], index);
}
};
var toString = object.toString;
var isArray = function isArray(value) {
return toString.call(value) == '[object Array]';
};
var isNumber = function isNumber(value) {
return typeof value == 'number' || toString.call(value) == '[object Number]';
};
var zeroes = '0000';
var pad = function pad(number, totalCharacters) {
var string = String(number);
return string.length < totalCharacters ? (zeroes + string).slice(-totalCharacters) : string;
};
var hex = function hex(number) {
return Number(number).toString(16).toUpperCase();
};
var slice = [].slice;
var dataFromCodePoints = function dataFromCodePoints(codePoints) {
var index = -1;
var length = codePoints.length;
var max = length - 1;
var result = [];
var isStart = true;
var tmp;
var previous = 0;
while (++index < length) {
tmp = codePoints[index];
if (isStart) {
result.push(tmp);
previous = tmp;
isStart = false;
} else {
if (tmp == previous + 1) {
if (index != max) {
previous = tmp;
continue;
} else {
isStart = true;
result.push(tmp + 1);
}
} else {
result.push(previous + 1, tmp);
previous = tmp;
}
}
}
if (!isStart) {
result.push(tmp + 1);
}
return result;
};
var dataRemove = function dataRemove(data, codePoint) {
var index = 0;
var start;
var end;
var length = data.length;
while (index < length) {
start = data[index];
end = data[index + 1];
if (codePoint >= start && codePoint < end) {
if (codePoint == start) {
if (end == start + 1) {
data.splice(index, 2);
return data;
} else {
data[index] = codePoint + 1;
return data;
}
} else if (codePoint == end - 1) {
data[index + 1] = codePoint;
return data;
} else {
data.splice(index, 2, start, codePoint, codePoint + 1, end);
return data;
}
}
index += 2;
}
return data;
};
var dataRemoveRange = function dataRemoveRange(data, rangeStart, rangeEnd) {
if (rangeEnd < rangeStart) {
throw Error(ERRORS.rangeOrder);
}
var index = 0;
var start;
var end;
while (index < data.length) {
start = data[index];
end = data[index + 1] - 1;
if (start > rangeEnd) {
return data;
}
if (rangeStart <= start && rangeEnd >= end) {
data.splice(index, 2);
continue;
}
if (rangeStart >= start && rangeEnd < end) {
if (rangeStart == start) {
data[index] = rangeEnd + 1;
data[index + 1] = end + 1;
return data;
}
data.splice(index, 2, start, rangeStart, rangeEnd + 1, end + 1);
return data;
}
if (rangeStart >= start && rangeStart <= end) {
data[index + 1] = rangeStart;
} else if (rangeEnd >= start && rangeEnd <= end) {
data[index] = rangeEnd + 1;
return data;
}
index += 2;
}
return data;
};
var dataAdd = function dataAdd(data, codePoint) {
var index = 0;
var start;
var end;
var lastIndex = null;
var length = data.length;
if (codePoint < 0x0 || codePoint > 0x10FFFF) {
throw RangeError(ERRORS.codePointRange);
}
while (index < length) {
start = data[index];
end = data[index + 1];
if (codePoint >= start && codePoint < end) {
return data;
}
if (codePoint == start - 1) {
data[index] = codePoint;
return data;
}
if (start > codePoint) {
data.splice(lastIndex != null ? lastIndex + 2 : 0, 0, codePoint, codePoint + 1);
return data;
}
if (codePoint == end) {
if (codePoint + 1 == data[index + 2]) {
data.splice(index, 4, start, data[index + 3]);
return data;
}
data[index + 1] = codePoint + 1;
return data;
}
lastIndex = index;
index += 2;
}
data.push(codePoint, codePoint + 1);
return data;
};
var dataAddData = function dataAddData(dataA, dataB) {
var index = 0;
var start;
var end;
var data = dataA.slice();
var length = dataB.length;
while (index < length) {
start = dataB[index];
end = dataB[index + 1] - 1;
if (start == end) {
data = dataAdd(data, start);
} else {
data = dataAddRange(data, start, end);
}
index += 2;
}
return data;
};
var dataRemoveData = function dataRemoveData(dataA, dataB) {
var index = 0;
var start;
var end;
var data = dataA.slice();
var length = dataB.length;
while (index < length) {
start = dataB[index];
end = dataB[index + 1] - 1;
if (start == end) {
data = dataRemove(data, start);
} else {
data = dataRemoveRange(data, start, end);
}
index += 2;
}
return data;
};
var dataAddRange = function dataAddRange(data, rangeStart, rangeEnd) {
if (rangeEnd < rangeStart) {
throw Error(ERRORS.rangeOrder);
}
if (rangeStart < 0x0 || rangeStart > 0x10FFFF || rangeEnd < 0x0 || rangeEnd > 0x10FFFF) {
throw RangeError(ERRORS.codePointRange);
}
var index = 0;
var start;
var end;
var added = false;
var length = data.length;
while (index < length) {
start = data[index];
end = data[index + 1];
if (added) {
if (start == rangeEnd + 1) {
data.splice(index - 1, 2);
return data;
}
if (start > rangeEnd) {
return data;
}
if (start >= rangeStart && start <= rangeEnd) {
if (end > rangeStart && end - 1 <= rangeEnd) {
data.splice(index, 2);
index -= 2;
} else {
data.splice(index - 1, 2);
index -= 2;
}
}
} else if (start == rangeEnd + 1) {
data[index] = rangeStart;
return data;
} else if (start > rangeEnd) {
data.splice(index, 0, rangeStart, rangeEnd + 1);
return data;
} else if (rangeStart >= start && rangeStart < end && rangeEnd + 1 <= end) {
return data;
} else if (rangeStart >= start && rangeStart < end || end == rangeStart) {
data[index + 1] = rangeEnd + 1;
added = true;
} else if (rangeStart <= start && rangeEnd + 1 >= end) {
data[index] = rangeStart;
data[index + 1] = rangeEnd + 1;
added = true;
}
index += 2;
}
if (!added) {
data.push(rangeStart, rangeEnd + 1);
}
return data;
};
var dataContains = function dataContains(data, codePoint) {
var index = 0;
var length = data.length;
var start = data[index];
var end = data[length - 1];
if (length >= 2) {
if (codePoint < start || codePoint > end) {
return false;
}
}
while (index < length) {
start = data[index];
end = data[index + 1];
if (codePoint >= start && codePoint < end) {
return true;
}
index += 2;
}
return false;
};
var dataIntersection = function dataIntersection(data, codePoints) {
var index = 0;
var length = codePoints.length;
var codePoint;
var result = [];
while (index < length) {
codePoint = codePoints[index];
if (dataContains(data, codePoint)) {
result.push(codePoint);
}
++index;
}
return dataFromCodePoints(result);
};
var dataIsEmpty = function dataIsEmpty(data) {
return !data.length;
};
var dataIsSingleton = function dataIsSingleton(data) {
return data.length == 2 && data[0] + 1 == data[1];
};
var dataToArray = function dataToArray(data) {
var index = 0;
var start;
var end;
var result = [];
var length = data.length;
while (index < length) {
start = data[index];
end = data[index + 1];
while (start < end) {
result.push(start);
++start;
}
index += 2;
}
return result;
};
var floor = Math.floor;
var highSurrogate = function highSurrogate(codePoint) {
return parseInt(floor((codePoint - 0x10000) / 0x400) + HIGH_SURROGATE_MIN, 10);
};
var lowSurrogate = function lowSurrogate(codePoint) {
return parseInt((codePoint - 0x10000) % 0x400 + LOW_SURROGATE_MIN, 10);
};
var stringFromCharCode = String.fromCharCode;
var codePointToString = function codePointToString(codePoint) {
var string;
if (codePoint == 0x09) {
string = '\\t';
} else if (codePoint == 0x0A) {
string = '\\n';
} else if (codePoint == 0x0C) {
string = '\\f';
} else if (codePoint == 0x0D) {
string = '\\r';
} else if (codePoint == 0x2D) {
string = '\\x2D';
} else if (codePoint == 0x5C) {
string = '\\\\';
} else if (codePoint == 0x24 || codePoint >= 0x28 && codePoint <= 0x2B || codePoint == 0x2E || codePoint == 0x2F || codePoint == 0x3F || codePoint >= 0x5B && codePoint <= 0x5E || codePoint >= 0x7B && codePoint <= 0x7D) {
string = '\\' + stringFromCharCode(codePoint);
} else if (codePoint >= 0x20 && codePoint <= 0x7E) {
string = stringFromCharCode(codePoint);
} else if (codePoint <= 0xFF) {
string = '\\x' + pad(hex(codePoint), 2);
} else {
string = "\\u" + pad(hex(codePoint), 4);
}
return string;
};
var codePointToStringUnicode = function codePointToStringUnicode(codePoint) {
if (codePoint <= 0xFFFF) {
return codePointToString(codePoint);
}
return "\\u{" + codePoint.toString(16).toUpperCase() + '}';
};
var symbolToCodePoint = function symbolToCodePoint(symbol) {
var length = symbol.length;
var first = symbol.charCodeAt(0);
var second;
if (first >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX && length > 1) {
second = symbol.charCodeAt(1);
return (first - HIGH_SURROGATE_MIN) * 0x400 + second - LOW_SURROGATE_MIN + 0x10000;
}
return first;
};
var createBMPCharacterClasses = function createBMPCharacterClasses(data) {
var result = '';
var index = 0;
var start;
var end;
var length = data.length;
if (dataIsSingleton(data)) {
return codePointToString(data[0]);
}
while (index < length) {
start = data[index];
end = data[index + 1] - 1;
if (start == end) {
result += codePointToString(start);
} else if (start + 1 == end) {
result += codePointToString(start) + codePointToString(end);
} else {
result += codePointToString(start) + '-' + codePointToString(end);
}
index += 2;
}
return '[' + result + ']';
};
var createUnicodeCharacterClasses = function createUnicodeCharacterClasses(data) {
var result = '';
var index = 0;
var start;
var end;
var length = data.length;
if (dataIsSingleton(data)) {
return codePointToStringUnicode(data[0]);
}
while (index < length) {
start = data[index];
end = data[index + 1] - 1;
if (start == end) {
result += codePointToStringUnicode(start);
} else if (start + 1 == end) {
result += codePointToStringUnicode(start) + codePointToStringUnicode(end);
} else {
result += codePointToStringUnicode(start) + '-' + codePointToStringUnicode(end);
}
index += 2;
}
return '[' + result + ']';
};
var splitAtBMP = function splitAtBMP(data) {
var loneHighSurrogates = [];
var loneLowSurrogates = [];
var bmp = [];
var astral = [];
var index = 0;
var start;
var end;
var length = data.length;
while (index < length) {
start = data[index];
end = data[index + 1] - 1;
if (start < HIGH_SURROGATE_MIN) {
if (end < HIGH_SURROGATE_MIN) {
bmp.push(start, end + 1);
}
if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {
bmp.push(start, HIGH_SURROGATE_MIN);
loneHighSurrogates.push(HIGH_SURROGATE_MIN, end + 1);
}
if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
bmp.push(start, HIGH_SURROGATE_MIN);
loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);
loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);
}
if (end > LOW_SURROGATE_MAX) {
bmp.push(start, HIGH_SURROGATE_MIN);
loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);
loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);
if (end <= 0xFFFF) {
bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
} else {
bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
astral.push(0xFFFF + 1, end + 1);
}
}
} else if (start >= HIGH_SURROGATE_MIN && start <= HIGH_SURROGATE_MAX) {
if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {
loneHighSurrogates.push(start, end + 1);
}
if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);
loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);
}
if (end > LOW_SURROGATE_MAX) {
loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);
loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);
if (end <= 0xFFFF) {
bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
} else {
bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
astral.push(0xFFFF + 1, end + 1);
}
}
} else if (start >= LOW_SURROGATE_MIN && start <= LOW_SURROGATE_MAX) {
if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
loneLowSurrogates.push(start, end + 1);
}
if (end > LOW_SURROGATE_MAX) {
loneLowSurrogates.push(start, LOW_SURROGATE_MAX + 1);
if (end <= 0xFFFF) {
bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
} else {
bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
astral.push(0xFFFF + 1, end + 1);
}
}
} else if (start > LOW_SURROGATE_MAX && start <= 0xFFFF) {
if (end <= 0xFFFF) {
bmp.push(start, end + 1);
} else {
bmp.push(start, 0xFFFF + 1);
astral.push(0xFFFF + 1, end + 1);
}
} else {
astral.push(start, end + 1);
}
index += 2;
}
return {
'loneHighSurrogates': loneHighSurrogates,
'loneLowSurrogates': loneLowSurrogates,
'bmp': bmp,
'astral': astral
};
};
var optimizeSurrogateMappings = function optimizeSurrogateMappings(surrogateMappings) {
var result = [];
var tmpLow = [];
var addLow = false;
var mapping;
var nextMapping;
var highSurrogates;
var lowSurrogates;
var nextHighSurrogates;
var nextLowSurrogates;
var index = -1;
var length = surrogateMappings.length;
while (++index < length) {
mapping = surrogateMappings[index];
nextMapping = surrogateMappings[index + 1];
if (!nextMapping) {
result.push(mapping);
continue;
}
highSurrogates = mapping[0];
lowSurrogates = mapping[1];
nextHighSurrogates = nextMapping[0];
nextLowSurrogates = nextMapping[1];
tmpLow = lowSurrogates;
while (nextHighSurrogates && highSurrogates[0] == nextHighSurrogates[0] && highSurrogates[1] == nextHighSurrogates[1]) {
if (dataIsSingleton(nextLowSurrogates)) {
tmpLow = dataAdd(tmpLow, nextLowSurrogates[0]);
} else {
tmpLow = dataAddRange(tmpLow, nextLowSurrogates[0], nextLowSurrogates[1] - 1);
}
++index;
mapping = surrogateMappings[index];
highSurrogates = mapping[0];
lowSurrogates = mapping[1];
nextMapping = surrogateMappings[index + 1];
nextHighSurrogates = nextMapping && nextMapping[0];
nextLowSurrogates = nextMapping && nextMapping[1];
addLow = true;
}
result.push([highSurrogates, addLow ? tmpLow : lowSurrogates]);
addLow = false;
}
return optimizeByLowSurrogates(result);
};
var optimizeByLowSurrogates = function optimizeByLowSurrogates(surrogateMappings) {
if (surrogateMappings.length == 1) {
return surrogateMappings;
}
var index = -1;
var innerIndex = -1;
while (++index < surrogateMappings.length) {
var mapping = surrogateMappings[index];
var lowSurrogates = mapping[1];
var lowSurrogateStart = lowSurrogates[0];
var lowSurrogateEnd = lowSurrogates[1];
innerIndex = index;
while (++innerIndex < surrogateMappings.length) {
var otherMapping = surrogateMappings[innerIndex];
var otherLowSurrogates = otherMapping[1];
var otherLowSurrogateStart = otherLowSurrogates[0];
var otherLowSurrogateEnd = otherLowSurrogates[1];
if (lowSurrogateStart == otherLowSurrogateStart && lowSurrogateEnd == otherLowSurrogateEnd) {
if (dataIsSingleton(otherMapping[0])) {
mapping[0] = dataAdd(mapping[0], otherMapping[0][0]);
} else {
mapping[0] = dataAddRange(mapping[0], otherMapping[0][0], otherMapping[0][1] - 1);
}
surrogateMappings.splice(innerIndex, 1);
--innerIndex;
}
}
}
return surrogateMappings;
};
var surrogateSet = function surrogateSet(data) {
if (!data.length) {
return [];
}
var index = 0;
var start;
var end;
var startHigh;
var startLow;
var endHigh;
var endLow;
var surrogateMappings = [];
var length = data.length;
while (index < length) {
start = data[index];
end = data[index + 1] - 1;
startHigh = highSurrogate(start);
startLow = lowSurrogate(start);
endHigh = highSurrogate(end);
endLow = lowSurrogate(end);
var startsWithLowestLowSurrogate = startLow == LOW_SURROGATE_MIN;
var endsWithHighestLowSurrogate = endLow == LOW_SURROGATE_MAX;
var complete = false;
if (startHigh == endHigh || startsWithLowestLowSurrogate && endsWithHighestLowSurrogate) {
surrogateMappings.push([[startHigh, endHigh + 1], [startLow, endLow + 1]]);
complete = true;
} else {
surrogateMappings.push([[startHigh, startHigh + 1], [startLow, LOW_SURROGATE_MAX + 1]]);
}
if (!complete && startHigh + 1 < endHigh) {
if (endsWithHighestLowSurrogate) {
surrogateMappings.push([[startHigh + 1, endHigh + 1], [LOW_SURROGATE_MIN, endLow + 1]]);
complete = true;
} else {
surrogateMappings.push([[startHigh + 1, endHigh], [LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1]]);
}
}
if (!complete) {
surrogateMappings.push([[endHigh, endHigh + 1], [LOW_SURROGATE_MIN, endLow + 1]]);
}
index += 2;
}
return optimizeSurrogateMappings(surrogateMappings);
};
var createSurrogateCharacterClasses = function createSurrogateCharacterClasses(surrogateMappings) {
var result = [];
forEach(surrogateMappings, function (surrogateMapping) {
var highSurrogates = surrogateMapping[0];
var lowSurrogates = surrogateMapping[1];
result.push(createBMPCharacterClasses(highSurrogates) + createBMPCharacterClasses(lowSurrogates));
});
return result.join('|');
};
var createCharacterClassesFromData = function createCharacterClassesFromData(data, bmpOnly, hasUnicodeFlag) {
if (hasUnicodeFlag) {
return createUnicodeCharacterClasses(data);
}
var result = [];
var parts = splitAtBMP(data);
var loneHighSurrogates = parts.loneHighSurrogates;
var loneLowSurrogates = parts.loneLowSurrogates;
var bmp = parts.bmp;
var astral = parts.astral;
var hasLoneHighSurrogates = !dataIsEmpty(loneHighSurrogates);
var hasLoneLowSurrogates = !dataIsEmpty(loneLowSurrogates);
var surrogateMappings = surrogateSet(astral);
if (bmpOnly) {
bmp = dataAddData(bmp, loneHighSurrogates);
hasLoneHighSurrogates = false;
bmp = dataAddData(bmp, loneLowSurrogates);
hasLoneLowSurrogates = false;
}
if (!dataIsEmpty(bmp)) {
result.push(createBMPCharacterClasses(bmp));
}
if (surrogateMappings.length) {
result.push(createSurrogateCharacterClasses(surrogateMappings));
}
if (hasLoneHighSurrogates) {
result.push(createBMPCharacterClasses(loneHighSurrogates) + "(?![\\uDC00-\\uDFFF])");
}
if (hasLoneLowSurrogates) {
result.push("(?:[^\\uD800-\\uDBFF]|^)" + createBMPCharacterClasses(loneLowSurrogates));
}
return result.join('|');
};
var regenerate = function regenerate(value) {
if (arguments.length > 1) {
value = slice.call(arguments);
}
if (this instanceof regenerate) {
this.data = [];
return value ? this.add(value) : this;
}
return new regenerate().add(value);
};
regenerate.version = '1.3.3';
var proto = regenerate.prototype;
extend(proto, {
'add': function add(value) {
var $this = this;
if (value == null) {
return $this;
}
if (value instanceof regenerate) {
$this.data = dataAddData($this.data, value.data);
return $this;
}
if (arguments.length > 1) {
value = slice.call(arguments);
}
if (isArray(value)) {
forEach(value, function (item) {
$this.add(item);
});
return $this;
}
$this.data = dataAdd($this.data, isNumber(value) ? value : symbolToCodePoint(value));
return $this;
},
'remove': function remove(value) {
var $this = this;
if (value == null) {
return $this;
}
if (value instanceof regenerate) {
$this.data = dataRemoveData($this.data, value.data);
return $this;
}
if (arguments.length > 1) {
value = slice.call(arguments);
}
if (isArray(value)) {
forEach(value, function (item) {
$this.remove(item);
});
return $this;
}
$this.data = dataRemove($this.data, isNumber(value) ? value : symbolToCodePoint(value));
return $this;
},
'addRange': function addRange(start, end) {
var $this = this;
$this.data = dataAddRange($this.data, isNumber(start) ? start : symbolToCodePoint(start), isNumber(end) ? end : symbolToCodePoint(end));
return $this;
},
'removeRange': function removeRange(start, end) {
var $this = this;
var startCodePoint = isNumber(start) ? start : symbolToCodePoint(start);
var endCodePoint = isNumber(end) ? end : symbolToCodePoint(end);
$this.data = dataRemoveRange($this.data, startCodePoint, endCodePoint);
return $this;
},
'intersection': function intersection(argument) {
var $this = this;
var array = argument instanceof regenerate ? dataToArray(argument.data) : argument;
$this.data = dataIntersection($this.data, array);
return $this;
},
'contains': function contains(codePoint) {
return dataContains(this.data, isNumber(codePoint) ? codePoint : symbolToCodePoint(codePoint));
},
'clone': function clone() {
var set = new regenerate();
set.data = this.data.slice(0);
return set;
},
'toString': function toString(options) {
var result = createCharacterClassesFromData(this.data, options ? options.bmpOnly : false, options ? options.hasUnicodeFlag : false);
if (!result) {
return '[]';
}
return result.replace(regexNull, '\\0$1');
},
'toRegExp': function toRegExp(flags) {
var pattern = this.toString(flags && flags.indexOf('u') != -1 ? {
'hasUnicodeFlag': true
} : null);
return RegExp(pattern, flags || '');
},
'valueOf': function valueOf() {
return dataToArray(this.data);
}
});
proto.toArray = proto.valueOf;
{
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
return regenerate;
}).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
})(this);
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22)(module), __webpack_require__(9)));
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;
(function (root) {
var freeExports = typeof exports == 'object' && exports;
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
root = freeGlobal;
}
var ERRORS = {
'rangeOrder': "A range\u2019s `stop` value must be greater than or equal " + 'to the `start` value.',
'codePointRange': 'Invalid code point value. Code points range from ' + 'U+000000 to U+10FFFF.'
};
var HIGH_SURROGATE_MIN = 0xD800;
var HIGH_SURROGATE_MAX = 0xDBFF;
var LOW_SURROGATE_MIN = 0xDC00;
var LOW_SURROGATE_MAX = 0xDFFF;
var regexNull = /\\x00([^0123456789]|$)/g;
var object = {};
var hasOwnProperty = object.hasOwnProperty;
var extend = function extend(destination, source) {
var key;
for (key in source) {
if (hasOwnProperty.call(source, key)) {
destination[key] = source[key];
}
}
return destination;
};
var forEach = function forEach(array, callback) {
var index = -1;
var length = array.length;
while (++index < length) {
callback(array[index], index);
}
};
var toString = object.toString;
var isArray = function isArray(value) {
return toString.call(value) == '[object Array]';
};
var isNumber = function isNumber(value) {
return typeof value == 'number' || toString.call(value) == '[object Number]';
};
var zeroes = '0000';
var pad = function pad(number, totalCharacters) {
var string = String(number);
return string.length < totalCharacters ? (zeroes + string).slice(-totalCharacters) : string;
};
var hex = function hex(number) {
return Number(number).toString(16).toUpperCase();
};
var slice = [].slice;
var dataFromCodePoints = function dataFromCodePoints(codePoints) {
var index = -1;
var length = codePoints.length;
var max = length - 1;
var result = [];
var isStart = true;
var tmp;
var previous = 0;
while (++index < length) {
tmp = codePoints[index];
if (isStart) {
result.push(tmp);
previous = tmp;
isStart = false;
} else {
if (tmp == previous + 1) {
if (index != max) {
previous = tmp;
continue;
} else {
isStart = true;
result.push(tmp + 1);
}
} else {
result.push(previous + 1, tmp);
previous = tmp;
}
}
}
if (!isStart) {
result.push(tmp + 1);
}
return result;
};
var dataRemove = function dataRemove(data, codePoint) {
var index = 0;
var start;
var end;
var length = data.length;
while (index < length) {
start = data[index];
end = data[index + 1];
if (codePoint >= start && codePoint < end) {
if (codePoint == start) {
if (end == start + 1) {
data.splice(index, 2);
return data;
} else {
data[index] = codePoint + 1;
return data;
}
} else if (codePoint == end - 1) {
data[index + 1] = codePoint;
return data;
} else {
data.splice(index, 2, start, codePoint, codePoint + 1, end);
return data;
}
}
index += 2;
}
return data;
};
var dataRemoveRange = function dataRemoveRange(data, rangeStart, rangeEnd) {
if (rangeEnd < rangeStart) {
throw Error(ERRORS.rangeOrder);
}
var index = 0;
var start;
var end;
while (index < data.length) {
start = data[index];
end = data[index + 1] - 1;
if (start > rangeEnd) {
return data;
}
if (rangeStart <= start && rangeEnd >= end) {
data.splice(index, 2);
continue;
}
if (rangeStart >= start && rangeEnd < end) {
if (rangeStart == start) {
data[index] = rangeEnd + 1;
data[index + 1] = end + 1;
return data;
}
data.splice(index, 2, start, rangeStart, rangeEnd + 1, end + 1);
return data;
}
if (rangeStart >= start && rangeStart <= end) {
data[index + 1] = rangeStart;
} else if (rangeEnd >= start && rangeEnd <= end) {
data[index] = rangeEnd + 1;
return data;
}
index += 2;
}
return data;
};
var dataAdd = function dataAdd(data, codePoint) {
var index = 0;
var start;
var end;
var lastIndex = null;
var length = data.length;
if (codePoint < 0x0 || codePoint > 0x10FFFF) {
throw RangeError(ERRORS.codePointRange);
}
while (index < length) {
start = data[index];
end = data[index + 1];
if (codePoint >= start && codePoint < end) {
return data;
}
if (codePoint == start - 1) {
data[index] = codePoint;
return data;
}
if (start > codePoint) {
data.splice(lastIndex != null ? lastIndex + 2 : 0, 0, codePoint, codePoint + 1);
return data;
}
if (codePoint == end) {
if (codePoint + 1 == data[index + 2]) {
data.splice(index, 4, start, data[index + 3]);
return data;
}
data[index + 1] = codePoint + 1;
return data;
}
lastIndex = index;
index += 2;
}
data.push(codePoint, codePoint + 1);
return data;
};
var dataAddData = function dataAddData(dataA, dataB) {
var index = 0;
var start;
var end;
var data = dataA.slice();
var length = dataB.length;
while (index < length) {
start = dataB[index];
end = dataB[index + 1] - 1;
if (start == end) {
data = dataAdd(data, start);
} else {
data = dataAddRange(data, start, end);
}
index += 2;
}
return data;
};
var dataRemoveData = function dataRemoveData(dataA, dataB) {
var index = 0;
var start;
var end;
var data = dataA.slice();
var length = dataB.length;
while (index < length) {
start = dataB[index];
end = dataB[index + 1] - 1;
if (start == end) {
data = dataRemove(data, start);
} else {
data = dataRemoveRange(data, start, end);
}
index += 2;
}
return data;
};
var dataAddRange = function dataAddRange(data, rangeStart, rangeEnd) {
if (rangeEnd < rangeStart) {
throw Error(ERRORS.rangeOrder);
}
if (rangeStart < 0x0 || rangeStart > 0x10FFFF || rangeEnd < 0x0 || rangeEnd > 0x10FFFF) {
throw RangeError(ERRORS.codePointRange);
}
var index = 0;
var start;
var end;
var added = false;
var length = data.length;
while (index < length) {
start = data[index];
end = data[index + 1];
if (added) {
if (start == rangeEnd + 1) {
data.splice(index - 1, 2);
return data;
}
if (start > rangeEnd) {
return data;
}
if (start >= rangeStart && start <= rangeEnd) {
if (end > rangeStart && end - 1 <= rangeEnd) {
data.splice(index, 2);
index -= 2;
} else {
data.splice(index - 1, 2);
index -= 2;
}
}
} else if (start == rangeEnd + 1) {
data[index] = rangeStart;
return data;
} else if (start > rangeEnd) {
data.splice(index, 0, rangeStart, rangeEnd + 1);
return data;
} else if (rangeStart >= start && rangeStart < end && rangeEnd + 1 <= end) {
return data;
} else if (rangeStart >= start && rangeStart < end || end == rangeStart) {
data[index + 1] = rangeEnd + 1;
added = true;
} else if (rangeStart <= start && rangeEnd + 1 >= end) {
data[index] = rangeStart;
data[index + 1] = rangeEnd + 1;
added = true;
}
index += 2;
}
if (!added) {
data.push(rangeStart, rangeEnd + 1);
}
return data;
};
var dataContains = function dataContains(data, codePoint) {
var index = 0;
var length = data.length;
var start = data[index];
var end = data[length - 1];
if (length >= 2) {
if (codePoint < start || codePoint > end) {
return false;
}
}
while (index < length) {
start = data[index];
end = data[index + 1];
if (codePoint >= start && codePoint < end) {
return true;
}
index += 2;
}
return false;
};
var dataIntersection = function dataIntersection(data, codePoints) {
var index = 0;
var length = codePoints.length;
var codePoint;
var result = [];
while (index < length) {
codePoint = codePoints[index];
if (dataContains(data, codePoint)) {
result.push(codePoint);
}
++index;
}
return dataFromCodePoints(result);
};
var dataIsEmpty = function dataIsEmpty(data) {
return !data.length;
};
var dataIsSingleton = function dataIsSingleton(data) {
return data.length == 2 && data[0] + 1 == data[1];
};
var dataToArray = function dataToArray(data) {
var index = 0;
var start;
var end;
var result = [];
var length = data.length;
while (index < length) {
start = data[index];
end = data[index + 1];
while (start < end) {
result.push(start);
++start;
}
index += 2;
}
return result;
};
var floor = Math.floor;
var highSurrogate = function highSurrogate(codePoint) {
return parseInt(floor((codePoint - 0x10000) / 0x400) + HIGH_SURROGATE_MIN, 10);
};
var lowSurrogate = function lowSurrogate(codePoint) {
return parseInt((codePoint - 0x10000) % 0x400 + LOW_SURROGATE_MIN, 10);
};
var stringFromCharCode = String.fromCharCode;
var codePointToString = function codePointToString(codePoint) {
var string;
if (codePoint == 0x09) {
string = '\\t';
} else if (codePoint == 0x0A) {
string = '\\n';
} else if (codePoint == 0x0C) {
string = '\\f';
} else if (codePoint == 0x0D) {
string = '\\r';
} else if (codePoint == 0x5C) {
string = '\\\\';
} else if (codePoint == 0x24 || codePoint >= 0x28 && codePoint <= 0x2B || codePoint >= 0x2D && codePoint <= 0x2F || codePoint == 0x3F || codePoint >= 0x5B && codePoint <= 0x5E || codePoint >= 0x7B && codePoint <= 0x7D) {
string = '\\' + stringFromCharCode(codePoint);
} else if (codePoint >= 0x20 && codePoint <= 0x7E) {
string = stringFromCharCode(codePoint);
} else if (codePoint <= 0xFF) {
string = '\\x' + pad(hex(codePoint), 2);
} else {
string = "\\u" + pad(hex(codePoint), 4);
}
return string;
};
var codePointToStringUnicode = function codePointToStringUnicode(codePoint) {
if (codePoint <= 0xFFFF) {
return codePointToString(codePoint);
}
return "\\u{" + codePoint.toString(16).toUpperCase() + '}';
};
var symbolToCodePoint = function symbolToCodePoint(symbol) {
var length = symbol.length;
var first = symbol.charCodeAt(0);
var second;
if (first >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX && length > 1) {
second = symbol.charCodeAt(1);
return (first - HIGH_SURROGATE_MIN) * 0x400 + second - LOW_SURROGATE_MIN + 0x10000;
}
return first;
};
var createBMPCharacterClasses = function createBMPCharacterClasses(data) {
var result = '';
var index = 0;
var start;
var end;
var length = data.length;
if (dataIsSingleton(data)) {
return codePointToString(data[0]);
}
while (index < length) {
start = data[index];
end = data[index + 1] - 1;
if (start == end) {
result += codePointToString(start);
} else if (start + 1 == end) {
result += codePointToString(start) + codePointToString(end);
} else {
result += codePointToString(start) + '-' + codePointToString(end);
}
index += 2;
}
return '[' + result + ']';
};
var createUnicodeCharacterClasses = function createUnicodeCharacterClasses(data) {
var result = '';
var index = 0;
var start;
var end;
var length = data.length;
if (dataIsSingleton(data)) {
return codePointToStringUnicode(data[0]);
}
while (index < length) {
start = data[index];
end = data[index + 1] - 1;
if (start == end) {
result += codePointToStringUnicode(start);
} else if (start + 1 == end) {
result += codePointToStringUnicode(start) + codePointToStringUnicode(end);
} else {
result += codePointToStringUnicode(start) + '-' + codePointToStringUnicode(end);
}
index += 2;
}
return '[' + result + ']';
};
var splitAtBMP = function splitAtBMP(data) {
var loneHighSurrogates = [];
var loneLowSurrogates = [];
var bmp = [];
var astral = [];
var index = 0;
var start;
var end;
var length = data.length;
while (index < length) {
start = data[index];
end = data[index + 1] - 1;
if (start < HIGH_SURROGATE_MIN) {
if (end < HIGH_SURROGATE_MIN) {
bmp.push(start, end + 1);
}
if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {
bmp.push(start, HIGH_SURROGATE_MIN);
loneHighSurrogates.push(HIGH_SURROGATE_MIN, end + 1);
}
if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
bmp.push(start, HIGH_SURROGATE_MIN);
loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);
loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);
}
if (end > LOW_SURROGATE_MAX) {
bmp.push(start, HIGH_SURROGATE_MIN);
loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);
loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);
if (end <= 0xFFFF) {
bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
} else {
bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
astral.push(0xFFFF + 1, end + 1);
}
}
} else if (start >= HIGH_SURROGATE_MIN && start <= HIGH_SURROGATE_MAX) {
if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {
loneHighSurrogates.push(start, end + 1);
}
if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);
loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);
}
if (end > LOW_SURROGATE_MAX) {
loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);
loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);
if (end <= 0xFFFF) {
bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
} else {
bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
astral.push(0xFFFF + 1, end + 1);
}
}
} else if (start >= LOW_SURROGATE_MIN && start <= LOW_SURROGATE_MAX) {
if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {
loneLowSurrogates.push(start, end + 1);
}
if (end > LOW_SURROGATE_MAX) {
loneLowSurrogates.push(start, LOW_SURROGATE_MAX + 1);
if (end <= 0xFFFF) {
bmp.push(LOW_SURROGATE_MAX + 1, end + 1);
} else {
bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);
astral.push(0xFFFF + 1, end + 1);
}
}
} else if (start > LOW_SURROGATE_MAX && start <= 0xFFFF) {
if (end <= 0xFFFF) {
bmp.push(start, end + 1);
} else {
bmp.push(start, 0xFFFF + 1);
astral.push(0xFFFF + 1, end + 1);
}
} else {
astral.push(start, end + 1);
}
index += 2;
}
return {
'loneHighSurrogates': loneHighSurrogates,
'loneLowSurrogates': loneLowSurrogates,
'bmp': bmp,
'astral': astral
};
};
var optimizeSurrogateMappings = function optimizeSurrogateMappings(surrogateMappings) {
var result = [];
var tmpLow = [];
var addLow = false;
var mapping;
var nextMapping;
var highSurrogates;
var lowSurrogates;
var nextHighSurrogates;
var nextLowSurrogates;
var index = -1;
var length = surrogateMappings.length;
while (++index < length) {
mapping = surrogateMappings[index];
nextMapping = surrogateMappings[index + 1];
if (!nextMapping) {
result.push(mapping);
continue;
}
highSurrogates = mapping[0];
lowSurrogates = mapping[1];
nextHighSurrogates = nextMapping[0];
nextLowSurrogates = nextMapping[1];
tmpLow = lowSurrogates;
while (nextHighSurrogates && highSurrogates[0] == nextHighSurrogates[0] && highSurrogates[1] == nextHighSurrogates[1]) {
if (dataIsSingleton(nextLowSurrogates)) {
tmpLow = dataAdd(tmpLow, nextLowSurrogates[0]);
} else {
tmpLow = dataAddRange(tmpLow, nextLowSurrogates[0], nextLowSurrogates[1] - 1);
}
++index;
mapping = surrogateMappings[index];
highSurrogates = mapping[0];
lowSurrogates = mapping[1];
nextMapping = surrogateMappings[index + 1];
nextHighSurrogates = nextMapping && nextMapping[0];
nextLowSurrogates = nextMapping && nextMapping[1];
addLow = true;
}
result.push([highSurrogates, addLow ? tmpLow : lowSurrogates]);
addLow = false;
}
return optimizeByLowSurrogates(result);
};
var optimizeByLowSurrogates = function optimizeByLowSurrogates(surrogateMappings) {
if (surrogateMappings.length == 1) {
return surrogateMappings;
}
var index = -1;
var innerIndex = -1;
while (++index < surrogateMappings.length) {
var mapping = surrogateMappings[index];
var lowSurrogates = mapping[1];
var lowSurrogateStart = lowSurrogates[0];
var lowSurrogateEnd = lowSurrogates[1];
innerIndex = index;
while (++innerIndex < surrogateMappings.length) {
var otherMapping = surrogateMappings[innerIndex];
var otherLowSurrogates = otherMapping[1];
var otherLowSurrogateStart = otherLowSurrogates[0];
var otherLowSurrogateEnd = otherLowSurrogates[1];
if (lowSurrogateStart == otherLowSurrogateStart && lowSurrogateEnd == otherLowSurrogateEnd) {
if (dataIsSingleton(otherMapping[0])) {
mapping[0] = dataAdd(mapping[0], otherMapping[0][0]);
} else {
mapping[0] = dataAddRange(mapping[0], otherMapping[0][0], otherMapping[0][1] - 1);
}
surrogateMappings.splice(innerIndex, 1);
--innerIndex;
}
}
}
return surrogateMappings;
};
var surrogateSet = function surrogateSet(data) {
if (!data.length) {
return [];
}
var index = 0;
var start;
var end;
var startHigh;
var startLow;
var endHigh;
var endLow;
var surrogateMappings = [];
var length = data.length;
while (index < length) {
start = data[index];
end = data[index + 1] - 1;
startHigh = highSurrogate(start);
startLow = lowSurrogate(start);
endHigh = highSurrogate(end);
endLow = lowSurrogate(end);
var startsWithLowestLowSurrogate = startLow == LOW_SURROGATE_MIN;
var endsWithHighestLowSurrogate = endLow == LOW_SURROGATE_MAX;
var complete = false;
if (startHigh == endHigh || startsWithLowestLowSurrogate && endsWithHighestLowSurrogate) {
surrogateMappings.push([[startHigh, endHigh + 1], [startLow, endLow + 1]]);
complete = true;
} else {
surrogateMappings.push([[startHigh, startHigh + 1], [startLow, LOW_SURROGATE_MAX + 1]]);
}
if (!complete && startHigh + 1 < endHigh) {
if (endsWithHighestLowSurrogate) {
surrogateMappings.push([[startHigh + 1, endHigh + 1], [LOW_SURROGATE_MIN, endLow + 1]]);
complete = true;
} else {
surrogateMappings.push([[startHigh + 1, endHigh], [LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1]]);
}
}
if (!complete) {
surrogateMappings.push([[endHigh, endHigh + 1], [LOW_SURROGATE_MIN, endLow + 1]]);
}
index += 2;
}
return optimizeSurrogateMappings(surrogateMappings);
};
var createSurrogateCharacterClasses = function createSurrogateCharacterClasses(surrogateMappings) {
var result = [];
forEach(surrogateMappings, function (surrogateMapping) {
var highSurrogates = surrogateMapping[0];
var lowSurrogates = surrogateMapping[1];
result.push(createBMPCharacterClasses(highSurrogates) + createBMPCharacterClasses(lowSurrogates));
});
return result.join('|');
};
var createCharacterClassesFromData = function createCharacterClassesFromData(data, bmpOnly, hasUnicodeFlag) {
if (hasUnicodeFlag) {
return createUnicodeCharacterClasses(data);
}
var result = [];
var parts = splitAtBMP(data);
var loneHighSurrogates = parts.loneHighSurrogates;
var loneLowSurrogates = parts.loneLowSurrogates;
var bmp = parts.bmp;
var astral = parts.astral;
var hasLoneHighSurrogates = !dataIsEmpty(loneHighSurrogates);
var hasLoneLowSurrogates = !dataIsEmpty(loneLowSurrogates);
var surrogateMappings = surrogateSet(astral);
if (bmpOnly) {
bmp = dataAddData(bmp, loneHighSurrogates);
hasLoneHighSurrogates = false;
bmp = dataAddData(bmp, loneLowSurrogates);
hasLoneLowSurrogates = false;
}
if (!dataIsEmpty(bmp)) {
result.push(createBMPCharacterClasses(bmp));
}
if (surrogateMappings.length) {
result.push(createSurrogateCharacterClasses(surrogateMappings));
}
if (hasLoneHighSurrogates) {
result.push(createBMPCharacterClasses(loneHighSurrogates) + "(?![\\uDC00-\\uDFFF])");
}
if (hasLoneLowSurrogates) {
result.push("(?:[^\\uD800-\\uDBFF]|^)" + createBMPCharacterClasses(loneLowSurrogates));
}
return result.join('|');
};
var regenerate = function regenerate(value) {
if (arguments.length > 1) {
value = slice.call(arguments);
}
if (this instanceof regenerate) {
this.data = [];
return value ? this.add(value) : this;
}
return new regenerate().add(value);
};
regenerate.version = '1.3.3';
var proto = regenerate.prototype;
extend(proto, {
'add': function add(value) {
var $this = this;
if (value == null) {
return $this;
}
if (value instanceof regenerate) {
$this.data = dataAddData($this.data, value.data);
return $this;
}
if (arguments.length > 1) {
value = slice.call(arguments);
}
if (isArray(value)) {
forEach(value, function (item) {
$this.add(item);
});
return $this;
}
$this.data = dataAdd($this.data, isNumber(value) ? value : symbolToCodePoint(value));
return $this;
},
'remove': function remove(value) {
var $this = this;
if (value == null) {
return $this;
}
if (value instanceof regenerate) {
$this.data = dataRemoveData($this.data, value.data);
return $this;
}
if (arguments.length > 1) {
value = slice.call(arguments);
}
if (isArray(value)) {
forEach(value, function (item) {
$this.remove(item);
});
return $this;
}
$this.data = dataRemove($this.data, isNumber(value) ? value : symbolToCodePoint(value));
return $this;
},
'addRange': function addRange(start, end) {
var $this = this;
$this.data = dataAddRange($this.data, isNumber(start) ? start : symbolToCodePoint(start), isNumber(end) ? end : symbolToCodePoint(end));
return $this;
},
'removeRange': function removeRange(start, end) {
var $this = this;
var startCodePoint = isNumber(start) ? start : symbolToCodePoint(start);
var endCodePoint = isNumber(end) ? end : symbolToCodePoint(end);
$this.data = dataRemoveRange($this.data, startCodePoint, endCodePoint);
return $this;
},
'intersection': function intersection(argument) {
var $this = this;
var array = argument instanceof regenerate ? dataToArray(argument.data) : argument;
$this.data = dataIntersection($this.data, array);
return $this;
},
'contains': function contains(codePoint) {
return dataContains(this.data, isNumber(codePoint) ? codePoint : symbolToCodePoint(codePoint));
},
'clone': function clone() {
var set = new regenerate();
set.data = this.data.slice(0);
return set;
},
'toString': function toString(options) {
var result = createCharacterClassesFromData(this.data, options ? options.bmpOnly : false, options ? options.hasUnicodeFlag : false);
if (!result) {
return '[]';
}
return result.replace(regexNull, '\\0$1');
},
'toRegExp': function toRegExp(flags) {
var pattern = this.toString(flags && flags.indexOf('u') != -1 ? {
'hasUnicodeFlag': true
} : null);
return RegExp(pattern, flags || '');
},
'valueOf': function valueOf() {
return dataToArray(this.data);
}
});
proto.toArray = proto.valueOf;
{
!(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
return regenerate;
}).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}
})(this);
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22)(module), __webpack_require__(9)));
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.declare = declare;
function declare(builder) {
return function (api, options, dirname) {
if (!api.assertVersion) {
api = Object.assign(copyApiObject(api), {
assertVersion: function assertVersion(range) {
throwVersionError(range, api.version);
}
});
}
return builder(api, options || {}, dirname);
};
}
function copyApiObject(api) {
var proto = null;
if (typeof api.version === "string" && /^7\./.test(api.version)) {
proto = Object.getPrototypeOf(api);
if (proto && (!has(proto, "version") || !has(proto, "transform") || !has(proto, "template") || !has(proto, "types"))) {
proto = null;
}
}
return Object.assign({}, proto, api);
}
function has(obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key);
}
function throwVersionError(range, version) {
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.");
}
var limit = Error.stackTraceLimit;
if (typeof limit === "number" && limit < 25) {
Error.stackTraceLimit = 25;
}
var err;
if (version.slice(0, 2) === "7.") {
err = new Error("Requires Babel \"^7.0.0-beta.41\", but was loaded with \"" + version + "\". " + "You'll need to update your @babel/core version.");
} else {
err = new Error("Requires Babel \"" + range + "\", but was loaded with \"" + 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: version,
range: range
});
}
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Plugin = Plugin;
Object.defineProperty(exports, "File", {
enumerable: true,
get: function get() {
return _file.default;
}
});
Object.defineProperty(exports, "buildExternalHelpers", {
enumerable: true,
get: function get() {
return _buildExternalHelpers.default;
}
});
Object.defineProperty(exports, "resolvePlugin", {
enumerable: true,
get: function get() {
return _files.resolvePlugin;
}
});
Object.defineProperty(exports, "resolvePreset", {
enumerable: true,
get: function get() {
return _files.resolvePreset;
}
});
Object.defineProperty(exports, "version", {
enumerable: true,
get: function get() {
return _package.version;
}
});
Object.defineProperty(exports, "getEnv", {
enumerable: true,
get: function get() {
return _environment.getEnv;
}
});
Object.defineProperty(exports, "traverse", {
enumerable: true,
get: function get() {
return _traverse().default;
}
});
Object.defineProperty(exports, "template", {
enumerable: true,
get: function get() {
return _template().default;
}
});
Object.defineProperty(exports, "createConfigItem", {
enumerable: true,
get: function get() {
return _item.createConfigItem;
}
});
Object.defineProperty(exports, "loadPartialConfig", {
enumerable: true,
get: function get() {
return _config.loadPartialConfig;
}
});
Object.defineProperty(exports, "loadOptions", {
enumerable: true,
get: function get() {
return _config.loadOptions;
}
});
Object.defineProperty(exports, "transform", {
enumerable: true,
get: function get() {
return _transform.transform;
}
});
Object.defineProperty(exports, "transformSync", {
enumerable: true,
get: function get() {
return _transform.transformSync;
}
});
Object.defineProperty(exports, "transformAsync", {
enumerable: true,
get: function get() {
return _transform.transformAsync;
}
});
Object.defineProperty(exports, "transformFile", {
enumerable: true,
get: function get() {
return _transformFile.transformFile;
}
});
Object.defineProperty(exports, "transformFileSync", {
enumerable: true,
get: function get() {
return _transformFile.transformFileSync;
}
});
Object.defineProperty(exports, "transformFileAsync", {
enumerable: true,
get: function get() {
return _transformFile.transformFileAsync;
}
});
Object.defineProperty(exports, "transformFromAst", {
enumerable: true,
get: function get() {
return _transformAst.transformFromAst;
}
});
Object.defineProperty(exports, "transformFromAstSync", {
enumerable: true,
get: function get() {
return _transformAst.transformFromAstSync;
}
});
Object.defineProperty(exports, "transformFromAstAsync", {
enumerable: true,
get: function get() {
return _transformAst.transformFromAstAsync;
}
});
Object.defineProperty(exports, "parse", {
enumerable: true,
get: function get() {
return _parse.parse;
}
});
Object.defineProperty(exports, "parseSync", {
enumerable: true,
get: function get() {
return _parse.parseSync;
}
});
Object.defineProperty(exports, "parseAsync", {
enumerable: true,
get: function get() {
return _parse.parseAsync;
}
});
exports.types = exports.OptionManager = exports.DEFAULT_EXTENSIONS = void 0;
var _file = _interopRequireDefault(__webpack_require__(119));
var _buildExternalHelpers = _interopRequireDefault(__webpack_require__(486));
var _files = __webpack_require__(102);
var _package = __webpack_require__(487);
var _environment = __webpack_require__(175);
function _types() {
var data = _interopRequireWildcard(__webpack_require__(4));
_types = function _types() {
return data;
};
return data;
}
Object.defineProperty(exports, "types", {
enumerable: true,
get: function get() {
return _types();
}
});
function _traverse() {
var data = _interopRequireDefault(__webpack_require__(12));
_traverse = function _traverse() {
return data;
};
return data;
}
function _template() {
var data = _interopRequireDefault(__webpack_require__(29));
_template = function _template() {
return data;
};
return data;
}
var _item = __webpack_require__(64);
var _config = __webpack_require__(45);
var _transform = __webpack_require__(586);
var _transformFile = __webpack_require__(624);
var _transformAst = __webpack_require__(625);
var _parse = __webpack_require__(626);
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
var DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs"]);
exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS;
var OptionManager = function () {
function OptionManager() {}
var _proto = OptionManager.prototype;
_proto.init = function init(opts) {
return (0, _config.loadOptions)(opts);
};
return OptionManager;
}();
exports.OptionManager = OptionManager;
function Plugin(alias) {
throw new Error("The (" + alias + ") Babel 5 plugin is being run with an unsupported Babel version.");
}
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _exportNames = {
react: true,
assertNode: true,
createTypeAnnotationBasedOnTypeof: true,
createUnionTypeAnnotation: true,
cloneNode: true,
clone: true,
cloneDeep: 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,
toSequenceExpression: true,
toStatement: true,
valueToNode: true,
appendToMemberExpression: true,
inherits: true,
prependToMemberExpression: true,
removeProperties: true,
removePropertiesDeep: true,
removeTypeDuplicates: true,
getBindingIdentifiers: true,
getOuterBindingIdentifiers: true,
traverse: true,
traverseFast: true,
shallowEqual: true,
is: true,
isBinding: true,
isBlockScoped: true,
isImmutable: true,
isLet: true,
isNode: true,
isNodesEquivalent: true,
isReferenced: true,
isScope: true,
isSpecifierDefault: true,
isType: true,
isValidES3Identifier: true,
isValidIdentifier: true,
isVar: true,
matchesPattern: true,
validate: true,
buildMatchMemberExpression: true
};
Object.defineProperty(exports, "assertNode", {
enumerable: true,
get: function get() {
return _assertNode.default;
}
});
Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", {
enumerable: true,
get: function get() {
return _createTypeAnnotationBasedOnTypeof.default;
}
});
Object.defineProperty(exports, "createUnionTypeAnnotation", {
enumerable: true,
get: function get() {
return _createUnionTypeAnnotation.default;
}
});
Object.defineProperty(exports, "cloneNode", {
enumerable: true,
get: function get() {
return _cloneNode.default;
}
});
Object.defineProperty(exports, "clone", {
enumerable: true,
get: function get() {
return _clone.default;
}
});
Object.defineProperty(exports, "cloneDeep", {
enumerable: true,
get: function get() {
return _cloneDeep.default;
}
});
Object.defineProperty(exports, "cloneWithoutLoc", {
enumerable: true,
get: function get() {
return _cloneWithoutLoc.default;
}
});
Object.defineProperty(exports, "addComment", {
enumerable: true,
get: function get() {
return _addComment.default;
}
});
Object.defineProperty(exports, "addComments", {
enumerable: true,
get: function get() {
return _addComments.default;
}
});
Object.defineProperty(exports, "inheritInnerComments", {
enumerable: true,
get: function get() {
return _inheritInnerComments.default;
}
});
Object.defineProperty(exports, "inheritLeadingComments", {
enumerable: true,
get: function get() {
return _inheritLeadingComments.default;
}
});
Object.defineProperty(exports, "inheritsComments", {
enumerable: true,
get: function get() {
return _inheritsComments.default;
}
});
Object.defineProperty(exports, "inheritTrailingComments", {
enumerable: true,
get: function get() {
return _inheritTrailingComments.default;
}
});
Object.defineProperty(exports, "removeComments", {
enumerable: true,
get: function get() {
return _removeComments.default;
}
});
Object.defineProperty(exports, "ensureBlock", {
enumerable: true,
get: function get() {
return _ensureBlock.default;
}
});
Object.defineProperty(exports, "toBindingIdentifierName", {
enumerable: true,
get: function get() {
return _toBindingIdentifierName.default;
}
});
Object.defineProperty(exports, "toBlock", {
enumerable: true,
get: function get() {
return _toBlock.default;
}
});
Object.defineProperty(exports, "toComputedKey", {
enumerable: true,
get: function get() {
return _toComputedKey.default;
}
});
Object.defineProperty(exports, "toExpression", {
enumerable: true,
get: function get() {
return _toExpression.default;
}
});
Object.defineProperty(exports, "toIdentifier", {
enumerable: true,
get: function get() {
return _toIdentifier.default;
}
});
Object.defineProperty(exports, "toKeyAlias", {
enumerable: true,
get: function get() {
return _toKeyAlias.default;
}
});
Object.defineProperty(exports, "toSequenceExpression", {
enumerable: true,
get: function get() {
return _toSequenceExpression.default;
}
});
Object.defineProperty(exports, "toStatement", {
enumerable: true,
get: function get() {
return _toStatement.default;
}
});
Object.defineProperty(exports, "valueToNode", {
enumerable: true,
get: function get() {
return _valueToNode.default;
}
});
Object.defineProperty(exports, "appendToMemberExpression", {
enumerable: true,
get: function get() {
return _appendToMemberExpression.default;
}
});
Object.defineProperty(exports, "inherits", {
enumerable: true,
get: function get() {
return _inherits.default;
}
});
Object.defineProperty(exports, "prependToMemberExpression", {
enumerable: true,
get: function get() {
return _prependToMemberExpression.default;
}
});
Object.defineProperty(exports, "removeProperties", {
enumerable: true,
get: function get() {
return _removeProperties.default;
}
});
Object.defineProperty(exports, "removePropertiesDeep", {
enumerable: true,
get: function get() {
return _removePropertiesDeep.default;
}
});
Object.defineProperty(exports, "removeTypeDuplicates", {
enumerable: true,
get: function get() {
return _removeTypeDuplicates.default;
}
});
Object.defineProperty(exports, "getBindingIdentifiers", {
enumerable: true,
get: function get() {
return _getBindingIdentifiers.default;
}
});
Object.defineProperty(exports, "getOuterBindingIdentifiers", {
enumerable: true,
get: function get() {
return _getOuterBindingIdentifiers.default;
}
});
Object.defineProperty(exports, "traverse", {
enumerable: true,
get: function get() {
return _traverse.default;
}
});
Object.defineProperty(exports, "traverseFast", {
enumerable: true,
get: function get() {
return _traverseFast.default;
}
});
Object.defineProperty(exports, "shallowEqual", {
enumerable: true,
get: function get() {
return _shallowEqual.default;
}
});
Object.defineProperty(exports, "is", {
enumerable: true,
get: function get() {
return _is.default;
}
});
Object.defineProperty(exports, "isBinding", {
enumerable: true,
get: function get() {
return _isBinding.default;
}
});
Object.defineProperty(exports, "isBlockScoped", {
enumerable: true,
get: function get() {
return _isBlockScoped.default;
}
});
Object.defineProperty(exports, "isImmutable", {
enumerable: true,
get: function get() {
return _isImmutable.default;
}
});
Object.defineProperty(exports, "isLet", {
enumerable: true,
get: function get() {
return _isLet.default;
}
});
Object.defineProperty(exports, "isNode", {
enumerable: true,
get: function get() {
return _isNode.default;
}
});
Object.defineProperty(exports, "isNodesEquivalent", {
enumerable: true,
get: function get() {
return _isNodesEquivalent.default;
}
});
Object.defineProperty(exports, "isReferenced", {
enumerable: true,
get: function get() {
return _isReferenced.default;
}
});
Object.defineProperty(exports, "isScope", {
enumerable: true,
get: function get() {
return _isScope.default;
}
});
Object.defineProperty(exports, "isSpecifierDefault", {
enumerable: true,
get: function get() {
return _isSpecifierDefault.default;
}
});
Object.defineProperty(exports, "isType", {
enumerable: true,
get: function get() {
return _isType.default;
}
});
Object.defineProperty(exports, "isValidES3Identifier", {
enumerable: true,
get: function get() {
return _isValidES3Identifier.default;
}
});
Object.defineProperty(exports, "isValidIdentifier", {
enumerable: true,
get: function get() {
return _isValidIdentifier.default;
}
});
Object.defineProperty(exports, "isVar", {
enumerable: true,
get: function get() {
return _isVar.default;
}
});
Object.defineProperty(exports, "matchesPattern", {
enumerable: true,
get: function get() {
return _matchesPattern.default;
}
});
Object.defineProperty(exports, "validate", {
enumerable: true,
get: function get() {
return _validate.default;
}
});
Object.defineProperty(exports, "buildMatchMemberExpression", {
enumerable: true,
get: function get() {
return _buildMatchMemberExpression.default;
}
});
exports.react = void 0;
var _isReactComponent = _interopRequireDefault(__webpack_require__(291));
var _isCompatTag = _interopRequireDefault(__webpack_require__(292));
var _buildChildren = _interopRequireDefault(__webpack_require__(293));
var _assertNode = _interopRequireDefault(__webpack_require__(364));
var _generated = __webpack_require__(365);
Object.keys(_generated).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _generated[key];
}
});
});
var _createTypeAnnotationBasedOnTypeof = _interopRequireDefault(__webpack_require__(366));
var _createUnionTypeAnnotation = _interopRequireDefault(__webpack_require__(367));
var _generated2 = __webpack_require__(8);
Object.keys(_generated2).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _generated2[key];
}
});
});
var _cloneNode = _interopRequireDefault(__webpack_require__(41));
var _clone = _interopRequireDefault(__webpack_require__(145));
var _cloneDeep = _interopRequireDefault(__webpack_require__(368));
var _cloneWithoutLoc = _interopRequireDefault(__webpack_require__(369));
var _addComment = _interopRequireDefault(__webpack_require__(370));
var _addComments = _interopRequireDefault(__webpack_require__(146));
var _inheritInnerComments = _interopRequireDefault(__webpack_require__(147));
var _inheritLeadingComments = _interopRequireDefault(__webpack_require__(150));
var _inheritsComments = _interopRequireDefault(__webpack_require__(151));
var _inheritTrailingComments = _interopRequireDefault(__webpack_require__(152));
var _removeComments = _interopRequireDefault(__webpack_require__(382));
var _generated3 = __webpack_require__(383);
Object.keys(_generated3).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _generated3[key];
}
});
});
var _constants = __webpack_require__(27);
Object.keys(_constants).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _constants[key];
}
});
});
var _ensureBlock = _interopRequireDefault(__webpack_require__(384));
var _toBindingIdentifierName = _interopRequireDefault(__webpack_require__(385));
var _toBlock = _interopRequireDefault(__webpack_require__(153));
var _toComputedKey = _interopRequireDefault(__webpack_require__(386));
var _toExpression = _interopRequireDefault(__webpack_require__(387));
var _toIdentifier = _interopRequireDefault(__webpack_require__(154));
var _toKeyAlias = _interopRequireDefault(__webpack_require__(388));
var _toSequenceExpression = _interopRequireDefault(__webpack_require__(389));
var _toStatement = _interopRequireDefault(__webpack_require__(391));
var _valueToNode = _interopRequireDefault(__webpack_require__(392));
var _definitions = __webpack_require__(15);
Object.keys(_definitions).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _definitions[key];
}
});
});
var _appendToMemberExpression = _interopRequireDefault(__webpack_require__(396));
var _inherits = _interopRequireDefault(__webpack_require__(397));
var _prependToMemberExpression = _interopRequireDefault(__webpack_require__(398));
var _removeProperties = _interopRequireDefault(__webpack_require__(157));
var _removePropertiesDeep = _interopRequireDefault(__webpack_require__(155));
var _removeTypeDuplicates = _interopRequireDefault(__webpack_require__(144));
var _getBindingIdentifiers = _interopRequireDefault(__webpack_require__(57));
var _getOuterBindingIdentifiers = _interopRequireDefault(__webpack_require__(399));
var _traverse = _interopRequireDefault(__webpack_require__(400));
var _traverseFast = _interopRequireDefault(__webpack_require__(156));
var _shallowEqual = _interopRequireDefault(__webpack_require__(72));
var _is = _interopRequireDefault(__webpack_require__(87));
var _isBinding = _interopRequireDefault(__webpack_require__(401));
var _isBlockScoped = _interopRequireDefault(__webpack_require__(402));
var _isImmutable = _interopRequireDefault(__webpack_require__(403));
var _isLet = _interopRequireDefault(__webpack_require__(158));
var _isNode = _interopRequireDefault(__webpack_require__(143));
var _isNodesEquivalent = _interopRequireDefault(__webpack_require__(404));
var _isReferenced = _interopRequireDefault(__webpack_require__(405));
var _isScope = _interopRequireDefault(__webpack_require__(406));
var _isSpecifierDefault = _interopRequireDefault(__webpack_require__(407));
var _isType = _interopRequireDefault(__webpack_require__(88));
var _isValidES3Identifier = _interopRequireDefault(__webpack_require__(408));
var _isValidIdentifier = _interopRequireDefault(__webpack_require__(40));
var _isVar = _interopRequireDefault(__webpack_require__(409));
var _matchesPattern = _interopRequireDefault(__webpack_require__(123));
var _validate = _interopRequireDefault(__webpack_require__(142));
var _buildMatchMemberExpression = _interopRequireDefault(__webpack_require__(122));
var _generated4 = __webpack_require__(5);
Object.keys(_generated4).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _generated4[key];
}
});
});
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
var react = {
isReactComponent: _isReactComponent.default,
isCompatTag: _isCompatTag.default,
buildChildren: _buildChildren.default
};
exports.react = react;
/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isArrayExpression = isArrayExpression;
exports.isAssignmentExpression = isAssignmentExpression;
exports.isBinaryExpression = isBinaryExpression;
exports.isInterpreterDirective = isInterpreterDirective;
exports.isDirective = isDirective;
exports.isDirectiveLiteral = isDirectiveLiteral;
exports.isBlockStatement = isBlockStatement;
exports.isBreakStatement = isBreakStatement;
exports.isCallExpression = isCallExpression;
exports.isCatchClause = isCatchClause;
exports.isConditionalExpression = isConditionalExpression;
exports.isContinueStatement = isContinueStatement;
exports.isDebuggerStatement = isDebuggerStatement;
exports.isDoWhileStatement = isDoWhileStatement;
exports.isEmptyStatement = isEmptyStatement;
exports.isExpressionStatement = isExpressionStatement;
exports.isFile = isFile;
exports.isForInStatement = isForInStatement;
exports.isForStatement = isForStatement;
exports.isFunctionDeclaration = isFunctionDeclaration;
exports.isFunctionExpression = isFunctionExpression;
exports.isIdentifier = isIdentifier;
exports.isIfStatement = isIfStatement;
exports.isLabeledStatement = isLabeledStatement;
exports.isStringLiteral = isStringLiteral;
exports.isNumericLiteral = isNumericLiteral;
exports.isNullLiteral = isNullLiteral;
exports.isBooleanLiteral = isBooleanLiteral;
exports.isRegExpLiteral = isRegExpLiteral;
exports.isLogicalExpression = isLogicalExpression;
exports.isMemberExpression = isMemberExpression;
exports.isNewExpression = isNewExpression;
exports.isProgram = isProgram;
exports.isObjectExpression = isObjectExpression;
exports.isObjectMethod = isObjectMethod;
exports.isObjectProperty = isObjectProperty;
exports.isRestElement = isRestElement;
exports.isReturnStatement = isReturnStatement;
exports.isSequenceExpression = isSequenceExpression;
exports.isSwitchCase = isSwitchCase;
exports.isSwitchStatement = isSwitchStatement;
exports.isThisExpression = isThisExpression;
exports.isThrowStatement = isThrowStatement;
exports.isTryStatement = isTryStatement;
exports.isUnaryExpression = isUnaryExpression;
exports.isUpdateExpression = isUpdateExpression;
exports.isVariableDeclaration = isVariableDeclaration;
exports.isVariableDeclarator = isVariableDeclarator;
exports.isWhileStatement = isWhileStatement;
exports.isWithStatement = isWithStatement;
exports.isAssignmentPattern = isAssignmentPattern;
exports.isArrayPattern = isArrayPattern;
exports.isArrowFunctionExpression = isArrowFunctionExpression;
exports.isClassBody = isClassBody;
exports.isClassDeclaration = isClassDeclaration;
exports.isClassExpression = isClassExpression;
exports.isExportAllDeclaration = isExportAllDeclaration;
exports.isExportDefaultDeclaration = isExportDefaultDeclaration;
exports.isExportNamedDeclaration = isExportNamedDeclaration;
exports.isExportSpecifier = isExportSpecifier;
exports.isForOfStatement = isForOfStatement;
exports.isImportDeclaration = isImportDeclaration;
exports.isImportDefaultSpecifier = isImportDefaultSpecifier;
exports.isImportNamespaceSpecifier = isImportNamespaceSpecifier;
exports.isImportSpecifier = isImportSpecifier;
exports.isMetaProperty = isMetaProperty;
exports.isClassMethod = isClassMethod;
exports.isObjectPattern = isObjectPattern;
exports.isSpreadElement = isSpreadElement;
exports.isSuper = isSuper;
exports.isTaggedTemplateExpression = isTaggedTemplateExpression;
exports.isTemplateElement = isTemplateElement;
exports.isTemplateLiteral = isTemplateLiteral;
exports.isYieldExpression = isYieldExpression;
exports.isAnyTypeAnnotation = isAnyTypeAnnotation;
exports.isArrayTypeAnnotation = isArrayTypeAnnotation;
exports.isBooleanTypeAnnotation = isBooleanTypeAnnotation;
exports.isBooleanLiteralTypeAnnotation = isBooleanLiteralTypeAnnotation;
exports.isNullLiteralTypeAnnotation = isNullLiteralTypeAnnotation;
exports.isClassImplements = isClassImplements;
exports.isDeclareClass = isDeclareClass;
exports.isDeclareFunction = isDeclareFunction;
exports.isDeclareInterface = isDeclareInterface;
exports.isDeclareModule = isDeclareModule;
exports.isDeclareModuleExports = isDeclareModuleExports;
exports.isDeclareTypeAlias = isDeclareTypeAlias;
exports.isDeclareOpaqueType = isDeclareOpaqueType;
exports.isDeclareVariable = isDeclareVariable;
exports.isDeclareExportDeclaration = isDeclareExportDeclaration;
exports.isDeclareExportAllDeclaration = isDeclareExportAllDeclaration;
exports.isDeclaredPredicate = isDeclaredPredicate;
exports.isExistsTypeAnnotation = isExistsTypeAnnotation;
exports.isFunctionTypeAnnotation = isFunctionTypeAnnotation;
exports.isFunctionTypeParam = isFunctionTypeParam;
exports.isGenericTypeAnnotation = isGenericTypeAnnotation;
exports.isInferredPredicate = isInferredPredicate;
exports.isInterfaceExtends = isInterfaceExtends;
exports.isInterfaceDeclaration = isInterfaceDeclaration;
exports.isInterfaceTypeAnnotation = isInterfaceTypeAnnotation;
exports.isIntersectionTypeAnnotation = isIntersectionTypeAnnotation;
exports.isMixedTypeAnnotation = isMixedTypeAnnotation;
exports.isEmptyTypeAnnotation = isEmptyTypeAnnotation;
exports.isNullableTypeAnnotation = isNullableTypeAnnotation;
exports.isNumberLiteralTypeAnnotation = isNumberLiteralTypeAnnotation;
exports.isNumberTypeAnnotation = isNumberTypeAnnotation;
exports.isObjectTypeAnnotation = isObjectTypeAnnotation;
exports.isObjectTypeInternalSlot = isObjectTypeInternalSlot;
exports.isObjectTypeCallProperty = isObjectTypeCallProperty;
exports.isObjectTypeIndexer = isObjectTypeIndexer;
exports.isObjectTypeProperty = isObjectTypeProperty;
exports.isObjectTypeSpreadProperty = isObjectTypeSpreadProperty;
exports.isOpaqueType = isOpaqueType;
exports.isQualifiedTypeIdentifier = isQualifiedTypeIdentifier;
exports.isStringLiteralTypeAnnotation = isStringLiteralTypeAnnotation;
exports.isStringTypeAnnotation = isStringTypeAnnotation;
exports.isThisTypeAnnotation = isThisTypeAnnotation;
exports.isTupleTypeAnnotation = isTupleTypeAnnotation;
exports.isTypeofTypeAnnotation = isTypeofTypeAnnotation;
exports.isTypeAlias = isTypeAlias;
exports.isTypeAnnotation = isTypeAnnotation;
exports.isTypeCastExpression = isTypeCastExpression;
exports.isTypeParameter = isTypeParameter;
exports.isTypeParameterDeclaration = isTypeParameterDeclaration;
exports.isTypeParameterInstantiation = isTypeParameterInstantiation;
exports.isUnionTypeAnnotation = isUnionTypeAnnotation;
exports.isVariance = isVariance;
exports.isVoidTypeAnnotation = isVoidTypeAnnotation;
exports.isJSXAttribute = isJSXAttribute;
exports.isJSXClosingElement = isJSXClosingElement;
exports.isJSXElement = isJSXElement;
exports.isJSXEmptyExpression = isJSXEmptyExpression;
exports.isJSXExpressionContainer = isJSXExpressionContainer;
exports.isJSXSpreadChild = isJSXSpreadChild;
exports.isJSXIdentifier = isJSXIdentifier;
exports.isJSXMemberExpression = isJSXMemberExpression;
exports.isJSXNamespacedName = isJSXNamespacedName;
exports.isJSXOpeningElement = isJSXOpeningElement;
exports.isJSXSpreadAttribute = isJSXSpreadAttribute;
exports.isJSXText = isJSXText;
exports.isJSXFragment = isJSXFragment;
exports.isJSXOpeningFragment = isJSXOpeningFragment;
exports.isJSXClosingFragment = isJSXClosingFragment;
exports.isNoop = isNoop;
exports.isParenthesizedExpression = isParenthesizedExpression;
exports.isAwaitExpression = isAwaitExpression;
exports.isBindExpression = isBindExpression;
exports.isClassProperty = isClassProperty;
exports.isOptionalMemberExpression = isOptionalMemberExpression;
exports.isOptionalCallExpression = isOptionalCallExpression;
exports.isClassPrivateProperty = isClassPrivateProperty;
exports.isImport = isImport;
exports.isDecorator = isDecorator;
exports.isDoExpression = isDoExpression;
exports.isExportDefaultSpecifier = isExportDefaultSpecifier;
exports.isExportNamespaceSpecifier = isExportNamespaceSpecifier;
exports.isPrivateName = isPrivateName;
exports.isBigIntLiteral = isBigIntLiteral;
exports.isTSParameterProperty = isTSParameterProperty;
exports.isTSDeclareFunction = isTSDeclareFunction;
exports.isTSDeclareMethod = isTSDeclareMethod;
exports.isTSQualifiedName = isTSQualifiedName;
exports.isTSCallSignatureDeclaration = isTSCallSignatureDeclaration;
exports.isTSConstructSignatureDeclaration = isTSConstructSignatureDeclaration;
exports.isTSPropertySignature = isTSPropertySignature;
exports.isTSMethodSignature = isTSMethodSignature;
exports.isTSIndexSignature = isTSIndexSignature;
exports.isTSAnyKeyword = isTSAnyKeyword;
exports.isTSNumberKeyword = isTSNumberKeyword;
exports.isTSObjectKeyword = isTSObjectKeyword;
exports.isTSBooleanKeyword = isTSBooleanKeyword;
exports.isTSStringKeyword = isTSStringKeyword;
exports.isTSSymbolKeyword = isTSSymbolKeyword;
exports.isTSVoidKeyword = isTSVoidKeyword;
exports.isTSUndefinedKeyword = isTSUndefinedKeyword;
exports.isTSNullKeyword = isTSNullKeyword;
exports.isTSNeverKeyword = isTSNeverKeyword;
exports.isTSThisType = isTSThisType;
exports.isTSFunctionType = isTSFunctionType;
exports.isTSConstructorType = isTSConstructorType;
exports.isTSTypeReference = isTSTypeReference;
exports.isTSTypePredicate = isTSTypePredicate;
exports.isTSTypeQuery = isTSTypeQuery;
exports.isTSTypeLiteral = isTSTypeLiteral;
exports.isTSArrayType = isTSArrayType;
exports.isTSTupleType = isTSTupleType;
exports.isTSUnionType = isTSUnionType;
exports.isTSIntersectionType = isTSIntersectionType;
exports.isTSConditionalType = isTSConditionalType;
exports.isTSInferType = isTSInferType;
exports.isTSParenthesizedType = isTSParenthesizedType;
exports.isTSTypeOperator = isTSTypeOperator;
exports.isTSIndexedAccessType = isTSIndexedAccessType;
exports.isTSMappedType = isTSMappedType;
exports.isTSLiteralType = isTSLiteralType;
exports.isTSExpressionWithTypeArguments = isTSExpressionWithTypeArguments;
exports.isTSInterfaceDeclaration = isTSInterfaceDeclaration;
exports.isTSInterfaceBody = isTSInterfaceBody;
exports.isTSTypeAliasDeclaration = isTSTypeAliasDeclaration;
exports.isTSAsExpression = isTSAsExpression;
exports.isTSTypeAssertion = isTSTypeAssertion;
exports.isTSEnumDeclaration = isTSEnumDeclaration;
exports.isTSEnumMember = isTSEnumMember;
exports.isTSModuleDeclaration = isTSModuleDeclaration;
exports.isTSModuleBlock = isTSModuleBlock;
exports.isTSImportEqualsDeclaration = isTSImportEqualsDeclaration;
exports.isTSExternalModuleReference = isTSExternalModuleReference;
exports.isTSNonNullExpression = isTSNonNullExpression;
exports.isTSExportAssignment = isTSExportAssignment;
exports.isTSNamespaceExportDeclaration = isTSNamespaceExportDeclaration;
exports.isTSTypeAnnotation = isTSTypeAnnotation;
exports.isTSTypeParameterInstantiation = isTSTypeParameterInstantiation;
exports.isTSTypeParameterDeclaration = isTSTypeParameterDeclaration;
exports.isTSTypeParameter = isTSTypeParameter;
exports.isExpression = isExpression;
exports.isBinary = isBinary;
exports.isScopable = isScopable;
exports.isBlockParent = isBlockParent;
exports.isBlock = isBlock;
exports.isStatement = isStatement;
exports.isTerminatorless = isTerminatorless;
exports.isCompletionStatement = isCompletionStatement;
exports.isConditional = isConditional;
exports.isLoop = isLoop;
exports.isWhile = isWhile;
exports.isExpressionWrapper = isExpressionWrapper;
exports.isFor = isFor;
exports.isForXStatement = isForXStatement;
exports.isFunction = isFunction;
exports.isFunctionParent = isFunctionParent;
exports.isPureish = isPureish;
exports.isDeclaration = isDeclaration;
exports.isPatternLike = isPatternLike;
exports.isLVal = isLVal;
exports.isTSEntityName = isTSEntityName;
exports.isLiteral = isLiteral;
exports.isImmutable = isImmutable;
exports.isUserWhitespacable = isUserWhitespacable;
exports.isMethod = isMethod;
exports.isObjectMember = isObjectMember;
exports.isProperty = isProperty;
exports.isUnaryLike = isUnaryLike;
exports.isPattern = isPattern;
exports.isClass = isClass;
exports.isModuleDeclaration = isModuleDeclaration;
exports.isExportDeclaration = isExportDeclaration;
exports.isModuleSpecifier = isModuleSpecifier;
exports.isFlow = isFlow;
exports.isFlowType = isFlowType;
exports.isFlowBaseAnnotation = isFlowBaseAnnotation;
exports.isFlowDeclaration = isFlowDeclaration;
exports.isFlowPredicate = isFlowPredicate;
exports.isJSX = isJSX;
exports.isPrivate = isPrivate;
exports.isTSTypeElement = isTSTypeElement;
exports.isTSType = isTSType;
exports.isNumberLiteral = isNumberLiteral;
exports.isRegexLiteral = isRegexLiteral;
exports.isRestProperty = isRestProperty;
exports.isSpreadProperty = isSpreadProperty;
var _shallowEqual = _interopRequireDefault(__webpack_require__(72));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function isArrayExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ArrayExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isAssignmentExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "AssignmentExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isBinaryExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "BinaryExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isInterpreterDirective(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "InterpreterDirective") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDirective(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Directive") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDirectiveLiteral(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DirectiveLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isBlockStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "BlockStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isBreakStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "BreakStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isCallExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "CallExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isCatchClause(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "CatchClause") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isConditionalExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ConditionalExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isContinueStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ContinueStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDebuggerStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DebuggerStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDoWhileStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DoWhileStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isEmptyStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "EmptyStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isExpressionStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ExpressionStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isFile(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "File") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isForInStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ForInStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isForStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ForStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isFunctionDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "FunctionDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isFunctionExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "FunctionExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isIdentifier(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Identifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isIfStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "IfStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isLabeledStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "LabeledStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isStringLiteral(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "StringLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isNumericLiteral(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "NumericLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isNullLiteral(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "NullLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isBooleanLiteral(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "BooleanLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isRegExpLiteral(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "RegExpLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isLogicalExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "LogicalExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isMemberExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "MemberExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isNewExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "NewExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isProgram(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Program") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isObjectExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ObjectExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isObjectMethod(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ObjectMethod") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isObjectProperty(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ObjectProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isRestElement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "RestElement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isReturnStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ReturnStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isSequenceExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "SequenceExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isSwitchCase(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "SwitchCase") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isSwitchStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "SwitchStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isThisExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ThisExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isThrowStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ThrowStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTryStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TryStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isUnaryExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "UnaryExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isUpdateExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "UpdateExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isVariableDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "VariableDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isVariableDeclarator(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "VariableDeclarator") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isWhileStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "WhileStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isWithStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "WithStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isAssignmentPattern(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "AssignmentPattern") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isArrayPattern(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ArrayPattern") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isArrowFunctionExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ArrowFunctionExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isClassBody(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ClassBody") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isClassDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ClassDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isClassExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ClassExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isExportAllDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ExportAllDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isExportDefaultDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ExportDefaultDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isExportNamedDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ExportNamedDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isExportSpecifier(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ExportSpecifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isForOfStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ForOfStatement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isImportDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ImportDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isImportDefaultSpecifier(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ImportDefaultSpecifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isImportNamespaceSpecifier(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ImportNamespaceSpecifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isImportSpecifier(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ImportSpecifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isMetaProperty(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "MetaProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isClassMethod(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ClassMethod") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isObjectPattern(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ObjectPattern") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isSpreadElement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "SpreadElement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isSuper(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Super") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTaggedTemplateExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TaggedTemplateExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTemplateElement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TemplateElement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTemplateLiteral(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TemplateLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isYieldExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "YieldExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isAnyTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "AnyTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isArrayTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ArrayTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isBooleanTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "BooleanTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isBooleanLiteralTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "BooleanLiteralTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isNullLiteralTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "NullLiteralTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isClassImplements(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ClassImplements") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDeclareClass(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DeclareClass") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDeclareFunction(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DeclareFunction") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDeclareInterface(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DeclareInterface") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDeclareModule(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DeclareModule") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDeclareModuleExports(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DeclareModuleExports") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDeclareTypeAlias(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DeclareTypeAlias") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDeclareOpaqueType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DeclareOpaqueType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDeclareVariable(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DeclareVariable") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDeclareExportDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DeclareExportDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDeclareExportAllDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DeclareExportAllDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDeclaredPredicate(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DeclaredPredicate") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isExistsTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ExistsTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isFunctionTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "FunctionTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isFunctionTypeParam(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "FunctionTypeParam") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isGenericTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "GenericTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isInferredPredicate(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "InferredPredicate") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isInterfaceExtends(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "InterfaceExtends") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isInterfaceDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "InterfaceDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isInterfaceTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "InterfaceTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isIntersectionTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "IntersectionTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isMixedTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "MixedTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isEmptyTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "EmptyTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isNullableTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "NullableTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isNumberLiteralTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "NumberLiteralTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isNumberTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "NumberTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isObjectTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ObjectTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isObjectTypeInternalSlot(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ObjectTypeInternalSlot") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isObjectTypeCallProperty(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ObjectTypeCallProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isObjectTypeIndexer(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ObjectTypeIndexer") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isObjectTypeProperty(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ObjectTypeProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isObjectTypeSpreadProperty(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ObjectTypeSpreadProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isOpaqueType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "OpaqueType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isQualifiedTypeIdentifier(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "QualifiedTypeIdentifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isStringLiteralTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "StringLiteralTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isStringTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "StringTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isThisTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ThisTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTupleTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TupleTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTypeofTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TypeofTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTypeAlias(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TypeAlias") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTypeCastExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TypeCastExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTypeParameter(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TypeParameter") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTypeParameterDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TypeParameterDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTypeParameterInstantiation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TypeParameterInstantiation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isUnionTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "UnionTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isVariance(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Variance") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isVoidTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "VoidTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXAttribute(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXAttribute") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXClosingElement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXClosingElement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXElement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXElement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXEmptyExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXEmptyExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXExpressionContainer(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXExpressionContainer") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXSpreadChild(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXSpreadChild") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXIdentifier(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXIdentifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXMemberExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXMemberExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXNamespacedName(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXNamespacedName") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXOpeningElement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXOpeningElement") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXSpreadAttribute(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXSpreadAttribute") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXText(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXText") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXFragment(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXFragment") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXOpeningFragment(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXOpeningFragment") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSXClosingFragment(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSXClosingFragment") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isNoop(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Noop") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isParenthesizedExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ParenthesizedExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isAwaitExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "AwaitExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isBindExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "BindExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isClassProperty(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ClassProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isOptionalMemberExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "OptionalMemberExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isOptionalCallExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "OptionalCallExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isClassPrivateProperty(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ClassPrivateProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isImport(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Import") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDecorator(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Decorator") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDoExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "DoExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isExportDefaultSpecifier(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ExportDefaultSpecifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isExportNamespaceSpecifier(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ExportNamespaceSpecifier") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isPrivateName(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "PrivateName") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isBigIntLiteral(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "BigIntLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSParameterProperty(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSParameterProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSDeclareFunction(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSDeclareFunction") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSDeclareMethod(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSDeclareMethod") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSQualifiedName(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSQualifiedName") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSCallSignatureDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSCallSignatureDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSConstructSignatureDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSConstructSignatureDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSPropertySignature(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSPropertySignature") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSMethodSignature(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSMethodSignature") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSIndexSignature(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSIndexSignature") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSAnyKeyword(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSAnyKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSNumberKeyword(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSNumberKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSObjectKeyword(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSObjectKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSBooleanKeyword(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSBooleanKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSStringKeyword(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSStringKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSSymbolKeyword(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSSymbolKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSVoidKeyword(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSVoidKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSUndefinedKeyword(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSUndefinedKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSNullKeyword(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSNullKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSNeverKeyword(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSNeverKeyword") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSThisType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSThisType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSFunctionType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSFunctionType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSConstructorType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSConstructorType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSTypeReference(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSTypeReference") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSTypePredicate(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSTypePredicate") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSTypeQuery(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSTypeQuery") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSTypeLiteral(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSTypeLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSArrayType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSArrayType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSTupleType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSTupleType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSUnionType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSUnionType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSIntersectionType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSIntersectionType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSConditionalType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSConditionalType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSInferType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSInferType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSParenthesizedType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSParenthesizedType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSTypeOperator(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSTypeOperator") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSIndexedAccessType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSIndexedAccessType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSMappedType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSMappedType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSLiteralType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSLiteralType") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSExpressionWithTypeArguments(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSExpressionWithTypeArguments") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSInterfaceDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSInterfaceDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSInterfaceBody(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSInterfaceBody") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSTypeAliasDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSTypeAliasDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSAsExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSAsExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSTypeAssertion(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSTypeAssertion") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSEnumDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSEnumDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSEnumMember(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSEnumMember") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSModuleDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSModuleDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSModuleBlock(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSModuleBlock") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSImportEqualsDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSImportEqualsDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSExternalModuleReference(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSExternalModuleReference") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSNonNullExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSNonNullExpression") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSExportAssignment(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSExportAssignment") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSNamespaceExportDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSNamespaceExportDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSTypeAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSTypeAnnotation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSTypeParameterInstantiation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSTypeParameterInstantiation") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSTypeParameterDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSTypeParameterDeclaration") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSTypeParameter(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSTypeParameter") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isExpression(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Expression" || "ArrayExpression" === nodeType || "AssignmentExpression" === nodeType || "BinaryExpression" === nodeType || "CallExpression" === nodeType || "ConditionalExpression" === nodeType || "FunctionExpression" === nodeType || "Identifier" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "LogicalExpression" === nodeType || "MemberExpression" === nodeType || "NewExpression" === nodeType || "ObjectExpression" === nodeType || "SequenceExpression" === nodeType || "ThisExpression" === nodeType || "UnaryExpression" === nodeType || "UpdateExpression" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassExpression" === nodeType || "MetaProperty" === nodeType || "Super" === nodeType || "TaggedTemplateExpression" === nodeType || "TemplateLiteral" === nodeType || "YieldExpression" === nodeType || "TypeCastExpression" === nodeType || "JSXElement" === nodeType || "JSXFragment" === nodeType || "ParenthesizedExpression" === nodeType || "AwaitExpression" === nodeType || "BindExpression" === nodeType || "OptionalMemberExpression" === nodeType || "OptionalCallExpression" === nodeType || "Import" === nodeType || "DoExpression" === nodeType || "BigIntLiteral" === nodeType || "TSAsExpression" === nodeType || "TSTypeAssertion" === nodeType || "TSNonNullExpression" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isBinary(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Binary" || "BinaryExpression" === nodeType || "LogicalExpression" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isScopable(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Scopable" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassDeclaration" === nodeType || "ClassExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isBlockParent(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "BlockParent" || "BlockStatement" === nodeType || "CatchClause" === nodeType || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "Program" === nodeType || "ObjectMethod" === nodeType || "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isBlock(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Block" || "BlockStatement" === nodeType || "Program" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Statement" || "BlockStatement" === nodeType || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "DebuggerStatement" === nodeType || "DoWhileStatement" === nodeType || "EmptyStatement" === nodeType || "ExpressionStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "FunctionDeclaration" === nodeType || "IfStatement" === nodeType || "LabeledStatement" === nodeType || "ReturnStatement" === nodeType || "SwitchStatement" === nodeType || "ThrowStatement" === nodeType || "TryStatement" === nodeType || "VariableDeclaration" === nodeType || "WhileStatement" === nodeType || "WithStatement" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ForOfStatement" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType || "TSImportEqualsDeclaration" === nodeType || "TSExportAssignment" === nodeType || "TSNamespaceExportDeclaration" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTerminatorless(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Terminatorless" || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType || "YieldExpression" === nodeType || "AwaitExpression" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isCompletionStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "CompletionStatement" || "BreakStatement" === nodeType || "ContinueStatement" === nodeType || "ReturnStatement" === nodeType || "ThrowStatement" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isConditional(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Conditional" || "ConditionalExpression" === nodeType || "IfStatement" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isLoop(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Loop" || "DoWhileStatement" === nodeType || "ForInStatement" === nodeType || "ForStatement" === nodeType || "WhileStatement" === nodeType || "ForOfStatement" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isWhile(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "While" || "DoWhileStatement" === nodeType || "WhileStatement" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isExpressionWrapper(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ExpressionWrapper" || "ExpressionStatement" === nodeType || "TypeCastExpression" === nodeType || "ParenthesizedExpression" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isFor(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "For" || "ForInStatement" === nodeType || "ForStatement" === nodeType || "ForOfStatement" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isForXStatement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ForXStatement" || "ForInStatement" === nodeType || "ForOfStatement" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isFunction(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Function" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isFunctionParent(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "FunctionParent" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "ObjectMethod" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassMethod" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isPureish(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Pureish" || "FunctionDeclaration" === nodeType || "FunctionExpression" === nodeType || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "ArrowFunctionExpression" === nodeType || "ClassDeclaration" === nodeType || "ClassExpression" === nodeType || "BigIntLiteral" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Declaration" || "FunctionDeclaration" === nodeType || "VariableDeclaration" === nodeType || "ClassDeclaration" === nodeType || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || "TSEnumDeclaration" === nodeType || "TSModuleDeclaration" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isPatternLike(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "PatternLike" || "Identifier" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isLVal(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "LVal" || "Identifier" === nodeType || "MemberExpression" === nodeType || "RestElement" === nodeType || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType || "TSParameterProperty" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSEntityName(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSEntityName" || "Identifier" === nodeType || "TSQualifiedName" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isLiteral(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Literal" || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "RegExpLiteral" === nodeType || "TemplateLiteral" === nodeType || "BigIntLiteral" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isImmutable(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Immutable" || "StringLiteral" === nodeType || "NumericLiteral" === nodeType || "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXOpeningElement" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType || "BigIntLiteral" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isUserWhitespacable(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "UserWhitespacable" || "ObjectMethod" === nodeType || "ObjectProperty" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isMethod(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Method" || "ObjectMethod" === nodeType || "ClassMethod" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isObjectMember(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ObjectMember" || "ObjectMethod" === nodeType || "ObjectProperty" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isProperty(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Property" || "ObjectProperty" === nodeType || "ClassProperty" === nodeType || "ClassPrivateProperty" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isUnaryLike(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "UnaryLike" || "UnaryExpression" === nodeType || "SpreadElement" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isPattern(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Pattern" || "AssignmentPattern" === nodeType || "ArrayPattern" === nodeType || "ObjectPattern" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isClass(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Class" || "ClassDeclaration" === nodeType || "ClassExpression" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isModuleDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ModuleDeclaration" || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType || "ImportDeclaration" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isExportDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ExportDeclaration" || "ExportAllDeclaration" === nodeType || "ExportDefaultDeclaration" === nodeType || "ExportNamedDeclaration" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isModuleSpecifier(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "ModuleSpecifier" || "ExportSpecifier" === nodeType || "ImportDefaultSpecifier" === nodeType || "ImportNamespaceSpecifier" === nodeType || "ImportSpecifier" === nodeType || "ExportDefaultSpecifier" === nodeType || "ExportNamespaceSpecifier" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isFlow(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Flow" || "AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ClassImplements" === nodeType || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "DeclaredPredicate" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "FunctionTypeParam" === nodeType || "GenericTypeAnnotation" === nodeType || "InferredPredicate" === nodeType || "InterfaceExtends" === nodeType || "InterfaceDeclaration" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "ObjectTypeInternalSlot" === nodeType || "ObjectTypeCallProperty" === nodeType || "ObjectTypeIndexer" === nodeType || "ObjectTypeProperty" === nodeType || "ObjectTypeSpreadProperty" === nodeType || "OpaqueType" === nodeType || "QualifiedTypeIdentifier" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "TypeAlias" === nodeType || "TypeAnnotation" === nodeType || "TypeCastExpression" === nodeType || "TypeParameter" === nodeType || "TypeParameterDeclaration" === nodeType || "TypeParameterInstantiation" === nodeType || "UnionTypeAnnotation" === nodeType || "Variance" === nodeType || "VoidTypeAnnotation" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isFlowType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "FlowType" || "AnyTypeAnnotation" === nodeType || "ArrayTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "BooleanLiteralTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "ExistsTypeAnnotation" === nodeType || "FunctionTypeAnnotation" === nodeType || "GenericTypeAnnotation" === nodeType || "InterfaceTypeAnnotation" === nodeType || "IntersectionTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NullableTypeAnnotation" === nodeType || "NumberLiteralTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "ObjectTypeAnnotation" === nodeType || "StringLiteralTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "UnionTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isFlowBaseAnnotation(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "FlowBaseAnnotation" || "AnyTypeAnnotation" === nodeType || "BooleanTypeAnnotation" === nodeType || "NullLiteralTypeAnnotation" === nodeType || "MixedTypeAnnotation" === nodeType || "EmptyTypeAnnotation" === nodeType || "NumberTypeAnnotation" === nodeType || "StringTypeAnnotation" === nodeType || "ThisTypeAnnotation" === nodeType || "VoidTypeAnnotation" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isFlowDeclaration(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "FlowDeclaration" || "DeclareClass" === nodeType || "DeclareFunction" === nodeType || "DeclareInterface" === nodeType || "DeclareModule" === nodeType || "DeclareModuleExports" === nodeType || "DeclareTypeAlias" === nodeType || "DeclareOpaqueType" === nodeType || "DeclareVariable" === nodeType || "DeclareExportDeclaration" === nodeType || "DeclareExportAllDeclaration" === nodeType || "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isFlowPredicate(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "FlowPredicate" || "DeclaredPredicate" === nodeType || "InferredPredicate" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isJSX(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "JSX" || "JSXAttribute" === nodeType || "JSXClosingElement" === nodeType || "JSXElement" === nodeType || "JSXEmptyExpression" === nodeType || "JSXExpressionContainer" === nodeType || "JSXSpreadChild" === nodeType || "JSXIdentifier" === nodeType || "JSXMemberExpression" === nodeType || "JSXNamespacedName" === nodeType || "JSXOpeningElement" === nodeType || "JSXSpreadAttribute" === nodeType || "JSXText" === nodeType || "JSXFragment" === nodeType || "JSXOpeningFragment" === nodeType || "JSXClosingFragment" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isPrivate(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "Private" || "ClassPrivateProperty" === nodeType || "PrivateName" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSTypeElement(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSTypeElement" || "TSCallSignatureDeclaration" === nodeType || "TSConstructSignatureDeclaration" === nodeType || "TSPropertySignature" === nodeType || "TSMethodSignature" === nodeType || "TSIndexSignature" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isTSType(node, opts) {
if (!node) return false;
var nodeType = node.type;
if (nodeType === "TSType" || "TSAnyKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || "TSBooleanKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || "TSVoidKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || "TSNullKeyword" === nodeType || "TSNeverKeyword" === nodeType || "TSThisType" === nodeType || "TSFunctionType" === nodeType || "TSConstructorType" === nodeType || "TSTypeReference" === nodeType || "TSTypePredicate" === nodeType || "TSTypeQuery" === nodeType || "TSTypeLiteral" === nodeType || "TSArrayType" === nodeType || "TSTupleType" === nodeType || "TSUnionType" === nodeType || "TSIntersectionType" === nodeType || "TSConditionalType" === nodeType || "TSInferType" === nodeType || "TSParenthesizedType" === nodeType || "TSTypeOperator" === nodeType || "TSIndexedAccessType" === nodeType || "TSMappedType" === nodeType || "TSLiteralType" === nodeType || "TSExpressionWithTypeArguments" === nodeType) {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isNumberLiteral(node, opts) {
console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
if (!node) return false;
var nodeType = node.type;
if (nodeType === "NumberLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isRegexLiteral(node, opts) {
console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
if (!node) return false;
var nodeType = node.type;
if (nodeType === "RegexLiteral") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isRestProperty(node, opts) {
console.trace("The node type RestProperty has been renamed to RestElement");
if (!node) return false;
var nodeType = node.type;
if (nodeType === "RestProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
function isSpreadProperty(node, opts) {
console.trace("The node type SpreadProperty has been renamed to SpreadElement");
if (!node) return false;
var nodeType = node.type;
if (nodeType === "SpreadProperty") {
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
return false;
}
/***/ }),
/* 6 */
/***/ (function(module, exports) {
var process = module.exports = {};
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout() {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
})();
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
return setTimeout(fun, 0);
}
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
return cachedSetTimeout(fun, 0);
} catch (e) {
try {
return cachedSetTimeout.call(null, fun, 0);
} catch (e) {
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
return clearTimeout(marker);
}
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
return cachedClearTimeout(marker);
} catch (e) {
try {
return cachedClearTimeout.call(null, marker);
} catch (e) {
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while (len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = '';
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;
process.listeners = function (name) {
return [];
};
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () {
return '/';
};
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function () {
return 0;
};
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = function isObject(val) {
return val != null && typeof val === 'object' && Array.isArray(val) === false;
};
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.arrayExpression = exports.ArrayExpression = ArrayExpression;
exports.assignmentExpression = exports.AssignmentExpression = AssignmentExpression;
exports.binaryExpression = exports.BinaryExpression = BinaryExpression;
exports.interpreterDirective = exports.InterpreterDirective = InterpreterDirective;
exports.directive = exports.Directive = Directive;
exports.directiveLiteral = exports.DirectiveLiteral = DirectiveLiteral;
exports.blockStatement = exports.BlockStatement = BlockStatement;
exports.breakStatement = exports.BreakStatement = BreakStatement;
exports.callExpression = exports.CallExpression = CallExpression;
exports.catchClause = exports.CatchClause = CatchClause;
exports.conditionalExpression = exports.ConditionalExpression = ConditionalExpression;
exports.continueStatement = exports.ContinueStatement = ContinueStatement;
exports.debuggerStatement = exports.DebuggerStatement = DebuggerStatement;
exports.doWhileStatement = exports.DoWhileStatement = DoWhileStatement;
exports.emptyStatement = exports.EmptyStatement = EmptyStatement;
exports.expressionStatement = exports.ExpressionStatement = ExpressionStatement;
exports.file = exports.File = File;
exports.forInStatement = exports.ForInStatement = ForInStatement;
exports.forStatement = exports.ForStatement = ForStatement;
exports.functionDeclaration = exports.FunctionDeclaration = FunctionDeclaration;
exports.functionExpression = exports.FunctionExpression = FunctionExpression;
exports.identifier = exports.Identifier = Identifier;
exports.ifStatement = exports.IfStatement = IfStatement;
exports.labeledStatement = exports.LabeledStatement = LabeledStatement;
exports.stringLiteral = exports.StringLiteral = StringLiteral;
exports.numericLiteral = exports.NumericLiteral = NumericLiteral;
exports.nullLiteral = exports.NullLiteral = NullLiteral;
exports.booleanLiteral = exports.BooleanLiteral = BooleanLiteral;
exports.regExpLiteral = exports.RegExpLiteral = RegExpLiteral;
exports.logicalExpression = exports.LogicalExpression = LogicalExpression;
exports.memberExpression = exports.MemberExpression = MemberExpression;
exports.newExpression = exports.NewExpression = NewExpression;
exports.program = exports.Program = Program;
exports.objectExpression = exports.ObjectExpression = ObjectExpression;
exports.objectMethod = exports.ObjectMethod = ObjectMethod;
exports.objectProperty = exports.ObjectProperty = ObjectProperty;
exports.restElement = exports.RestElement = RestElement;
exports.returnStatement = exports.ReturnStatement = ReturnStatement;
exports.sequenceExpression = exports.SequenceExpression = SequenceExpression;
exports.switchCase = exports.SwitchCase = SwitchCase;
exports.switchStatement = exports.SwitchStatement = SwitchStatement;
exports.thisExpression = exports.ThisExpression = ThisExpression;
exports.throwStatement = exports.ThrowStatement = ThrowStatement;
exports.tryStatement = exports.TryStatement = TryStatement;
exports.unaryExpression = exports.UnaryExpression = UnaryExpression;
exports.updateExpression = exports.UpdateExpression = UpdateExpression;
exports.variableDeclaration = exports.VariableDeclaration = VariableDeclaration;
exports.variableDeclarator = exports.VariableDeclarator = VariableDeclarator;
exports.whileStatement = exports.WhileStatement = WhileStatement;
exports.withStatement = exports.WithStatement = WithStatement;
exports.assignmentPattern = exports.AssignmentPattern = AssignmentPattern;
exports.arrayPattern = exports.ArrayPattern = ArrayPattern;
exports.arrowFunctionExpression = exports.ArrowFunctionExpression = ArrowFunctionExpression;
exports.classBody = exports.ClassBody = ClassBody;
exports.classDeclaration = exports.ClassDeclaration = ClassDeclaration;
exports.classExpression = exports.ClassExpression = ClassExpression;
exports.exportAllDeclaration = exports.ExportAllDeclaration = ExportAllDeclaration;
exports.exportDefaultDeclaration = exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
exports.exportNamedDeclaration = exports.ExportNamedDeclaration = ExportNamedDeclaration;
exports.exportSpecifier = exports.ExportSpecifier = ExportSpecifier;
exports.forOfStatement = exports.ForOfStatement = ForOfStatement;
exports.importDeclaration = exports.ImportDeclaration = ImportDeclaration;
exports.importDefaultSpecifier = exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
exports.importNamespaceSpecifier = exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
exports.importSpecifier = exports.ImportSpecifier = ImportSpecifier;
exports.metaProperty = exports.MetaProperty = MetaProperty;
exports.classMethod = exports.ClassMethod = ClassMethod;
exports.objectPattern = exports.ObjectPattern = ObjectPattern;
exports.spreadElement = exports.SpreadElement = SpreadElement;
exports.super = exports.Super = Super;
exports.taggedTemplateExpression = exports.TaggedTemplateExpression = TaggedTemplateExpression;
exports.templateElement = exports.TemplateElement = TemplateElement;
exports.templateLiteral = exports.TemplateLiteral = TemplateLiteral;
exports.yieldExpression = exports.YieldExpression = YieldExpression;
exports.anyTypeAnnotation = exports.AnyTypeAnnotation = AnyTypeAnnotation;
exports.arrayTypeAnnotation = exports.ArrayTypeAnnotation = ArrayTypeAnnotation;
exports.booleanTypeAnnotation = exports.BooleanTypeAnnotation = BooleanTypeAnnotation;
exports.booleanLiteralTypeAnnotation = exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
exports.nullLiteralTypeAnnotation = exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
exports.classImplements = exports.ClassImplements = ClassImplements;
exports.declareClass = exports.DeclareClass = DeclareClass;
exports.declareFunction = exports.DeclareFunction = DeclareFunction;
exports.declareInterface = exports.DeclareInterface = DeclareInterface;
exports.declareModule = exports.DeclareModule = DeclareModule;
exports.declareModuleExports = exports.DeclareModuleExports = DeclareModuleExports;
exports.declareTypeAlias = exports.DeclareTypeAlias = DeclareTypeAlias;
exports.declareOpaqueType = exports.DeclareOpaqueType = DeclareOpaqueType;
exports.declareVariable = exports.DeclareVariable = DeclareVariable;
exports.declareExportDeclaration = exports.DeclareExportDeclaration = DeclareExportDeclaration;
exports.declareExportAllDeclaration = exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration;
exports.declaredPredicate = exports.DeclaredPredicate = DeclaredPredicate;
exports.existsTypeAnnotation = exports.ExistsTypeAnnotation = ExistsTypeAnnotation;
exports.functionTypeAnnotation = exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
exports.functionTypeParam = exports.FunctionTypeParam = FunctionTypeParam;
exports.genericTypeAnnotation = exports.GenericTypeAnnotation = GenericTypeAnnotation;
exports.inferredPredicate = exports.InferredPredicate = InferredPredicate;
exports.interfaceExtends = exports.InterfaceExtends = InterfaceExtends;
exports.interfaceDeclaration = exports.InterfaceDeclaration = InterfaceDeclaration;
exports.interfaceTypeAnnotation = exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation;
exports.intersectionTypeAnnotation = exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
exports.mixedTypeAnnotation = exports.MixedTypeAnnotation = MixedTypeAnnotation;
exports.emptyTypeAnnotation = exports.EmptyTypeAnnotation = EmptyTypeAnnotation;
exports.nullableTypeAnnotation = exports.NullableTypeAnnotation = NullableTypeAnnotation;
exports.numberLiteralTypeAnnotation = exports.NumberLiteralTypeAnnotation = NumberLiteralTypeAnnotation;
exports.numberTypeAnnotation = exports.NumberTypeAnnotation = NumberTypeAnnotation;
exports.objectTypeAnnotation = exports.ObjectTypeAnnotation = ObjectTypeAnnotation;
exports.objectTypeInternalSlot = exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot;
exports.objectTypeCallProperty = exports.ObjectTypeCallProperty = ObjectTypeCallProperty;
exports.objectTypeIndexer = exports.ObjectTypeIndexer = ObjectTypeIndexer;
exports.objectTypeProperty = exports.ObjectTypeProperty = ObjectTypeProperty;
exports.objectTypeSpreadProperty = exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
exports.opaqueType = exports.OpaqueType = OpaqueType;
exports.qualifiedTypeIdentifier = exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
exports.stringLiteralTypeAnnotation = exports.StringLiteralTypeAnnotation = StringLiteralTypeAnnotation;
exports.stringTypeAnnotation = exports.StringTypeAnnotation = StringTypeAnnotation;
exports.thisTypeAnnotation = exports.ThisTypeAnnotation = ThisTypeAnnotation;
exports.tupleTypeAnnotation = exports.TupleTypeAnnotation = TupleTypeAnnotation;
exports.typeofTypeAnnotation = exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
exports.typeAlias = exports.TypeAlias = TypeAlias;
exports.typeAnnotation = exports.TypeAnnotation = TypeAnnotation;
exports.typeCastExpression = exports.TypeCastExpression = TypeCastExpression;
exports.typeParameter = exports.TypeParameter = TypeParameter;
exports.typeParameterDeclaration = exports.TypeParameterDeclaration = TypeParameterDeclaration;
exports.typeParameterInstantiation = exports.TypeParameterInstantiation = TypeParameterInstantiation;
exports.unionTypeAnnotation = exports.UnionTypeAnnotation = UnionTypeAnnotation;
exports.variance = exports.Variance = Variance;
exports.voidTypeAnnotation = exports.VoidTypeAnnotation = VoidTypeAnnotation;
exports.jSXAttribute = exports.jsxAttribute = exports.JSXAttribute = JSXAttribute;
exports.jSXClosingElement = exports.jsxClosingElement = exports.JSXClosingElement = JSXClosingElement;
exports.jSXElement = exports.jsxElement = exports.JSXElement = JSXElement;
exports.jSXEmptyExpression = exports.jsxEmptyExpression = exports.JSXEmptyExpression = JSXEmptyExpression;
exports.jSXExpressionContainer = exports.jsxExpressionContainer = exports.JSXExpressionContainer = JSXExpressionContainer;
exports.jSXSpreadChild = exports.jsxSpreadChild = exports.JSXSpreadChild = JSXSpreadChild;
exports.jSXIdentifier = exports.jsxIdentifier = exports.JSXIdentifier = JSXIdentifier;
exports.jSXMemberExpression = exports.jsxMemberExpression = exports.JSXMemberExpression = JSXMemberExpression;
exports.jSXNamespacedName = exports.jsxNamespacedName = exports.JSXNamespacedName = JSXNamespacedName;
exports.jSXOpeningElement = exports.jsxOpeningElement = exports.JSXOpeningElement = JSXOpeningElement;
exports.jSXSpreadAttribute = exports.jsxSpreadAttribute = exports.JSXSpreadAttribute = JSXSpreadAttribute;
exports.jSXText = exports.jsxText = exports.JSXText = JSXText;
exports.jSXFragment = exports.jsxFragment = exports.JSXFragment = JSXFragment;
exports.jSXOpeningFragment = exports.jsxOpeningFragment = exports.JSXOpeningFragment = JSXOpeningFragment;
exports.jSXClosingFragment = exports.jsxClosingFragment = exports.JSXClosingFragment = JSXClosingFragment;
exports.noop = exports.Noop = Noop;
exports.parenthesizedExpression = exports.ParenthesizedExpression = ParenthesizedExpression;
exports.awaitExpression = exports.AwaitExpression = AwaitExpression;
exports.bindExpression = exports.BindExpression = BindExpression;
exports.classProperty = exports.ClassProperty = ClassProperty;
exports.optionalMemberExpression = exports.OptionalMemberExpression = OptionalMemberExpression;
exports.optionalCallExpression = exports.OptionalCallExpression = OptionalCallExpression;
exports.classPrivateProperty = exports.ClassPrivateProperty = ClassPrivateProperty;
exports.import = exports.Import = Import;
exports.decorator = exports.Decorator = Decorator;
exports.doExpression = exports.DoExpression = DoExpression;
exports.exportDefaultSpecifier = exports.ExportDefaultSpecifier = ExportDefaultSpecifier;
exports.exportNamespaceSpecifier = exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier;
exports.privateName = exports.PrivateName = PrivateName;
exports.bigIntLiteral = exports.BigIntLiteral = BigIntLiteral;
exports.tSParameterProperty = exports.tsParameterProperty = exports.TSParameterProperty = TSParameterProperty;
exports.tSDeclareFunction = exports.tsDeclareFunction = exports.TSDeclareFunction = TSDeclareFunction;
exports.tSDeclareMethod = exports.tsDeclareMethod = exports.TSDeclareMethod = TSDeclareMethod;
exports.tSQualifiedName = exports.tsQualifiedName = exports.TSQualifiedName = TSQualifiedName;
exports.tSCallSignatureDeclaration = exports.tsCallSignatureDeclaration = exports.TSCallSignatureDeclaration = TSCallSignatureDeclaration;
exports.tSConstructSignatureDeclaration = exports.tsConstructSignatureDeclaration = exports.TSConstructSignatureDeclaration = TSConstructSignatureDeclaration;
exports.tSPropertySignature = exports.tsPropertySignature = exports.TSPropertySignature = TSPropertySignature;
exports.tSMethodSignature = exports.tsMethodSignature = exports.TSMethodSignature = TSMethodSignature;
exports.tSIndexSignature = exports.tsIndexSignature = exports.TSIndexSignature = TSIndexSignature;
exports.tSAnyKeyword = exports.tsAnyKeyword = exports.TSAnyKeyword = TSAnyKeyword;
exports.tSNumberKeyword = exports.tsNumberKeyword = exports.TSNumberKeyword = TSNumberKeyword;
exports.tSObjectKeyword = exports.tsObjectKeyword = exports.TSObjectKeyword = TSObjectKeyword;
exports.tSBooleanKeyword = exports.tsBooleanKeyword = exports.TSBooleanKeyword = TSBooleanKeyword;
exports.tSStringKeyword = exports.tsStringKeyword = exports.TSStringKeyword = TSStringKeyword;
exports.tSSymbolKeyword = exports.tsSymbolKeyword = exports.TSSymbolKeyword = TSSymbolKeyword;
exports.tSVoidKeyword = exports.tsVoidKeyword = exports.TSVoidKeyword = TSVoidKeyword;
exports.tSUndefinedKeyword = exports.tsUndefinedKeyword = exports.TSUndefinedKeyword = TSUndefinedKeyword;
exports.tSNullKeyword = exports.tsNullKeyword = exports.TSNullKeyword = TSNullKeyword;
exports.tSNeverKeyword = exports.tsNeverKeyword = exports.TSNeverKeyword = TSNeverKeyword;
exports.tSThisType = exports.tsThisType = exports.TSThisType = TSThisType;
exports.tSFunctionType = exports.tsFunctionType = exports.TSFunctionType = TSFunctionType;
exports.tSConstructorType = exports.tsConstructorType = exports.TSConstructorType = TSConstructorType;
exports.tSTypeReference = exports.tsTypeReference = exports.TSTypeReference = TSTypeReference;
exports.tSTypePredicate = exports.tsTypePredicate = exports.TSTypePredicate = TSTypePredicate;
exports.tSTypeQuery = exports.tsTypeQuery = exports.TSTypeQuery = TSTypeQuery;
exports.tSTypeLiteral = exports.tsTypeLiteral = exports.TSTypeLiteral = TSTypeLiteral;
exports.tSArrayType = exports.tsArrayType = exports.TSArrayType = TSArrayType;
exports.tSTupleType = exports.tsTupleType = exports.TSTupleType = TSTupleType;
exports.tSUnionType = exports.tsUnionType = exports.TSUnionType = TSUnionType;
exports.tSIntersectionType = exports.tsIntersectionType = exports.TSIntersectionType = TSIntersectionType;
exports.tSConditionalType = exports.tsConditionalType = exports.TSConditionalType = TSConditionalType;
exports.tSInferType = exports.tsInferType = exports.TSInferType = TSInferType;
exports.tSParenthesizedType = exports.tsParenthesizedType = exports.TSParenthesizedType = TSParenthesizedType;
exports.tSTypeOperator = exports.tsTypeOperator = exports.TSTypeOperator = TSTypeOperator;
exports.tSIndexedAccessType = exports.tsIndexedAccessType = exports.TSIndexedAccessType = TSIndexedAccessType;
exports.tSMappedType = exports.tsMappedType = exports.TSMappedType = TSMappedType;
exports.tSLiteralType = exports.tsLiteralType = exports.TSLiteralType = TSLiteralType;
exports.tSExpressionWithTypeArguments = exports.tsExpressionWithTypeArguments = exports.TSExpressionWithTypeArguments = TSExpressionWithTypeArguments;
exports.tSInterfaceDeclaration = exports.tsInterfaceDeclaration = exports.TSInterfaceDeclaration = TSInterfaceDeclaration;
exports.tSInterfaceBody = exports.tsInterfaceBody = exports.TSInterfaceBody = TSInterfaceBody;
exports.tSTypeAliasDeclaration = exports.tsTypeAliasDeclaration = exports.TSTypeAliasDeclaration = TSTypeAliasDeclaration;
exports.tSAsExpression = exports.tsAsExpression = exports.TSAsExpression = TSAsExpression;
exports.tSTypeAssertion = exports.tsTypeAssertion = exports.TSTypeAssertion = TSTypeAssertion;
exports.tSEnumDeclaration = exports.tsEnumDeclaration = exports.TSEnumDeclaration = TSEnumDeclaration;
exports.tSEnumMember = exports.tsEnumMember = exports.TSEnumMember = TSEnumMember;
exports.tSModuleDeclaration = exports.tsModuleDeclaration = exports.TSModuleDeclaration = TSModuleDeclaration;
exports.tSModuleBlock = exports.tsModuleBlock = exports.TSModuleBlock = TSModuleBlock;
exports.tSImportEqualsDeclaration = exports.tsImportEqualsDeclaration = exports.TSImportEqualsDeclaration = TSImportEqualsDeclaration;
exports.tSExternalModuleReference = exports.tsExternalModuleReference = exports.TSExternalModuleReference = TSExternalModuleReference;
exports.tSNonNullExpression = exports.tsNonNullExpression = exports.TSNonNullExpression = TSNonNullExpression;
exports.tSExportAssignment = exports.tsExportAssignment = exports.TSExportAssignment = TSExportAssignment;
exports.tSNamespaceExportDeclaration = exports.tsNamespaceExportDeclaration = exports.TSNamespaceExportDeclaration = TSNamespaceExportDeclaration;
exports.tSTypeAnnotation = exports.tsTypeAnnotation = exports.TSTypeAnnotation = TSTypeAnnotation;
exports.tSTypeParameterInstantiation = exports.tsTypeParameterInstantiation = exports.TSTypeParameterInstantiation = TSTypeParameterInstantiation;
exports.tSTypeParameterDeclaration = exports.tsTypeParameterDeclaration = exports.TSTypeParameterDeclaration = TSTypeParameterDeclaration;
exports.tSTypeParameter = exports.tsTypeParameter = exports.TSTypeParameter = TSTypeParameter;
exports.numberLiteral = exports.NumberLiteral = NumberLiteral;
exports.regexLiteral = exports.RegexLiteral = RegexLiteral;
exports.restProperty = exports.RestProperty = RestProperty;
exports.spreadProperty = exports.SpreadProperty = SpreadProperty;
var _builder = _interopRequireDefault(__webpack_require__(295));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function ArrayExpression() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return (_builder.default).apply(void 0, ["ArrayExpression"].concat(args));
}
function AssignmentExpression() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return (_builder.default).apply(void 0, ["AssignmentExpression"].concat(args));
}
function BinaryExpression() {
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
return (_builder.default).apply(void 0, ["BinaryExpression"].concat(args));
}
function InterpreterDirective() {
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
return (_builder.default).apply(void 0, ["InterpreterDirective"].concat(args));
}
function Directive() {
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
args[_key5] = arguments[_key5];
}
return (_builder.default).apply(void 0, ["Directive"].concat(args));
}
function DirectiveLiteral() {
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
args[_key6] = arguments[_key6];
}
return (_builder.default).apply(void 0, ["DirectiveLiteral"].concat(args));
}
function BlockStatement() {
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
args[_key7] = arguments[_key7];
}
return (_builder.default).apply(void 0, ["BlockStatement"].concat(args));
}
function BreakStatement() {
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
args[_key8] = arguments[_key8];
}
return (_builder.default).apply(void 0, ["BreakStatement"].concat(args));
}
function CallExpression() {
for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
args[_key9] = arguments[_key9];
}
return (_builder.default).apply(void 0, ["CallExpression"].concat(args));
}
function CatchClause() {
for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
args[_key10] = arguments[_key10];
}
return (_builder.default).apply(void 0, ["CatchClause"].concat(args));
}
function ConditionalExpression() {
for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
args[_key11] = arguments[_key11];
}
return (_builder.default).apply(void 0, ["ConditionalExpression"].concat(args));
}
function ContinueStatement() {
for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
args[_key12] = arguments[_key12];
}
return (_builder.default).apply(void 0, ["ContinueStatement"].concat(args));
}
function DebuggerStatement() {
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
args[_key13] = arguments[_key13];
}
return (_builder.default).apply(void 0, ["DebuggerStatement"].concat(args));
}
function DoWhileStatement() {
for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
args[_key14] = arguments[_key14];
}
return (_builder.default).apply(void 0, ["DoWhileStatement"].concat(args));
}
function EmptyStatement() {
for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
args[_key15] = arguments[_key15];
}
return (_builder.default).apply(void 0, ["EmptyStatement"].concat(args));
}
function ExpressionStatement() {
for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {
args[_key16] = arguments[_key16];
}
return (_builder.default).apply(void 0, ["ExpressionStatement"].concat(args));
}
function File() {
for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) {
args[_key17] = arguments[_key17];
}
return (_builder.default).apply(void 0, ["File"].concat(args));
}
function ForInStatement() {
for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) {
args[_key18] = arguments[_key18];
}
return (_builder.default).apply(void 0, ["ForInStatement"].concat(args));
}
function ForStatement() {
for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) {
args[_key19] = arguments[_key19];
}
return (_builder.default).apply(void 0, ["ForStatement"].concat(args));
}
function FunctionDeclaration() {
for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) {
args[_key20] = arguments[_key20];
}
return (_builder.default).apply(void 0, ["FunctionDeclaration"].concat(args));
}
function FunctionExpression() {
for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) {
args[_key21] = arguments[_key21];
}
return (_builder.default).apply(void 0, ["FunctionExpression"].concat(args));
}
function Identifier() {
for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {
args[_key22] = arguments[_key22];
}
return (_builder.default).apply(void 0, ["Identifier"].concat(args));
}
function IfStatement() {
for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) {
args[_key23] = arguments[_key23];
}
return (_builder.default).apply(void 0, ["IfStatement"].concat(args));
}
function LabeledStatement() {
for (var _len24 = arguments.length, args = new Array(_len24), _key24 = 0; _key24 < _len24; _key24++) {
args[_key24] = arguments[_key24];
}
return (_builder.default).apply(void 0, ["LabeledStatement"].concat(args));
}
function StringLiteral() {
for (var _len25 = arguments.length, args = new Array(_len25), _key25 = 0; _key25 < _len25; _key25++) {
args[_key25] = arguments[_key25];
}
return (_builder.default).apply(void 0, ["StringLiteral"].concat(args));
}
function NumericLiteral() {
for (var _len26 = arguments.length, args = new Array(_len26), _key26 = 0; _key26 < _len26; _key26++) {
args[_key26] = arguments[_key26];
}
return (_builder.default).apply(void 0, ["NumericLiteral"].concat(args));
}
function NullLiteral() {
for (var _len27 = arguments.length, args = new Array(_len27), _key27 = 0; _key27 < _len27; _key27++) {
args[_key27] = arguments[_key27];
}
return (_builder.default).apply(void 0, ["NullLiteral"].concat(args));
}
function BooleanLiteral() {
for (var _len28 = arguments.length, args = new Array(_len28), _key28 = 0; _key28 < _len28; _key28++) {
args[_key28] = arguments[_key28];
}
return (_builder.default).apply(void 0, ["BooleanLiteral"].concat(args));
}
function RegExpLiteral() {
for (var _len29 = arguments.length, args = new Array(_len29), _key29 = 0; _key29 < _len29; _key29++) {
args[_key29] = arguments[_key29];
}
return (_builder.default).apply(void 0, ["RegExpLiteral"].concat(args));
}
function LogicalExpression() {
for (var _len30 = arguments.length, args = new Array(_len30), _key30 = 0; _key30 < _len30; _key30++) {
args[_key30] = arguments[_key30];
}
return (_builder.default).apply(void 0, ["LogicalExpression"].concat(args));
}
function MemberExpression() {
for (var _len31 = arguments.length, args = new Array(_len31), _key31 = 0; _key31 < _len31; _key31++) {
args[_key31] = arguments[_key31];
}
return (_builder.default).apply(void 0, ["MemberExpression"].concat(args));
}
function NewExpression() {
for (var _len32 = arguments.length, args = new Array(_len32), _key32 = 0; _key32 < _len32; _key32++) {
args[_key32] = arguments[_key32];
}
return (_builder.default).apply(void 0, ["NewExpression"].concat(args));
}
function Program() {
for (var _len33 = arguments.length, args = new Array(_len33), _key33 = 0; _key33 < _len33; _key33++) {
args[_key33] = arguments[_key33];
}
return (_builder.default).apply(void 0, ["Program"].concat(args));
}
function ObjectExpression() {
for (var _len34 = arguments.length, args = new Array(_len34), _key34 = 0; _key34 < _len34; _key34++) {
args[_key34] = arguments[_key34];
}
return (_builder.default).apply(void 0, ["ObjectExpression"].concat(args));
}
function ObjectMethod() {
for (var _len35 = arguments.length, args = new Array(_len35), _key35 = 0; _key35 < _len35; _key35++) {
args[_key35] = arguments[_key35];
}
return (_builder.default).apply(void 0, ["ObjectMethod"].concat(args));
}
function ObjectProperty() {
for (var _len36 = arguments.length, args = new Array(_len36), _key36 = 0; _key36 < _len36; _key36++) {
args[_key36] = arguments[_key36];
}
return (_builder.default).apply(void 0, ["ObjectProperty"].concat(args));
}
function RestElement() {
for (var _len37 = arguments.length, args = new Array(_len37), _key37 = 0; _key37 < _len37; _key37++) {
args[_key37] = arguments[_key37];
}
return (_builder.default).apply(void 0, ["RestElement"].concat(args));
}
function ReturnStatement() {
for (var _len38 = arguments.length, args = new Array(_len38), _key38 = 0; _key38 < _len38; _key38++) {
args[_key38] = arguments[_key38];
}
return (_builder.default).apply(void 0, ["ReturnStatement"].concat(args));
}
function SequenceExpression() {
for (var _len39 = arguments.length, args = new Array(_len39), _key39 = 0; _key39 < _len39; _key39++) {
args[_key39] = arguments[_key39];
}
return (_builder.default).apply(void 0, ["SequenceExpression"].concat(args));
}
function SwitchCase() {
for (var _len40 = arguments.length, args = new Array(_len40), _key40 = 0; _key40 < _len40; _key40++) {
args[_key40] = arguments[_key40];
}
return (_builder.default).apply(void 0, ["SwitchCase"].concat(args));
}
function SwitchStatement() {
for (var _len41 = arguments.length, args = new Array(_len41), _key41 = 0; _key41 < _len41; _key41++) {
args[_key41] = arguments[_key41];
}
return (_builder.default).apply(void 0, ["SwitchStatement"].concat(args));
}
function ThisExpression() {
for (var _len42 = arguments.length, args = new Array(_len42), _key42 = 0; _key42 < _len42; _key42++) {
args[_key42] = arguments[_key42];
}
return (_builder.default).apply(void 0, ["ThisExpression"].concat(args));
}
function ThrowStatement() {
for (var _len43 = arguments.length, args = new Array(_len43), _key43 = 0; _key43 < _len43; _key43++) {
args[_key43] = arguments[_key43];
}
return (_builder.default).apply(void 0, ["ThrowStatement"].concat(args));
}
function TryStatement() {
for (var _len44 = arguments.length, args = new Array(_len44), _key44 = 0; _key44 < _len44; _key44++) {
args[_key44] = arguments[_key44];
}
return (_builder.default).apply(void 0, ["TryStatement"].concat(args));
}
function UnaryExpression() {
for (var _len45 = arguments.length, args = new Array(_len45), _key45 = 0; _key45 < _len45; _key45++) {
args[_key45] = arguments[_key45];
}
return (_builder.default).apply(void 0, ["UnaryExpression"].concat(args));
}
function UpdateExpression() {
for (var _len46 = arguments.length, args = new Array(_len46), _key46 = 0; _key46 < _len46; _key46++) {
args[_key46] = arguments[_key46];
}
return (_builder.default).apply(void 0, ["UpdateExpression"].concat(args));
}
function VariableDeclaration() {
for (var _len47 = arguments.length, args = new Array(_len47), _key47 = 0; _key47 < _len47; _key47++) {
args[_key47] = arguments[_key47];
}
return (_builder.default).apply(void 0, ["VariableDeclaration"].concat(args));
}
function VariableDeclarator() {
for (var _len48 = arguments.length, args = new Array(_len48), _key48 = 0; _key48 < _len48; _key48++) {
args[_key48] = arguments[_key48];
}
return (_builder.default).apply(void 0, ["VariableDeclarator"].concat(args));
}
function WhileStatement() {
for (var _len49 = arguments.length, args = new Array(_len49), _key49 = 0; _key49 < _len49; _key49++) {
args[_key49] = arguments[_key49];
}
return (_builder.default).apply(void 0, ["WhileStatement"].concat(args));
}
function WithStatement() {
for (var _len50 = arguments.length, args = new Array(_len50), _key50 = 0; _key50 < _len50; _key50++) {
args[_key50] = arguments[_key50];
}
return (_builder.default).apply(void 0, ["WithStatement"].concat(args));
}
function AssignmentPattern() {
for (var _len51 = arguments.length, args = new Array(_len51), _key51 = 0; _key51 < _len51; _key51++) {
args[_key51] = arguments[_key51];
}
return (_builder.default).apply(void 0, ["AssignmentPattern"].concat(args));
}
function ArrayPattern() {
for (var _len52 = arguments.length, args = new Array(_len52), _key52 = 0; _key52 < _len52; _key52++) {
args[_key52] = arguments[_key52];
}
return (_builder.default).apply(void 0, ["ArrayPattern"].concat(args));
}
function ArrowFunctionExpression() {
for (var _len53 = arguments.length, args = new Array(_len53), _key53 = 0; _key53 < _len53; _key53++) {
args[_key53] = arguments[_key53];
}
return (_builder.default).apply(void 0, ["ArrowFunctionExpression"].concat(args));
}
function ClassBody() {
for (var _len54 = arguments.length, args = new Array(_len54), _key54 = 0; _key54 < _len54; _key54++) {
args[_key54] = arguments[_key54];
}
return (_builder.default).apply(void 0, ["ClassBody"].concat(args));
}
function ClassDeclaration() {
for (var _len55 = arguments.length, args = new Array(_len55), _key55 = 0; _key55 < _len55; _key55++) {
args[_key55] = arguments[_key55];
}
return (_builder.default).apply(void 0, ["ClassDeclaration"].concat(args));
}
function ClassExpression() {
for (var _len56 = arguments.length, args = new Array(_len56), _key56 = 0; _key56 < _len56; _key56++) {
args[_key56] = arguments[_key56];
}
return (_builder.default).apply(void 0, ["ClassExpression"].concat(args));
}
function ExportAllDeclaration() {
for (var _len57 = arguments.length, args = new Array(_len57), _key57 = 0; _key57 < _len57; _key57++) {
args[_key57] = arguments[_key57];
}
return (_builder.default).apply(void 0, ["ExportAllDeclaration"].concat(args));
}
function ExportDefaultDeclaration() {
for (var _len58 = arguments.length, args = new Array(_len58), _key58 = 0; _key58 < _len58; _key58++) {
args[_key58] = arguments[_key58];
}
return (_builder.default).apply(void 0, ["ExportDefaultDeclaration"].concat(args));
}
function ExportNamedDeclaration() {
for (var _len59 = arguments.length, args = new Array(_len59), _key59 = 0; _key59 < _len59; _key59++) {
args[_key59] = arguments[_key59];
}
return (_builder.default).apply(void 0, ["ExportNamedDeclaration"].concat(args));
}
function ExportSpecifier() {
for (var _len60 = arguments.length, args = new Array(_len60), _key60 = 0; _key60 < _len60; _key60++) {
args[_key60] = arguments[_key60];
}
return (_builder.default).apply(void 0, ["ExportSpecifier"].concat(args));
}
function ForOfStatement() {
for (var _len61 = arguments.length, args = new Array(_len61), _key61 = 0; _key61 < _len61; _key61++) {
args[_key61] = arguments[_key61];
}
return (_builder.default).apply(void 0, ["ForOfStatement"].concat(args));
}
function ImportDeclaration() {
for (var _len62 = arguments.length, args = new Array(_len62), _key62 = 0; _key62 < _len62; _key62++) {
args[_key62] = arguments[_key62];
}
return (_builder.default).apply(void 0, ["ImportDeclaration"].concat(args));
}
function ImportDefaultSpecifier() {
for (var _len63 = arguments.length, args = new Array(_len63), _key63 = 0; _key63 < _len63; _key63++) {
args[_key63] = arguments[_key63];
}
return (_builder.default).apply(void 0, ["ImportDefaultSpecifier"].concat(args));
}
function ImportNamespaceSpecifier() {
for (var _len64 = arguments.length, args = new Array(_len64), _key64 = 0; _key64 < _len64; _key64++) {
args[_key64] = arguments[_key64];
}
return (_builder.default).apply(void 0, ["ImportNamespaceSpecifier"].concat(args));
}
function ImportSpecifier() {
for (var _len65 = arguments.length, args = new Array(_len65), _key65 = 0; _key65 < _len65; _key65++) {
args[_key65] = arguments[_key65];
}
return (_builder.default).apply(void 0, ["ImportSpecifier"].concat(args));
}
function MetaProperty() {
for (var _len66 = arguments.length, args = new Array(_len66), _key66 = 0; _key66 < _len66; _key66++) {
args[_key66] = arguments[_key66];
}
return (_builder.default).apply(void 0, ["MetaProperty"].concat(args));
}
function ClassMethod() {
for (var _len67 = arguments.length, args = new Array(_len67), _key67 = 0; _key67 < _len67; _key67++) {
args[_key67] = arguments[_key67];
}
return (_builder.default).apply(void 0, ["ClassMethod"].concat(args));
}
function ObjectPattern() {
for (var _len68 = arguments.length, args = new Array(_len68), _key68 = 0; _key68 < _len68; _key68++) {
args[_key68] = arguments[_key68];
}
return (_builder.default).apply(void 0, ["ObjectPattern"].concat(args));
}
function SpreadElement() {
for (var _len69 = arguments.length, args = new Array(_len69), _key69 = 0; _key69 < _len69; _key69++) {
args[_key69] = arguments[_key69];
}
return (_builder.default).apply(void 0, ["SpreadElement"].concat(args));
}
function Super() {
for (var _len70 = arguments.length, args = new Array(_len70), _key70 = 0; _key70 < _len70; _key70++) {
args[_key70] = arguments[_key70];
}
return (_builder.default).apply(void 0, ["Super"].concat(args));
}
function TaggedTemplateExpression() {
for (var _len71 = arguments.length, args = new Array(_len71), _key71 = 0; _key71 < _len71; _key71++) {
args[_key71] = arguments[_key71];
}
return (_builder.default).apply(void 0, ["TaggedTemplateExpression"].concat(args));
}
function TemplateElement() {
for (var _len72 = arguments.length, args = new Array(_len72), _key72 = 0; _key72 < _len72; _key72++) {
args[_key72] = arguments[_key72];
}
return (_builder.default).apply(void 0, ["TemplateElement"].concat(args));
}
function TemplateLiteral() {
for (var _len73 = arguments.length, args = new Array(_len73), _key73 = 0; _key73 < _len73; _key73++) {
args[_key73] = arguments[_key73];
}
return (_builder.default).apply(void 0, ["TemplateLiteral"].concat(args));
}
function YieldExpression() {
for (var _len74 = arguments.length, args = new Array(_len74), _key74 = 0; _key74 < _len74; _key74++) {
args[_key74] = arguments[_key74];
}
return (_builder.default).apply(void 0, ["YieldExpression"].concat(args));
}
function AnyTypeAnnotation() {
for (var _len75 = arguments.length, args = new Array(_len75), _key75 = 0; _key75 < _len75; _key75++) {
args[_key75] = arguments[_key75];
}
return (_builder.default).apply(void 0, ["AnyTypeAnnotation"].concat(args));
}
function ArrayTypeAnnotation() {
for (var _len76 = arguments.length, args = new Array(_len76), _key76 = 0; _key76 < _len76; _key76++) {
args[_key76] = arguments[_key76];
}
return (_builder.default).apply(void 0, ["ArrayTypeAnnotation"].concat(args));
}
function BooleanTypeAnnotation() {
for (var _len77 = arguments.length, args = new Array(_len77), _key77 = 0; _key77 < _len77; _key77++) {
args[_key77] = arguments[_key77];
}
return (_builder.default).apply(void 0, ["BooleanTypeAnnotation"].concat(args));
}
function BooleanLiteralTypeAnnotation() {
for (var _len78 = arguments.length, args = new Array(_len78), _key78 = 0; _key78 < _len78; _key78++) {
args[_key78] = arguments[_key78];
}
return (_builder.default).apply(void 0, ["BooleanLiteralTypeAnnotation"].concat(args));
}
function NullLiteralTypeAnnotation() {
for (var _len79 = arguments.length, args = new Array(_len79), _key79 = 0; _key79 < _len79; _key79++) {
args[_key79] = arguments[_key79];
}
return (_builder.default).apply(void 0, ["NullLiteralTypeAnnotation"].concat(args));
}
function ClassImplements() {
for (var _len80 = arguments.length, args = new Array(_len80), _key80 = 0; _key80 < _len80; _key80++) {
args[_key80] = arguments[_key80];
}
return (_builder.default).apply(void 0, ["ClassImplements"].concat(args));
}
function DeclareClass() {
for (var _len81 = arguments.length, args = new Array(_len81), _key81 = 0; _key81 < _len81; _key81++) {
args[_key81] = arguments[_key81];
}
return (_builder.default).apply(void 0, ["DeclareClass"].concat(args));
}
function DeclareFunction() {
for (var _len82 = arguments.length, args = new Array(_len82), _key82 = 0; _key82 < _len82; _key82++) {
args[_key82] = arguments[_key82];
}
return (_builder.default).apply(void 0, ["DeclareFunction"].concat(args));
}
function DeclareInterface() {
for (var _len83 = arguments.length, args = new Array(_len83), _key83 = 0; _key83 < _len83; _key83++) {
args[_key83] = arguments[_key83];
}
return (_builder.default).apply(void 0, ["DeclareInterface"].concat(args));
}
function DeclareModule() {
for (var _len84 = arguments.length, args = new Array(_len84), _key84 = 0; _key84 < _len84; _key84++) {
args[_key84] = arguments[_key84];
}
return (_builder.default).apply(void 0, ["DeclareModule"].concat(args));
}
function DeclareModuleExports() {
for (var _len85 = arguments.length, args = new Array(_len85), _key85 = 0; _key85 < _len85; _key85++) {
args[_key85] = arguments[_key85];
}
return (_builder.default).apply(void 0, ["DeclareModuleExports"].concat(args));
}
function DeclareTypeAlias() {
for (var _len86 = arguments.length, args = new Array(_len86), _key86 = 0; _key86 < _len86; _key86++) {
args[_key86] = arguments[_key86];
}
return (_builder.default).apply(void 0, ["DeclareTypeAlias"].concat(args));
}
function DeclareOpaqueType() {
for (var _len87 = arguments.length, args = new Array(_len87), _key87 = 0; _key87 < _len87; _key87++) {
args[_key87] = arguments[_key87];
}
return (_builder.default).apply(void 0, ["DeclareOpaqueType"].concat(args));
}
function DeclareVariable() {
for (var _len88 = arguments.length, args = new Array(_len88), _key88 = 0; _key88 < _len88; _key88++) {
args[_key88] = arguments[_key88];
}
return (_builder.default).apply(void 0, ["DeclareVariable"].concat(args));
}
function DeclareExportDeclaration() {
for (var _len89 = arguments.length, args = new Array(_len89), _key89 = 0; _key89 < _len89; _key89++) {
args[_key89] = arguments[_key89];
}
return (_builder.default).apply(void 0, ["DeclareExportDeclaration"].concat(args));
}
function DeclareExportAllDeclaration() {
for (var _len90 = arguments.length, args = new Array(_len90), _key90 = 0; _key90 < _len90; _key90++) {
args[_key90] = arguments[_key90];
}
return (_builder.default).apply(void 0, ["DeclareExportAllDeclaration"].concat(args));
}
function DeclaredPredicate() {
for (var _len91 = arguments.length, args = new Array(_len91), _key91 = 0; _key91 < _len91; _key91++) {
args[_key91] = arguments[_key91];
}
return (_builder.default).apply(void 0, ["DeclaredPredicate"].concat(args));
}
function ExistsTypeAnnotation() {
for (var _len92 = arguments.length, args = new Array(_len92), _key92 = 0; _key92 < _len92; _key92++) {
args[_key92] = arguments[_key92];
}
return (_builder.default).apply(void 0, ["ExistsTypeAnnotation"].concat(args));
}
function FunctionTypeAnnotation() {
for (var _len93 = arguments.length, args = new Array(_len93), _key93 = 0; _key93 < _len93; _key93++) {
args[_key93] = arguments[_key93];
}
return (_builder.default).apply(void 0, ["FunctionTypeAnnotation"].concat(args));
}
function FunctionTypeParam() {
for (var _len94 = arguments.length, args = new Array(_len94), _key94 = 0; _key94 < _len94; _key94++) {
args[_key94] = arguments[_key94];
}
return (_builder.default).apply(void 0, ["FunctionTypeParam"].concat(args));
}
function GenericTypeAnnotation() {
for (var _len95 = arguments.length, args = new Array(_len95), _key95 = 0; _key95 < _len95; _key95++) {
args[_key95] = arguments[_key95];
}
return (_builder.default).apply(void 0, ["GenericTypeAnnotation"].concat(args));
}
function InferredPredicate() {
for (var _len96 = arguments.length, args = new Array(_len96), _key96 = 0; _key96 < _len96; _key96++) {
args[_key96] = arguments[_key96];
}
return (_builder.default).apply(void 0, ["InferredPredicate"].concat(args));
}
function InterfaceExtends() {
for (var _len97 = arguments.length, args = new Array(_len97), _key97 = 0; _key97 < _len97; _key97++) {
args[_key97] = arguments[_key97];
}
return (_builder.default).apply(void 0, ["InterfaceExtends"].concat(args));
}
function InterfaceDeclaration() {
for (var _len98 = arguments.length, args = new Array(_len98), _key98 = 0; _key98 < _len98; _key98++) {
args[_key98] = arguments[_key98];
}
return (_builder.default).apply(void 0, ["InterfaceDeclaration"].concat(args));
}
function InterfaceTypeAnnotation() {
for (var _len99 = arguments.length, args = new Array(_len99), _key99 = 0; _key99 < _len99; _key99++) {
args[_key99] = arguments[_key99];
}
return (_builder.default).apply(void 0, ["InterfaceTypeAnnotation"].concat(args));
}
function IntersectionTypeAnnotation() {
for (var _len100 = arguments.length, args = new Array(_len100), _key100 = 0; _key100 < _len100; _key100++) {
args[_key100] = arguments[_key100];
}
return (_builder.default).apply(void 0, ["IntersectionTypeAnnotation"].concat(args));
}
function MixedTypeAnnotation() {
for (var _len101 = arguments.length, args = new Array(_len101), _key101 = 0; _key101 < _len101; _key101++) {
args[_key101] = arguments[_key101];
}
return (_builder.default).apply(void 0, ["MixedTypeAnnotation"].concat(args));
}
function EmptyTypeAnnotation() {
for (var _len102 = arguments.length, args = new Array(_len102), _key102 = 0; _key102 < _len102; _key102++) {
args[_key102] = arguments[_key102];
}
return (_builder.default).apply(void 0, ["EmptyTypeAnnotation"].concat(args));
}
function NullableTypeAnnotation() {
for (var _len103 = arguments.length, args = new Array(_len103), _key103 = 0; _key103 < _len103; _key103++) {
args[_key103] = arguments[_key103];
}
return (_builder.default).apply(void 0, ["NullableTypeAnnotation"].concat(args));
}
function NumberLiteralTypeAnnotation() {
for (var _len104 = arguments.length, args = new Array(_len104), _key104 = 0; _key104 < _len104; _key104++) {
args[_key104] = arguments[_key104];
}
return (_builder.default).apply(void 0, ["NumberLiteralTypeAnnotation"].concat(args));
}
function NumberTypeAnnotation() {
for (var _len105 = arguments.length, args = new Array(_len105), _key105 = 0; _key105 < _len105; _key105++) {
args[_key105] = arguments[_key105];
}
return (_builder.default).apply(void 0, ["NumberTypeAnnotation"].concat(args));
}
function ObjectTypeAnnotation() {
for (var _len106 = arguments.length, args = new Array(_len106), _key106 = 0; _key106 < _len106; _key106++) {
args[_key106] = arguments[_key106];
}
return (_builder.default).apply(void 0, ["ObjectTypeAnnotation"].concat(args));
}
function ObjectTypeInternalSlot() {
for (var _len107 = arguments.length, args = new Array(_len107), _key107 = 0; _key107 < _len107; _key107++) {
args[_key107] = arguments[_key107];
}
return (_builder.default).apply(void 0, ["ObjectTypeInternalSlot"].concat(args));
}
function ObjectTypeCallProperty() {
for (var _len108 = arguments.length, args = new Array(_len108), _key108 = 0; _key108 < _len108; _key108++) {
args[_key108] = arguments[_key108];
}
return (_builder.default).apply(void 0, ["ObjectTypeCallProperty"].concat(args));
}
function ObjectTypeIndexer() {
for (var _len109 = arguments.length, args = new Array(_len109), _key109 = 0; _key109 < _len109; _key109++) {
args[_key109] = arguments[_key109];
}
return (_builder.default).apply(void 0, ["ObjectTypeIndexer"].concat(args));
}
function ObjectTypeProperty() {
for (var _len110 = arguments.length, args = new Array(_len110), _key110 = 0; _key110 < _len110; _key110++) {
args[_key110] = arguments[_key110];
}
return (_builder.default).apply(void 0, ["ObjectTypeProperty"].concat(args));
}
function ObjectTypeSpreadProperty() {
for (var _len111 = arguments.length, args = new Array(_len111), _key111 = 0; _key111 < _len111; _key111++) {
args[_key111] = arguments[_key111];
}
return (_builder.default).apply(void 0, ["ObjectTypeSpreadProperty"].concat(args));
}
function OpaqueType() {
for (var _len112 = arguments.length, args = new Array(_len112), _key112 = 0; _key112 < _len112; _key112++) {
args[_key112] = arguments[_key112];
}
return (_builder.default).apply(void 0, ["OpaqueType"].concat(args));
}
function QualifiedTypeIdentifier() {
for (var _len113 = arguments.length, args = new Array(_len113), _key113 = 0; _key113 < _len113; _key113++) {
args[_key113] = arguments[_key113];
}
return (_builder.default).apply(void 0, ["QualifiedTypeIdentifier"].concat(args));
}
function StringLiteralTypeAnnotation() {
for (var _len114 = arguments.length, args = new Array(_len114), _key114 = 0; _key114 < _len114; _key114++) {
args[_key114] = arguments[_key114];
}
return (_builder.default).apply(void 0, ["StringLiteralTypeAnnotation"].concat(args));
}
function StringTypeAnnotation() {
for (var _len115 = arguments.length, args = new Array(_len115), _key115 = 0; _key115 < _len115; _key115++) {
args[_key115] = arguments[_key115];
}
return (_builder.default).apply(void 0, ["StringTypeAnnotation"].concat(args));
}
function ThisTypeAnnotation() {
for (var _len116 = arguments.length, args = new Array(_len116), _key116 = 0; _key116 < _len116; _key116++) {
args[_key116] = arguments[_key116];
}
return (_builder.default).apply(void 0, ["ThisTypeAnnotation"].concat(args));
}
function TupleTypeAnnotation() {
for (var _len117 = arguments.length, args = new Array(_len117), _key117 = 0; _key117 < _len117; _key117++) {
args[_key117] = arguments[_key117];
}
return (_builder.default).apply(void 0, ["TupleTypeAnnotation"].concat(args));
}
function TypeofTypeAnnotation() {
for (var _len118 = arguments.length, args = new Array(_len118), _key118 = 0; _key118 < _len118; _key118++) {
args[_key118] = arguments[_key118];
}
return (_builder.default).apply(void 0, ["TypeofTypeAnnotation"].concat(args));
}
function TypeAlias() {
for (var _len119 = arguments.length, args = new Array(_len119), _key119 = 0; _key119 < _len119; _key119++) {
args[_key119] = arguments[_key119];
}
return (_builder.default).apply(void 0, ["TypeAlias"].concat(args));
}
function TypeAnnotation() {
for (var _len120 = arguments.length, args = new Array(_len120), _key120 = 0; _key120 < _len120; _key120++) {
args[_key120] = arguments[_key120];
}
return (_builder.default).apply(void 0, ["TypeAnnotation"].concat(args));
}
function TypeCastExpression() {
for (var _len121 = arguments.length, args = new Array(_len121), _key121 = 0; _key121 < _len121; _key121++) {
args[_key121] = arguments[_key121];
}
return (_builder.default).apply(void 0, ["TypeCastExpression"].concat(args));
}
function TypeParameter() {
for (var _len122 = arguments.length, args = new Array(_len122), _key122 = 0; _key122 < _len122; _key122++) {
args[_key122] = arguments[_key122];
}
return (_builder.default).apply(void 0, ["TypeParameter"].concat(args));
}
function TypeParameterDeclaration() {
for (var _len123 = arguments.length, args = new Array(_len123), _key123 = 0; _key123 < _len123; _key123++) {
args[_key123] = arguments[_key123];
}
return (_builder.default).apply(void 0, ["TypeParameterDeclaration"].concat(args));
}
function TypeParameterInstantiation() {
for (var _len124 = arguments.length, args = new Array(_len124), _key124 = 0; _key124 < _len124; _key124++) {
args[_key124] = arguments[_key124];
}
return (_builder.default).apply(void 0, ["TypeParameterInstantiation"].concat(args));
}
function UnionTypeAnnotation() {
for (var _len125 = arguments.length, args = new Array(_len125), _key125 = 0; _key125 < _len125; _key125++) {
args[_key125] = arguments[_key125];
}
return (_builder.default).apply(void 0, ["UnionTypeAnnotation"].concat(args));
}
function Variance() {
for (var _len126 = arguments.length, args = new Array(_len126), _key126 = 0; _key126 < _len126; _key126++) {
args[_key126] = arguments[_key126];
}
return (_builder.default).apply(void 0, ["Variance"].concat(args));
}
function VoidTypeAnnotation() {
for (var _len127 = arguments.length, args = new Array(_len127), _key127 = 0; _key127 < _len127; _key127++) {
args[_key127] = arguments[_key127];
}
return (_builder.default).apply(void 0, ["VoidTypeAnnotation"].concat(args));
}
function JSXAttribute() {
for (var _len128 = arguments.length, args = new Array(_len128), _key128 = 0; _key128 < _len128; _key128++) {
args[_key128] = arguments[_key128];
}
return (_builder.default).apply(void 0, ["JSXAttribute"].concat(args));
}
function JSXClosingElement() {
for (var _len129 = arguments.length, args = new Array(_len129), _key129 = 0; _key129 < _len129; _key129++) {
args[_key129] = arguments[_key129];
}
return (_builder.default).apply(void 0, ["JSXClosingElement"].concat(args));
}
function JSXElement() {
for (var _len130 = arguments.length, args = new Array(_len130), _key130 = 0; _key130 < _len130; _key130++) {
args[_key130] = arguments[_key130];
}
return (_builder.default).apply(void 0, ["JSXElement"].concat(args));
}
function JSXEmptyExpression() {
for (var _len131 = arguments.length, args = new Array(_len131), _key131 = 0; _key131 < _len131; _key131++) {
args[_key131] = arguments[_key131];
}
return (_builder.default).apply(void 0, ["JSXEmptyExpression"].concat(args));
}
function JSXExpressionContainer() {
for (var _len132 = arguments.length, args = new Array(_len132), _key132 = 0; _key132 < _len132; _key132++) {
args[_key132] = arguments[_key132];
}
return (_builder.default).apply(void 0, ["JSXExpressionContainer"].concat(args));
}
function JSXSpreadChild() {
for (var _len133 = arguments.length, args = new Array(_len133), _key133 = 0; _key133 < _len133; _key133++) {
args[_key133] = arguments[_key133];
}
return (_builder.default).apply(void 0, ["JSXSpreadChild"].concat(args));
}
function JSXIdentifier() {
for (var _len134 = arguments.length, args = new Array(_len134), _key134 = 0; _key134 < _len134; _key134++) {
args[_key134] = arguments[_key134];
}
return (_builder.default).apply(void 0, ["JSXIdentifier"].concat(args));
}
function JSXMemberExpression() {
for (var _len135 = arguments.length, args = new Array(_len135), _key135 = 0; _key135 < _len135; _key135++) {
args[_key135] = arguments[_key135];
}
return (_builder.default).apply(void 0, ["JSXMemberExpression"].concat(args));
}
function JSXNamespacedName() {
for (var _len136 = arguments.length, args = new Array(_len136), _key136 = 0; _key136 < _len136; _key136++) {
args[_key136] = arguments[_key136];
}
return (_builder.default).apply(void 0, ["JSXNamespacedName"].concat(args));
}
function JSXOpeningElement() {
for (var _len137 = arguments.length, args = new Array(_len137), _key137 = 0; _key137 < _len137; _key137++) {
args[_key137] = arguments[_key137];
}
return (_builder.default).apply(void 0, ["JSXOpeningElement"].concat(args));
}
function JSXSpreadAttribute() {
for (var _len138 = arguments.length, args = new Array(_len138), _key138 = 0; _key138 < _len138; _key138++) {
args[_key138] = arguments[_key138];
}
return (_builder.default).apply(void 0, ["JSXSpreadAttribute"].concat(args));
}
function JSXText() {
for (var _len139 = arguments.length, args = new Array(_len139), _key139 = 0; _key139 < _len139; _key139++) {
args[_key139] = arguments[_key139];
}
return (_builder.default).apply(void 0, ["JSXText"].concat(args));
}
function JSXFragment() {
for (var _len140 = arguments.length, args = new Array(_len140), _key140 = 0; _key140 < _len140; _key140++) {
args[_key140] = arguments[_key140];
}
return (_builder.default).apply(void 0, ["JSXFragment"].concat(args));
}
function JSXOpeningFragment() {
for (var _len141 = arguments.length, args = new Array(_len141), _key141 = 0; _key141 < _len141; _key141++) {
args[_key141] = arguments[_key141];
}
return (_builder.default).apply(void 0, ["JSXOpeningFragment"].concat(args));
}
function JSXClosingFragment() {
for (var _len142 = arguments.length, args = new Array(_len142), _key142 = 0; _key142 < _len142; _key142++) {
args[_key142] = arguments[_key142];
}
return (_builder.default).apply(void 0, ["JSXClosingFragment"].concat(args));
}
function Noop() {
for (var _len143 = arguments.length, args = new Array(_len143), _key143 = 0; _key143 < _len143; _key143++) {
args[_key143] = arguments[_key143];
}
return (_builder.default).apply(void 0, ["Noop"].concat(args));
}
function ParenthesizedExpression() {
for (var _len144 = arguments.length, args = new Array(_len144), _key144 = 0; _key144 < _len144; _key144++) {
args[_key144] = arguments[_key144];
}
return (_builder.default).apply(void 0, ["ParenthesizedExpression"].concat(args));
}
function AwaitExpression() {
for (var _len145 = arguments.length, args = new Array(_len145), _key145 = 0; _key145 < _len145; _key145++) {
args[_key145] = arguments[_key145];
}
return (_builder.default).apply(void 0, ["AwaitExpression"].concat(args));
}
function BindExpression() {
for (var _len146 = arguments.length, args = new Array(_len146), _key146 = 0; _key146 < _len146; _key146++) {
args[_key146] = arguments[_key146];
}
return (_builder.default).apply(void 0, ["BindExpression"].concat(args));
}
function ClassProperty() {
for (var _len147 = arguments.length, args = new Array(_len147), _key147 = 0; _key147 < _len147; _key147++) {
args[_key147] = arguments[_key147];
}
return (_builder.default).apply(void 0, ["ClassProperty"].concat(args));
}
function OptionalMemberExpression() {
for (var _len148 = arguments.length, args = new Array(_len148), _key148 = 0; _key148 < _len148; _key148++) {
args[_key148] = arguments[_key148];
}
return (_builder.default).apply(void 0, ["OptionalMemberExpression"].concat(args));
}
function OptionalCallExpression() {
for (var _len149 = arguments.length, args = new Array(_len149), _key149 = 0; _key149 < _len149; _key149++) {
args[_key149] = arguments[_key149];
}
return (_builder.default).apply(void 0, ["OptionalCallExpression"].concat(args));
}
function ClassPrivateProperty() {
for (var _len150 = arguments.length, args = new Array(_len150), _key150 = 0; _key150 < _len150; _key150++) {
args[_key150] = arguments[_key150];
}
return (_builder.default).apply(void 0, ["ClassPrivateProperty"].concat(args));
}
function Import() {
for (var _len151 = arguments.length, args = new Array(_len151), _key151 = 0; _key151 < _len151; _key151++) {
args[_key151] = arguments[_key151];
}
return (_builder.default).apply(void 0, ["Import"].concat(args));
}
function Decorator() {
for (var _len152 = arguments.length, args = new Array(_len152), _key152 = 0; _key152 < _len152; _key152++) {
args[_key152] = arguments[_key152];
}
return (_builder.default).apply(void 0, ["Decorator"].concat(args));
}
function DoExpression() {
for (var _len153 = arguments.length, args = new Array(_len153), _key153 = 0; _key153 < _len153; _key153++) {
args[_key153] = arguments[_key153];
}
return (_builder.default).apply(void 0, ["DoExpression"].concat(args));
}
function ExportDefaultSpecifier() {
for (var _len154 = arguments.length, args = new Array(_len154), _key154 = 0; _key154 < _len154; _key154++) {
args[_key154] = arguments[_key154];
}
return (_builder.default).apply(void 0, ["ExportDefaultSpecifier"].concat(args));
}
function ExportNamespaceSpecifier() {
for (var _len155 = arguments.length, args = new Array(_len155), _key155 = 0; _key155 < _len155; _key155++) {
args[_key155] = arguments[_key155];
}
return (_builder.default).apply(void 0, ["ExportNamespaceSpecifier"].concat(args));
}
function PrivateName() {
for (var _len156 = arguments.length, args = new Array(_len156), _key156 = 0; _key156 < _len156; _key156++) {
args[_key156] = arguments[_key156];
}
return (_builder.default).apply(void 0, ["PrivateName"].concat(args));
}
function BigIntLiteral() {
for (var _len157 = arguments.length, args = new Array(_len157), _key157 = 0; _key157 < _len157; _key157++) {
args[_key157] = arguments[_key157];
}
return (_builder.default).apply(void 0, ["BigIntLiteral"].concat(args));
}
function TSParameterProperty() {
for (var _len158 = arguments.length, args = new Array(_len158), _key158 = 0; _key158 < _len158; _key158++) {
args[_key158] = arguments[_key158];
}
return (_builder.default).apply(void 0, ["TSParameterProperty"].concat(args));
}
function TSDeclareFunction() {
for (var _len159 = arguments.length, args = new Array(_len159), _key159 = 0; _key159 < _len159; _key159++) {
args[_key159] = arguments[_key159];
}
return (_builder.default).apply(void 0, ["TSDeclareFunction"].concat(args));
}
function TSDeclareMethod() {
for (var _len160 = arguments.length, args = new Array(_len160), _key160 = 0; _key160 < _len160; _key160++) {
args[_key160] = arguments[_key160];
}
return (_builder.default).apply(void 0, ["TSDeclareMethod"].concat(args));
}
function TSQualifiedName() {
for (var _len161 = arguments.length, args = new Array(_len161), _key161 = 0; _key161 < _len161; _key161++) {
args[_key161] = arguments[_key161];
}
return (_builder.default).apply(void 0, ["TSQualifiedName"].concat(args));
}
function TSCallSignatureDeclaration() {
for (var _len162 = arguments.length, args = new Array(_len162), _key162 = 0; _key162 < _len162; _key162++) {
args[_key162] = arguments[_key162];
}
return (_builder.default).apply(void 0, ["TSCallSignatureDeclaration"].concat(args));
}
function TSConstructSignatureDeclaration() {
for (var _len163 = arguments.length, args = new Array(_len163), _key163 = 0; _key163 < _len163; _key163++) {
args[_key163] = arguments[_key163];
}
return (_builder.default).apply(void 0, ["TSConstructSignatureDeclaration"].concat(args));
}
function TSPropertySignature() {
for (var _len164 = arguments.length, args = new Array(_len164), _key164 = 0; _key164 < _len164; _key164++) {
args[_key164] = arguments[_key164];
}
return (_builder.default).apply(void 0, ["TSPropertySignature"].concat(args));
}
function TSMethodSignature() {
for (var _len165 = arguments.length, args = new Array(_len165), _key165 = 0; _key165 < _len165; _key165++) {
args[_key165] = arguments[_key165];
}
return (_builder.default).apply(void 0, ["TSMethodSignature"].concat(args));
}
function TSIndexSignature() {
for (var _len166 = arguments.length, args = new Array(_len166), _key166 = 0; _key166 < _len166; _key166++) {
args[_key166] = arguments[_key166];
}
return (_builder.default).apply(void 0, ["TSIndexSignature"].concat(args));
}
function TSAnyKeyword() {
for (var _len167 = arguments.length, args = new Array(_len167), _key167 = 0; _key167 < _len167; _key167++) {
args[_key167] = arguments[_key167];
}
return (_builder.default).apply(void 0, ["TSAnyKeyword"].concat(args));
}
function TSNumberKeyword() {
for (var _len168 = arguments.length, args = new Array(_len168), _key168 = 0; _key168 < _len168; _key168++) {
args[_key168] = arguments[_key168];
}
return (_builder.default).apply(void 0, ["TSNumberKeyword"].concat(args));
}
function TSObjectKeyword() {
for (var _len169 = arguments.length, args = new Array(_len169), _key169 = 0; _key169 < _len169; _key169++) {
args[_key169] = arguments[_key169];
}
return (_builder.default).apply(void 0, ["TSObjectKeyword"].concat(args));
}
function TSBooleanKeyword() {
for (var _len170 = arguments.length, args = new Array(_len170), _key170 = 0; _key170 < _len170; _key170++) {
args[_key170] = arguments[_key170];
}
return (_builder.default).apply(void 0, ["TSBooleanKeyword"].concat(args));
}
function TSStringKeyword() {
for (var _len171 = arguments.length, args = new Array(_len171), _key171 = 0; _key171 < _len171; _key171++) {
args[_key171] = arguments[_key171];
}
return (_builder.default).apply(void 0, ["TSStringKeyword"].concat(args));
}
function TSSymbolKeyword() {
for (var _len172 = arguments.length, args = new Array(_len172), _key172 = 0; _key172 < _len172; _key172++) {
args[_key172] = arguments[_key172];
}
return (_builder.default).apply(void 0, ["TSSymbolKeyword"].concat(args));
}
function TSVoidKeyword() {
for (var _len173 = arguments.length, args = new Array(_len173), _key173 = 0; _key173 < _len173; _key173++) {
args[_key173] = arguments[_key173];
}
return (_builder.default).apply(void 0, ["TSVoidKeyword"].concat(args));
}
function TSUndefinedKeyword() {
for (var _len174 = arguments.length, args = new Array(_len174), _key174 = 0; _key174 < _len174; _key174++) {
args[_key174] = arguments[_key174];
}
return (_builder.default).apply(void 0, ["TSUndefinedKeyword"].concat(args));
}
function TSNullKeyword() {
for (var _len175 = arguments.length, args = new Array(_len175), _key175 = 0; _key175 < _len175; _key175++) {
args[_key175] = arguments[_key175];
}
return (_builder.default).apply(void 0, ["TSNullKeyword"].concat(args));
}
function TSNeverKeyword() {
for (var _len176 = arguments.length, args = new Array(_len176), _key176 = 0; _key176 < _len176; _key176++) {
args[_key176] = arguments[_key176];
}
return (_builder.default).apply(void 0, ["TSNeverKeyword"].concat(args));
}
function TSThisType() {
for (var _len177 = arguments.length, args = new Array(_len177), _key177 = 0; _key177 < _len177; _key177++) {
args[_key177] = arguments[_key177];
}
return (_builder.default).apply(void 0, ["TSThisType"].concat(args));
}
function TSFunctionType() {
for (var _len178 = arguments.length, args = new Array(_len178), _key178 = 0; _key178 < _len178; _key178++) {
args[_key178] = arguments[_key178];
}
return (_builder.default).apply(void 0, ["TSFunctionType"].concat(args));
}
function TSConstructorType() {
for (var _len179 = arguments.length, args = new Array(_len179), _key179 = 0; _key179 < _len179; _key179++) {
args[_key179] = arguments[_key179];
}
return (_builder.default).apply(void 0, ["TSConstructorType"].concat(args));
}
function TSTypeReference() {
for (var _len180 = arguments.length, args = new Array(_len180), _key180 = 0; _key180 < _len180; _key180++) {
args[_key180] = arguments[_key180];
}
return (_builder.default).apply(void 0, ["TSTypeReference"].concat(args));
}
function TSTypePredicate() {
for (var _len181 = arguments.length, args = new Array(_len181), _key181 = 0; _key181 < _len181; _key181++) {
args[_key181] = arguments[_key181];
}
return (_builder.default).apply(void 0, ["TSTypePredicate"].concat(args));
}
function TSTypeQuery() {
for (var _len182 = arguments.length, args = new Array(_len182), _key182 = 0; _key182 < _len182; _key182++) {
args[_key182] = arguments[_key182];
}
return (_builder.default).apply(void 0, ["TSTypeQuery"].concat(args));
}
function TSTypeLiteral() {
for (var _len183 = arguments.length, args = new Array(_len183), _key183 = 0; _key183 < _len183; _key183++) {
args[_key183] = arguments[_key183];
}
return (_builder.default).apply(void 0, ["TSTypeLiteral"].concat(args));
}
function TSArrayType() {
for (var _len184 = arguments.length, args = new Array(_len184), _key184 = 0; _key184 < _len184; _key184++) {
args[_key184] = arguments[_key184];
}
return (_builder.default).apply(void 0, ["TSArrayType"].concat(args));
}
function TSTupleType() {
for (var _len185 = arguments.length, args = new Array(_len185), _key185 = 0; _key185 < _len185; _key185++) {
args[_key185] = arguments[_key185];
}
return (_builder.default).apply(void 0, ["TSTupleType"].concat(args));
}
function TSUnionType() {
for (var _len186 = arguments.length, args = new Array(_len186), _key186 = 0; _key186 < _len186; _key186++) {
args[_key186] = arguments[_key186];
}
return (_builder.default).apply(void 0, ["TSUnionType"].concat(args));
}
function TSIntersectionType() {
for (var _len187 = arguments.length, args = new Array(_len187), _key187 = 0; _key187 < _len187; _key187++) {
args[_key187] = arguments[_key187];
}
return (_builder.default).apply(void 0, ["TSIntersectionType"].concat(args));
}
function TSConditionalType() {
for (var _len188 = arguments.length, args = new Array(_len188), _key188 = 0; _key188 < _len188; _key188++) {
args[_key188] = arguments[_key188];
}
return (_builder.default).apply(void 0, ["TSConditionalType"].concat(args));
}
function TSInferType() {
for (var _len189 = arguments.length, args = new Array(_len189), _key189 = 0; _key189 < _len189; _key189++) {
args[_key189] = arguments[_key189];
}
return (_builder.default).apply(void 0, ["TSInferType"].concat(args));
}
function TSParenthesizedType() {
for (var _len190 = arguments.length, args = new Array(_len190), _key190 = 0; _key190 < _len190; _key190++) {
args[_key190] = arguments[_key190];
}
return (_builder.default).apply(void 0, ["TSParenthesizedType"].concat(args));
}
function TSTypeOperator() {
for (var _len191 = arguments.length, args = new Array(_len191), _key191 = 0; _key191 < _len191; _key191++) {
args[_key191] = arguments[_key191];
}
return (_builder.default).apply(void 0, ["TSTypeOperator"].concat(args));
}
function TSIndexedAccessType() {
for (var _len192 = arguments.length, args = new Array(_len192), _key192 = 0; _key192 < _len192; _key192++) {
args[_key192] = arguments[_key192];
}
return (_builder.default).apply(void 0, ["TSIndexedAccessType"].concat(args));
}
function TSMappedType() {
for (var _len193 = arguments.length, args = new Array(_len193), _key193 = 0; _key193 < _len193; _key193++) {
args[_key193] = arguments[_key193];
}
return (_builder.default).apply(void 0, ["TSMappedType"].concat(args));
}
function TSLiteralType() {
for (var _len194 = arguments.length, args = new Array(_len194), _key194 = 0; _key194 < _len194; _key194++) {
args[_key194] = arguments[_key194];
}
return (_builder.default).apply(void 0, ["TSLiteralType"].concat(args));
}
function TSExpressionWithTypeArguments() {
for (var _len195 = arguments.length, args = new Array(_len195), _key195 = 0; _key195 < _len195; _key195++) {
args[_key195] = arguments[_key195];
}
return (_builder.default).apply(void 0, ["TSExpressionWithTypeArguments"].concat(args));
}
function TSInterfaceDeclaration() {
for (var _len196 = arguments.length, args = new Array(_len196), _key196 = 0; _key196 < _len196; _key196++) {
args[_key196] = arguments[_key196];
}
return (_builder.default).apply(void 0, ["TSInterfaceDeclaration"].concat(args));
}
function TSInterfaceBody() {
for (var _len197 = arguments.length, args = new Array(_len197), _key197 = 0; _key197 < _len197; _key197++) {
args[_key197] = arguments[_key197];
}
return (_builder.default).apply(void 0, ["TSInterfaceBody"].concat(args));
}
function TSTypeAliasDeclaration() {
for (var _len198 = arguments.length, args = new Array(_len198), _key198 = 0; _key198 < _len198; _key198++) {
args[_key198] = arguments[_key198];
}
return (_builder.default).apply(void 0, ["TSTypeAliasDeclaration"].concat(args));
}
function TSAsExpression() {
for (var _len199 = arguments.length, args = new Array(_len199), _key199 = 0; _key199 < _len199; _key199++) {
args[_key199] = arguments[_key199];
}
return (_builder.default).apply(void 0, ["TSAsExpression"].concat(args));
}
function TSTypeAssertion() {
for (var _len200 = arguments.length, args = new Array(_len200), _key200 = 0; _key200 < _len200; _key200++) {
args[_key200] = arguments[_key200];
}
return (_builder.default).apply(void 0, ["TSTypeAssertion"].concat(args));
}
function TSEnumDeclaration() {
for (var _len201 = arguments.length, args = new Array(_len201), _key201 = 0; _key201 < _len201; _key201++) {
args[_key201] = arguments[_key201];
}
return (_builder.default).apply(void 0, ["TSEnumDeclaration"].concat(args));
}
function TSEnumMember() {
for (var _len202 = arguments.length, args = new Array(_len202), _key202 = 0; _key202 < _len202; _key202++) {
args[_key202] = arguments[_key202];
}
return (_builder.default).apply(void 0, ["TSEnumMember"].concat(args));
}
function TSModuleDeclaration() {
for (var _len203 = arguments.length, args = new Array(_len203), _key203 = 0; _key203 < _len203; _key203++) {
args[_key203] = arguments[_key203];
}
return (_builder.default).apply(void 0, ["TSModuleDeclaration"].concat(args));
}
function TSModuleBlock() {
for (var _len204 = arguments.length, args = new Array(_len204), _key204 = 0; _key204 < _len204; _key204++) {
args[_key204] = arguments[_key204];
}
return (_builder.default).apply(void 0, ["TSModuleBlock"].concat(args));
}
function TSImportEqualsDeclaration() {
for (var _len205 = arguments.length, args = new Array(_len205), _key205 = 0; _key205 < _len205; _key205++) {
args[_key205] = arguments[_key205];
}
return (_builder.default).apply(void 0, ["TSImportEqualsDeclaration"].concat(args));
}
function TSExternalModuleReference() {
for (var _len206 = arguments.length, args = new Array(_len206), _key206 = 0; _key206 < _len206; _key206++) {
args[_key206] = arguments[_key206];
}
return (_builder.default).apply(void 0, ["TSExternalModuleReference"].concat(args));
}
function TSNonNullExpression() {
for (var _len207 = arguments.length, args = new Array(_len207), _key207 = 0; _key207 < _len207; _key207++) {
args[_key207] = arguments[_key207];
}
return (_builder.default).apply(void 0, ["TSNonNullExpression"].concat(args));
}
function TSExportAssignment() {
for (var _len208 = arguments.length, args = new Array(_len208), _key208 = 0; _key208 < _len208; _key208++) {
args[_key208] = arguments[_key208];
}
return (_builder.default).apply(void 0, ["TSExportAssignment"].concat(args));
}
function TSNamespaceExportDeclaration() {
for (var _len209 = arguments.length, args = new Array(_len209), _key209 = 0; _key209 < _len209; _key209++) {
args[_key209] = arguments[_key209];
}
return (_builder.default).apply(void 0, ["TSNamespaceExportDeclaration"].concat(args));
}
function TSTypeAnnotation() {
for (var _len210 = arguments.length, args = new Array(_len210), _key210 = 0; _key210 < _len210; _key210++) {
args[_key210] = arguments[_key210];
}
return (_builder.default).apply(void 0, ["TSTypeAnnotation"].concat(args));
}
function TSTypeParameterInstantiation() {
for (var _len211 = arguments.length, args = new Array(_len211), _key211 = 0; _key211 < _len211; _key211++) {
args[_key211] = arguments[_key211];
}
return (_builder.default).apply(void 0, ["TSTypeParameterInstantiation"].concat(args));
}
function TSTypeParameterDeclaration() {
for (var _len212 = arguments.length, args = new Array(_len212), _key212 = 0; _key212 < _len212; _key212++) {
args[_key212] = arguments[_key212];
}
return (_builder.default).apply(void 0, ["TSTypeParameterDeclaration"].concat(args));
}
function TSTypeParameter() {
for (var _len213 = arguments.length, args = new Array(_len213), _key213 = 0; _key213 < _len213; _key213++) {
args[_key213] = arguments[_key213];
}
return (_builder.default).apply(void 0, ["TSTypeParameter"].concat(args));
}
function NumberLiteral() {
console.trace("The node type NumberLiteral has been renamed to NumericLiteral");
for (var _len214 = arguments.length, args = new Array(_len214), _key214 = 0; _key214 < _len214; _key214++) {
args[_key214] = arguments[_key214];
}
return NumberLiteral.apply(void 0, ["NumberLiteral"].concat(args));
}
function RegexLiteral() {
console.trace("The node type RegexLiteral has been renamed to RegExpLiteral");
for (var _len215 = arguments.length, args = new Array(_len215), _key215 = 0; _key215 < _len215; _key215++) {
args[_key215] = arguments[_key215];
}
return RegexLiteral.apply(void 0, ["RegexLiteral"].concat(args));
}
function RestProperty() {
console.trace("The node type RestProperty has been renamed to RestElement");
for (var _len216 = arguments.length, args = new Array(_len216), _key216 = 0; _key216 < _len216; _key216++) {
args[_key216] = arguments[_key216];
}
return RestProperty.apply(void 0, ["RestProperty"].concat(args));
}
function SpreadProperty() {
console.trace("The node type SpreadProperty has been renamed to SpreadElement");
for (var _len217 = arguments.length, args = new Array(_len217), _key217 = 0; _key217 < _len217; _key217++) {
args[_key217] = arguments[_key217];
}
return SpreadProperty.apply(void 0, ["SpreadProperty"].concat(args));
}
/***/ }),
/* 9 */
/***/ (function(module, exports) {
var g;
g = function () {
return this;
}();
try {
g = g || Function("return this")() || (eval)("this");
} catch (e) {
if (typeof window === "object") g = window;
}
module.exports = g;
/***/ }),
/* 10 */
/***/ (function(module, exports) {
var isArray = Array.isArray;
module.exports = isArray;
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {function normalizeArray(parts, allowAboveRoot) {
var up = 0;
for (var i = parts.length - 1; i >= 0; i--) {
var last = parts[i];
if (last === '.') {
parts.splice(i, 1);
} else if (last === '..') {
parts.splice(i, 1);
up++;
} else if (up) {
parts.splice(i, 1);
up--;
}
}
if (allowAboveRoot) {
for (; up--; up) {
parts.unshift('..');
}
}
return parts;
}
var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
var splitPath = function splitPath(filename) {
return splitPathRe.exec(filename).slice(1);
};
exports.resolve = function () {
var resolvedPath = '',
resolvedAbsolute = false;
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
var path = i >= 0 ? arguments[i] : process.cwd();
if (typeof path !== 'string') {
throw new TypeError('Arguments to path.resolve must be strings');
} else if (!path) {
continue;
}
resolvedPath = path + '/' + resolvedPath;
resolvedAbsolute = path.charAt(0) === '/';
}
resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function (p) {
return !!p;
}), !resolvedAbsolute).join('/');
return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';
};
exports.normalize = function (path) {
var isAbsolute = exports.isAbsolute(path),
trailingSlash = substr(path, -1) === '/';
path = normalizeArray(filter(path.split('/'), function (p) {
return !!p;
}), !isAbsolute).join('/');
if (!path && !isAbsolute) {
path = '.';
}
if (path && trailingSlash) {
path += '/';
}
return (isAbsolute ? '/' : '') + path;
};
exports.isAbsolute = function (path) {
return path.charAt(0) === '/';
};
exports.join = function () {
var paths = Array.prototype.slice.call(arguments, 0);
return exports.normalize(filter(paths, function (p, index) {
if (typeof p !== 'string') {
throw new TypeError('Arguments to path.join must be strings');
}
return p;
}).join('/'));
};
exports.relative = function (from, to) {
from = exports.resolve(from).substr(1);
to = exports.resolve(to).substr(1);
function trim(arr) {
var start = 0;
for (; start < arr.length; start++) {
if (arr[start] !== '') break;
}
var end = arr.length - 1;
for (; end >= 0; end--) {
if (arr[end] !== '') break;
}
if (start > end) return [];
return arr.slice(start, end - start + 1);
}
var fromParts = trim(from.split('/'));
var toParts = trim(to.split('/'));
var length = Math.min(fromParts.length, toParts.length);
var samePartsLength = length;
for (var i = 0; i < length; i++) {
if (fromParts[i] !== toParts[i]) {
samePartsLength = i;
break;
}
}
var outputParts = [];
for (var i = samePartsLength; i < fromParts.length; i++) {
outputParts.push('..');
}
outputParts = outputParts.concat(toParts.slice(samePartsLength));
return outputParts.join('/');
};
exports.sep = '/';
exports.delimiter = ':';
exports.dirname = function (path) {
var result = splitPath(path),
root = result[0],
dir = result[1];
if (!root && !dir) {
return '.';
}
if (dir) {
dir = dir.substr(0, dir.length - 1);
}
return root + dir;
};
exports.basename = function (path, ext) {
var f = splitPath(path)[2];
if (ext && f.substr(-1 * ext.length) === ext) {
f = f.substr(0, f.length - ext.length);
}
return f;
};
exports.extname = function (path) {
return splitPath(path)[3];
};
function filter(xs, f) {
if (xs.filter) return xs.filter(f);
var res = [];
for (var i = 0; i < xs.length; i++) {
if (f(xs[i], i, xs)) res.push(xs[i]);
}
return res;
}
var substr = 'ab'.substr(-1) === 'b' ? function (str, start, len) {
return str.substr(start, len);
} : function (str, start, len) {
if (start < 0) start = str.length + start;
return str.substr(start, len);
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)));
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = traverse;
Object.defineProperty(exports, "NodePath", {
enumerable: true,
get: function get() {
return _path.default;
}
});
Object.defineProperty(exports, "Scope", {
enumerable: true,
get: function get() {
return _scope.default;
}
});
Object.defineProperty(exports, "Hub", {
enumerable: true,
get: function get() {
return _hub.default;
}
});
exports.visitors = void 0;
var _context = _interopRequireDefault(__webpack_require__(290));
var visitors = _interopRequireWildcard(__webpack_require__(483));
exports.visitors = visitors;
function _includes() {
var data = _interopRequireDefault(__webpack_require__(95));
_includes = function _includes() {
return data;
};
return data;
}
function t() {
var data = _interopRequireWildcard(__webpack_require__(4));
t = function t() {
return data;
};
return data;
}
var cache = _interopRequireWildcard(__webpack_require__(62));
var _path = _interopRequireDefault(__webpack_require__(31));
var _scope = _interopRequireDefault(__webpack_require__(159));
var _hub = _interopRequireDefault(__webpack_require__(484));
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function traverse(parent, opts, scope, state, parentPath) {
if (!parent) return;
if (!opts) opts = {};
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.");
}
}
visitors.explode(opts);
traverse.node(parent, opts, scope, state, parentPath);
}
traverse.visitors = visitors;
traverse.verify = visitors.verify;
traverse.explode = visitors.explode;
traverse.cheap = function (node, enter) {
return t().traverseFast(node, enter);
};
traverse.node = function (node, opts, scope, state, parentPath, skipKeys) {
var keys = t().VISITOR_KEYS[node.type];
if (!keys) return;
var context = new _context.default(scope, opts, state, parentPath);
for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var key = _ref;
if (skipKeys && skipKeys[key]) continue;
if (context.visit(node, key)) return;
}
};
traverse.clearNode = function (node, opts) {
t().removeProperties(node, opts);
cache.path.delete(node);
};
traverse.removeProperties = function (tree, opts) {
t().traverseFast(tree, traverse.clearNode, opts);
return tree;
};
function hasBlacklistedType(path, state) {
if (path.node.type === state.type) {
state.has = true;
path.stop();
}
}
traverse.hasType = function (tree, type, blacklistTypes) {
if ((0, _includes().default)(blacklistTypes, tree.type)) return false;
if (tree.type === type) return true;
var state = {
has: false,
type: type
};
traverse(tree, {
noScope: true,
blacklist: blacklistTypes,
enter: hasBlacklistedType
}, null, state);
return state.has;
};
traverse.cache = cache;
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(126);
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
var root = freeGlobal || freeSelf || Function('return this')();
module.exports = root;
/***/ }),
/* 14 */
/***/ (function(module, exports) {
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
module.exports = isObjectLike;
/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "VISITOR_KEYS", {
enumerable: true,
get: function get() {
return _utils.VISITOR_KEYS;
}
});
Object.defineProperty(exports, "ALIAS_KEYS", {
enumerable: true,
get: function get() {
return _utils.ALIAS_KEYS;
}
});
Object.defineProperty(exports, "FLIPPED_ALIAS_KEYS", {
enumerable: true,
get: function get() {
return _utils.FLIPPED_ALIAS_KEYS;
}
});
Object.defineProperty(exports, "NODE_FIELDS", {
enumerable: true,
get: function get() {
return _utils.NODE_FIELDS;
}
});
Object.defineProperty(exports, "BUILDER_KEYS", {
enumerable: true,
get: function get() {
return _utils.BUILDER_KEYS;
}
});
Object.defineProperty(exports, "DEPRECATED_KEYS", {
enumerable: true,
get: function get() {
return _utils.DEPRECATED_KEYS;
}
});
exports.TYPES = void 0;
function _toFastProperties() {
var data = _interopRequireDefault(__webpack_require__(356));
_toFastProperties = function _toFastProperties() {
return data;
};
return data;
}
__webpack_require__(85);
__webpack_require__(89);
__webpack_require__(359);
__webpack_require__(360);
__webpack_require__(361);
__webpack_require__(362);
__webpack_require__(363);
var _utils = __webpack_require__(23);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
(0, _toFastProperties().default)(_utils.VISITOR_KEYS);
(0, _toFastProperties().default)(_utils.ALIAS_KEYS);
(0, _toFastProperties().default)(_utils.FLIPPED_ALIAS_KEYS);
(0, _toFastProperties().default)(_utils.NODE_FIELDS);
(0, _toFastProperties().default)(_utils.BUILDER_KEYS);
(0, _toFastProperties().default)(_utils.DEPRECATED_KEYS);
var TYPES = Object.keys(_utils.VISITOR_KEYS).concat(Object.keys(_utils.FLIPPED_ALIAS_KEYS)).concat(Object.keys(_utils.DEPRECATED_KEYS));
exports.TYPES = TYPES;
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global, process) {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;
};
exports.deprecate = function (fn, msg) {
if (isUndefined(global.process)) {
return function () {
return exports.deprecate(fn, msg).apply(this, arguments);
};
}
if (process.noDeprecation === true) {
return fn;
}
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 debugEnviron;
exports.debuglog = function (set) {
if (isUndefined(debugEnviron)) debugEnviron = {"NODE_ENV":"production"}.NODE_DEBUG || '';
set = set.toUpperCase();
if (!debugs[set]) {
if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
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];
};
function inspect(obj, opts) {
var ctx = {
seen: [],
stylize: stylizeNoColor
};
if (arguments.length >= 3) ctx.depth = arguments[2];
if (arguments.length >= 4) ctx.colors = arguments[3];
if (isBoolean(opts)) {
ctx.showHidden = opts;
} else if (opts) {
exports._extend(ctx, opts);
}
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;
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]
};
inspect.styles = {
'special': 'cyan',
'number': 'yellow',
'boolean': 'yellow',
'undefined': 'grey',
'null': 'bold',
'string': 'green',
'date': 'magenta',
'regexp': 'red'
};
function stylizeWithColor(str, styleType) {
var style = inspect.styles[styleType];
if (style) {
return "\x1B[" + inspect.colors[style][0] + 'm' + str + "\x1B[" + 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) {
if (ctx.customInspect && value && isFunction(value.inspect) && value.inspect !== exports.inspect && !(value.constructor && value.constructor.prototype === value)) {
var ret = value.inspect(recurseTimes, ctx);
if (!isString(ret)) {
ret = formatValue(ctx, ret, recurseTimes);
}
return ret;
}
var primitive = formatPrimitive(ctx, value);
if (primitive) {
return primitive;
}
var keys = Object.keys(value);
var visibleKeys = arrayToHash(keys);
if (ctx.showHidden) {
keys = Object.getOwnPropertyNames(value);
}
if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
return formatError(value);
}
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 = ['{', '}'];
if (isArray(value)) {
array = true;
braces = ['[', ']'];
}
if (isFunction(value)) {
var n = value.name ? ': ' + value.name : '';
base = ' [Function' + n + ']';
}
if (isRegExp(value)) {
base = ' ' + RegExp.prototype.toString.call(value);
}
if (isDate(value)) {
base = ' ' + Date.prototype.toUTCString.call(value);
}
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');
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').substr(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.substr(1, name.length - 2);
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];
}
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;
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;
function isError(e) {
return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = 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' || typeof arg === 'undefined';
}
exports.isPrimitive = isPrimitive;
exports.isBuffer = __webpack_require__(490);
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'];
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(' ');
}
exports.log = function () {
console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
};
exports.inherits = __webpack_require__(491);
exports._extend = function (origin, add) {
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);
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9), __webpack_require__(6)));
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(66);
module.exports = function extend(o) {
if (!isObject(o)) {
o = {};
}
var len = arguments.length;
for (var i = 1; i < len; i++) {
var obj = arguments[i];
if (isObject(obj)) {
assign(o, obj);
}
}
return o;
};
function assign(a, b) {
for (var key in b) {
if (hasOwn(b, key)) {
a[key] = b[key];
}
}
}
function hasOwn(obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key);
}
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
var isDescriptor = __webpack_require__(537);
module.exports = function defineProperty(obj, prop, val) {
if (typeof obj !== 'object' && typeof obj !== 'function') {
throw new TypeError('expected an object or function.');
}
if (typeof prop !== 'string') {
throw new TypeError('expected `prop` to be a string.');
}
if (isDescriptor(val) && ('set' in val || 'get' in val)) {
return Object.defineProperty(obj, prop, val);
}
return Object.defineProperty(obj, prop, {
configurable: true,
enumerable: false,
writable: true,
value: val
});
};
/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {
(function(global) {
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <[email protected]> <http://feross.org>
* @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;
}
function isBuffer(b) {
if (global.Buffer && typeof global.Buffer.isBuffer === 'function') {
return global.Buffer.isBuffer(b);
}
return !!(b != null && b._isBuffer);
}
var util = __webpack_require__(16);
var hasOwn = Object.prototype.hasOwnProperty;
var pSlice = Array.prototype.slice;
var functionsHaveNames = function () {
return function foo() {}.name === 'foo';
}();
function pToString(obj) {
return Object.prototype.toString.call(obj);
}
function isView(arrbuf) {
if (isBuffer(arrbuf)) {
return false;
}
if (typeof global.ArrayBuffer !== 'function') {
return false;
}
if (typeof ArrayBuffer.isView === 'function') {
return ArrayBuffer.isView(arrbuf);
}
if (!arrbuf) {
return false;
}
if (arrbuf instanceof DataView) {
return true;
}
if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
return true;
}
return false;
}
var assert = module.exports = ok;
var regex = /\s*function\s+([^\(\s]*)\s*/;
function getName(func) {
if (!util.isFunction(func)) {
return;
}
if (functionsHaveNames) {
return func.name;
}
var str = func.toString();
var match = str.match(regex);
return match && match[1];
}
assert.AssertionError = function AssertionError(options) {
this.name = 'AssertionError';
this.actual = options.actual;
this.expected = options.expected;
this.operator = options.operator;
if (options.message) {
this.message = options.message;
this.generatedMessage = false;
} else {
this.message = getMessage(this);
this.generatedMessage = true;
}
var stackStartFunction = options.stackStartFunction || fail;
if (Error.captureStackTrace) {
Error.captureStackTrace(this, stackStartFunction);
} else {
var err = new Error();
if (err.stack) {
var out = err.stack;
var fn_name = getName(stackStartFunction);
var idx = out.indexOf('\n' + fn_name);
if (idx >= 0) {
var next_line = out.indexOf('\n', idx + 1);
out = out.substring(next_line + 1);
}
this.stack = out;
}
}
};
util.inherits(assert.AssertionError, Error);
function truncate(s, n) {
if (typeof s === 'string') {
return s.length < n ? s : s.slice(0, n);
} else {
return s;
}
}
function inspect(something) {
if (functionsHaveNames || !util.isFunction(something)) {
return util.inspect(something);
}
var rawname = getName(something);
var name = rawname ? ': ' + rawname : '';
return '[Function' + name + ']';
}
function getMessage(self) {
return truncate(inspect(self.actual), 128) + ' ' + self.operator + ' ' + truncate(inspect(self.expected), 128);
}
function fail(actual, expected, message, operator, stackStartFunction) {
throw new assert.AssertionError({
message: message,
actual: actual,
expected: expected,
operator: operator,
stackStartFunction: stackStartFunction
});
}
assert.fail = fail;
function ok(value, message) {
if (!value) fail(value, true, message, '==', assert.ok);
}
assert.ok = ok;
assert.equal = function equal(actual, expected, message) {
if (actual != expected) fail(actual, expected, message, '==', assert.equal);
};
assert.notEqual = function notEqual(actual, expected, message) {
if (actual == expected) {
fail(actual, expected, message, '!=', assert.notEqual);
}
};
assert.deepEqual = function deepEqual(actual, expected, message) {
if (!_deepEqual(actual, expected, false)) {
fail(actual, expected, message, 'deepEqual', assert.deepEqual);
}
};
assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
if (!_deepEqual(actual, expected, true)) {
fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
}
};
function _deepEqual(actual, expected, strict, memos) {
if (actual === expected) {
return true;
} else if (isBuffer(actual) && isBuffer(expected)) {
return compare(actual, expected) === 0;
} else if (util.isDate(actual) && util.isDate(expected)) {
return actual.getTime() === expected.getTime();
} else if (util.isRegExp(actual) && util.isRegExp(expected)) {
return actual.source === expected.source && actual.global === expected.global && actual.multiline === expected.multiline && actual.lastIndex === expected.lastIndex && actual.ignoreCase === expected.ignoreCase;
} else if ((actual === null || typeof actual !== 'object') && (expected === null || typeof expected !== 'object')) {
return strict ? actual === expected : actual == expected;
} else if (isView(actual) && isView(expected) && pToString(actual) === pToString(expected) && !(actual instanceof Float32Array || actual instanceof Float64Array)) {
return compare(new Uint8Array(actual.buffer), new Uint8Array(expected.buffer)) === 0;
} else if (isBuffer(actual) !== isBuffer(expected)) {
return false;
} else {
memos = memos || {
actual: [],
expected: []
};
var actualIndex = memos.actual.indexOf(actual);
if (actualIndex !== -1) {
if (actualIndex === memos.expected.indexOf(expected)) {
return true;
}
}
memos.actual.push(actual);
memos.expected.push(expected);
return objEquiv(actual, expected, strict, memos);
}
}
function isArguments(object) {
return Object.prototype.toString.call(object) == '[object Arguments]';
}
function objEquiv(a, b, strict, actualVisitedObjects) {
if (a === null || a === undefined || b === null || b === undefined) return false;
if (util.isPrimitive(a) || util.isPrimitive(b)) return a === b;
if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) return false;
var aIsArgs = isArguments(a);
var bIsArgs = isArguments(b);
if (aIsArgs && !bIsArgs || !aIsArgs && bIsArgs) return false;
if (aIsArgs) {
a = pSlice.call(a);
b = pSlice.call(b);
return _deepEqual(a, b, strict);
}
var ka = objectKeys(a);
var kb = objectKeys(b);
var key, i;
if (ka.length !== kb.length) return false;
ka.sort();
kb.sort();
for (i = ka.length - 1; i >= 0; i--) {
if (ka[i] !== kb[i]) return false;
}
for (i = ka.length - 1; i >= 0; i--) {
key = ka[i];
if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects)) return false;
}
return true;
}
assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
if (_deepEqual(actual, expected, false)) {
fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
}
};
assert.notDeepStrictEqual = notDeepStrictEqual;
function notDeepStrictEqual(actual, expected, message) {
if (_deepEqual(actual, expected, true)) {
fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
}
}
assert.strictEqual = function strictEqual(actual, expected, message) {
if (actual !== expected) {
fail(actual, expected, message, '===', assert.strictEqual);
}
};
assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
if (actual === expected) {
fail(actual, expected, message, '!==', assert.notStrictEqual);
}
};
function expectedException(actual, expected) {
if (!actual || !expected) {
return false;
}
if (Object.prototype.toString.call(expected) == '[object RegExp]') {
return expected.test(actual);
}
try {
if (actual instanceof expected) {
return true;
}
} catch (e) {}
if (Error.isPrototypeOf(expected)) {
return false;
}
return expected.call({}, actual) === true;
}
function _tryBlock(block) {
var error;
try {
block();
} catch (e) {
error = e;
}
return error;
}
function _throws(shouldThrow, block, expected, message) {
var actual;
if (typeof block !== 'function') {
throw new TypeError('"block" argument must be a function');
}
if (typeof expected === 'string') {
message = expected;
expected = null;
}
actual = _tryBlock(block);
message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + (message ? ' ' + message : '.');
if (shouldThrow && !actual) {
fail(actual, expected, 'Missing expected exception' + message);
}
var userProvidedMessage = typeof message === 'string';
var isUnwantedException = !shouldThrow && util.isError(actual);
var isUnexpectedException = !shouldThrow && actual && !expected;
if (isUnwantedException && userProvidedMessage && expectedException(actual, expected) || isUnexpectedException) {
fail(actual, expected, 'Got unwanted exception' + message);
}
if (shouldThrow && actual && expected && !expectedException(actual, expected) || !shouldThrow && actual) {
throw actual;
}
}
assert.throws = function (block, error, message) {
_throws(true, block, error, message);
};
assert.doesNotThrow = function (block, error, message) {
_throws(false, block, error, message);
};
assert.ifError = function (err) {
if (err) throw err;
};
var objectKeys = Object.keys || function (obj) {
var keys = [];
for (var key in obj) {
if (hasOwn.call(obj, key)) keys.push(key);
}
return keys;
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9)));
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(32),
getRawTag = __webpack_require__(308),
objectToString = __webpack_require__(309);
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
}
module.exports = baseGetTag;
/***/ }),
/* 21 */
/***/ (function(module, exports) {
function isObject(value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
module.exports = isObject;
/***/ }),
/* 22 */
/***/ (function(module, exports) {
module.exports = function (module) {
if (!module.webpackPolyfill) {
module.deprecate = function () {};
module.paths = [];
if (!module.children) module.children = [];
Object.defineProperty(module, "loaded", {
enumerable: true,
get: function get() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function get() {
return module.i;
}
});
module.webpackPolyfill = 1;
}
return module;
};
/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.validate = validate;
exports.typeIs = typeIs;
exports.validateType = validateType;
exports.validateOptional = validateOptional;
exports.validateOptionalType = validateOptionalType;
exports.arrayOf = arrayOf;
exports.arrayOfType = arrayOfType;
exports.validateArrayOfType = validateArrayOfType;
exports.assertEach = assertEach;
exports.assertOneOf = assertOneOf;
exports.assertNodeType = assertNodeType;
exports.assertNodeOrValueType = assertNodeOrValueType;
exports.assertValueType = assertValueType;
exports.chain = chain;
exports.default = defineType;
exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.FLIPPED_ALIAS_KEYS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = void 0;
var _is = _interopRequireDefault(__webpack_require__(87));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
var VISITOR_KEYS = {};
exports.VISITOR_KEYS = VISITOR_KEYS;
var ALIAS_KEYS = {};
exports.ALIAS_KEYS = ALIAS_KEYS;
var FLIPPED_ALIAS_KEYS = {};
exports.FLIPPED_ALIAS_KEYS = FLIPPED_ALIAS_KEYS;
var NODE_FIELDS = {};
exports.NODE_FIELDS = NODE_FIELDS;
var BUILDER_KEYS = {};
exports.BUILDER_KEYS = BUILDER_KEYS;
var DEPRECATED_KEYS = {};
exports.DEPRECATED_KEYS = DEPRECATED_KEYS;
function getType(val) {
if (Array.isArray(val)) {
return "array";
} else if (val === null) {
return "null";
} else if (val === undefined) {
return "undefined";
} else {
return typeof val;
}
}
function validate(validate) {
return {
validate: validate
};
}
function typeIs(typeName) {
return typeof typeName === "string" ? assertNodeType(typeName) : assertNodeType.apply(void 0, typeName);
}
function validateType(typeName) {
return validate(typeIs(typeName));
}
function validateOptional(validate) {
return {
validate: validate,
optional: true
};
}
function validateOptionalType(typeName) {
return {
validate: typeIs(typeName),
optional: true
};
}
function arrayOf(elementType) {
return chain(assertValueType("array"), assertEach(elementType));
}
function arrayOfType(typeName) {
return arrayOf(typeIs(typeName));
}
function validateArrayOfType(typeName) {
return validate(arrayOfType(typeName));
}
function assertEach(callback) {
function validator(node, key, val) {
if (!Array.isArray(val)) return;
for (var i = 0; i < val.length; i++) {
callback(node, key + "[" + i + "]", val[i]);
}
}
validator.each = callback;
return validator;
}
function assertOneOf() {
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
values[_key] = arguments[_key];
}
function validate(node, key, val) {
if (values.indexOf(val) < 0) {
throw new TypeError("Property " + key + " expected value to be one of " + JSON.stringify(values) + " but got " + JSON.stringify(val));
}
}
validate.oneOf = values;
return validate;
}
function assertNodeType() {
for (var _len2 = arguments.length, types = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
types[_key2] = arguments[_key2];
}
function validate(node, key, val) {
var valid = false;
for (var _i = 0; _i < types.length; _i++) {
var type = types[_i];
if ((0, _is.default)(type, val)) {
valid = true;
break;
}
}
if (!valid) {
throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + JSON.stringify(types) + " " + ("but instead got " + JSON.stringify(val && val.type)));
}
}
validate.oneOfNodeTypes = types;
return validate;
}
function assertNodeOrValueType() {
for (var _len3 = arguments.length, types = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
types[_key3] = arguments[_key3];
}
function validate(node, key, val) {
var valid = false;
for (var _i2 = 0; _i2 < types.length; _i2++) {
var type = types[_i2];
if (getType(val) === type || (0, _is.default)(type, val)) {
valid = true;
break;
}
}
if (!valid) {
throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + JSON.stringify(types) + " " + ("but instead got " + JSON.stringify(val && val.type)));
}
}
validate.oneOfNodeOrValueTypes = types;
return validate;
}
function assertValueType(type) {
function validate(node, key, val) {
var valid = getType(val) === type;
if (!valid) {
throw new TypeError("Property " + key + " expected type of " + type + " but got " + getType(val));
}
}
validate.type = type;
return validate;
}
function chain() {
for (var _len4 = arguments.length, fns = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
fns[_key4] = arguments[_key4];
}
function validate() {
for (var _i3 = 0; _i3 < fns.length; _i3++) {
var fn = fns[_i3];
fn.apply(void 0, arguments);
}
}
validate.chainOf = fns;
return validate;
}
function defineType(type, opts) {
if (opts === void 0) {
opts = {};
}
var inherits = opts.inherits && store[opts.inherits] || {};
var fields = opts.fields || inherits.fields || {};
var visitor = opts.visitor || inherits.visitor || [];
var aliases = opts.aliases || inherits.aliases || [];
var builder = opts.builder || inherits.builder || opts.visitor || [];
if (opts.deprecatedAlias) {
DEPRECATED_KEYS[opts.deprecatedAlias] = type;
}
for (var _iterator = visitor.concat(builder), _isArray = Array.isArray(_iterator), _i4 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i4 >= _iterator.length) break;
_ref = _iterator[_i4++];
} else {
_i4 = _iterator.next();
if (_i4.done) break;
_ref = _i4.value;
}
var _key5 = _ref;
fields[_key5] = fields[_key5] || {};
}
for (var key in fields) {
var field = fields[key];
if (builder.indexOf(key) === -1) {
field.optional = true;
}
if (field.default === undefined) {
field.default = null;
} else if (!field.validate) {
field.validate = assertValueType(getType(field.default));
}
}
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(function (alias) {
FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];
FLIPPED_ALIAS_KEYS[alias].push(type);
});
store[type] = opts;
}
var store = {};
/***/ }),
/* 24 */
/***/ (function(module, exports, __webpack_require__) {
var safe = __webpack_require__(179);
var define = __webpack_require__(496);
var extend = __webpack_require__(502);
var not = __webpack_require__(47);
var MAX_LENGTH = 1024 * 64;
var cache = {};
module.exports = function (patterns, options) {
if (!Array.isArray(patterns)) {
return makeRe(patterns, options);
}
return makeRe(patterns.join('|'), options);
};
function makeRe(pattern, options) {
if (pattern instanceof RegExp) {
return pattern;
}
if (typeof pattern !== 'string') {
throw new TypeError('expected a string');
}
if (pattern.length > MAX_LENGTH) {
throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters');
}
var key = pattern;
if (!options || options && options.cache !== false) {
key = createKey(pattern, options);
if (cache.hasOwnProperty(key)) {
return cache[key];
}
}
var opts = extend({}, options);
if (opts.contains === true) {
if (opts.negate === true) {
opts.strictNegate = false;
} else {
opts.strict = false;
}
}
if (opts.strict === false) {
opts.strictOpen = false;
opts.strictClose = false;
}
var open = opts.strictOpen !== false ? '^' : '';
var close = opts.strictClose !== false ? '$' : '';
var flags = opts.flags || '';
var regex;
if (opts.nocase === true && !/i/.test(flags)) {
flags += 'i';
}
try {
if (opts.negate || typeof opts.strictNegate === 'boolean') {
pattern = not.create(pattern, opts);
}
var str = open + '(?:' + pattern + ')' + close;
regex = new RegExp(str, flags);
if (opts.safe === true && safe(regex) === false) {
throw new Error('potentially unsafe regular expression: ' + regex.source);
}
} catch (err) {
if (opts.strictErrors === true || opts.safe === true) {
err.key = key;
err.pattern = pattern;
err.originalOptions = options;
err.createdOptions = opts;
throw err;
}
try {
regex = new RegExp('^' + pattern.replace(/(\W)/g, '\\$1') + '$');
} catch (err) {
regex = /.^/;
}
}
if (opts.cache !== false) {
memoize(regex, key, pattern, opts);
}
return regex;
}
function memoize(regex, key, pattern, options) {
define(regex, 'cached', true);
define(regex, 'pattern', pattern);
define(regex, 'options', options);
define(regex, 'key', key);
cache[key] = regex;
}
function createKey(pattern, options) {
if (!options) return pattern;
var key = pattern;
for (var prop in options) {
if (options.hasOwnProperty(prop)) {
key += ';' + prop + '=' + String(options[prop]);
}
}
return key;
}
module.exports.makeRe = makeRe;
/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(7);
function isObjectObject(o) {
return isObject(o) === true && Object.prototype.toString.call(o) === '[object Object]';
}
module.exports = function isPlainObject(o) {
var ctor, prot;
if (isObjectObject(o) === false) return false;
ctor = o.constructor;
if (typeof ctor !== 'function') return false;
prot = ctor.prototype;
if (isObjectObject(prot) === false) return false;
if (prot.hasOwnProperty('isPrototypeOf') === false) {
return false;
}
return true;
};
/***/ }),
/* 26 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsNative = __webpack_require__(307),
getValue = __webpack_require__(312);
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
module.exports = getNative;
/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = void 0;
var STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"];
exports.STATEMENT_OR_BLOCK_KEYS = STATEMENT_OR_BLOCK_KEYS;
var FLATTENABLE_KEYS = ["body", "expressions"];
exports.FLATTENABLE_KEYS = FLATTENABLE_KEYS;
var FOR_INIT_KEYS = ["left", "init"];
exports.FOR_INIT_KEYS = FOR_INIT_KEYS;
var COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"];
exports.COMMENT_KEYS = COMMENT_KEYS;
var LOGICAL_OPERATORS = ["||", "&&", "??"];
exports.LOGICAL_OPERATORS = LOGICAL_OPERATORS;
var UPDATE_OPERATORS = ["++", "--"];
exports.UPDATE_OPERATORS = UPDATE_OPERATORS;
var BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="];
exports.BOOLEAN_NUMBER_BINARY_OPERATORS = BOOLEAN_NUMBER_BINARY_OPERATORS;
var EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="];
exports.EQUALITY_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS;
var COMPARISON_BINARY_OPERATORS = EQUALITY_BINARY_OPERATORS.concat(["in", "instanceof"]);
exports.COMPARISON_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS;
var BOOLEAN_BINARY_OPERATORS = COMPARISON_BINARY_OPERATORS.concat(BOOLEAN_NUMBER_BINARY_OPERATORS);
exports.BOOLEAN_BINARY_OPERATORS = BOOLEAN_BINARY_OPERATORS;
var NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"];
exports.NUMBER_BINARY_OPERATORS = NUMBER_BINARY_OPERATORS;
var BINARY_OPERATORS = ["+"].concat(NUMBER_BINARY_OPERATORS, BOOLEAN_BINARY_OPERATORS);
exports.BINARY_OPERATORS = BINARY_OPERATORS;
var BOOLEAN_UNARY_OPERATORS = ["delete", "!"];
exports.BOOLEAN_UNARY_OPERATORS = BOOLEAN_UNARY_OPERATORS;
var NUMBER_UNARY_OPERATORS = ["+", "-", "~"];
exports.NUMBER_UNARY_OPERATORS = NUMBER_UNARY_OPERATORS;
var STRING_UNARY_OPERATORS = ["typeof"];
exports.STRING_UNARY_OPERATORS = STRING_UNARY_OPERATORS;
var UNARY_OPERATORS = ["void", "throw"].concat(BOOLEAN_UNARY_OPERATORS, NUMBER_UNARY_OPERATORS, STRING_UNARY_OPERATORS);
exports.UNARY_OPERATORS = UNARY_OPERATORS;
var INHERIT_KEYS = {
optional: ["typeAnnotation", "typeParameters", "returnType"],
force: ["start", "loc", "end"]
};
exports.INHERIT_KEYS = INHERIT_KEYS;
var BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped");
exports.BLOCK_SCOPED_SYMBOL = BLOCK_SCOPED_SYMBOL;
var NOT_LOCAL_BINDING = Symbol.for("should not be considered a local binding");
exports.NOT_LOCAL_BINDING = NOT_LOCAL_BINDING;
/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
function _helperGetFunctionArity() {
var data = _interopRequireDefault(__webpack_require__(470));
_helperGetFunctionArity = function _helperGetFunctionArity() {
return data;
};
return data;
}
function _template() {
var data = _interopRequireDefault(__webpack_require__(29));
_template = function _template() {
return data;
};
return data;
}
function t() {
var data = _interopRequireWildcard(__webpack_require__(4));
t = function t() {
return data;
};
return data;
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
var buildPropertyMethodAssignmentWrapper = (0, _template().default)("\n (function (FUNCTION_KEY) {\n function FUNCTION_ID() {\n return FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n }\n\n return FUNCTION_ID;\n })(FUNCTION)\n");
var buildGeneratorPropertyMethodAssignmentWrapper = (0, _template().default)("\n (function (FUNCTION_KEY) {\n function* FUNCTION_ID() {\n return yield* FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n };\n\n return FUNCTION_ID;\n })(FUNCTION)\n");
var visitor = {
"ReferencedIdentifier|BindingIdentifier": function ReferencedIdentifierBindingIdentifier(path, state) {
if (path.node.name !== state.name) return;
var localDeclar = path.scope.getBindingIdentifier(state.name);
if (localDeclar !== state.outerDeclar) return;
state.selfReference = true;
path.stop();
}
};
function getNameFromLiteralId(id) {
if (t().isNullLiteral(id)) {
return "null";
}
if (t().isRegExpLiteral(id)) {
return "_" + id.pattern + "_" + id.flags;
}
if (t().isTemplateLiteral(id)) {
return id.quasis.map(function (quasi) {
return quasi.value.raw;
}).join("");
}
if (id.value !== undefined) {
return id.value + "";
}
return "";
}
function wrap(state, method, id, scope) {
if (state.selfReference) {
if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) {
scope.rename(id.name);
} else {
if (!t().isFunction(method)) return;
var build = buildPropertyMethodAssignmentWrapper;
if (method.generator) {
build = buildGeneratorPropertyMethodAssignmentWrapper;
}
var template = build({
FUNCTION: method,
FUNCTION_ID: id,
FUNCTION_KEY: scope.generateUidIdentifier(id.name)
}).expression;
var params = template.callee.body.body[0].params;
for (var i = 0, len = (0, _helperGetFunctionArity().default)(method); i < len; i++) {
params.push(scope.generateUidIdentifier("x"));
}
return template;
}
}
method.id = id;
scope.getProgramParent().references[id.name] = true;
}
function visit(node, name, scope) {
var state = {
selfAssignment: false,
selfReference: false,
outerDeclar: scope.getBindingIdentifier(name),
references: [],
name: name
};
var binding = scope.getOwnBinding(name);
if (binding) {
if (binding.kind === "param") {
state.selfReference = true;
} else {}
} else if (state.outerDeclar || scope.hasGlobal(name)) {
scope.traverse(node, visitor, state);
}
return state;
}
function _default(_ref, localBinding) {
var node = _ref.node,
parent = _ref.parent,
scope = _ref.scope,
id = _ref.id;
if (localBinding === void 0) {
localBinding = false;
}
if (node.id) return;
if ((t().isObjectProperty(parent) || t().isObjectMethod(parent, {
kind: "method"
})) && (!parent.computed || t().isLiteral(parent.key))) {
id = parent.key;
} else if (t().isVariableDeclarator(parent)) {
id = parent.id;
if (t().isIdentifier(id) && !localBinding) {
var binding = scope.parent.getBinding(id.name);
if (binding && binding.constant && scope.getBinding(id.name) === binding) {
node.id = t().cloneNode(id);
node.id[t().NOT_LOCAL_BINDING] = true;
return;
}
}
} else if (t().isAssignmentExpression(parent)) {
id = parent.left;
} else if (!id) {
return;
}
var name;
if (id && t().isLiteral(id)) {
name = getNameFromLiteralId(id);
} else if (id && t().isIdentifier(id)) {
name = id.name;
}
if (name === undefined) {
return;
}
name = t().toBindingIdentifierName(name);
id = t().identifier(name);
id[t().NOT_LOCAL_BINDING] = true;
var state = visit(node, name, scope);
return wrap(state, node, id, scope) || node;
}
/***/ }),
/* 29 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.program = exports.expression = exports.statements = exports.statement = exports.smart = void 0;
var formatters = _interopRequireWildcard(__webpack_require__(471));
var _builder = _interopRequireDefault(__webpack_require__(472));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
var smart = (0, _builder.default)(formatters.smart);
exports.smart = smart;
var statement = (0, _builder.default)(formatters.statement);
exports.statement = statement;
var statements = (0, _builder.default)(formatters.statements);
exports.statements = statements;
var expression = (0, _builder.default)(formatters.expression);
exports.expression = expression;
var program = (0, _builder.default)(formatters.program);
exports.program = program;
var _default = Object.assign(smart.bind(undefined), {
smart: smart,
statement: statement,
statements: statements,
expression: expression,
program: program,
ast: smart.ast
});
exports.default = _default;
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
var typeOf = __webpack_require__(497);
var isAccessor = __webpack_require__(498);
var isData = __webpack_require__(500);
module.exports = function isDescriptor(obj, key) {
if (typeOf(obj) !== 'object') {
return false;
}
if ('get' in obj) {
return isAccessor(obj, key);
}
return isData(obj, key);
};
/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var virtualTypes = _interopRequireWildcard(__webpack_require__(121));
function _debug() {
var data = _interopRequireDefault(__webpack_require__(93));
_debug = function _debug() {
return data;
};
return data;
}
function _invariant() {
var data = _interopRequireDefault(__webpack_require__(411));
_invariant = function _invariant() {
return data;
};
return data;
}
var _index = _interopRequireDefault(__webpack_require__(12));
var _scope = _interopRequireDefault(__webpack_require__(159));
function t() {
var data = _interopRequireWildcard(__webpack_require__(4));
t = function t() {
return data;
};
return data;
}
var _cache = __webpack_require__(62);
function _generator() {
var data = _interopRequireDefault(__webpack_require__(97));
_generator = function _generator() {
return data;
};
return data;
}
var NodePath_ancestry = _interopRequireWildcard(__webpack_require__(453));
var NodePath_inference = _interopRequireWildcard(__webpack_require__(454));
var NodePath_replacement = _interopRequireWildcard(__webpack_require__(457));
var NodePath_evaluation = _interopRequireWildcard(__webpack_require__(468));
var NodePath_conversion = _interopRequireWildcard(__webpack_require__(469));
var NodePath_introspection = _interopRequireWildcard(__webpack_require__(475));
var NodePath_context = _interopRequireWildcard(__webpack_require__(476));
var NodePath_removal = _interopRequireWildcard(__webpack_require__(477));
var NodePath_modification = _interopRequireWildcard(__webpack_require__(479));
var NodePath_family = _interopRequireWildcard(__webpack_require__(481));
var NodePath_comments = _interopRequireWildcard(__webpack_require__(482));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
var _debug2 = (0, _debug().default)("babel");
var NodePath = function () {
function NodePath(hub, parent) {
this.parent = parent;
this.hub = hub;
this.contexts = [];
this.data = {};
this.shouldSkip = false;
this.shouldStop = false;
this.removed = false;
this.state = null;
this.opts = null;
this.skipKeys = null;
this.parentPath = null;
this.context = null;
this.container = null;
this.listKey = null;
this.inList = false;
this.parentKey = null;
this.key = null;
this.node = null;
this.scope = null;
this.type = null;
this.typeAnnotation = null;
}
NodePath.get = function get(_ref) {
var hub = _ref.hub,
parentPath = _ref.parentPath,
parent = _ref.parent,
container = _ref.container,
listKey = _ref.listKey,
key = _ref.key;
if (!hub && parentPath) {
hub = parentPath.hub;
}
(0, _invariant().default)(parent, "To get a node path the parent needs to exist");
var targetNode = container[key];
var paths = _cache.path.get(parent) || [];
if (!_cache.path.has(parent)) {
_cache.path.set(parent, paths);
}
var path;
for (var i = 0; i < paths.length; i++) {
var pathCheck = paths[i];
if (pathCheck.node === targetNode) {
path = pathCheck;
break;
}
}
if (!path) {
path = new NodePath(hub, parent);
paths.push(path);
}
path.setup(parentPath, container, listKey, key);
return path;
};
var _proto = NodePath.prototype;
_proto.getScope = function getScope(scope) {
return this.isScope() ? new _scope.default(this) : scope;
};
_proto.setData = function setData(key, val) {
return this.data[key] = val;
};
_proto.getData = function getData(key, def) {
var val = this.data[key];
if (!val && def) val = this.data[key] = def;
return val;
};
_proto.buildCodeFrameError = function buildCodeFrameError(msg, Error) {
if (Error === void 0) {
Error = SyntaxError;
}
return this.hub.file.buildCodeFrameError(this.node, msg, Error);
};
_proto.traverse = function traverse(visitor, state) {
(0, _index.default)(this.node, visitor, this.scope, state, this);
};
_proto.set = function set(key, node) {
t().validate(this.node, key, node);
this.node[key] = node;
};
_proto.getPathLocation = function getPathLocation() {
var parts = [];
var path = this;
do {
var key = path.key;
if (path.inList) key = path.listKey + "[" + key + "]";
parts.unshift(key);
} while (path = path.parentPath);
return parts.join(".");
};
_proto.debug = function debug(message) {
if (!_debug2.enabled) return;
_debug2(this.getPathLocation() + " " + this.type + ": " + message);
};
_proto.toString = function toString() {
return (0, _generator().default)(this.node).code;
};
return NodePath;
}();
exports.default = NodePath;
Object.assign(NodePath.prototype, NodePath_ancestry, NodePath_inference, NodePath_replacement, NodePath_evaluation, NodePath_conversion, NodePath_introspection, NodePath_context, NodePath_removal, NodePath_modification, NodePath_family, NodePath_comments);
var _loop2 = function _loop2() {
if (_isArray) {
if (_i >= _iterator.length) return "break";
_ref2 = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) return "break";
_ref2 = _i.value;
}
var type = _ref2;
var typeKey = "is" + type;
var fn = t()[typeKey];
NodePath.prototype[typeKey] = function (opts) {
return fn(this.node, opts);
};
NodePath.prototype["assert" + type] = function (opts) {
if (!fn(this.node, opts)) {
throw new TypeError("Expected node path of type " + type);
}
};
};
for (var _iterator = t().TYPES, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref2;
var _ret2 = _loop2();
if (_ret2 === "break") break;
}
var _loop = function _loop(type) {
if (type[0] === "_") return "continue";
if (t().TYPES.indexOf(type) < 0) t().TYPES.push(type);
var virtualType = virtualTypes[type];
NodePath.prototype["is" + type] = function (opts) {
return virtualType.checkPath(this, opts);
};
};
for (var type in virtualTypes) {
var _ret = _loop(type);
if (_ret === "continue") continue;
}
/***/ }),
/* 32 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(13);
var Symbol = root.Symbol;
module.exports = Symbol;
/***/ }),
/* 33 */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(131),
baseKeys = __webpack_require__(331),
isArrayLike = __webpack_require__(35);
function keys(object) {
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
}
module.exports = keys;
/***/ }),
/* 34 */
/***/ (function(module, exports) {
function baseUnary(func) {
return function (value) {
return func(value);
};
}
module.exports = baseUnary;
/***/ }),
/* 35 */
/***/ (function(module, exports, __webpack_require__) {
var isFunction = __webpack_require__(125),
isLength = __webpack_require__(79);
function isArrayLike(value) {
return value != null && isLength(value.length) && !isFunction(value);
}
module.exports = isArrayLike;
/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {
var isBuffer = __webpack_require__(183);
var toString = Object.prototype.toString;
module.exports = function kindOf(val) {
if (typeof val === 'undefined') {
return 'undefined';
}
if (val === null) {
return 'null';
}
if (val === true || val === false || val instanceof Boolean) {
return 'boolean';
}
if (typeof val === 'string' || val instanceof String) {
return 'string';
}
if (typeof val === 'number' || val instanceof Number) {
return 'number';
}
if (typeof val === 'function' || val instanceof Function) {
return 'function';
}
if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) {
return 'array';
}
if (val instanceof RegExp) {
return 'regexp';
}
if (val instanceof Date) {
return 'date';
}
var type = toString.call(val);
if (type === '[object RegExp]') {
return 'regexp';
}
if (type === '[object Date]') {
return 'date';
}
if (type === '[object Arguments]') {
return 'arguments';
}
if (type === '[object Error]') {
return 'error';
}
if (isBuffer(val)) {
return 'buffer';
}
if (type === '[object Set]') {
return 'set';
}
if (type === '[object WeakSet]') {
return 'weakset';
}
if (type === '[object Map]') {
return 'map';
}
if (type === '[object WeakMap]') {
return 'weakmap';
}
if (type === '[object Symbol]') {
return 'symbol';
}
if (type === '[object Int8Array]') {
return 'int8array';
}
if (type === '[object Uint8Array]') {
return 'uint8array';
}
if (type === '[object Uint8ClampedArray]') {
return 'uint8clampedarray';
}
if (type === '[object Int16Array]') {
return 'int16array';
}
if (type === '[object Uint16Array]') {
return 'uint16array';
}
if (type === '[object Int32Array]') {
return 'int32array';
}
if (type === '[object Uint32Array]') {
return 'uint32array';
}
if (type === '[object Float32Array]') {
return 'float32array';
}
if (type === '[object Float64Array]') {
return 'float64array';
}
return 'object';
};
/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {
exports.__esModule = true;
exports.wrapWithTypes = wrapWithTypes;
exports.getTypes = getTypes;
exports.runtimeProperty = runtimeProperty;
exports.isReference = isReference;
exports.replaceWithOrRemove = replaceWithOrRemove;
var currentTypes = null;
function wrapWithTypes(types, fn) {
return function () {
var oldTypes = currentTypes;
currentTypes = types;
try {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return fn.apply(this, args);
} finally {
currentTypes = oldTypes;
}
};
}
function getTypes() {
return currentTypes;
}
function runtimeProperty(name) {
var t = getTypes();
return t.memberExpression(t.identifier("regeneratorRuntime"), t.identifier(name), false);
}
function isReference(path) {
return path.isReferenced() || path.parentPath.isAssignmentExpression({
left: path.node
});
}
function replaceWithOrRemove(path, replacement) {
if (replacement) {
path.replaceWith(replacement);
} else {
path.remove();
}
}
/***/ }),
/* 38 */
/***/ (function(module, exports) {
function eq(value, other) {
return value === other || value !== value && other !== other;
}
module.exports = eq;
/***/ }),
/* 39 */
/***/ (function(module, exports, __webpack_require__) {
var assignValue = __webpack_require__(128),
baseAssignValue = __webpack_require__(129);
function copyObject(source, props, object, customizer) {
var isNew = !object;
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
if (newValue === undefined) {
newValue = source[key];
}
if (isNew) {
baseAssignValue(object, key, newValue);
} else {
assignValue(object, key, newValue);
}
}
return object;
}
module.exports = copyObject;
/***/ }),
/* 40 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isValidIdentifier;
function _esutils() {
var data = _interopRequireDefault(__webpack_require__(86));
_esutils = function _esutils() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function isValidIdentifier(name) {
if (typeof name !== "string" || _esutils().default.keyword.isReservedWordES6(name, true)) {
return false;
} else if (name === "await") {
return false;
} else {
return _esutils().default.keyword.isIdentifierNameES6(name);
}
}
/***/ }),
/* 41 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = cloneNode;
var _definitions = __webpack_require__(15);
var has = Function.call.bind(Object.prototype.hasOwnProperty);
function cloneIfNode(obj, deep) {
if (obj && typeof obj.type === "string" && obj.type !== "CommentLine" && obj.type !== "CommentBlock") {
return cloneNode(obj, deep);
}
return obj;
}
function cloneIfNodeOrArray(obj, deep) {
if (Array.isArray(obj)) {
return obj.map(function (node) {
return cloneIfNode(node, deep);
});
}
return cloneIfNode(obj, deep);
}
function cloneNode(node, deep) {
if (deep === void 0) {
deep = true;
}
if (!node) return node;
var type = node.type;
var newNode = {
type: type
};
if (type === "Identifier") {
newNode.name = node.name;
} else if (!has(_definitions.NODE_FIELDS, type)) {
throw new Error("Unknown node type: \"" + type + "\"");
} else {
var _arr = Object.keys(_definitions.NODE_FIELDS[type]);
for (var _i = 0; _i < _arr.length; _i++) {
var field = _arr[_i];
if (has(node, field)) {
newNode[field] = deep ? cloneIfNodeOrArray(node[field], true) : node[field];
}
}
}
if (has(node, "loc")) {
newNode.loc = node.loc;
}
if (has(node, "leadingComments")) {
newNode.leadingComments = node.leadingComments;
}
if (has(node, "innerComments")) {
newNode.innerComments = node.innerCmments;
}
if (has(node, "trailingComments")) {
newNode.trailingComments = node.trailingComments;
}
if (has(node, "extra")) {
newNode.extra = Object.assign({}, node.extra);
}
return newNode;
}
/***/ }),
/* 42 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(20),
isObjectLike = __webpack_require__(14);
var symbolTag = '[object Symbol]';
function isSymbol(value) {
return typeof value == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag;
}
module.exports = isSymbol;
/***/ }),
/* 43 */
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(38),
isArrayLike = __webpack_require__(35),
isIndex = __webpack_require__(78),
isObject = __webpack_require__(21);
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) {
return eq(object[index], value);
}
return false;
}
module.exports = isIterateeCall;
/***/ }),
/* 44 */
/***/ (function(module, exports) {
function getArg(aArgs, aName, aDefaultValue) {
if (aName in aArgs) {
return aArgs[aName];
} else if (arguments.length === 3) {
return aDefaultValue;
} else {
throw new Error('"' + aName + '" is a required argument.');
}
}
exports.getArg = getArg;
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
var dataUrlRegexp = /^data:.+\,.+$/;
function urlParse(aUrl) {
var match = aUrl.match(urlRegexp);
if (!match) {
return null;
}
return {
scheme: match[1],
auth: match[2],
host: match[3],
port: match[4],
path: match[5]
};
}
exports.urlParse = urlParse;
function urlGenerate(aParsedUrl) {
var url = '';
if (aParsedUrl.scheme) {
url += aParsedUrl.scheme + ':';
}
url += '//';
if (aParsedUrl.auth) {
url += aParsedUrl.auth + '@';
}
if (aParsedUrl.host) {
url += aParsedUrl.host;
}
if (aParsedUrl.port) {
url += ":" + aParsedUrl.port;
}
if (aParsedUrl.path) {
url += aParsedUrl.path;
}
return url;
}
exports.urlGenerate = urlGenerate;
function normalize(aPath) {
var path = aPath;
var url = urlParse(aPath);
if (url) {
if (!url.path) {
return aPath;
}
path = url.path;
}
var isAbsolute = exports.isAbsolute(path);
var parts = path.split(/\/+/);
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
part = parts[i];
if (part === '.') {
parts.splice(i, 1);
} else if (part === '..') {
up++;
} else if (up > 0) {
if (part === '') {
parts.splice(i + 1, up);
up = 0;
} else {
parts.splice(i, 2);
up--;
}
}
}
path = parts.join('/');
if (path === '') {
path = isAbsolute ? '/' : '.';
}
if (url) {
url.path = path;
return urlGenerate(url);
}
return path;
}
exports.normalize = normalize;
function join(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
if (aPath === "") {
aPath = ".";
}
var aPathUrl = urlParse(aPath);
var aRootUrl = urlParse(aRoot);
if (aRootUrl) {
aRoot = aRootUrl.path || '/';
}
if (aPathUrl && !aPathUrl.scheme) {
if (aRootUrl) {
aPathUrl.scheme = aRootUrl.scheme;
}
return urlGenerate(aPathUrl);
}
if (aPathUrl || aPath.match(dataUrlRegexp)) {
return aPath;
}
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
aRootUrl.host = aPath;
return urlGenerate(aRootUrl);
}
var joined = aPath.charAt(0) === '/' ? aPath : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
if (aRootUrl) {
aRootUrl.path = joined;
return urlGenerate(aRootUrl);
}
return joined;
}
exports.join = join;
exports.isAbsolute = function (aPath) {
return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
};
function relative(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
aRoot = aRoot.replace(/\/$/, '');
var level = 0;
while (aPath.indexOf(aRoot + '/') !== 0) {
var index = aRoot.lastIndexOf("/");
if (index < 0) {
return aPath;
}
aRoot = aRoot.slice(0, index);
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
return aPath;
}
++level;
}
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
}
exports.relative = relative;
var supportsNullProto = function () {
var obj = Object.create(null);
return !('__proto__' in obj);
}();
function identity(s) {
return s;
}
function toSetString(aStr) {
if (isProtoString(aStr)) {
return '$' + aStr;
}
return aStr;
}
exports.toSetString = supportsNullProto ? identity : toSetString;
function fromSetString(aStr) {
if (isProtoString(aStr)) {
return aStr.slice(1);
}
return aStr;
}
exports.fromSetString = supportsNullProto ? identity : fromSetString;
function isProtoString(s) {
if (!s) {
return false;
}
var length = s.length;
if (length < 9) {
return false;
}
if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) {
return false;
}
for (var i = length - 10; i >= 0; i--) {
if (s.charCodeAt(i) !== 36) {
return false;
}
}
return true;
}
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
var cmp = mappingA.source - mappingB.source;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0 || onlyCompareOriginal) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
return mappingA.name - mappingB.name;
}
exports.compareByOriginalPositions = compareByOriginalPositions;
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
var cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0 || onlyCompareGenerated) {
return cmp;
}
cmp = mappingA.source - mappingB.source;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return mappingA.name - mappingB.name;
}
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
function strcmp(aStr1, aStr2) {
if (aStr1 === aStr2) {
return 0;
}
if (aStr1 > aStr2) {
return 1;
}
return -1;
}
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
var cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
/***/ }),
/* 45 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.loadOptions = loadOptions;
Object.defineProperty(exports, "default", {
enumerable: true,
get: function get() {
return _full.default;
}
});
Object.defineProperty(exports, "loadPartialConfig", {
enumerable: true,
get: function get() {
return _partial.loadPartialConfig;
}
});
var _full = _interopRequireDefault(__webpack_require__(488));
var _partial = __webpack_require__(205);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function loadOptions(opts) {
var config = (0, _full.default)(opts);
return config ? config.options : null;
}
/***/ }),
/* 46 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = function (receiver, objects) {
if (receiver === null || typeof receiver === 'undefined') {
throw new TypeError('expected first argument to be an object.');
}
if (typeof objects === 'undefined' || typeof Symbol === 'undefined') {
return receiver;
}
if (typeof Object.getOwnPropertySymbols !== 'function') {
return receiver;
}
var isEnumerable = Object.prototype.propertyIsEnumerable;
var target = Object(receiver);
var len = arguments.length,
i = 0;
while (++i < len) {
var provider = Object(arguments[i]);
var names = Object.getOwnPropertySymbols(provider);
for (var j = 0; j < names.length; j++) {
var key = names[j];
if (isEnumerable.call(provider, key)) {
target[key] = provider[key];
}
}
}
return target;
};
/***/ }),
/* 47 */
/***/ (function(module, exports, __webpack_require__) {
var extend = __webpack_require__(504);
var safe = __webpack_require__(179);
function toRegex(pattern, options) {
return new RegExp(toRegex.create(pattern, options));
}
toRegex.create = function (pattern, options) {
if (typeof pattern !== 'string') {
throw new TypeError('expected a string');
}
var opts = extend({}, options);
if (opts.contains === true) {
opts.strictNegate = false;
}
var open = opts.strictOpen !== false ? '^' : '';
var close = opts.strictClose !== false ? '$' : '';
var endChar = opts.endChar ? opts.endChar : '+';
var str = pattern;
if (opts.strictNegate === false) {
str = '(?:(?!(?:' + pattern + ')).)' + endChar;
} else {
str = '(?:(?!^(?:' + pattern + ')$).)' + endChar;
}
var res = open + str + close;
if (opts.safe === true && safe(res) === false) {
throw new Error('potentially unsafe regular expression: ' + res);
}
return res;
};
module.exports = toRegex;
/***/ }),
/* 48 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = function unique(arr) {
if (!Array.isArray(arr)) {
throw new TypeError('array-unique expects an array.');
}
var len = arr.length;
var i = -1;
while (i++ < len) {
var j = i + 1;
for (; j < arr.length; ++j) {
if (arr[i] === arr[j]) {
arr.splice(j--, 1);
}
}
}
return arr;
};
module.exports.immutable = function uniqueImmutable(arr) {
if (!Array.isArray(arr)) {
throw new TypeError('array-unique expects an array.');
}
var arrLen = arr.length;
var newArr = new Array(arrLen);
for (var i = 0; i < arrLen; i++) {
newArr[i] = arr[i];
}
return module.exports(newArr);
};
/***/ }),
/* 49 */
/***/ (function(module, exports, __webpack_require__) {
var Base = __webpack_require__(517);
var define = __webpack_require__(18);
var Compiler = __webpack_require__(544);
var Parser = __webpack_require__(556);
var utils = __webpack_require__(69);
function Snapdragon(options) {
Base.call(this, null, options);
this.options = utils.extend({
source: 'string'
}, this.options);
this.compiler = new Compiler(this.options);
this.parser = new Parser(this.options);
Object.defineProperty(this, 'compilers', {
get: function get() {
return this.compiler.compilers;
}
});
Object.defineProperty(this, 'parsers', {
get: function get() {
return this.parser.parsers;
}
});
Object.defineProperty(this, 'regex', {
get: function get() {
return this.parser.regex;
}
});
}
Base.extend(Snapdragon);
Snapdragon.prototype.capture = function () {
return this.parser.capture.apply(this.parser, arguments);
};
Snapdragon.prototype.use = function (fn) {
fn.call(this, this);
return this;
};
Snapdragon.prototype.parse = function (str, options) {
this.options = utils.extend({}, this.options, options);
var parsed = this.parser.parse(str, this.options);
define(parsed, 'parser', this.parser);
return parsed;
};
Snapdragon.prototype.compile = function (ast, options) {
this.options = utils.extend({}, this.options, options);
var compiled = this.compiler.compile(ast, this.options);
define(compiled, 'compiler', this.compiler);
return compiled;
};
module.exports = Snapdragon;
module.exports.Compiler = Compiler;
module.exports.Parser = Parser;
/***/ }),
/* 50 */
/***/ (function(module, exports, __webpack_require__) {
var listCacheClear = __webpack_require__(297),
listCacheDelete = __webpack_require__(298),
listCacheGet = __webpack_require__(299),
listCacheHas = __webpack_require__(300),
listCacheSet = __webpack_require__(301);
function ListCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
ListCache.prototype.clear = listCacheClear;
ListCache.prototype['delete'] = listCacheDelete;
ListCache.prototype.get = listCacheGet;
ListCache.prototype.has = listCacheHas;
ListCache.prototype.set = listCacheSet;
module.exports = ListCache;
/***/ }),
/* 51 */
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(38);
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
module.exports = assocIndexOf;
/***/ }),
/* 52 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(26);
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
/***/ }),
/* 53 */
/***/ (function(module, exports, __webpack_require__) {
var isKeyable = __webpack_require__(321);
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
}
module.exports = getMapData;
/***/ }),
/* 54 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(126);
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
var moduleExports = freeModule && freeModule.exports === freeExports;
var freeProcess = moduleExports && freeGlobal.process;
var nodeUtil = function () {
try {
var types = freeModule && freeModule.require && freeModule.require('util').types;
if (types) {
return types;
}
return freeProcess && freeProcess.binding && freeProcess.binding('util');
} catch (e) {}
}();
module.exports = nodeUtil;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22)(module)));
/***/ }),
/* 55 */
/***/ (function(module, exports, __webpack_require__) {
var arrayLikeKeys = __webpack_require__(131),
baseKeysIn = __webpack_require__(334),
isArrayLike = __webpack_require__(35);
function keysIn(object) {
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}
module.exports = keysIn;
/***/ }),
/* 56 */
/***/ (function(module, exports, __webpack_require__) {
var DataView = __webpack_require__(341),
Map = __webpack_require__(74),
Promise = __webpack_require__(342),
Set = __webpack_require__(139),
WeakMap = __webpack_require__(343),
baseGetTag = __webpack_require__(20),
toSource = __webpack_require__(127);
var mapTag = '[object Map]',
objectTag = '[object Object]',
promiseTag = '[object Promise]',
setTag = '[object Set]',
weakMapTag = '[object WeakMap]';
var dataViewTag = '[object DataView]';
var dataViewCtorString = toSource(DataView),
mapCtorString = toSource(Map),
promiseCtorString = toSource(Promise),
setCtorString = toSource(Set),
weakMapCtorString = toSource(WeakMap);
var getTag = baseGetTag;
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
getTag = function getTag(value) {
var result = baseGetTag(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : '';
if (ctorString) {
switch (ctorString) {
case dataViewCtorString:
return dataViewTag;
case mapCtorString:
return mapTag;
case promiseCtorString:
return promiseTag;
case setCtorString:
return setTag;
case weakMapCtorString:
return weakMapTag;
}
}
return result;
};
}
module.exports = getTag;
/***/ }),
/* 57 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getBindingIdentifiers;
var _generated = __webpack_require__(5);
function getBindingIdentifiers(node, duplicates, outerOnly) {
var search = [].concat(node);
var ids = Object.create(null);
while (search.length) {
var id = search.shift();
if (!id) continue;
var keys = getBindingIdentifiers.keys[id.type];
if ((0, _generated.isIdentifier)(id)) {
if (duplicates) {
var _ids = ids[id.name] = ids[id.name] || [];
_ids.push(id);
} else {
ids[id.name] = id;
}
continue;
}
if ((0, _generated.isExportDeclaration)(id)) {
if ((0, _generated.isDeclaration)(id.declaration)) {
search.push(id.declaration);
}
continue;
}
if (outerOnly) {
if ((0, _generated.isFunctionDeclaration)(id)) {
search.push(id.id);
continue;
}
if ((0, _generated.isFunctionExpression)(id)) {
continue;
}
}
if (keys) {
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (id[key]) {
search = search.concat(id[key]);
}
}
}
}
return ids;
}
getBindingIdentifiers.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"],
ExportSpecifier: ["exported"],
ExportNamespaceSpecifier: ["exported"],
ExportDefaultSpecifier: ["exported"],
FunctionDeclaration: ["id", "params"],
FunctionExpression: ["id", "params"],
ArrowFunctionExpression: ["params"],
ObjectMethod: ["params"],
ClassMethod: ["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"]
};
/***/ }),
/* 58 */
/***/ (function(module, exports, __webpack_require__) {
var toFinite = __webpack_require__(413);
function toInteger(value) {
var result = toFinite(value),
remainder = result % 1;
return result === result ? remainder ? result - remainder : result : 0;
}
module.exports = toInteger;
/***/ }),
/* 59 */
/***/ (function(module, exports) {
function arrayMap(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
module.exports = arrayMap;
/***/ }),
/* 60 */
/***/ (function(module, exports, __webpack_require__) {
var identity = __webpack_require__(61),
overRest = __webpack_require__(420),
setToString = __webpack_require__(422);
function baseRest(func, start) {
return setToString(overRest(func, start, identity), func + '');
}
module.exports = baseRest;
/***/ }),
/* 61 */
/***/ (function(module, exports) {
function identity(value) {
return value;
}
module.exports = identity;
/***/ }),
/* 62 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.clear = clear;
exports.clearPath = clearPath;
exports.clearScope = clearScope;
exports.scope = exports.path = void 0;
var path = new WeakMap();
exports.path = path;
var scope = new WeakMap();
exports.scope = scope;
function clear() {
clearPath();
clearScope();
}
function clearPath() {
exports.path = path = new WeakMap();
}
function clearScope() {
exports.scope = scope = new WeakMap();
}
/***/ }),
/* 63 */
/***/ (function(module, exports, __webpack_require__) {
(function(process) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.codeFrameColumns = codeFrameColumns;
exports.default = _default;
function _highlight() {
var data = _interopRequireWildcard(__webpack_require__(458));
_highlight = function _highlight() {
return data;
};
return data;
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
var deprecationWarningShown = false;
function getDefs(chalk) {
return {
gutter: chalk.grey,
marker: chalk.red.bold,
message: chalk.red.bold
};
}
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
function getMarkerLines(loc, source, opts) {
var startLoc = Object.assign({
column: 0,
line: -1
}, loc.start);
var endLoc = Object.assign({}, startLoc, loc.end);
var _ref = opts || {},
_ref$linesAbove = _ref.linesAbove,
linesAbove = _ref$linesAbove === void 0 ? 2 : _ref$linesAbove,
_ref$linesBelow = _ref.linesBelow,
linesBelow = _ref$linesBelow === void 0 ? 3 : _ref$linesBelow;
var startLine = startLoc.line;
var startColumn = startLoc.column;
var endLine = endLoc.line;
var endColumn = endLoc.column;
var start = Math.max(startLine - (linesAbove + 1), 0);
var end = Math.min(source.length, endLine + linesBelow);
if (startLine === -1) {
start = 0;
}
if (endLine === -1) {
end = source.length;
}
var lineDiff = endLine - startLine;
var markerLines = {};
if (lineDiff) {
for (var i = 0; i <= lineDiff; i++) {
var lineNumber = i + startLine;
if (!startColumn) {
markerLines[lineNumber] = true;
} else if (i === 0) {
var sourceLength = source[lineNumber - 1].length;
markerLines[lineNumber] = [startColumn, sourceLength - startColumn];
} else if (i === lineDiff) {
markerLines[lineNumber] = [0, endColumn];
} else {
var _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: start,
end: end,
markerLines: markerLines
};
}
function codeFrameColumns(rawLines, loc, opts) {
if (opts === void 0) {
opts = {};
}
var highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight().shouldHighlight)(opts);
var chalk = (0, _highlight().getChalk)(opts);
var defs = getDefs(chalk);
var maybeHighlight = function maybeHighlight(chalkFn, string) {
return highlighted ? chalkFn(string) : string;
};
if (highlighted) rawLines = (0, _highlight().default)(rawLines, opts);
var lines = rawLines.split(NEWLINE);
var _getMarkerLines = getMarkerLines(loc, lines, opts),
start = _getMarkerLines.start,
end = _getMarkerLines.end,
markerLines = _getMarkerLines.markerLines;
var hasColumns = loc.start && typeof loc.start.column === "number";
var numberMaxWidth = String(end).length;
var frame = lines.slice(start, end).map(function (line, index) {
var number = start + 1 + index;
var paddedNumber = (" " + number).slice(-numberMaxWidth);
var gutter = " " + paddedNumber + " | ";
var hasMarker = markerLines[number];
var lastMarkerLine = !markerLines[number + 1];
if (hasMarker) {
var markerLine = "";
if (Array.isArray(hasMarker)) {
var markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
var numberOfMarkers = hasMarker[1] || 1;
markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
if (lastMarkerLine && opts.message) {
markerLine += " " + maybeHighlight(defs.message, opts.message);
}
}
return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join("");
} else {
return " " + maybeHighlight(defs.gutter, gutter) + line;
}
}).join("\n");
if (opts.message && !hasColumns) {
frame = "" + " ".repeat(numberMaxWidth + 1) + opts.message + "\n" + frame;
}
if (highlighted) {
return chalk.reset(frame);
} else {
return frame;
}
}
function _default(rawLines, lineNumber, colNumber, opts) {
if (opts === void 0) {
opts = {};
}
if (!deprecationWarningShown) {
deprecationWarningShown = true;
var message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
if (process.emitWarning) {
process.emitWarning(message, "DeprecationWarning");
} else {
var deprecationError = new Error(message);
deprecationError.name = "DeprecationWarning";
console.warn(new Error(message));
}
}
colNumber = Math.max(colNumber, 0);
var location = {
start: {
column: colNumber,
line: lineNumber
}
};
return codeFrameColumns(rawLines, location, opts);
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)));
/***/ }),
/* 64 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createItemFromDescriptor = createItemFromDescriptor;
exports.createConfigItem = createConfigItem;
exports.getItemDescriptor = getItemDescriptor;
function _path() {
var data = _interopRequireDefault(__webpack_require__(11));
_path = function _path() {
return data;
};
return data;
}
var _configDescriptors = __webpack_require__(176);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function createItemFromDescriptor(desc) {
return new ConfigItem(desc);
}
function createConfigItem(value, _temp) {
var _ref = _temp === void 0 ? {} : _temp,
_ref$dirname = _ref.dirname,
dirname = _ref$dirname === void 0 ? "." : _ref$dirname,
type = _ref.type;
var descriptor = (0, _configDescriptors.createDescriptor)(value, _path().default.resolve(dirname), {
type: type,
alias: "programmatic item"
});
return createItemFromDescriptor(descriptor);
}
function getItemDescriptor(item) {
if (item instanceof ConfigItem) {
return item._descriptor;
}
return undefined;
}
var ConfigItem = function ConfigItem(descriptor) {
this._descriptor = descriptor;
Object.defineProperty(this, "_descriptor", {
enumerable: false
});
if (this._descriptor.options === false) {
throw new Error("Assertion failure - unexpected false options");
}
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);
/***/ }),
/* 65 */
/***/ (function(module, exports) {
module.exports = {
ROOT: 0,
GROUP: 1,
POSITION: 2,
SET: 3,
RANGE: 4,
REPETITION: 5,
REFERENCE: 6,
CHAR: 7
};
/***/ }),
/* 66 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = function isExtendable(val) {
return typeof val !== 'undefined' && val !== null && (typeof val === 'object' || typeof val === 'function');
};
/***/ }),
/* 67 */
/***/ (function(module, exports, __webpack_require__) {
var splitString = __webpack_require__(182);
var utils = module.exports;
utils.define = __webpack_require__(105);
utils.extend = __webpack_require__(17);
utils.flatten = __webpack_require__(508);
utils.isObject = __webpack_require__(7);
utils.fillRange = __webpack_require__(509);
utils.repeat = __webpack_require__(511);
utils.unique = __webpack_require__(48);
utils.isEmptySets = function (str) {
return /^(?:\{,\})+$/.test(str);
};
utils.isQuotedString = function (str) {
var open = str.charAt(0);
if (open === '\'' || open === '"' || open === '`') {
return str.slice(-1) === open;
}
return false;
};
utils.createKey = function (pattern, options) {
var id = pattern;
if (typeof options === 'undefined') {
return id;
}
var keys = Object.keys(options);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
id += ';' + key + '=' + String(options[key]);
}
return id;
};
utils.createOptions = function (options) {
var opts = utils.extend.apply(null, arguments);
if (typeof opts.expand === 'boolean') {
opts.optimize = !opts.expand;
}
if (typeof opts.optimize === 'boolean') {
opts.expand = !opts.optimize;
}
if (opts.optimize === true) {
opts.makeRe = true;
}
return opts;
};
utils.join = function (a, b, options) {
options = options || {};
a = utils.arrayify(a);
b = utils.arrayify(b);
if (!a.length) return b;
if (!b.length) return a;
var len = a.length;
var idx = -1;
var arr = [];
while (++idx < len) {
var val = a[idx];
if (Array.isArray(val)) {
for (var i = 0; i < val.length; i++) {
val[i] = utils.join(val[i], b, options);
}
arr.push(val);
continue;
}
for (var j = 0; j < b.length; j++) {
var bval = b[j];
if (Array.isArray(bval)) {
arr.push(utils.join(val, bval, options));
} else {
arr.push(val + bval);
}
}
}
return arr;
};
utils.split = function (str, options) {
var opts = utils.extend({
sep: ','
}, options);
if (typeof opts.keepQuotes !== 'boolean') {
opts.keepQuotes = true;
}
if (opts.unescape === false) {
opts.keepEscaping = true;
}
return splitString(str, opts, utils.escapeBrackets(opts));
};
utils.expand = function (str, options) {
var opts = utils.extend({
rangeLimit: 10000
}, options);
var segs = utils.split(str, opts);
var tok = {
segs: segs
};
if (utils.isQuotedString(str)) {
return tok;
}
if (opts.rangeLimit === true) {
opts.rangeLimit = 10000;
}
if (segs.length > 1) {
if (opts.optimize === false) {
tok.val = segs[0];
return tok;
}
tok.segs = utils.stringifyArray(tok.segs);
} else if (segs.length === 1) {
var arr = str.split('..');
if (arr.length === 1) {
tok.val = tok.segs[tok.segs.length - 1] || tok.val || str;
tok.segs = [];
return tok;
}
if (arr.length === 2 && arr[0] === arr[1]) {
tok.escaped = true;
tok.val = arr[0];
tok.segs = [];
return tok;
}
if (arr.length > 1) {
if (opts.optimize !== false) {
opts.optimize = true;
delete opts.expand;
}
if (opts.optimize !== true) {
var min = Math.min(arr[0], arr[1]);
var max = Math.max(arr[0], arr[1]);
var step = arr[2] || 1;
if (opts.rangeLimit !== false && (max - min) / step >= opts.rangeLimit) {
throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
}
}
arr.push(opts);
tok.segs = utils.fillRange.apply(null, arr);
if (!tok.segs.length) {
tok.escaped = true;
tok.val = str;
return tok;
}
if (opts.optimize === true) {
tok.segs = utils.stringifyArray(tok.segs);
}
if (tok.segs === '') {
tok.val = str;
} else {
tok.val = tok.segs[0];
}
return tok;
}
} else {
tok.val = str;
}
return tok;
};
utils.escapeBrackets = function (options) {
return function (tok) {
if (tok.escaped && tok.val === 'b') {
tok.val = '\\b';
return;
}
if (tok.val !== '(' && tok.val !== '[') return;
var opts = utils.extend({}, options);
var brackets = [];
var parens = [];
var stack = [];
var val = tok.val;
var str = tok.str;
var i = tok.idx - 1;
while (++i < str.length) {
var ch = str[i];
if (ch === '\\') {
val += (opts.keepEscaping === false ? '' : ch) + str[++i];
continue;
}
if (ch === '(') {
parens.push(ch);
stack.push(ch);
}
if (ch === '[') {
brackets.push(ch);
stack.push(ch);
}
if (ch === ')') {
parens.pop();
stack.pop();
if (!stack.length) {
val += ch;
break;
}
}
if (ch === ']') {
brackets.pop();
stack.pop();
if (!stack.length) {
val += ch;
break;
}
}
val += ch;
}
tok.split = false;
tok.val = val.slice(1);
tok.idx = i;
};
};
utils.isQuantifier = function (str) {
return /^(?:[0-9]?,[0-9]|[0-9],)$/.test(str);
};
utils.stringifyArray = function (arr) {
return [utils.arrayify(arr).join('|')];
};
utils.arrayify = function (arr) {
if (typeof arr === 'undefined') {
return [];
}
if (typeof arr === 'string') {
return [arr];
}
return arr;
};
utils.isString = function (str) {
return str != null && typeof str === 'string';
};
utils.last = function (arr, n) {
return arr[arr.length - (n || 1)];
};
utils.escapeRegex = function (str) {
return str.replace(/\\?([!^*?()\[\]{}+?/])/g, '\\$1');
};
/***/ }),
/* 68 */
/***/ (function(module, exports) {
module.exports = function (obj, prop, a, b, c) {
if (!isObject(obj) || !prop) {
return obj;
}
prop = toString(prop);
if (a) prop += '.' + toString(a);
if (b) prop += '.' + toString(b);
if (c) prop += '.' + toString(c);
if (prop in obj) {
return obj[prop];
}
var segs = prop.split('.');
var len = segs.length;
var i = -1;
while (obj && ++i < len) {
var key = segs[i];
while (key[key.length - 1] === '\\') {
key = key.slice(0, -1) + '.' + segs[++i];
}
obj = obj[key];
}
return obj;
};
function isObject(val) {
return val !== null && (typeof val === 'object' || typeof val === 'function');
}
function toString(val) {
if (!val) return '';
if (Array.isArray(val)) {
return val.join('.');
}
return val;
}
/***/ }),
/* 69 */
/***/ (function(module, exports, __webpack_require__) {
exports.extend = __webpack_require__(17);
exports.SourceMap = __webpack_require__(98);
exports.sourceMapResolve = __webpack_require__(550);
exports.unixify = function (fp) {
return fp.split(/\\+/).join('/');
};
exports.isString = function (str) {
return str && typeof str === 'string';
};
exports.arrayify = function (val) {
if (typeof val === 'string') return [val];
return val ? Array.isArray(val) ? val : [val] : [];
};
exports.last = function (arr, n) {
return arr[arr.length - (n || 1)];
};
/***/ }),
/* 70 */
/***/ (function(module, exports, __webpack_require__) {
var isSymbol = __webpack_require__(42);
var INFINITY = 1 / 0;
function toKey(value) {
if (typeof value == 'string' || isSymbol(value)) {
return value;
}
var result = value + '';
return result == '0' && 1 / value == -INFINITY ? '-0' : result;
}
module.exports = toKey;
/***/ }),
/* 71 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.is = is;
exports.pullFlag = pullFlag;
function _pull() {
var data = _interopRequireDefault(__webpack_require__(252));
_pull = function _pull() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function is(node, flag) {
return node.type === "RegExpLiteral" && node.flags.indexOf(flag) >= 0;
}
function pullFlag(node, flag) {
var flags = node.flags.split("");
if (node.flags.indexOf(flag) < 0) return;
(0, _pull().default)(flags, flag);
node.flags = flags.join("");
}
/***/ }),
/* 72 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = shallowEqual;
function shallowEqual(actual, expected) {
var keys = Object.keys(expected);
for (var _i = 0; _i < keys.length; _i++) {
var key = keys[_i];
if (actual[key] !== expected[key]) {
return false;
}
}
return true;
}
/***/ }),
/* 73 */
/***/ (function(module, exports, __webpack_require__) {
var ListCache = __webpack_require__(50),
stackClear = __webpack_require__(302),
stackDelete = __webpack_require__(303),
stackGet = __webpack_require__(304),
stackHas = __webpack_require__(305),
stackSet = __webpack_require__(306);
function Stack(entries) {
var data = this.__data__ = new ListCache(entries);
this.size = data.size;
}
Stack.prototype.clear = stackClear;
Stack.prototype['delete'] = stackDelete;
Stack.prototype.get = stackGet;
Stack.prototype.has = stackHas;
Stack.prototype.set = stackSet;
module.exports = Stack;
/***/ }),
/* 74 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(26),
root = __webpack_require__(13);
var Map = getNative(root, 'Map');
module.exports = Map;
/***/ }),
/* 75 */
/***/ (function(module, exports, __webpack_require__) {
var mapCacheClear = __webpack_require__(313),
mapCacheDelete = __webpack_require__(320),
mapCacheGet = __webpack_require__(322),
mapCacheHas = __webpack_require__(323),
mapCacheSet = __webpack_require__(324);
function MapCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
}
MapCache.prototype.clear = mapCacheClear;
MapCache.prototype['delete'] = mapCacheDelete;
MapCache.prototype.get = mapCacheGet;
MapCache.prototype.has = mapCacheHas;
MapCache.prototype.set = mapCacheSet;
module.exports = MapCache;
/***/ }),
/* 76 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsArguments = __webpack_require__(328),
isObjectLike = __webpack_require__(14);
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
var isArguments = baseIsArguments(function () {
return arguments;
}()) ? baseIsArguments : function (value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
};
module.exports = isArguments;
/***/ }),
/* 77 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(13),
stubFalse = __webpack_require__(329);
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
var moduleExports = freeModule && freeModule.exports === freeExports;
var Buffer = moduleExports ? root.Buffer : undefined;
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
var isBuffer = nativeIsBuffer || stubFalse;
module.exports = isBuffer;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22)(module)));
/***/ }),
/* 78 */
/***/ (function(module, exports) {
var MAX_SAFE_INTEGER = 9007199254740991;
var reIsUint = /^(?:0|[1-9]\d*)$/;
function isIndex(value, length) {
var type = typeof value;
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
}
module.exports = isIndex;
/***/ }),
/* 79 */
/***/ (function(module, exports) {
var MAX_SAFE_INTEGER = 9007199254740991;
function isLength(value) {
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
}
module.exports = isLength;
/***/ }),
/* 80 */
/***/ (function(module, exports) {
var objectProto = Object.prototype;
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
return value === proto;
}
module.exports = isPrototype;
/***/ }),
/* 81 */
/***/ (function(module, exports, __webpack_require__) {
var arrayFilter = __webpack_require__(338),
stubArray = __webpack_require__(135);
var objectProto = Object.prototype;
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
var nativeGetSymbols = Object.getOwnPropertySymbols;
var getSymbols = !nativeGetSymbols ? stubArray : function (object) {
if (object == null) {
return [];
}
object = Object(object);
return arrayFilter(nativeGetSymbols(object), function (symbol) {
return propertyIsEnumerable.call(object, symbol);
});
};
module.exports = getSymbols;
/***/ }),
/* 82 */
/***/ (function(module, exports) {
function arrayPush(array, values) {
var index = -1,
length = values.length,
offset = array.length;
while (++index < length) {
array[offset + index] = values[index];
}
return array;
}
module.exports = arrayPush;
/***/ }),
/* 83 */
/***/ (function(module, exports, __webpack_require__) {
var overArg = __webpack_require__(133);
var getPrototype = overArg(Object.getPrototypeOf, Object);
module.exports = getPrototype;
/***/ }),
/* 84 */
/***/ (function(module, exports, __webpack_require__) {
var Uint8Array = __webpack_require__(140);
function cloneArrayBuffer(arrayBuffer) {
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
new Uint8Array(result).set(new Uint8Array(arrayBuffer));
return result;
}
module.exports = cloneArrayBuffer;
/***/ }),
/* 85 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.patternLikeCommon = exports.functionDeclarationCommon = exports.functionTypeAnnotationCommon = exports.functionCommon = void 0;
var _isValidIdentifier = _interopRequireDefault(__webpack_require__(40));
var _constants = __webpack_require__(27);
var _utils = _interopRequireWildcard(__webpack_require__(23));
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
(0, _utils.default)("ArrayExpression", {
fields: {
elements: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeOrValueType)("null", "Expression", "SpreadElement"))),
default: []
}
},
visitor: ["elements"],
aliases: ["Expression"]
});
(0, _utils.default)("AssignmentExpression", {
fields: {
operator: {
validate: (0, _utils.assertValueType)("string")
},
left: {
validate: (0, _utils.assertNodeType)("LVal")
},
right: {
validate: (0, _utils.assertNodeType)("Expression")
}
},
builder: ["operator", "left", "right"],
visitor: ["left", "right"],
aliases: ["Expression"]
});
(0, _utils.default)("BinaryExpression", {
builder: ["operator", "left", "right"],
fields: {
operator: {
validate: (_utils.assertOneOf).apply(void 0, _constants.BINARY_OPERATORS)
},
left: {
validate: (0, _utils.assertNodeType)("Expression")
},
right: {
validate: (0, _utils.assertNodeType)("Expression")
}
},
visitor: ["left", "right"],
aliases: ["Binary", "Expression"]
});
(0, _utils.default)("InterpreterDirective", {
builder: ["value"],
fields: {
value: {
validate: (0, _utils.assertValueType)("string")
}
}
});
(0, _utils.default)("Directive", {
visitor: ["value"],
fields: {
value: {
validate: (0, _utils.assertNodeType)("DirectiveLiteral")
}
}
});
(0, _utils.default)("DirectiveLiteral", {
builder: ["value"],
fields: {
value: {
validate: (0, _utils.assertValueType)("string")
}
}
});
(0, _utils.default)("BlockStatement", {
builder: ["body", "directives"],
visitor: ["directives", "body"],
fields: {
directives: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))),
default: []
},
body: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
}
},
aliases: ["Scopable", "BlockParent", "Block", "Statement"]
});
(0, _utils.default)("BreakStatement", {
visitor: ["label"],
fields: {
label: {
validate: (0, _utils.assertNodeType)("Identifier"),
optional: true
}
},
aliases: ["Statement", "Terminatorless", "CompletionStatement"]
});
(0, _utils.default)("CallExpression", {
visitor: ["callee", "arguments", "typeParameters"],
builder: ["callee", "arguments"],
aliases: ["Expression"],
fields: {
callee: {
validate: (0, _utils.assertNodeType)("Expression")
},
arguments: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression", "SpreadElement", "JSXNamespacedName")))
},
optional: {
validate: (0, _utils.assertOneOf)(true, false),
optional: true
},
typeArguments: {
validate: (0, _utils.assertNodeType)("TypeParameterInstantiation"),
optional: true
},
typeParameters: {
validate: (0, _utils.assertNodeType)("TSTypeParameterInstantiation"),
optional: true
}
}
});
(0, _utils.default)("CatchClause", {
visitor: ["param", "body"],
fields: {
param: {
validate: (0, _utils.assertNodeType)("Identifier"),
optional: true
},
body: {
validate: (0, _utils.assertNodeType)("BlockStatement")
}
},
aliases: ["Scopable", "BlockParent"]
});
(0, _utils.default)("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"]
});
(0, _utils.default)("ContinueStatement", {
visitor: ["label"],
fields: {
label: {
validate: (0, _utils.assertNodeType)("Identifier"),
optional: true
}
},
aliases: ["Statement", "Terminatorless", "CompletionStatement"]
});
(0, _utils.default)("DebuggerStatement", {
aliases: ["Statement"]
});
(0, _utils.default)("DoWhileStatement", {
visitor: ["test", "body"],
fields: {
test: {
validate: (0, _utils.assertNodeType)("Expression")
},
body: {
validate: (0, _utils.assertNodeType)("Statement")
}
},
aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"]
});
(0, _utils.default)("EmptyStatement", {
aliases: ["Statement"]
});
(0, _utils.default)("ExpressionStatement", {
visitor: ["expression"],
fields: {
expression: {
validate: (0, _utils.assertNodeType)("Expression")
}
},
aliases: ["Statement", "ExpressionWrapper"]
});
(0, _utils.default)("File", {
builder: ["program", "comments", "tokens"],
visitor: ["program"],
fields: {
program: {
validate: (0, _utils.assertNodeType)("Program")
}
}
});
(0, _utils.default)("ForInStatement", {
visitor: ["left", "right", "body"],
aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
fields: {
left: {
validate: (0, _utils.assertNodeType)("VariableDeclaration", "LVal")
},
right: {
validate: (0, _utils.assertNodeType)("Expression")
},
body: {
validate: (0, _utils.assertNodeType)("Statement")
}
}
});
(0, _utils.default)("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")
}
}
});
var functionCommon = {
params: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("LVal")))
},
generator: {
default: false,
validate: (0, _utils.assertValueType)("boolean")
},
async: {
validate: (0, _utils.assertValueType)("boolean"),
default: false
}
};
exports.functionCommon = functionCommon;
var functionTypeAnnotationCommon = {
returnType: {
validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
optional: true
},
typeParameters: {
validate: (0, _utils.assertNodeType)("TypeParameterDeclaration", "TSTypeParameterDeclaration", "Noop"),
optional: true
}
};
exports.functionTypeAnnotationCommon = functionTypeAnnotationCommon;
var functionDeclarationCommon = Object.assign({}, functionCommon, {
declare: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
},
id: {
validate: (0, _utils.assertNodeType)("Identifier"),
optional: true
}
});
exports.functionDeclarationCommon = functionDeclarationCommon;
(0, _utils.default)("FunctionDeclaration", {
builder: ["id", "params", "body", "generator", "async"],
visitor: ["id", "params", "body", "returnType", "typeParameters"],
fields: Object.assign({}, functionDeclarationCommon, functionTypeAnnotationCommon, {
body: {
validate: (0, _utils.assertNodeType)("BlockStatement")
}
}),
aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"]
});
(0, _utils.default)("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")
}
})
});
var patternLikeCommon = {
typeAnnotation: {
validate: (0, _utils.assertNodeType)("TypeAnnotation", "TSTypeAnnotation", "Noop"),
optional: true
},
decorators: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator")))
}
};
exports.patternLikeCommon = patternLikeCommon;
(0, _utils.default)("Identifier", {
builder: ["name"],
visitor: ["typeAnnotation"],
aliases: ["Expression", "PatternLike", "LVal", "TSEntityName"],
fields: Object.assign({}, patternLikeCommon, {
name: {
validate: (0, _utils.chain)(function (node, key, val) {
if (!(0, _isValidIdentifier.default)(val)) {}
}, (0, _utils.assertValueType)("string"))
},
optional: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
}
})
});
(0, _utils.default)("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")
}
}
});
(0, _utils.default)("LabeledStatement", {
visitor: ["label", "body"],
aliases: ["Statement"],
fields: {
label: {
validate: (0, _utils.assertNodeType)("Identifier")
},
body: {
validate: (0, _utils.assertNodeType)("Statement")
}
}
});
(0, _utils.default)("StringLiteral", {
builder: ["value"],
fields: {
value: {
validate: (0, _utils.assertValueType)("string")
}
},
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
});
(0, _utils.default)("NumericLiteral", {
builder: ["value"],
deprecatedAlias: "NumberLiteral",
fields: {
value: {
validate: (0, _utils.assertValueType)("number")
}
},
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
});
(0, _utils.default)("NullLiteral", {
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
});
(0, _utils.default)("BooleanLiteral", {
builder: ["value"],
fields: {
value: {
validate: (0, _utils.assertValueType)("boolean")
}
},
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
});
(0, _utils.default)("RegExpLiteral", {
builder: ["pattern", "flags"],
deprecatedAlias: "RegexLiteral",
aliases: ["Expression", "Literal"],
fields: {
pattern: {
validate: (0, _utils.assertValueType)("string")
},
flags: {
validate: (0, _utils.assertValueType)("string"),
default: ""
}
}
});
(0, _utils.default)("LogicalExpression", {
builder: ["operator", "left", "right"],
visitor: ["left", "right"],
aliases: ["Binary", "Expression"],
fields: {
operator: {
validate: (_utils.assertOneOf).apply(void 0, _constants.LOGICAL_OPERATORS)
},
left: {
validate: (0, _utils.assertNodeType)("Expression")
},
right: {
validate: (0, _utils.assertNodeType)("Expression")
}
}
});
(0, _utils.default)("MemberExpression", {
builder: ["object", "property", "computed", "optional"],
visitor: ["object", "property"],
aliases: ["Expression", "LVal"],
fields: {
object: {
validate: (0, _utils.assertNodeType)("Expression")
},
property: {
validate: function () {
var normal = (0, _utils.assertNodeType)("Identifier", "PrivateName");
var computed = (0, _utils.assertNodeType)("Expression");
return function (node, key, val) {
var validator = node.computed ? computed : normal;
validator(node, key, val);
};
}()
},
computed: {
default: false
},
optional: {
validate: (0, _utils.assertOneOf)(true, false),
optional: true
}
}
});
(0, _utils.default)("NewExpression", {
inherits: "CallExpression"
});
(0, _utils.default)("Program", {
visitor: ["directives", "body"],
builder: ["body", "directives", "sourceType", "interpreter"],
fields: {
sourceFile: {
validate: (0, _utils.assertValueType)("string")
},
sourceType: {
validate: (0, _utils.assertOneOf)("script", "module"),
default: "script"
},
interpreter: {
validate: (0, _utils.assertNodeType)("InterpreterDirective"),
default: null,
optional: true
},
directives: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Directive"))),
default: []
},
body: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
}
},
aliases: ["Scopable", "BlockParent", "Block"]
});
(0, _utils.default)("ObjectExpression", {
visitor: ["properties"],
aliases: ["Expression"],
fields: {
properties: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadElement")))
}
}
});
(0, _utils.default)("ObjectMethod", {
builder: ["kind", "key", "params", "body", "computed"],
fields: Object.assign({}, functionCommon, functionTypeAnnotationCommon, {
kind: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("method", "get", "set")),
default: "method"
},
computed: {
validate: (0, _utils.assertValueType)("boolean"),
default: false
},
key: {
validate: function () {
var normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
var computed = (0, _utils.assertNodeType)("Expression");
return function (node, key, val) {
var validator = node.computed ? computed : normal;
validator(node, key, val);
};
}()
},
decorators: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator")))
},
body: {
validate: (0, _utils.assertNodeType)("BlockStatement")
}
}),
visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
});
(0, _utils.default)("ObjectProperty", {
builder: ["key", "value", "computed", "shorthand", "decorators"],
fields: {
computed: {
validate: (0, _utils.assertValueType)("boolean"),
default: false
},
key: {
validate: function () {
var normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
var computed = (0, _utils.assertNodeType)("Expression");
return function (node, key, val) {
var validator = node.computed ? computed : normal;
validator(node, key, val);
};
}()
},
value: {
validate: (0, _utils.assertNodeType)("Expression", "PatternLike")
},
shorthand: {
validate: (0, _utils.assertValueType)("boolean"),
default: false
},
decorators: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
optional: true
}
},
visitor: ["key", "value", "decorators"],
aliases: ["UserWhitespacable", "Property", "ObjectMember"]
});
(0, _utils.default)("RestElement", {
visitor: ["argument", "typeAnnotation"],
builder: ["argument"],
aliases: ["LVal", "PatternLike"],
deprecatedAlias: "RestProperty",
fields: Object.assign({}, patternLikeCommon, {
argument: {
validate: (0, _utils.assertNodeType)("LVal")
}
})
});
(0, _utils.default)("ReturnStatement", {
visitor: ["argument"],
aliases: ["Statement", "Terminatorless", "CompletionStatement"],
fields: {
argument: {
validate: (0, _utils.assertNodeType)("Expression"),
optional: true
}
}
});
(0, _utils.default)("SequenceExpression", {
visitor: ["expressions"],
fields: {
expressions: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression")))
}
},
aliases: ["Expression"]
});
(0, _utils.default)("SwitchCase", {
visitor: ["test", "consequent"],
fields: {
test: {
validate: (0, _utils.assertNodeType)("Expression"),
optional: true
},
consequent: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Statement")))
}
}
});
(0, _utils.default)("SwitchStatement", {
visitor: ["discriminant", "cases"],
aliases: ["Statement", "BlockParent", "Scopable"],
fields: {
discriminant: {
validate: (0, _utils.assertNodeType)("Expression")
},
cases: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("SwitchCase")))
}
}
});
(0, _utils.default)("ThisExpression", {
aliases: ["Expression"]
});
(0, _utils.default)("ThrowStatement", {
visitor: ["argument"],
aliases: ["Statement", "Terminatorless", "CompletionStatement"],
fields: {
argument: {
validate: (0, _utils.assertNodeType)("Expression")
}
}
});
(0, _utils.default)("TryStatement", {
visitor: ["block", "handler", "finalizer"],
aliases: ["Statement"],
fields: {
block: {
validate: (0, _utils.assertNodeType)("BlockStatement")
},
handler: {
optional: true,
validate: (0, _utils.assertNodeType)("CatchClause")
},
finalizer: {
optional: true,
validate: (0, _utils.assertNodeType)("BlockStatement")
}
}
});
(0, _utils.default)("UnaryExpression", {
builder: ["operator", "argument", "prefix"],
fields: {
prefix: {
default: true
},
argument: {
validate: (0, _utils.assertNodeType)("Expression")
},
operator: {
validate: (_utils.assertOneOf).apply(void 0, _constants.UNARY_OPERATORS)
}
},
visitor: ["argument"],
aliases: ["UnaryLike", "Expression"]
});
(0, _utils.default)("UpdateExpression", {
builder: ["operator", "argument", "prefix"],
fields: {
prefix: {
default: false
},
argument: {
validate: (0, _utils.assertNodeType)("Expression")
},
operator: {
validate: (_utils.assertOneOf).apply(void 0, _constants.UPDATE_OPERATORS)
}
},
visitor: ["argument"],
aliases: ["Expression"]
});
(0, _utils.default)("VariableDeclaration", {
builder: ["kind", "declarations"],
visitor: ["declarations"],
aliases: ["Statement", "Declaration"],
fields: {
declare: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
},
kind: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("var", "let", "const"))
},
declarations: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("VariableDeclarator")))
}
}
});
(0, _utils.default)("VariableDeclarator", {
visitor: ["id", "init"],
fields: {
id: {
validate: (0, _utils.assertNodeType)("LVal")
},
definite: {
optional: true,
validate: (0, _utils.assertValueType)("boolean")
},
init: {
optional: true,
validate: (0, _utils.assertNodeType)("Expression")
}
}
});
(0, _utils.default)("WhileStatement", {
visitor: ["test", "body"],
aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"],
fields: {
test: {
validate: (0, _utils.assertNodeType)("Expression")
},
body: {
validate: (0, _utils.assertNodeType)("BlockStatement", "Statement")
}
}
});
(0, _utils.default)("WithStatement", {
visitor: ["object", "body"],
aliases: ["Statement"],
fields: {
object: {
validate: (0, _utils.assertNodeType)("Expression")
},
body: {
validate: (0, _utils.assertNodeType)("BlockStatement", "Statement")
}
}
});
/***/ }),
/* 86 */
/***/ (function(module, exports, __webpack_require__) {
(function () {
exports.ast = __webpack_require__(357);
exports.code = __webpack_require__(141);
exports.keyword = __webpack_require__(358);
})();
/***/ }),
/* 87 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = is;
var _shallowEqual = _interopRequireDefault(__webpack_require__(72));
var _isType = _interopRequireDefault(__webpack_require__(88));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function is(type, node, opts) {
if (!node) return false;
var matches = (0, _isType.default)(node.type, type);
if (!matches) return false;
if (typeof opts === "undefined") {
return true;
} else {
return (0, _shallowEqual.default)(node, opts);
}
}
/***/ }),
/* 88 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isType;
var _definitions = __webpack_require__(15);
function isType(nodeType, targetType) {
if (nodeType === targetType) return true;
if (_definitions.ALIAS_KEYS[targetType]) return false;
var aliases = _definitions.FLIPPED_ALIAS_KEYS[targetType];
if (aliases) {
if (aliases[0] === nodeType) return true;
for (var _iterator = aliases, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var alias = _ref;
if (nodeType === alias) return true;
}
}
return false;
}
/***/ }),
/* 89 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.classMethodOrDeclareMethodCommon = exports.classMethodOrPropertyCommon = void 0;
var _utils = _interopRequireWildcard(__webpack_require__(23));
var _core = __webpack_require__(85);
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
(0, _utils.default)("AssignmentPattern", {
visitor: ["left", "right"],
builder: ["left", "right"],
aliases: ["Pattern", "PatternLike", "LVal"],
fields: Object.assign({}, _core.patternLikeCommon, {
left: {
validate: (0, _utils.assertNodeType)("Identifier", "ObjectPattern", "ArrayPattern")
},
right: {
validate: (0, _utils.assertNodeType)("Expression")
},
decorators: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator")))
}
})
});
(0, _utils.default)("ArrayPattern", {
visitor: ["elements", "typeAnnotation"],
builder: ["elements"],
aliases: ["Pattern", "PatternLike", "LVal"],
fields: Object.assign({}, _core.patternLikeCommon, {
elements: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("PatternLike")))
},
decorators: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator")))
}
})
});
(0, _utils.default)("ArrowFunctionExpression", {
builder: ["params", "body", "async"],
visitor: ["params", "body", "returnType", "typeParameters"],
aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
fields: Object.assign({}, _core.functionCommon, _core.functionTypeAnnotationCommon, {
expression: {
validate: (0, _utils.assertValueType)("boolean")
},
body: {
validate: (0, _utils.assertNodeType)("BlockStatement", "Expression")
}
})
});
(0, _utils.default)("ClassBody", {
visitor: ["body"],
fields: {
body: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ClassMethod", "ClassProperty", "ClassPrivateProperty", "TSDeclareMethod", "TSIndexSignature")))
}
}
});
var classCommon = {
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.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TSExpressionWithTypeArguments", "ClassImplements"))),
optional: true
}
};
(0, _utils.default)("ClassDeclaration", {
builder: ["id", "superClass", "body", "decorators"],
visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"],
aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"],
fields: Object.assign({}, classCommon, {
declare: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
},
abstract: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
},
id: {
validate: (0, _utils.assertNodeType)("Identifier"),
optional: true
},
decorators: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
optional: true
}
})
});
(0, _utils.default)("ClassExpression", {
inherits: "ClassDeclaration",
aliases: ["Scopable", "Class", "Expression", "Pureish"],
fields: Object.assign({}, classCommon, {
id: {
optional: true,
validate: (0, _utils.assertNodeType)("Identifier")
},
body: {
validate: (0, _utils.assertNodeType)("ClassBody")
},
superClass: {
optional: true,
validate: (0, _utils.assertNodeType)("Expression")
},
decorators: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
optional: true
}
})
});
(0, _utils.default)("ExportAllDeclaration", {
visitor: ["source"],
aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
fields: {
source: {
validate: (0, _utils.assertNodeType)("StringLiteral")
}
}
});
(0, _utils.default)("ExportDefaultDeclaration", {
visitor: ["declaration"],
aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
fields: {
declaration: {
validate: (0, _utils.assertNodeType)("FunctionDeclaration", "TSDeclareFunction", "ClassDeclaration", "Expression")
}
}
});
(0, _utils.default)("ExportNamedDeclaration", {
visitor: ["declaration", "specifiers", "source"],
aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
fields: {
declaration: {
validate: (0, _utils.assertNodeType)("Declaration"),
optional: true
},
specifiers: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ExportSpecifier", "ExportDefaultSpecifier", "ExportNamespaceSpecifier")))
},
source: {
validate: (0, _utils.assertNodeType)("StringLiteral"),
optional: true
}
}
});
(0, _utils.default)("ExportSpecifier", {
visitor: ["local", "exported"],
aliases: ["ModuleSpecifier"],
fields: {
local: {
validate: (0, _utils.assertNodeType)("Identifier")
},
exported: {
validate: (0, _utils.assertNodeType)("Identifier")
}
}
});
(0, _utils.default)("ForOfStatement", {
visitor: ["left", "right", "body"],
aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
fields: {
left: {
validate: (0, _utils.assertNodeType)("VariableDeclaration", "LVal")
},
right: {
validate: (0, _utils.assertNodeType)("Expression")
},
body: {
validate: (0, _utils.assertNodeType)("Statement")
},
await: {
default: false,
validate: (0, _utils.assertValueType)("boolean")
}
}
});
(0, _utils.default)("ImportDeclaration", {
visitor: ["specifiers", "source"],
aliases: ["Statement", "Declaration", "ModuleDeclaration"],
fields: {
specifiers: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier")))
},
source: {
validate: (0, _utils.assertNodeType)("StringLiteral")
}
}
});
(0, _utils.default)("ImportDefaultSpecifier", {
visitor: ["local"],
aliases: ["ModuleSpecifier"],
fields: {
local: {
validate: (0, _utils.assertNodeType)("Identifier")
}
}
});
(0, _utils.default)("ImportNamespaceSpecifier", {
visitor: ["local"],
aliases: ["ModuleSpecifier"],
fields: {
local: {
validate: (0, _utils.assertNodeType)("Identifier")
}
}
});
(0, _utils.default)("ImportSpecifier", {
visitor: ["local", "imported"],
aliases: ["ModuleSpecifier"],
fields: {
local: {
validate: (0, _utils.assertNodeType)("Identifier")
},
imported: {
validate: (0, _utils.assertNodeType)("Identifier")
},
importKind: {
validate: (0, _utils.assertOneOf)(null, "type", "typeof")
}
}
});
(0, _utils.default)("MetaProperty", {
visitor: ["meta", "property"],
aliases: ["Expression"],
fields: {
meta: {
validate: (0, _utils.assertNodeType)("Identifier")
},
property: {
validate: (0, _utils.assertNodeType)("Identifier")
}
}
});
var classMethodOrPropertyCommon = {
abstract: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
},
accessibility: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (0, _utils.assertOneOf)("public", "private", "protected")),
optional: true
},
static: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
},
computed: {
default: false,
validate: (0, _utils.assertValueType)("boolean")
},
optional: {
validate: (0, _utils.assertValueType)("boolean"),
optional: true
},
key: {
validate: (0, _utils.chain)(function () {
var normal = (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral");
var computed = (0, _utils.assertNodeType)("Expression");
return function (node, key, val) {
var validator = node.computed ? computed : normal;
validator(node, key, val);
};
}(), (0, _utils.assertNodeType)("Identifier", "StringLiteral", "NumericLiteral", "Expression"))
}
};
exports.classMethodOrPropertyCommon = classMethodOrPropertyCommon;
var classMethodOrDeclareMethodCommon = Object.assign({}, _core.functionCommon, classMethodOrPropertyCommon, {
kind: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("string"), (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.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Decorator"))),
optional: true
}
});
exports.classMethodOrDeclareMethodCommon = classMethodOrDeclareMethodCommon;
(0, _utils.default)("ClassMethod", {
aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
builder: ["kind", "key", "params", "body", "computed", "static"],
visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
fields: Object.assign({}, classMethodOrDeclareMethodCommon, _core.functionTypeAnnotationCommon, {
body: {
validate: (0, _utils.assertNodeType)("BlockStatement")
}
})
});
(0, _utils.default)("ObjectPattern", {
visitor: ["properties", "typeAnnotation"],
builder: ["properties"],
aliases: ["Pattern", "PatternLike", "LVal"],
fields: Object.assign({}, _core.patternLikeCommon, {
properties: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("RestElement", "ObjectProperty")))
}
})
});
(0, _utils.default)("SpreadElement", {
visitor: ["argument"],
aliases: ["UnaryLike"],
deprecatedAlias: "SpreadProperty",
fields: {
argument: {
validate: (0, _utils.assertNodeType)("Expression")
}
}
});
(0, _utils.default)("Super", {
aliases: ["Expression"]
});
(0, _utils.default)("TaggedTemplateExpression", {
visitor: ["tag", "quasi"],
aliases: ["Expression"],
fields: {
tag: {
validate: (0, _utils.assertNodeType)("Expression")
},
quasi: {
validate: (0, _utils.assertNodeType)("TemplateLiteral")
}
}
});
(0, _utils.default)("TemplateElement", {
builder: ["value", "tail"],
fields: {
value: {},
tail: {
validate: (0, _utils.assertValueType)("boolean"),
default: false
}
}
});
(0, _utils.default)("TemplateLiteral", {
visitor: ["quasis", "expressions"],
aliases: ["Expression", "Literal"],
fields: {
quasis: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("TemplateElement")))
},
expressions: {
validate: (0, _utils.chain)((0, _utils.assertValueType)("array"), (0, _utils.assertEach)((0, _utils.assertNodeType)("Expression")))
}
}
});
(0, _utils.default)("YieldExpression", {
builder: ["argument", "delegate"],
visitor: ["argument"],
aliases: ["Expression", "Terminatorless"],
fields: {
delegate: {
validate: (0, _utils.assertValueType)("boolean"),
default: false
},
argument: {
optional: true,
validate: (0, _utils.assertNodeType)("Expression")
}
}
});
/***/ }),
/* 90 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = inherit;
function _uniq() {
var data = _interopRequireDefault(__webpack_require__(371));
_uniq = function _uniq() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function inherit(key, child, parent) {
if (child && parent) {
child[key] = (0, _uniq().default)([].concat(child[key], parent[key]).filter(Boolean));
}
}
/***/ }),
/* 91 */
/***/ (function(module, exports, __webpack_require__) {
var baseFindIndex = __webpack_require__(376),
baseIsNaN = __webpack_require__(377),
strictIndexOf = __webpack_require__(378);
function baseIndexOf(array, value, fromIndex) {
return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
}
module.exports = baseIndexOf;
/***/ }),
/* 92 */
/***/ (function(module, exports) {
function setToArray(set) {
var index = -1,
result = Array(set.size);
set.forEach(function (value) {
result[++index] = value;
});
return result;
}
module.exports = setToArray;
/***/ }),
/* 93 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {exports = module.exports = __webpack_require__(410);
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage();
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'];
function useColors() {
if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
return true;
}
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
return false;
}
return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
}
exports.formatters.j = function (v) {
try {
return JSON.stringify(v);
} catch (err) {
return '[UnexpectedJSONParseError]: ' + err.message;
}
};
function formatArgs(args) {
var useColors = this.useColors;
args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff);
if (!useColors) return;
var c = 'color: ' + this.color;
args.splice(1, 0, c, 'color: inherit');
var index = 0;
var lastC = 0;
args[0].replace(/%[a-zA-Z%]/g, function (match) {
if ('%%' === match) return;
index++;
if ('%c' === match) {
lastC = index;
}
});
args.splice(lastC, 0, c);
}
function log() {
return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);
}
function save(namespaces) {
try {
if (null == namespaces) {
exports.storage.removeItem('debug');
} else {
exports.storage.debug = namespaces;
}
} catch (e) {}
}
function load() {
var r;
try {
r = exports.storage.debug;
} catch (e) {}
if (!r && typeof process !== 'undefined' && 'env' in process) {
r = {"NODE_ENV":"production"}.DEBUG;
}
return r;
}
exports.enable(load());
function localstorage() {
try {
return window.localStorage;
} catch (e) {}
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)));
/***/ }),
/* 94 */
/***/ (function(module, exports) {
var s = 1000;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var y = d * 365.25;
module.exports = function (val, options) {
options = options || {};
var type = typeof val;
if (type === 'string' && val.length > 0) {
return parse(val);
} else if (type === 'number' && isNaN(val) === false) {
return options.long ? fmtLong(val) : fmtShort(val);
}
throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
};
function parse(str) {
str = String(str);
if (str.length > 100) {
return;
}
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
if (!match) {
return;
}
var n = parseFloat(match[1]);
var type = (match[2] || 'ms').toLowerCase();
switch (type) {
case 'years':
case 'year':
case 'yrs':
case 'yr':
case 'y':
return n * y;
case 'days':
case 'day':
case 'd':
return n * d;
case 'hours':
case 'hour':
case 'hrs':
case 'hr':
case 'h':
return n * h;
case 'minutes':
case 'minute':
case 'mins':
case 'min':
case 'm':
return n * m;
case 'seconds':
case 'second':
case 'secs':
case 'sec':
case 's':
return n * s;
case 'milliseconds':
case 'millisecond':
case 'msecs':
case 'msec':
case 'ms':
return n;
default:
return undefined;
}
}
function fmtShort(ms) {
if (ms >= d) {
return Math.round(ms / d) + 'd';
}
if (ms >= h) {
return Math.round(ms / h) + 'h';
}
if (ms >= m) {
return Math.round(ms / m) + 'm';
}
if (ms >= s) {
return Math.round(ms / s) + 's';
}
return ms + 'ms';
}
function fmtLong(ms) {
return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms';
}
function plural(ms, n, name) {
if (ms < n) {
return;
}
if (ms < n * 1.5) {
return Math.floor(ms / n) + ' ' + name;
}
return Math.ceil(ms / n) + ' ' + name + 's';
}
/***/ }),
/* 95 */
/***/ (function(module, exports, __webpack_require__) {
var baseIndexOf = __webpack_require__(91),
isArrayLike = __webpack_require__(35),
isString = __webpack_require__(412),
toInteger = __webpack_require__(58),
values = __webpack_require__(160);
var nativeMax = Math.max;
function includes(collection, value, fromIndex, guard) {
collection = isArrayLike(collection) ? collection : values(collection);
fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
var length = collection.length;
if (fromIndex < 0) {
fromIndex = nativeMax(length + fromIndex, 0);
}
return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
}
module.exports = includes;
/***/ }),
/* 96 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = splitExportDeclaration;
function t() {
var data = _interopRequireWildcard(__webpack_require__(4));
t = function t() {
return data;
};
return data;
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function splitExportDeclaration(exportDeclaration) {
if (!exportDeclaration.isExportDeclaration()) {
throw new Error("Only export declarations can be splitted.");
}
var isDefault = exportDeclaration.isExportDefaultDeclaration();
var declaration = exportDeclaration.get("declaration");
var isClassDeclaration = declaration.isClassDeclaration();
if (isDefault) {
var standaloneDeclaration = declaration.isFunctionDeclaration() || isClassDeclaration;
var scope = declaration.isScope() ? declaration.scope.parent : declaration.scope;
var id = declaration.node.id;
var needBindingRegistration = false;
if (!id) {
needBindingRegistration = true;
id = scope.generateUidIdentifier("default");
if (standaloneDeclaration || declaration.isFunctionExpression() || declaration.isClassExpression()) {
declaration.node.id = t().cloneNode(id);
}
}
var updatedDeclaration = standaloneDeclaration ? declaration : t().variableDeclaration("var", [t().variableDeclarator(t().cloneNode(id), declaration.node)]);
var updatedExportDeclaration = t().exportNamedDeclaration(null, [t().exportSpecifier(t().cloneNode(id), t().identifier("default"))]);
exportDeclaration.insertAfter(updatedExportDeclaration);
exportDeclaration.replaceWith(updatedDeclaration);
if (needBindingRegistration) {
scope.registerBinding(isClassDeclaration ? "let" : "var", exportDeclaration);
}
return exportDeclaration;
}
if (exportDeclaration.get("specifiers").length > 0) {
throw new Error("It doesn't make sense to split exported specifiers.");
}
var bindingIdentifiers = declaration.getOuterBindingIdentifiers();
var specifiers = Object.keys(bindingIdentifiers).map(function (name) {
return t().exportSpecifier(t().identifier(name), t().identifier(name));
});
var aliasDeclar = t().exportNamedDeclaration(null, specifiers);
exportDeclaration.insertAfter(aliasDeclar);
exportDeclaration.replaceWith(declaration.node);
return exportDeclaration;
}
/***/ }),
/* 97 */
/***/ (function(module, exports, __webpack_require__) {
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
exports.CodeGenerator = void 0;
var _sourceMap = _interopRequireDefault(__webpack_require__(427));
var _printer = _interopRequireDefault(__webpack_require__(434));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
var Generator = function (_printer$default) {
_inheritsLoose(Generator, _printer$default);
function Generator(ast, opts, code) {
var _this;
if (opts === void 0) {
opts = {};
}
var format = normalizeOptions(code, opts);
var map = opts.sourceMaps ? new _sourceMap.default(opts, code) : null;
_this = _printer$default.call(this, format, map) || this;
_this.ast = ast;
return _this;
}
var _proto = Generator.prototype;
_proto.generate = function generate() {
return _printer$default.prototype.generate.call(this, this.ast);
};
return Generator;
}(_printer.default);
function normalizeOptions(code, opts) {
var format = {
auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
shouldPrintComment: opts.shouldPrintComment,
retainLines: opts.retainLines,
retainFunctionParens: opts.retainFunctionParens,
comments: opts.comments == null || opts.comments,
compact: opts.compact,
minified: opts.minified,
concise: opts.concise,
jsonCompatibleStrings: opts.jsonCompatibleStrings,
indent: {
adjustMultilineComment: true,
style: " ",
base: 0
},
decoratorsBeforeExport: !!opts.decoratorsBeforeExport,
jsescOption: Object.assign({
quotes: "double",
wrap: true
}, opts.jsescOption)
};
if (format.minified) {
format.compact = true;
format.shouldPrintComment = format.shouldPrintComment || function () {
return format.comments;
};
} else {
format.shouldPrintComment = format.shouldPrintComment || function (value) {
return format.comments || value.indexOf("@license") >= 0 || value.indexOf("@preserve") >= 0;
};
}
if (format.compact === "auto") {
format.compact = 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.indent.adjustMultilineComment = false;
}
return format;
}
var CodeGenerator = function () {
function CodeGenerator(ast, opts, code) {
this._generator = new Generator(ast, opts, code);
}
var _proto2 = CodeGenerator.prototype;
_proto2.generate = function generate() {
return this._generator.generate();
};
return CodeGenerator;
}();
exports.CodeGenerator = CodeGenerator;
function _default(ast, opts, code) {
var gen = new Generator(ast, opts, code);
return gen.generate();
}
/***/ }),
/* 98 */
/***/ (function(module, exports, __webpack_require__) {
exports.SourceMapGenerator = __webpack_require__(165).SourceMapGenerator;
exports.SourceMapConsumer = __webpack_require__(430).SourceMapConsumer;
exports.SourceNode = __webpack_require__(433).SourceNode;
/***/ }),
/* 99 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Identifier = Identifier;
exports.SpreadElement = exports.RestElement = RestElement;
exports.ObjectPattern = exports.ObjectExpression = ObjectExpression;
exports.ObjectMethod = ObjectMethod;
exports.ObjectProperty = ObjectProperty;
exports.ArrayPattern = exports.ArrayExpression = ArrayExpression;
exports.RegExpLiteral = RegExpLiteral;
exports.BooleanLiteral = BooleanLiteral;
exports.NullLiteral = NullLiteral;
exports.NumericLiteral = NumericLiteral;
exports.StringLiteral = StringLiteral;
exports.BigIntLiteral = BigIntLiteral;
function t() {
var data = _interopRequireWildcard(__webpack_require__(4));
t = function t() {
return data;
};
return data;
}
function _jsesc() {
var data = _interopRequireDefault(__webpack_require__(446));
_jsesc = function _jsesc() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function Identifier(node) {
this.word(node.name);
}
function RestElement(node) {
this.token("...");
this.print(node.argument, node);
}
function ObjectExpression(node) {
var props = node.properties;
this.token("{");
this.printInnerComments(node);
if (props.length) {
this.space();
this.printList(props, node, {
indent: true,
statement: true
});
this.space();
}
this.token("}");
}
function ObjectMethod(node) {
this.printJoin(node.decorators, node);
this._methodHead(node);
this.space();
this.print(node.body, node);
}
function ObjectProperty(node) {
this.printJoin(node.decorators, node);
if (node.computed) {
this.token("[");
this.print(node.key, node);
this.token("]");
} else {
if (t().isAssignmentPattern(node.value) && t().isIdentifier(node.key) && node.key.name === node.value.left.name) {
this.print(node.value, node);
return;
}
this.print(node.key, node);
if (node.shorthand && t().isIdentifier(node.key) && t().isIdentifier(node.value) && node.key.name === node.value.name) {
return;
}
}
this.token(":");
this.space();
this.print(node.value, node);
}
function ArrayExpression(node) {
var elems = node.elements;
var len = elems.length;
this.token("[");
this.printInnerComments(node);
for (var i = 0; i < elems.length; i++) {
var elem = elems[i];
if (elem) {
if (i > 0) this.space();
this.print(elem, node);
if (i < len - 1) this.token(",");
} else {
this.token(",");
}
}
this.token("]");
}
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) {
var raw = this.getPossibleRaw(node);
var value = node.value + "";
if (raw == null) {
this.number(value);
} else if (this.format.minified) {
this.number(raw.length < value.length ? raw : value);
} else {
this.number(raw);
}
}
function StringLiteral(node) {
var raw = this.getPossibleRaw(node);
if (!this.format.minified && raw != null) {
this.token(raw);
return;
}
var opts = this.format.jsescOption;
if (this.format.jsonCompatibleStrings) {
opts.json = true;
}
var val = (0, _jsesc().default)(node.value, opts);
return this.token(val);
}
function BigIntLiteral(node) {
var raw = this.getPossibleRaw(node);
if (!this.format.minified && raw != null) {
this.token(raw);
return;
}
this.token(node.value);
}
/***/ }),
/* 100 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, '__esModule', {
value: true
});
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass;
}
var beforeExpr = true;
var startsExpr = true;
var isLoop = true;
var isAssign = true;
var prefix = true;
var postfix = true;
var TokenType = function TokenType(label, conf) {
if (conf === void 0) {
conf = {};
}
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 === 0 ? 0 : conf.binop || null;
this.updateContext = null;
};
var KeywordTokenType = function (_TokenType) {
_inheritsLoose(KeywordTokenType, _TokenType);
function KeywordTokenType(name, options) {
if (options === void 0) {
options = {};
}
options.keyword = name;
return _TokenType.call(this, name, options) || this;
}
return KeywordTokenType;
}(TokenType);
var BinopTokenType = function (_TokenType2) {
_inheritsLoose(BinopTokenType, _TokenType2);
function BinopTokenType(name, prec) {
return _TokenType2.call(this, name, {
beforeExpr: beforeExpr,
binop: prec
}) || this;
}
return BinopTokenType;
}(TokenType);
var types = {
num: new TokenType("num", {
startsExpr: startsExpr
}),
bigint: new TokenType("bigint", {
startsExpr: startsExpr
}),
regexp: new TokenType("regexp", {
startsExpr: startsExpr
}),
string: new TokenType("string", {
startsExpr: startsExpr
}),
name: new TokenType("name", {
startsExpr: startsExpr
}),
eof: new TokenType("eof"),
bracketL: new TokenType("[", {
beforeExpr: beforeExpr,
startsExpr: startsExpr
}),
bracketR: new TokenType("]"),
braceL: new TokenType("{", {
beforeExpr: beforeExpr,
startsExpr: startsExpr
}),
braceBarL: new TokenType("{|", {
beforeExpr: beforeExpr,
startsExpr: startsExpr
}),
braceR: new TokenType("}"),
braceBarR: new TokenType("|}"),
parenL: new TokenType("(", {
beforeExpr: beforeExpr,
startsExpr: startsExpr
}),
parenR: new TokenType(")"),
comma: new TokenType(",", {
beforeExpr: beforeExpr
}),
semi: new TokenType(";", {
beforeExpr: beforeExpr
}),
colon: new TokenType(":", {
beforeExpr: beforeExpr
}),
doubleColon: new TokenType("::", {
beforeExpr: beforeExpr
}),
dot: new TokenType("."),
question: new TokenType("?", {
beforeExpr: beforeExpr
}),
questionDot: new TokenType("?."),
arrow: new TokenType("=>", {
beforeExpr: beforeExpr
}),
template: new TokenType("template"),
ellipsis: new TokenType("...", {
beforeExpr: beforeExpr
}),
backQuote: new TokenType("`", {
startsExpr: startsExpr
}),
dollarBraceL: new TokenType("${", {
beforeExpr: beforeExpr,
startsExpr: startsExpr
}),
at: new TokenType("@"),
hash: new TokenType("#"),
interpreterDirective: new TokenType("#!..."),
eq: new TokenType("=", {
beforeExpr: beforeExpr,
isAssign: isAssign
}),
assign: new TokenType("_=", {
beforeExpr: beforeExpr,
isAssign: isAssign
}),
incDec: new TokenType("++/--", {
prefix: prefix,
postfix: postfix,
startsExpr: startsExpr
}),
bang: new TokenType("!", {
beforeExpr: beforeExpr,
prefix: prefix,
startsExpr: startsExpr
}),
tilde: new TokenType("~", {
beforeExpr: beforeExpr,
prefix: prefix,
startsExpr: startsExpr
}),
pipeline: new BinopTokenType("|>", 0),
nullishCoalescing: new BinopTokenType("??", 1),
logicalOR: new BinopTokenType("||", 1),
logicalAND: new BinopTokenType("&&", 2),
bitwiseOR: new BinopTokenType("|", 3),
bitwiseXOR: new BinopTokenType("^", 4),
bitwiseAND: new BinopTokenType("&", 5),
equality: new BinopTokenType("==/!=", 6),
relational: new BinopTokenType("</>", 7),
bitShift: new BinopTokenType("<</>>", 8),
plusMin: new TokenType("+/-", {
beforeExpr: beforeExpr,
binop: 9,
prefix: prefix,
startsExpr: startsExpr
}),
modulo: new BinopTokenType("%", 10),
star: new BinopTokenType("*", 10),
slash: new BinopTokenType("/", 10),
exponent: new TokenType("**", {
beforeExpr: beforeExpr,
binop: 11,
rightAssociative: true
})
};
var keywords = {
break: new KeywordTokenType("break"),
case: new KeywordTokenType("case", {
beforeExpr: beforeExpr
}),
catch: new KeywordTokenType("catch"),
continue: new KeywordTokenType("continue"),
debugger: new KeywordTokenType("debugger"),
default: new KeywordTokenType("default", {
beforeExpr: beforeExpr
}),
do: new KeywordTokenType("do", {
isLoop: isLoop,
beforeExpr: beforeExpr
}),
else: new KeywordTokenType("else", {
beforeExpr: beforeExpr
}),
finally: new KeywordTokenType("finally"),
for: new KeywordTokenType("for", {
isLoop: isLoop
}),
function: new KeywordTokenType("function", {
startsExpr: startsExpr
}),
if: new KeywordTokenType("if"),
return: new KeywordTokenType("return", {
beforeExpr: beforeExpr
}),
switch: new KeywordTokenType("switch"),
throw: new KeywordTokenType("throw", {
beforeExpr: beforeExpr,
prefix: prefix,
startsExpr: startsExpr
}),
try: new KeywordTokenType("try"),
var: new KeywordTokenType("var"),
let: new KeywordTokenType("let"),
const: new KeywordTokenType("const"),
while: new KeywordTokenType("while", {
isLoop: isLoop
}),
with: new KeywordTokenType("with"),
new: new KeywordTokenType("new", {
beforeExpr: beforeExpr,
startsExpr: startsExpr
}),
this: new KeywordTokenType("this", {
startsExpr: startsExpr
}),
super: new KeywordTokenType("super", {
startsExpr: startsExpr
}),
class: new KeywordTokenType("class"),
extends: new KeywordTokenType("extends", {
beforeExpr: beforeExpr
}),
export: new KeywordTokenType("export"),
import: new KeywordTokenType("import", {
startsExpr: startsExpr
}),
yield: new KeywordTokenType("yield", {
beforeExpr: beforeExpr,
startsExpr: startsExpr
}),
null: new KeywordTokenType("null", {
startsExpr: startsExpr
}),
true: new KeywordTokenType("true", {
startsExpr: startsExpr
}),
false: new KeywordTokenType("false", {
startsExpr: startsExpr
}),
in: new KeywordTokenType("in", {
beforeExpr: beforeExpr,
binop: 7
}),
instanceof: new KeywordTokenType("instanceof", {
beforeExpr: beforeExpr,
binop: 7
}),
typeof: new KeywordTokenType("typeof", {
beforeExpr: beforeExpr,
prefix: prefix,
startsExpr: startsExpr
}),
void: new KeywordTokenType("void", {
beforeExpr: beforeExpr,
prefix: prefix,
startsExpr: startsExpr
}),
delete: new KeywordTokenType("delete", {
beforeExpr: beforeExpr,
prefix: prefix,
startsExpr: startsExpr
})
};
Object.keys(keywords).forEach(function (name) {
types["_" + name] = keywords[name];
});
function isSimpleProperty(node) {
return node != null && node.type === "Property" && node.kind === "init" && node.method === false;
}
var estree = function estree(superClass) {
return function (_superClass) {
_inheritsLoose(_class, _superClass);
function _class() {
return _superClass.apply(this, arguments) || this;
}
var _proto = _class.prototype;
_proto.estreeParseRegExpLiteral = function estreeParseRegExpLiteral(_ref) {
var pattern = _ref.pattern,
flags = _ref.flags;
var regex = null;
try {
regex = new RegExp(pattern, flags);
} catch (e) {}
var node = this.estreeParseLiteral(regex);
node.regex = {
pattern: pattern,
flags: flags
};
return node;
};
_proto.estreeParseLiteral = function estreeParseLiteral(value) {
return this.parseLiteral(value, "Literal");
};
_proto.directiveToStmt = function directiveToStmt(directive) {
var directiveLiteral = directive.value;
var stmt = this.startNodeAt(directive.start, directive.loc.start);
var expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start);
expression.value = directiveLiteral.value;
expression.raw = directiveLiteral.extra.raw;
stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end);
stmt.directive = directiveLiteral.extra.raw.slice(1, -1);
return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end);
};
_proto.initFunction = function initFunction(node, isAsync) {
_superClass.prototype.initFunction.call(this, node, isAsync);
node.expression = false;
};
_proto.checkDeclaration = function checkDeclaration(node) {
if (isSimpleProperty(node)) {
this.checkDeclaration(node.value);
} else {
_superClass.prototype.checkDeclaration.call(this, node);
}
};
_proto.checkGetterSetterParams = function checkGetterSetterParams(method) {
var prop = method;
var paramCount = prop.kind === "get" ? 0 : 1;
var start = prop.start;
if (prop.value.params.length !== paramCount) {
if (prop.kind === "get") {
this.raise(start, "getter must not have any formal parameters");
} else {
this.raise(start, "setter must have exactly one formal parameter");
}
}
if (prop.kind === "set" && prop.value.params[0].type === "RestElement") {
this.raise(start, "setter function argument must not be a rest parameter");
}
};
_proto.checkLVal = function checkLVal(expr, isBinding, checkClashes, contextDescription) {
var _this = this;
switch (expr.type) {
case "ObjectPattern":
expr.properties.forEach(function (prop) {
_this.checkLVal(prop.type === "Property" ? prop.value : prop, isBinding, checkClashes, "object destructuring pattern");
});
break;
default:
_superClass.prototype.checkLVal.call(this, expr, isBinding, checkClashes, contextDescription);
}
};
_proto.checkPropClash = function checkPropClash(prop, propHash) {
if (prop.computed || !isSimpleProperty(prop)) return;
var key = prop.key;
var name = key.type === "Identifier" ? key.name : String(key.value);
if (name === "__proto__") {
if (propHash.proto) {
this.raise(key.start, "Redefinition of __proto__ property");
}
propHash.proto = true;
}
};
_proto.isStrictBody = function isStrictBody(node) {
var isBlockStatement = node.body.type === "BlockStatement";
if (isBlockStatement && node.body.body.length > 0) {
for (var _i2 = 0, _node$body$body2 = node.body.body; _i2 < _node$body$body2.length; _i2++) {
var directive = _node$body$body2[_i2];
if (directive.type === "ExpressionStatement" && directive.expression.type === "Literal") {
if (directive.expression.value === "use strict") return true;
} else {
break;
}
}
}
return false;
};
_proto.isValidDirective = function isValidDirective(stmt) {
return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && (!stmt.expression.extra || !stmt.expression.extra.parenthesized);
};
_proto.stmtToDirective = function stmtToDirective(stmt) {
var directive = _superClass.prototype.stmtToDirective.call(this, stmt);
var value = stmt.expression.value;
directive.value.value = value;
return directive;
};
_proto.parseBlockBody = function parseBlockBody(node, allowDirectives, topLevel, end) {
var _this2 = this;
_superClass.prototype.parseBlockBody.call(this, node, allowDirectives, topLevel, end);
var directiveStatements = node.directives.map(function (d) {
return _this2.directiveToStmt(d);
});
node.body = directiveStatements.concat(node.body);
delete node.directives;
};
_proto.pushClassMethod = function pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor) {
this.parseMethod(method, isGenerator, isAsync, isConstructor, "MethodDefinition");
if (method.typeParameters) {
method.value.typeParameters = method.typeParameters;
delete method.typeParameters;
}
classBody.body.push(method);
};
_proto.parseExprAtom = function parseExprAtom(refShorthandDefaultPos) {
switch (this.state.type) {
case types.regexp:
return this.estreeParseRegExpLiteral(this.state.value);
case types.num:
case types.string:
return this.estreeParseLiteral(this.state.value);
case types._null:
return this.estreeParseLiteral(null);
case types._true:
return this.estreeParseLiteral(true);
case types._false:
return this.estreeParseLiteral(false);
default:
return _superClass.prototype.parseExprAtom.call(this, refShorthandDefaultPos);
}
};
_proto.parseLiteral = function parseLiteral(value, type, startPos, startLoc) {
var node = _superClass.prototype.parseLiteral.call(this, value, type, startPos, startLoc);
node.raw = node.extra.raw;
delete node.extra;
return node;
};
_proto.parseFunctionBody = function parseFunctionBody(node, allowExpression) {
_superClass.prototype.parseFunctionBody.call(this, node, allowExpression);
node.expression = node.body.type !== "BlockStatement";
};
_proto.parseMethod = function parseMethod(node, isGenerator, isAsync, isConstructor, type) {
var funcNode = this.startNode();
funcNode.kind = node.kind;
funcNode = _superClass.prototype.parseMethod.call(this, funcNode, isGenerator, isAsync, isConstructor, "FunctionExpression");
delete funcNode.kind;
node.value = funcNode;
return this.finishNode(node, type);
};
_proto.parseObjectMethod = function parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) {
var node = _superClass.prototype.parseObjectMethod.call(this, prop, isGenerator, isAsync, isPattern, containsEsc);
if (node) {
node.type = "Property";
if (node.kind === "method") node.kind = "init";
node.shorthand = false;
}
return node;
};
_proto.parseObjectProperty = function parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos) {
var node = _superClass.prototype.parseObjectProperty.call(this, prop, startPos, startLoc, isPattern, refShorthandDefaultPos);
if (node) {
node.kind = "init";
node.type = "Property";
}
return node;
};
_proto.toAssignable = function toAssignable(node, isBinding, contextDescription) {
if (isSimpleProperty(node)) {
this.toAssignable(node.value, isBinding, contextDescription);
return node;
}
return _superClass.prototype.toAssignable.call(this, node, isBinding, contextDescription);
};
_proto.toAssignableObjectExpressionProp = function toAssignableObjectExpressionProp(prop, isBinding, isLast) {
if (prop.kind === "get" || prop.kind === "set") {
this.raise(prop.key.start, "Object pattern can't contain getter or setter");
} else if (prop.method) {
this.raise(prop.key.start, "Object pattern can't contain methods");
} else {
_superClass.prototype.toAssignableObjectExpressionProp.call(this, prop, isBinding, isLast);
}
};
return _class;
}(superClass);
};
function makePredicate(words) {
var wordsArr = words.split(" ");
return function (str) {
return wordsArr.indexOf(str) >= 0;
};
}
var reservedWords = {
"6": makePredicate("enum await"),
strict: makePredicate("implements interface let package private protected public static yield"),
strictBind: makePredicate("eval arguments")
};
var isKeyword = makePredicate("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this let const class extends export import yield super");
var 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\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\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\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-\u1878\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\u1C90-\u1CBA\u1CBD-\u1CBF\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-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\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-\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";
var nonASCIIidentifierChars = "\u200C\u200D\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\u08D3-\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\u0B56\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\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\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\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-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\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\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\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";
var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
var 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, 157, 310, 10, 21, 11, 7, 153, 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, 477, 28, 11, 0, 9, 21, 190, 52, 76, 44, 33, 24, 27, 35, 30, 0, 12, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 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, 159, 52, 19, 3, 54, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 86, 26, 230, 43, 117, 63, 32, 0, 257, 0, 11, 39, 8, 0, 22, 0, 12, 39, 3, 3, 20, 0, 35, 56, 264, 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, 270, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 68, 12, 0, 67, 12, 65, 1, 31, 6129, 15, 754, 9486, 286, 82, 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, 4149, 196, 60, 67, 1213, 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, 42710, 42, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541];
var 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, 525, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 4, 9, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 280, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 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, 19306, 9, 135, 4, 60, 6, 26, 9, 1016, 45, 17, 3, 19723, 1, 5319, 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, 2214, 6, 110, 6, 6, 9, 792487, 239];
function isInAstralSet(code, set) {
var pos = 0x10000;
for (var i = 0; i < set.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 < 91) return true;
if (code < 97) return code === 95;
if (code < 123) return true;
if (code <= 0xffff) {
return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
}
return isInAstralSet(code, astralIdentifierStartCodes);
}
function isIteratorStart(current, next) {
return current === 64 && next === 64;
}
function isIdentifierChar(code) {
if (code < 48) return code === 36;
if (code < 58) return true;
if (code < 65) return false;
if (code < 91) return true;
if (code < 97) return code === 95;
if (code < 123) return true;
if (code <= 0xffff) {
return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
}
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
}
var primitiveTypes = ["any", "bool", "boolean", "empty", "false", "mixed", "null", "number", "static", "string", "true", "typeof", "void"];
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";
}
function isMaybeDefaultImport(state) {
return (state.type === types.name || !!state.type.keyword) && state.value !== "from";
}
var exportSuggestions = {
const: "declare export var",
let: "declare export var",
type: "export type",
interface: "export interface"
};
function partition(list, test) {
var list1 = [];
var list2 = [];
for (var i = 0; i < list.length; i++) {
(test(list[i], i, list) ? list1 : list2).push(list[i]);
}
return [list1, list2];
}
var FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/;
var flow = function flow(superClass) {
return function (_superClass) {
_inheritsLoose(_class, _superClass);
function _class(options, input) {
var _this;
_this = _superClass.call(this, options, input) || this;
_this.flowPragma = undefined;
return _this;
}
var _proto = _class.prototype;
_proto.shouldParseTypes = function shouldParseTypes() {
return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
};
_proto.addComment = function addComment(comment) {
if (this.flowPragma === undefined) {
var matches = FLOW_PRAGMA_REGEX.exec(comment.value);
if (!matches) {
this.flowPragma = null;
} else if (matches[1] === "flow") {
this.flowPragma = "flow";
} else if (matches[1] === "noflow") {
this.flowPragma = "noflow";
} else {
throw new Error("Unexpected flow pragma");
}
}
return _superClass.prototype.addComment.call(this, comment);
};
_proto.flowParseTypeInitialiser = function flowParseTypeInitialiser(tok) {
var oldInType = this.state.inType;
this.state.inType = true;
this.expect(tok || types.colon);
var type = this.flowParseType();
this.state.inType = oldInType;
return type;
};
_proto.flowParsePredicate = function flowParsePredicate() {
var node = this.startNode();
var moduloLoc = this.state.startLoc;
var moduloPos = this.state.start;
this.expect(types.modulo);
var checksLoc = this.state.startLoc;
this.expectContextual("checks");
if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) {
this.raise(moduloPos, "Spaces between ´%´ and ´checks´ are not allowed here.");
}
if (this.eat(types.parenL)) {
node.value = this.parseExpression();
this.expect(types.parenR);
return this.finishNode(node, "DeclaredPredicate");
} else {
return this.finishNode(node, "InferredPredicate");
}
};
_proto.flowParseTypeAndPredicateInitialiser = function flowParseTypeAndPredicateInitialiser() {
var oldInType = this.state.inType;
this.state.inType = true;
this.expect(types.colon);
var type = null;
var predicate = null;
if (this.match(types.modulo)) {
this.state.inType = oldInType;
predicate = this.flowParsePredicate();
} else {
type = this.flowParseType();
this.state.inType = oldInType;
if (this.match(types.modulo)) {
predicate = this.flowParsePredicate();
}
}
return [type, predicate];
};
_proto.flowParseDeclareClass = function flowParseDeclareClass(node) {
this.next();
this.flowParseInterfaceish(node, true);
return this.finishNode(node, "DeclareClass");
};
_proto.flowParseDeclareFunction = function flowParseDeclareFunction(node) {
this.next();
var id = node.id = this.parseIdentifier();
var typeNode = this.startNode();
var typeContainer = this.startNode();
if (this.isRelational("<")) {
typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
} else {
typeNode.typeParameters = null;
}
this.expect(types.parenL);
var tmp = this.flowParseFunctionTypeParams();
typeNode.params = tmp.params;
typeNode.rest = tmp.rest;
this.expect(types.parenR);
var _this$flowParseTypeAn = this.flowParseTypeAndPredicateInitialiser();
typeNode.returnType = _this$flowParseTypeAn[0];
node.predicate = _this$flowParseTypeAn[1];
typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation");
id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
this.finishNode(id, id.type);
this.semicolon();
return this.finishNode(node, "DeclareFunction");
};
_proto.flowParseDeclare = function flowParseDeclare(node, insideModule) {
if (this.match(types._class)) {
return this.flowParseDeclareClass(node);
} else if (this.match(types._function)) {
return this.flowParseDeclareFunction(node);
} else if (this.match(types._var)) {
return this.flowParseDeclareVariable(node);
} else if (this.isContextual("module")) {
if (this.lookahead().type === types.dot) {
return this.flowParseDeclareModuleExports(node);
} else {
if (insideModule) {
this.unexpected(null, "`declare module` cannot be used inside another `declare module`");
}
return this.flowParseDeclareModule(node);
}
} else if (this.isContextual("type")) {
return this.flowParseDeclareTypeAlias(node);
} else if (this.isContextual("opaque")) {
return this.flowParseDeclareOpaqueType(node);
} else if (this.isContextual("interface")) {
return this.flowParseDeclareInterface(node);
} else if (this.match(types._export)) {
return this.flowParseDeclareExportDeclaration(node, insideModule);
} else {
throw this.unexpected();
}
};
_proto.flowParseDeclareVariable = function flowParseDeclareVariable(node) {
this.next();
node.id = this.flowParseTypeAnnotatableIdentifier(true);
this.semicolon();
return this.finishNode(node, "DeclareVariable");
};
_proto.flowParseDeclareModule = function flowParseDeclareModule(node) {
var _this2 = this;
this.next();
if (this.match(types.string)) {
node.id = this.parseExprAtom();
} else {
node.id = this.parseIdentifier();
}
var bodyNode = node.body = this.startNode();
var body = bodyNode.body = [];
this.expect(types.braceL);
while (!this.match(types.braceR)) {
var _bodyNode = this.startNode();
if (this.match(types._import)) {
var lookahead = this.lookahead();
if (lookahead.value !== "type" && lookahead.value !== "typeof") {
this.unexpected(null, "Imports within a `declare module` body must always be `import type` or `import typeof`");
}
this.next();
this.parseImport(_bodyNode);
} else {
this.expectContextual("declare", "Only declares and type imports are allowed inside declare module");
_bodyNode = this.flowParseDeclare(_bodyNode, true);
}
body.push(_bodyNode);
}
this.expect(types.braceR);
this.finishNode(bodyNode, "BlockStatement");
var kind = null;
var hasModuleExport = false;
var errorMessage = "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";
body.forEach(function (bodyElement) {
if (isEsModuleType(bodyElement)) {
if (kind === "CommonJS") {
_this2.unexpected(bodyElement.start, errorMessage);
}
kind = "ES";
} else if (bodyElement.type === "DeclareModuleExports") {
if (hasModuleExport) {
_this2.unexpected(bodyElement.start, "Duplicate `declare module.exports` statement");
}
if (kind === "ES") _this2.unexpected(bodyElement.start, errorMessage);
kind = "CommonJS";
hasModuleExport = true;
}
});
node.kind = kind || "CommonJS";
return this.finishNode(node, "DeclareModule");
};
_proto.flowParseDeclareExportDeclaration = function flowParseDeclareExportDeclaration(node, insideModule) {
this.expect(types._export);
if (this.eat(types._default)) {
if (this.match(types._function) || this.match(types._class)) {
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(types._const) || this.match(types._let) || (this.isContextual("type") || this.isContextual("interface")) && !insideModule) {
var label = this.state.value;
var suggestion = exportSuggestions[label];
this.unexpected(this.state.start, "`declare export " + label + "` is not supported. Use `" + suggestion + "` instead");
}
if (this.match(types._var) || this.match(types._function) || this.match(types._class) || this.isContextual("opaque")) {
node.declaration = this.flowParseDeclare(this.startNode());
node.default = false;
return this.finishNode(node, "DeclareExportDeclaration");
} else if (this.match(types.star) || this.match(types.braceL) || this.isContextual("interface") || this.isContextual("type") || this.isContextual("opaque")) {
node = this.parseExport(node);
if (node.type === "ExportNamedDeclaration") {
node.type = "ExportDeclaration";
node.default = false;
delete node.exportKind;
}
node.type = "Declare" + node.type;
return node;
}
}
throw this.unexpected();
};
_proto.flowParseDeclareModuleExports = function flowParseDeclareModuleExports(node) {
this.expectContextual("module");
this.expect(types.dot);
this.expectContextual("exports");
node.typeAnnotation = this.flowParseTypeAnnotation();
this.semicolon();
return this.finishNode(node, "DeclareModuleExports");
};
_proto.flowParseDeclareTypeAlias = function flowParseDeclareTypeAlias(node) {
this.next();
this.flowParseTypeAlias(node);
return this.finishNode(node, "DeclareTypeAlias");
};
_proto.flowParseDeclareOpaqueType = function flowParseDeclareOpaqueType(node) {
this.next();
this.flowParseOpaqueType(node, true);
return this.finishNode(node, "DeclareOpaqueType");
};
_proto.flowParseDeclareInterface = function flowParseDeclareInterface(node) {
this.next();
this.flowParseInterfaceish(node);
return this.finishNode(node, "DeclareInterface");
};
_proto.flowParseInterfaceish = function flowParseInterfaceish(node, isClass) {
if (isClass === void 0) {
isClass = false;
}
node.id = this.flowParseRestrictedIdentifier(!isClass);
if (this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
} else {
node.typeParameters = null;
}
node.extends = [];
node.implements = [];
node.mixins = [];
if (this.eat(types._extends)) {
do {
node.extends.push(this.flowParseInterfaceExtends());
} while (!isClass && this.eat(types.comma));
}
if (this.isContextual("mixins")) {
this.next();
do {
node.mixins.push(this.flowParseInterfaceExtends());
} while (this.eat(types.comma));
}
if (this.isContextual("implements")) {
this.next();
do {
node.implements.push(this.flowParseInterfaceExtends());
} while (this.eat(types.comma));
}
node.body = this.flowParseObjectType(true, false, false, isClass);
};
_proto.flowParseInterfaceExtends = function flowParseInterfaceExtends() {
var node = this.startNode();
node.id = this.flowParseQualifiedTypeIdentifier();
if (this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterInstantiation();
} else {
node.typeParameters = null;
}
return this.finishNode(node, "InterfaceExtends");
};
_proto.flowParseInterface = function flowParseInterface(node) {
this.flowParseInterfaceish(node);
return this.finishNode(node, "InterfaceDeclaration");
};
_proto.checkReservedType = function checkReservedType(word, startLoc) {
if (primitiveTypes.indexOf(word) > -1) {
this.raise(startLoc, "Cannot overwrite primitive type " + word);
}
};
_proto.flowParseRestrictedIdentifier = function flowParseRestrictedIdentifier(liberal) {
this.checkReservedType(this.state.value, this.state.start);
return this.parseIdentifier(liberal);
};
_proto.flowParseTypeAlias = function flowParseTypeAlias(node) {
node.id = this.flowParseRestrictedIdentifier();
if (this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
} else {
node.typeParameters = null;
}
node.right = this.flowParseTypeInitialiser(types.eq);
this.semicolon();
return this.finishNode(node, "TypeAlias");
};
_proto.flowParseOpaqueType = function flowParseOpaqueType(node, declare) {
this.expectContextual("type");
node.id = this.flowParseRestrictedIdentifier(true);
if (this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
} else {
node.typeParameters = null;
}
node.supertype = null;
if (this.match(types.colon)) {
node.supertype = this.flowParseTypeInitialiser(types.colon);
}
node.impltype = null;
if (!declare) {
node.impltype = this.flowParseTypeInitialiser(types.eq);
}
this.semicolon();
return this.finishNode(node, "OpaqueType");
};
_proto.flowParseTypeParameter = function flowParseTypeParameter(allowDefault, requireDefault) {
if (allowDefault === void 0) {
allowDefault = true;
}
if (requireDefault === void 0) {
requireDefault = false;
}
if (!allowDefault && requireDefault) {
throw new Error("Cannot disallow a default value (`allowDefault`) while also requiring it (`requireDefault`).");
}
var nodeStart = this.state.start;
var node = this.startNode();
var variance = this.flowParseVariance();
var ident = this.flowParseTypeAnnotatableIdentifier();
node.name = ident.name;
node.variance = variance;
node.bound = ident.typeAnnotation;
if (this.match(types.eq)) {
if (allowDefault) {
this.eat(types.eq);
node.default = this.flowParseType();
} else {
this.unexpected();
}
} else {
if (requireDefault) {
this.unexpected(nodeStart, "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.");
}
}
return this.finishNode(node, "TypeParameter");
};
_proto.flowParseTypeParameterDeclaration = function flowParseTypeParameterDeclaration(allowDefault) {
if (allowDefault === void 0) {
allowDefault = true;
}
var oldInType = this.state.inType;
var node = this.startNode();
node.params = [];
this.state.inType = true;
if (this.isRelational("<") || this.match(types.jsxTagStart)) {
this.next();
} else {
this.unexpected();
}
var defaultRequired = false;
do {
var typeParameter = this.flowParseTypeParameter(allowDefault, defaultRequired);
node.params.push(typeParameter);
if (typeParameter.default) {
defaultRequired = true;
}
if (!this.isRelational(">")) {
this.expect(types.comma);
}
} while (!this.isRelational(">"));
this.expectRelational(">");
this.state.inType = oldInType;
return this.finishNode(node, "TypeParameterDeclaration");
};
_proto.flowParseTypeParameterInstantiation = function flowParseTypeParameterInstantiation() {
var node = this.startNode();
var oldInType = this.state.inType;
node.params = [];
this.state.inType = true;
this.expectRelational("<");
while (!this.isRelational(">")) {
node.params.push(this.flowParseType());
if (!this.isRelational(">")) {
this.expect(types.comma);
}
}
this.expectRelational(">");
this.state.inType = oldInType;
return this.finishNode(node, "TypeParameterInstantiation");
};
_proto.flowParseInterfaceType = function flowParseInterfaceType() {
var node = this.startNode();
this.expectContextual("interface");
node.extends = [];
if (this.eat(types._extends)) {
do {
node.extends.push(this.flowParseInterfaceExtends());
} while (this.eat(types.comma));
}
node.body = this.flowParseObjectType(true, false, false, false);
return this.finishNode(node, "InterfaceTypeAnnotation");
};
_proto.flowParseObjectPropertyKey = function flowParseObjectPropertyKey() {
return this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true);
};
_proto.flowParseObjectTypeIndexer = function flowParseObjectTypeIndexer(node, isStatic, variance) {
node.static = isStatic;
if (this.lookahead().type === types.colon) {
node.id = this.flowParseObjectPropertyKey();
node.key = this.flowParseTypeInitialiser();
} else {
node.id = null;
node.key = this.flowParseType();
}
this.expect(types.bracketR);
node.value = this.flowParseTypeInitialiser();
node.variance = variance;
return this.finishNode(node, "ObjectTypeIndexer");
};
_proto.flowParseObjectTypeInternalSlot = function flowParseObjectTypeInternalSlot(node, isStatic) {
node.static = isStatic;
node.id = this.flowParseObjectPropertyKey();
this.expect(types.bracketR);
this.expect(types.bracketR);
if (this.isRelational("<") || this.match(types.parenL)) {
node.method = true;
node.optional = false;
node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
} else {
node.method = false;
if (this.eat(types.question)) {
node.optional = true;
}
node.value = this.flowParseTypeInitialiser();
}
return this.finishNode(node, "ObjectTypeInternalSlot");
};
_proto.flowParseObjectTypeMethodish = function flowParseObjectTypeMethodish(node) {
node.params = [];
node.rest = null;
node.typeParameters = null;
if (this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterDeclaration(false);
}
this.expect(types.parenL);
while (!this.match(types.parenR) && !this.match(types.ellipsis)) {
node.params.push(this.flowParseFunctionTypeParam());
if (!this.match(types.parenR)) {
this.expect(types.comma);
}
}
if (this.eat(types.ellipsis)) {
node.rest = this.flowParseFunctionTypeParam();
}
this.expect(types.parenR);
node.returnType = this.flowParseTypeInitialiser();
return this.finishNode(node, "FunctionTypeAnnotation");
};
_proto.flowParseObjectTypeCallProperty = function flowParseObjectTypeCallProperty(node, isStatic) {
var valueNode = this.startNode();
node.static = isStatic;
node.value = this.flowParseObjectTypeMethodish(valueNode);
return this.finishNode(node, "ObjectTypeCallProperty");
};
_proto.flowParseObjectType = function flowParseObjectType(allowStatic, allowExact, allowSpread, allowProto) {
var oldInType = this.state.inType;
this.state.inType = true;
var nodeStart = this.startNode();
nodeStart.callProperties = [];
nodeStart.properties = [];
nodeStart.indexers = [];
nodeStart.internalSlots = [];
var endDelim;
var exact;
if (allowExact && this.match(types.braceBarL)) {
this.expect(types.braceBarL);
endDelim = types.braceBarR;
exact = true;
} else {
this.expect(types.braceL);
endDelim = types.braceR;
exact = false;
}
nodeStart.exact = exact;
while (!this.match(endDelim)) {
var isStatic = false;
var protoStart = null;
var node = this.startNode();
if (allowProto && this.isContextual("proto")) {
var lookahead = this.lookahead();
if (lookahead.type !== types.colon && lookahead.type !== types.question) {
this.next();
protoStart = this.state.start;
allowStatic = false;
}
}
if (allowStatic && this.isContextual("static")) {
var _lookahead = this.lookahead();
if (_lookahead.type !== types.colon && _lookahead.type !== types.question) {
this.next();
isStatic = true;
}
}
var variance = this.flowParseVariance();
if (this.eat(types.bracketL)) {
if (protoStart != null) {
this.unexpected(protoStart);
}
if (this.eat(types.bracketL)) {
if (variance) {
this.unexpected(variance.start);
}
nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic));
} else {
nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));
}
} else if (this.match(types.parenL) || this.isRelational("<")) {
if (protoStart != null) {
this.unexpected(protoStart);
}
if (variance) {
this.unexpected(variance.start);
}
nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));
} else {
var kind = "init";
if (this.isContextual("get") || this.isContextual("set")) {
var _lookahead2 = this.lookahead();
if (_lookahead2.type === types.name || _lookahead2.type === types.string || _lookahead2.type === types.num) {
kind = this.state.value;
this.next();
}
}
nodeStart.properties.push(this.flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread));
}
this.flowObjectTypeSemicolon();
}
this.expect(endDelim);
var out = this.finishNode(nodeStart, "ObjectTypeAnnotation");
this.state.inType = oldInType;
return out;
};
_proto.flowParseObjectTypeProperty = function flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread) {
if (this.match(types.ellipsis)) {
if (!allowSpread) {
this.unexpected(null, "Spread operator cannot appear in class or interface definitions");
}
if (protoStart != null) {
this.unexpected(protoStart);
}
if (variance) {
this.unexpected(variance.start, "Spread properties cannot have variance");
}
this.expect(types.ellipsis);
node.argument = this.flowParseType();
return this.finishNode(node, "ObjectTypeSpreadProperty");
} else {
node.key = this.flowParseObjectPropertyKey();
node.static = isStatic;
node.proto = protoStart != null;
node.kind = kind;
var optional = false;
if (this.isRelational("<") || this.match(types.parenL)) {
node.method = true;
if (protoStart != null) {
this.unexpected(protoStart);
}
if (variance) {
this.unexpected(variance.start);
}
node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
if (kind === "get" || kind === "set") {
this.flowCheckGetterSetterParams(node);
}
} else {
if (kind !== "init") this.unexpected();
node.method = false;
if (this.eat(types.question)) {
optional = true;
}
node.value = this.flowParseTypeInitialiser();
node.variance = variance;
}
node.optional = optional;
return this.finishNode(node, "ObjectTypeProperty");
}
};
_proto.flowCheckGetterSetterParams = function flowCheckGetterSetterParams(property) {
var paramCount = property.kind === "get" ? 0 : 1;
var start = property.start;
var length = property.value.params.length + (property.value.rest ? 1 : 0);
if (length !== paramCount) {
if (property.kind === "get") {
this.raise(start, "getter must not have any formal parameters");
} else {
this.raise(start, "setter must have exactly one formal parameter");
}
}
if (property.kind === "set" && property.value.rest) {
this.raise(start, "setter function argument must not be a rest parameter");
}
};
_proto.flowObjectTypeSemicolon = function flowObjectTypeSemicolon() {
if (!this.eat(types.semi) && !this.eat(types.comma) && !this.match(types.braceR) && !this.match(types.braceBarR)) {
this.unexpected();
}
};
_proto.flowParseQualifiedTypeIdentifier = function flowParseQualifiedTypeIdentifier(startPos, startLoc, id) {
startPos = startPos || this.state.start;
startLoc = startLoc || this.state.startLoc;
var node = id || this.parseIdentifier();
while (this.eat(types.dot)) {
var node2 = this.startNodeAt(startPos, startLoc);
node2.qualification = node;
node2.id = this.parseIdentifier();
node = this.finishNode(node2, "QualifiedTypeIdentifier");
}
return node;
};
_proto.flowParseGenericType = function flowParseGenericType(startPos, startLoc, id) {
var node = this.startNodeAt(startPos, startLoc);
node.typeParameters = null;
node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id);
if (this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterInstantiation();
}
return this.finishNode(node, "GenericTypeAnnotation");
};
_proto.flowParseTypeofType = function flowParseTypeofType() {
var node = this.startNode();
this.expect(types._typeof);
node.argument = this.flowParsePrimaryType();
return this.finishNode(node, "TypeofTypeAnnotation");
};
_proto.flowParseTupleType = function flowParseTupleType() {
var node = this.startNode();
node.types = [];
this.expect(types.bracketL);
while (this.state.pos < this.input.length && !this.match(types.bracketR)) {
node.types.push(this.flowParseType());
if (this.match(types.bracketR)) break;
this.expect(types.comma);
}
this.expect(types.bracketR);
return this.finishNode(node, "TupleTypeAnnotation");
};
_proto.flowParseFunctionTypeParam = function flowParseFunctionTypeParam() {
var name = null;
var optional = false;
var typeAnnotation = null;
var node = this.startNode();
var lh = this.lookahead();
if (lh.type === types.colon || lh.type === types.question) {
name = this.parseIdentifier();
if (this.eat(types.question)) {
optional = true;
}
typeAnnotation = this.flowParseTypeInitialiser();
} else {
typeAnnotation = this.flowParseType();
}
node.name = name;
node.optional = optional;
node.typeAnnotation = typeAnnotation;
return this.finishNode(node, "FunctionTypeParam");
};
_proto.reinterpretTypeAsFunctionTypeParam = function reinterpretTypeAsFunctionTypeParam(type) {
var node = this.startNodeAt(type.start, type.loc.start);
node.name = null;
node.optional = false;
node.typeAnnotation = type;
return this.finishNode(node, "FunctionTypeParam");
};
_proto.flowParseFunctionTypeParams = function flowParseFunctionTypeParams(params) {
if (params === void 0) {
params = [];
}
var rest = null;
while (!this.match(types.parenR) && !this.match(types.ellipsis)) {
params.push(this.flowParseFunctionTypeParam());
if (!this.match(types.parenR)) {
this.expect(types.comma);
}
}
if (this.eat(types.ellipsis)) {
rest = this.flowParseFunctionTypeParam();
}
return {
params: params,
rest: rest
};
};
_proto.flowIdentToTypeAnnotation = function flowIdentToTypeAnnotation(startPos, startLoc, node, id) {
switch (id.name) {
case "any":
return this.finishNode(node, "AnyTypeAnnotation");
case "void":
return this.finishNode(node, "VoidTypeAnnotation");
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");
default:
return this.flowParseGenericType(startPos, startLoc, id);
}
};
_proto.flowParsePrimaryType = function flowParsePrimaryType() {
var startPos = this.state.start;
var startLoc = this.state.startLoc;
var node = this.startNode();
var tmp;
var type;
var isGroupedType = false;
var oldNoAnonFunctionType = this.state.noAnonFunctionType;
switch (this.state.type) {
case types.name:
if (this.isContextual("interface")) {
return this.flowParseInterfaceType();
}
return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier());
case types.braceL:
return this.flowParseObjectType(false, false, true, false);
case types.braceBarL:
return this.flowParseObjectType(false, true, true, false);
case types.bracketL:
return this.flowParseTupleType();
case types.relational:
if (this.state.value === "<") {
node.typeParameters = this.flowParseTypeParameterDeclaration(false);
this.expect(types.parenL);
tmp = this.flowParseFunctionTypeParams();
node.params = tmp.params;
node.rest = tmp.rest;
this.expect(types.parenR);
this.expect(types.arrow);
node.returnType = this.flowParseType();
return this.finishNode(node, "FunctionTypeAnnotation");
}
break;
case types.parenL:
this.next();
if (!this.match(types.parenR) && !this.match(types.ellipsis)) {
if (this.match(types.name)) {
var token = this.lookahead().type;
isGroupedType = token !== types.question && token !== types.colon;
} else {
isGroupedType = true;
}
}
if (isGroupedType) {
this.state.noAnonFunctionType = false;
type = this.flowParseType();
this.state.noAnonFunctionType = oldNoAnonFunctionType;
if (this.state.noAnonFunctionType || !(this.match(types.comma) || this.match(types.parenR) && this.lookahead().type === types.arrow)) {
this.expect(types.parenR);
return type;
} else {
this.eat(types.comma);
}
}
if (type) {
tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);
} else {
tmp = this.flowParseFunctionTypeParams();
}
node.params = tmp.params;
node.rest = tmp.rest;
this.expect(types.parenR);
this.expect(types.arrow);
node.returnType = this.flowParseType();
node.typeParameters = null;
return this.finishNode(node, "FunctionTypeAnnotation");
case types.string:
return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
case types._true:
case types._false:
node.value = this.match(types._true);
this.next();
return this.finishNode(node, "BooleanLiteralTypeAnnotation");
case types.plusMin:
if (this.state.value === "-") {
this.next();
if (!this.match(types.num)) {
this.unexpected(null, "Unexpected token, expected \"number\"");
}
return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start);
}
this.unexpected();
case types.num:
return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
case types._null:
this.next();
return this.finishNode(node, "NullLiteralTypeAnnotation");
case types._this:
this.next();
return this.finishNode(node, "ThisTypeAnnotation");
case types.star:
this.next();
return this.finishNode(node, "ExistsTypeAnnotation");
default:
if (this.state.type.keyword === "typeof") {
return this.flowParseTypeofType();
}
}
throw this.unexpected();
};
_proto.flowParsePostfixType = function flowParsePostfixType() {
var startPos = this.state.start,
startLoc = this.state.startLoc;
var type = this.flowParsePrimaryType();
while (!this.canInsertSemicolon() && this.match(types.bracketL)) {
var node = this.startNodeAt(startPos, startLoc);
node.elementType = type;
this.expect(types.bracketL);
this.expect(types.bracketR);
type = this.finishNode(node, "ArrayTypeAnnotation");
}
return type;
};
_proto.flowParsePrefixType = function flowParsePrefixType() {
var node = this.startNode();
if (this.eat(types.question)) {
node.typeAnnotation = this.flowParsePrefixType();
return this.finishNode(node, "NullableTypeAnnotation");
} else {
return this.flowParsePostfixType();
}
};
_proto.flowParseAnonFunctionWithoutParens = function flowParseAnonFunctionWithoutParens() {
var param = this.flowParsePrefixType();
if (!this.state.noAnonFunctionType && this.eat(types.arrow)) {
var node = this.startNodeAt(param.start, param.loc.start);
node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
node.rest = null;
node.returnType = this.flowParseType();
node.typeParameters = null;
return this.finishNode(node, "FunctionTypeAnnotation");
}
return param;
};
_proto.flowParseIntersectionType = function flowParseIntersectionType() {
var node = this.startNode();
this.eat(types.bitwiseAND);
var type = this.flowParseAnonFunctionWithoutParens();
node.types = [type];
while (this.eat(types.bitwiseAND)) {
node.types.push(this.flowParseAnonFunctionWithoutParens());
}
return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation");
};
_proto.flowParseUnionType = function flowParseUnionType() {
var node = this.startNode();
this.eat(types.bitwiseOR);
var type = this.flowParseIntersectionType();
node.types = [type];
while (this.eat(types.bitwiseOR)) {
node.types.push(this.flowParseIntersectionType());
}
return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation");
};
_proto.flowParseType = function flowParseType() {
var oldInType = this.state.inType;
this.state.inType = true;
var type = this.flowParseUnionType();
this.state.inType = oldInType;
this.state.exprAllowed = this.state.exprAllowed || this.state.noAnonFunctionType;
return type;
};
_proto.flowParseTypeAnnotation = function flowParseTypeAnnotation() {
var node = this.startNode();
node.typeAnnotation = this.flowParseTypeInitialiser();
return this.finishNode(node, "TypeAnnotation");
};
_proto.flowParseTypeAnnotatableIdentifier = function flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {
var ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();
if (this.match(types.colon)) {
ident.typeAnnotation = this.flowParseTypeAnnotation();
this.finishNode(ident, ident.type);
}
return ident;
};
_proto.typeCastToParameter = function typeCastToParameter(node) {
node.expression.typeAnnotation = node.typeAnnotation;
return this.finishNodeAt(node.expression, node.expression.type, node.typeAnnotation.end, node.typeAnnotation.loc.end);
};
_proto.flowParseVariance = function flowParseVariance() {
var variance = null;
if (this.match(types.plusMin)) {
variance = this.startNode();
if (this.state.value === "+") {
variance.kind = "plus";
} else {
variance.kind = "minus";
}
this.next();
this.finishNode(variance, "Variance");
}
return variance;
};
_proto.parseFunctionBody = function parseFunctionBody(node, allowExpressionBody) {
var _this3 = this;
if (allowExpressionBody) {
return this.forwardNoArrowParamsConversionAt(node, function () {
return _superClass.prototype.parseFunctionBody.call(_this3, node, true);
});
}
return _superClass.prototype.parseFunctionBody.call(this, node, false);
};
_proto.parseFunctionBodyAndFinish = function parseFunctionBodyAndFinish(node, type, allowExpressionBody) {
if (!allowExpressionBody && this.match(types.colon)) {
var typeNode = this.startNode();
var _this$flowParseTypeAn2 = this.flowParseTypeAndPredicateInitialiser();
typeNode.typeAnnotation = _this$flowParseTypeAn2[0];
node.predicate = _this$flowParseTypeAn2[1];
node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null;
}
_superClass.prototype.parseFunctionBodyAndFinish.call(this, node, type, allowExpressionBody);
};
_proto.parseStatement = function parseStatement(declaration, topLevel) {
if (this.state.strict && this.match(types.name) && this.state.value === "interface") {
var node = this.startNode();
this.next();
return this.flowParseInterface(node);
} else {
var stmt = _superClass.prototype.parseStatement.call(this, declaration, topLevel);
if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {
this.flowPragma = null;
}
return stmt;
}
};
_proto.parseExpressionStatement = function parseExpressionStatement(node, expr) {
if (expr.type === "Identifier") {
if (expr.name === "declare") {
if (this.match(types._class) || this.match(types.name) || this.match(types._function) || this.match(types._var) || this.match(types._export)) {
return this.flowParseDeclare(node);
}
} else if (this.match(types.name)) {
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 _superClass.prototype.parseExpressionStatement.call(this, node, expr);
};
_proto.shouldParseExportDeclaration = function shouldParseExportDeclaration() {
return this.isContextual("type") || this.isContextual("interface") || this.isContextual("opaque") || _superClass.prototype.shouldParseExportDeclaration.call(this);
};
_proto.isExportDefaultSpecifier = function isExportDefaultSpecifier() {
if (this.match(types.name) && (this.state.value === "type" || this.state.value === "interface" || this.state.value == "opaque")) {
return false;
}
return _superClass.prototype.isExportDefaultSpecifier.call(this);
};
_proto.parseConditional = function parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) {
var _this4 = this;
if (!this.match(types.question)) return expr;
if (refNeedsArrowPos) {
var _state = this.state.clone();
try {
return _superClass.prototype.parseConditional.call(this, expr, noIn, startPos, startLoc);
} catch (err) {
if (err instanceof SyntaxError) {
this.state = _state;
refNeedsArrowPos.start = err.pos || this.state.start;
return expr;
} else {
throw err;
}
}
}
this.expect(types.question);
var state = this.state.clone();
var originalNoArrowAt = this.state.noArrowAt;
var node = this.startNodeAt(startPos, startLoc);
var _this$tryParseConditi = this.tryParseConditionalConsequent(),
consequent = _this$tryParseConditi.consequent,
failed = _this$tryParseConditi.failed;
var _this$getArrowLikeExp = this.getArrowLikeExpressions(consequent),
valid = _this$getArrowLikeExp[0],
invalid = _this$getArrowLikeExp[1];
if (failed || invalid.length > 0) {
var noArrowAt = originalNoArrowAt.concat();
if (invalid.length > 0) {
this.state = state;
this.state.noArrowAt = noArrowAt;
for (var i = 0; i < invalid.length; i++) {
noArrowAt.push(invalid[i].start);
}
var _this$tryParseConditi2 = this.tryParseConditionalConsequent();
consequent = _this$tryParseConditi2.consequent;
failed = _this$tryParseConditi2.failed;
var _this$getArrowLikeExp2 = this.getArrowLikeExpressions(consequent);
valid = _this$getArrowLikeExp2[0];
invalid = _this$getArrowLikeExp2[1];
}
if (failed && valid.length > 1) {
this.raise(state.start, "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.");
}
if (failed && valid.length === 1) {
this.state = state;
this.state.noArrowAt = noArrowAt.concat(valid[0].start);
var _this$tryParseConditi3 = this.tryParseConditionalConsequent();
consequent = _this$tryParseConditi3.consequent;
failed = _this$tryParseConditi3.failed;
}
this.getArrowLikeExpressions(consequent, true);
}
this.state.noArrowAt = originalNoArrowAt;
this.expect(types.colon);
node.test = expr;
node.consequent = consequent;
node.alternate = this.forwardNoArrowParamsConversionAt(node, function () {
return _this4.parseMaybeAssign(noIn, undefined, undefined, undefined);
});
return this.finishNode(node, "ConditionalExpression");
};
_proto.tryParseConditionalConsequent = function tryParseConditionalConsequent() {
this.state.noArrowParamsConversionAt.push(this.state.start);
var consequent = this.parseMaybeAssign();
var failed = !this.match(types.colon);
this.state.noArrowParamsConversionAt.pop();
return {
consequent: consequent,
failed: failed
};
};
_proto.getArrowLikeExpressions = function getArrowLikeExpressions(node, disallowInvalid) {
var _this5 = this;
var stack = [node];
var arrows = [];
while (stack.length !== 0) {
var _node = stack.pop();
if (_node.type === "ArrowFunctionExpression") {
if (_node.typeParameters || !_node.returnType) {
this.toAssignableList(_node.params, true, "arrow function parameters");
_superClass.prototype.checkFunctionNameAndParams.call(this, _node, true);
} else {
arrows.push(_node);
}
stack.push(_node.body);
} else if (_node.type === "ConditionalExpression") {
stack.push(_node.consequent);
stack.push(_node.alternate);
}
}
if (disallowInvalid) {
for (var i = 0; i < arrows.length; i++) {
this.toAssignableList(node.params, true, "arrow function parameters");
}
return [arrows, []];
}
return partition(arrows, function (node) {
try {
_this5.toAssignableList(node.params, true, "arrow function parameters");
return true;
} catch (err) {
return false;
}
});
};
_proto.forwardNoArrowParamsConversionAt = function forwardNoArrowParamsConversionAt(node, parse) {
var result;
if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
this.state.noArrowParamsConversionAt.push(this.state.start);
result = parse();
this.state.noArrowParamsConversionAt.pop();
} else {
result = parse();
}
return result;
};
_proto.parseParenItem = function parseParenItem(node, startPos, startLoc) {
node = _superClass.prototype.parseParenItem.call(this, node, startPos, startLoc);
if (this.eat(types.question)) {
node.optional = true;
}
if (this.match(types.colon)) {
var typeCastNode = this.startNodeAt(startPos, startLoc);
typeCastNode.expression = node;
typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
return this.finishNode(typeCastNode, "TypeCastExpression");
}
return node;
};
_proto.assertModuleNodeAllowed = function 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;
}
_superClass.prototype.assertModuleNodeAllowed.call(this, node);
};
_proto.parseExport = function parseExport(node) {
node = _superClass.prototype.parseExport.call(this, node);
if (node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration") {
node.exportKind = node.exportKind || "value";
}
return node;
};
_proto.parseExportDeclaration = function parseExportDeclaration(node) {
if (this.isContextual("type")) {
node.exportKind = "type";
var declarationNode = this.startNode();
this.next();
if (this.match(types.braceL)) {
node.specifiers = this.parseExportSpecifiers();
this.parseExportFrom(node);
return null;
} else {
return this.flowParseTypeAlias(declarationNode);
}
} else if (this.isContextual("opaque")) {
node.exportKind = "type";
var _declarationNode = this.startNode();
this.next();
return this.flowParseOpaqueType(_declarationNode, false);
} else if (this.isContextual("interface")) {
node.exportKind = "type";
var _declarationNode2 = this.startNode();
this.next();
return this.flowParseInterface(_declarationNode2);
} else {
return _superClass.prototype.parseExportDeclaration.call(this, node);
}
};
_proto.shouldParseExportStar = function shouldParseExportStar() {
return _superClass.prototype.shouldParseExportStar.call(this) || this.isContextual("type") && this.lookahead().type === types.star;
};
_proto.parseExportStar = function parseExportStar(node) {
if (this.eatContextual("type")) {
node.exportKind = "type";
}
return _superClass.prototype.parseExportStar.call(this, node);
};
_proto.parseExportNamespace = function parseExportNamespace(node) {
if (node.exportKind === "type") {
this.unexpected();
}
return _superClass.prototype.parseExportNamespace.call(this, node);
};
_proto.parseClassId = function parseClassId(node, isStatement, optionalId) {
_superClass.prototype.parseClassId.call(this, node, isStatement, optionalId);
if (this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
}
};
_proto.isKeyword = function isKeyword$$1(name) {
if (this.state.inType && name === "void") {
return false;
} else {
return _superClass.prototype.isKeyword.call(this, name);
}
};
_proto.readToken = function readToken(code) {
var next = this.input.charCodeAt(this.state.pos + 1);
if (this.state.inType && (code === 62 || code === 60)) {
return this.finishOp(types.relational, 1);
} else if (isIteratorStart(code, next)) {
this.state.isIterator = true;
return _superClass.prototype.readWord.call(this);
} else {
return _superClass.prototype.readToken.call(this, code);
}
};
_proto.toAssignable = function toAssignable(node, isBinding, contextDescription) {
if (node.type === "TypeCastExpression") {
return _superClass.prototype.toAssignable.call(this, this.typeCastToParameter(node), isBinding, contextDescription);
} else {
return _superClass.prototype.toAssignable.call(this, node, isBinding, contextDescription);
}
};
_proto.toAssignableList = function toAssignableList(exprList, isBinding, contextDescription) {
for (var i = 0; i < exprList.length; i++) {
var expr = exprList[i];
if (expr && expr.type === "TypeCastExpression") {
exprList[i] = this.typeCastToParameter(expr);
}
}
return _superClass.prototype.toAssignableList.call(this, exprList, isBinding, contextDescription);
};
_proto.toReferencedList = function toReferencedList(exprList) {
for (var i = 0; i < exprList.length; i++) {
var expr = exprList[i];
if (expr && expr._exprListItem && expr.type === "TypeCastExpression") {
this.raise(expr.start, "Unexpected type cast");
}
}
return exprList;
};
_proto.parseExprListItem = function parseExprListItem(allowEmpty, refShorthandDefaultPos, refNeedsArrowPos) {
var container = this.startNode();
var node = _superClass.prototype.parseExprListItem.call(this, allowEmpty, refShorthandDefaultPos, refNeedsArrowPos);
if (this.match(types.colon)) {
container._exprListItem = true;
container.expression = node;
container.typeAnnotation = this.flowParseTypeAnnotation();
return this.finishNode(container, "TypeCastExpression");
} else {
return node;
}
};
_proto.checkLVal = function checkLVal(expr, isBinding, checkClashes, contextDescription) {
if (expr.type !== "TypeCastExpression") {
return _superClass.prototype.checkLVal.call(this, expr, isBinding, checkClashes, contextDescription);
}
};
_proto.parseClassProperty = function parseClassProperty(node) {
if (this.match(types.colon)) {
node.typeAnnotation = this.flowParseTypeAnnotation();
}
return _superClass.prototype.parseClassProperty.call(this, node);
};
_proto.isClassMethod = function isClassMethod() {
return this.isRelational("<") || _superClass.prototype.isClassMethod.call(this);
};
_proto.isClassProperty = function isClassProperty() {
return this.match(types.colon) || _superClass.prototype.isClassProperty.call(this);
};
_proto.isNonstaticConstructor = function isNonstaticConstructor(method) {
return !this.match(types.colon) && _superClass.prototype.isNonstaticConstructor.call(this, method);
};
_proto.pushClassMethod = function pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor) {
if (method.variance) {
this.unexpected(method.variance.start);
}
delete method.variance;
if (this.isRelational("<")) {
method.typeParameters = this.flowParseTypeParameterDeclaration(false);
}
_superClass.prototype.pushClassMethod.call(this, classBody, method, isGenerator, isAsync, isConstructor);
};
_proto.pushClassPrivateMethod = function pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
if (method.variance) {
this.unexpected(method.variance.start);
}
delete method.variance;
if (this.isRelational("<")) {
method.typeParameters = this.flowParseTypeParameterDeclaration();
}
_superClass.prototype.pushClassPrivateMethod.call(this, classBody, method, isGenerator, isAsync);
};
_proto.parseClassSuper = function parseClassSuper(node) {
_superClass.prototype.parseClassSuper.call(this, node);
if (node.superClass && this.isRelational("<")) {
node.superTypeParameters = this.flowParseTypeParameterInstantiation();
}
if (this.isContextual("implements")) {
this.next();
var implemented = node.implements = [];
do {
var _node2 = this.startNode();
_node2.id = this.flowParseRestrictedIdentifier(true);
if (this.isRelational("<")) {
_node2.typeParameters = this.flowParseTypeParameterInstantiation();
} else {
_node2.typeParameters = null;
}
implemented.push(this.finishNode(_node2, "ClassImplements"));
} while (this.eat(types.comma));
}
};
_proto.parsePropertyName = function parsePropertyName(node) {
var variance = this.flowParseVariance();
var key = _superClass.prototype.parsePropertyName.call(this, node);
node.variance = variance;
return key;
};
_proto.parseObjPropValue = function parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos, containsEsc) {
if (prop.variance) {
this.unexpected(prop.variance.start);
}
delete prop.variance;
var typeParameters;
if (this.isRelational("<")) {
typeParameters = this.flowParseTypeParameterDeclaration(false);
if (!this.match(types.parenL)) this.unexpected();
}
_superClass.prototype.parseObjPropValue.call(this, prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos, containsEsc);
if (typeParameters) {
(prop.value || prop).typeParameters = typeParameters;
}
};
_proto.parseAssignableListItemTypes = function parseAssignableListItemTypes(param) {
if (this.eat(types.question)) {
if (param.type !== "Identifier") {
throw this.raise(param.start, "A binding pattern parameter cannot be optional in an implementation signature.");
}
param.optional = true;
}
if (this.match(types.colon)) {
param.typeAnnotation = this.flowParseTypeAnnotation();
}
this.finishNode(param, param.type);
return param;
};
_proto.parseMaybeDefault = function parseMaybeDefault(startPos, startLoc, left) {
var node = _superClass.prototype.parseMaybeDefault.call(this, startPos, startLoc, left);
if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, " + "e.g. instead of `age = 25: number` use `age: number = 25`");
}
return node;
};
_proto.shouldParseDefaultImport = function shouldParseDefaultImport(node) {
if (!hasTypeImportKind(node)) {
return _superClass.prototype.shouldParseDefaultImport.call(this, node);
}
return isMaybeDefaultImport(this.state);
};
_proto.parseImportSpecifierLocal = function parseImportSpecifierLocal(node, specifier, type, contextDescription) {
specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true) : this.parseIdentifier();
this.checkLVal(specifier.local, true, undefined, contextDescription);
node.specifiers.push(this.finishNode(specifier, type));
};
_proto.parseImportSpecifiers = function parseImportSpecifiers(node) {
node.importKind = "value";
var kind = null;
if (this.match(types._typeof)) {
kind = "typeof";
} else if (this.isContextual("type")) {
kind = "type";
}
if (kind) {
var lh = this.lookahead();
if (kind === "type" && lh.type === types.star) {
this.unexpected(lh.start);
}
if (isMaybeDefaultImport(lh) || lh.type === types.braceL || lh.type === types.star) {
this.next();
node.importKind = kind;
}
}
_superClass.prototype.parseImportSpecifiers.call(this, node);
};
_proto.parseImportSpecifier = function parseImportSpecifier(node) {
var specifier = this.startNode();
var firstIdentLoc = this.state.start;
var firstIdent = this.parseIdentifier(true);
var specifierTypeKind = null;
if (firstIdent.name === "type") {
specifierTypeKind = "type";
} else if (firstIdent.name === "typeof") {
specifierTypeKind = "typeof";
}
var isBinding = false;
if (this.isContextual("as") && !this.isLookaheadContextual("as")) {
var as_ident = this.parseIdentifier(true);
if (specifierTypeKind !== null && !this.match(types.name) && !this.state.type.keyword) {
specifier.imported = as_ident;
specifier.importKind = specifierTypeKind;
specifier.local = as_ident.__clone();
} else {
specifier.imported = firstIdent;
specifier.importKind = null;
specifier.local = this.parseIdentifier();
}
} else if (specifierTypeKind !== null && (this.match(types.name) || this.state.type.keyword)) {
specifier.imported = this.parseIdentifier(true);
specifier.importKind = specifierTypeKind;
if (this.eatContextual("as")) {
specifier.local = this.parseIdentifier();
} else {
isBinding = true;
specifier.local = specifier.imported.__clone();
}
} else {
isBinding = true;
specifier.imported = firstIdent;
specifier.importKind = null;
specifier.local = specifier.imported.__clone();
}
var nodeIsTypeImport = hasTypeImportKind(node);
var specifierIsTypeImport = hasTypeImportKind(specifier);
if (nodeIsTypeImport && specifierIsTypeImport) {
this.raise(firstIdentLoc, "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");
}
if (nodeIsTypeImport || specifierIsTypeImport) {
this.checkReservedType(specifier.local.name, specifier.local.start);
}
if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) {
this.checkReservedWord(specifier.local.name, specifier.start, true, true);
}
this.checkLVal(specifier.local, true, undefined, "import specifier");
node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
};
_proto.parseFunctionParams = function parseFunctionParams(node) {
var kind = node.kind;
if (kind !== "get" && kind !== "set" && this.isRelational("<")) {
node.typeParameters = this.flowParseTypeParameterDeclaration(false);
}
_superClass.prototype.parseFunctionParams.call(this, node);
};
_proto.parseVarHead = function parseVarHead(decl) {
_superClass.prototype.parseVarHead.call(this, decl);
if (this.match(types.colon)) {
decl.id.typeAnnotation = this.flowParseTypeAnnotation();
this.finishNode(decl.id, decl.id.type);
}
};
_proto.parseAsyncArrowFromCallExpression = function parseAsyncArrowFromCallExpression(node, call) {
if (this.match(types.colon)) {
var oldNoAnonFunctionType = this.state.noAnonFunctionType;
this.state.noAnonFunctionType = true;
node.returnType = this.flowParseTypeAnnotation();
this.state.noAnonFunctionType = oldNoAnonFunctionType;
}
return _superClass.prototype.parseAsyncArrowFromCallExpression.call(this, node, call);
};
_proto.shouldParseAsyncArrow = function shouldParseAsyncArrow() {
return this.match(types.colon) || _superClass.prototype.shouldParseAsyncArrow.call(this);
};
_proto.parseMaybeAssign = function parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) {
var _this6 = this;
var jsxError = null;
if (types.jsxTagStart && this.match(types.jsxTagStart)) {
var state = this.state.clone();
try {
return _superClass.prototype.parseMaybeAssign.call(this, noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos);
} catch (err) {
if (err instanceof SyntaxError) {
this.state = state;
this.state.context.length -= 2;
jsxError = err;
} else {
throw err;
}
}
}
if (jsxError != null || this.isRelational("<")) {
var arrowExpression;
var typeParameters;
try {
typeParameters = this.flowParseTypeParameterDeclaration();
arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, function () {
return _superClass.prototype.parseMaybeAssign.call(_this6, noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos);
});
arrowExpression.typeParameters = typeParameters;
this.resetStartLocationFromNode(arrowExpression, typeParameters);
} catch (err) {
throw jsxError || err;
}
if (arrowExpression.type === "ArrowFunctionExpression") {
return arrowExpression;
} else if (jsxError != null) {
throw jsxError;
} else {
this.raise(typeParameters.start, "Expected an arrow function after this type parameter declaration");
}
}
return _superClass.prototype.parseMaybeAssign.call(this, noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos);
};
_proto.parseArrow = function parseArrow(node) {
if (this.match(types.colon)) {
var state = this.state.clone();
try {
var oldNoAnonFunctionType = this.state.noAnonFunctionType;
this.state.noAnonFunctionType = true;
var typeNode = this.startNode();
var _this$flowParseTypeAn3 = this.flowParseTypeAndPredicateInitialiser();
typeNode.typeAnnotation = _this$flowParseTypeAn3[0];
node.predicate = _this$flowParseTypeAn3[1];
this.state.noAnonFunctionType = oldNoAnonFunctionType;
if (this.canInsertSemicolon()) this.unexpected();
if (!this.match(types.arrow)) this.unexpected();
node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null;
} catch (err) {
if (err instanceof SyntaxError) {
this.state = state;
} else {
throw err;
}
}
}
return _superClass.prototype.parseArrow.call(this, node);
};
_proto.shouldParseArrow = function shouldParseArrow() {
return this.match(types.colon) || _superClass.prototype.shouldParseArrow.call(this);
};
_proto.setArrowFunctionParameters = function setArrowFunctionParameters(node, params) {
if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
node.params = params;
} else {
_superClass.prototype.setArrowFunctionParameters.call(this, node, params);
}
};
_proto.checkFunctionNameAndParams = function checkFunctionNameAndParams(node, isArrowFunction) {
if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
return;
}
return _superClass.prototype.checkFunctionNameAndParams.call(this, node, isArrowFunction);
};
_proto.parseParenAndDistinguishExpression = function parseParenAndDistinguishExpression(canBeArrow) {
return _superClass.prototype.parseParenAndDistinguishExpression.call(this, canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1);
};
_proto.parseSubscripts = function parseSubscripts(base, startPos, startLoc, noCalls) {
if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startPos) !== -1) {
this.next();
var node = this.startNodeAt(startPos, startLoc);
node.callee = base;
node.arguments = this.parseCallExpressionArguments(types.parenR, false);
base = this.finishNode(node, "CallExpression");
} else if (base.type === "Identifier" && base.name === "async" && this.isRelational("<")) {
var state = this.state.clone();
var error;
try {
var _node3 = this.parseAsyncArrowWithTypeParameters(startPos, startLoc);
if (_node3) return _node3;
} catch (e) {
error = e;
}
this.state = state;
try {
return _superClass.prototype.parseSubscripts.call(this, base, startPos, startLoc, noCalls);
} catch (e) {
throw error || e;
}
}
return _superClass.prototype.parseSubscripts.call(this, base, startPos, startLoc, noCalls);
};
_proto.parseSubscript = function parseSubscript(base, startPos, startLoc, noCalls, subscriptState) {
if (this.match(types.questionDot) && this.isLookaheadRelational("<")) {
this.expectPlugin("optionalChaining");
subscriptState.optionalChainMember = true;
if (noCalls) {
subscriptState.stop = true;
return base;
}
this.next();
var node = this.startNodeAt(startPos, startLoc);
node.callee = base;
node.typeArguments = this.flowParseTypeParameterInstantiation();
this.expect(types.parenL);
node.arguments = this.parseCallExpressionArguments(types.parenR, false);
node.optional = true;
return this.finishNode(node, "OptionalCallExpression");
} else if (!noCalls && this.shouldParseTypes() && this.isRelational("<")) {
var _node4 = this.startNodeAt(startPos, startLoc);
_node4.callee = base;
var state = this.state.clone();
try {
_node4.typeArguments = this.flowParseTypeParameterInstantiation();
this.expect(types.parenL);
_node4.arguments = this.parseCallExpressionArguments(types.parenR, false);
if (subscriptState.optionalChainMember) {
_node4.optional = false;
return this.finishNode(_node4, "OptionalCallExpression");
}
return this.finishNode(_node4, "CallExpression");
} catch (e) {
if (e instanceof SyntaxError) {
this.state = state;
} else {
throw e;
}
}
}
return _superClass.prototype.parseSubscript.call(this, base, startPos, startLoc, noCalls, subscriptState);
};
_proto.parseNewArguments = function parseNewArguments(node) {
var targs = null;
if (this.shouldParseTypes() && this.isRelational("<")) {
var state = this.state.clone();
try {
targs = this.flowParseTypeParameterInstantiation();
} catch (e) {
if (e instanceof SyntaxError) {
this.state = state;
} else {
throw e;
}
}
}
node.typeArguments = targs;
_superClass.prototype.parseNewArguments.call(this, node);
};
_proto.parseAsyncArrowWithTypeParameters = function parseAsyncArrowWithTypeParameters(startPos, startLoc) {
var node = this.startNodeAt(startPos, startLoc);
this.parseFunctionParams(node);
if (!this.parseArrow(node)) return;
return this.parseArrowExpression(node, undefined, true);
};
_proto.readToken_mult_modulo = function readToken_mult_modulo(code) {
var 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;
}
_superClass.prototype.readToken_mult_modulo.call(this, code);
};
_proto.skipBlockComment = function skipBlockComment() {
if (this.hasPlugin("flow") && this.hasPlugin("flowComments") && this.skipFlowComment()) {
this.hasFlowCommentCompletion();
this.state.pos += this.skipFlowComment();
this.state.hasFlowComment = true;
return;
}
var end;
if (this.hasPlugin("flow") && this.state.hasFlowComment) {
end = this.input.indexOf("*-/", this.state.pos += 2);
if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment");
this.state.pos = end + 3;
return;
}
_superClass.prototype.skipBlockComment.call(this);
};
_proto.skipFlowComment = function skipFlowComment() {
var ch2 = this.input.charCodeAt(this.state.pos + 2);
var ch3 = this.input.charCodeAt(this.state.pos + 3);
if (ch2 === 58 && ch3 === 58) {
return 4;
}
if (this.input.slice(this.state.pos + 2, 14) === "flow-include") {
return 14;
}
if (ch2 === 58 && ch3 !== 58 && 2) {
return 2;
}
return false;
};
_proto.hasFlowCommentCompletion = function hasFlowCommentCompletion() {
var end = this.input.indexOf("*/", this.state.pos);
if (end === -1) {
this.raise(this.state.pos, "Unterminated comment");
}
};
return _class;
}(superClass);
};
var entities = {
quot: "\"",
amp: "&",
apos: "'",
lt: "<",
gt: ">",
nbsp: "\xA0",
iexcl: "\xA1",
cent: "\xA2",
pound: "\xA3",
curren: "\xA4",
yen: "\xA5",
brvbar: "\xA6",
sect: "\xA7",
uml: "\xA8",
copy: "\xA9",
ordf: "\xAA",
laquo: "\xAB",
not: "\xAC",
shy: "\xAD",
reg: "\xAE",
macr: "\xAF",
deg: "\xB0",
plusmn: "\xB1",
sup2: "\xB2",
sup3: "\xB3",
acute: "\xB4",
micro: "\xB5",
para: "\xB6",
middot: "\xB7",
cedil: "\xB8",
sup1: "\xB9",
ordm: "\xBA",
raquo: "\xBB",
frac14: "\xBC",
frac12: "\xBD",
frac34: "\xBE",
iquest: "\xBF",
Agrave: "\xC0",
Aacute: "\xC1",
Acirc: "\xC2",
Atilde: "\xC3",
Auml: "\xC4",
Aring: "\xC5",
AElig: "\xC6",
Ccedil: "\xC7",
Egrave: "\xC8",
Eacute: "\xC9",
Ecirc: "\xCA",
Euml: "\xCB",
Igrave: "\xCC",
Iacute: "\xCD",
Icirc: "\xCE",
Iuml: "\xCF",
ETH: "\xD0",
Ntilde: "\xD1",
Ograve: "\xD2",
Oacute: "\xD3",
Ocirc: "\xD4",
Otilde: "\xD5",
Ouml: "\xD6",
times: "\xD7",
Oslash: "\xD8",
Ugrave: "\xD9",
Uacute: "\xDA",
Ucirc: "\xDB",
Uuml: "\xDC",
Yacute: "\xDD",
THORN: "\xDE",
szlig: "\xDF",
agrave: "\xE0",
aacute: "\xE1",
acirc: "\xE2",
atilde: "\xE3",
auml: "\xE4",
aring: "\xE5",
aelig: "\xE6",
ccedil: "\xE7",
egrave: "\xE8",
eacute: "\xE9",
ecirc: "\xEA",
euml: "\xEB",
igrave: "\xEC",
iacute: "\xED",
icirc: "\xEE",
iuml: "\xEF",
eth: "\xF0",
ntilde: "\xF1",
ograve: "\xF2",
oacute: "\xF3",
ocirc: "\xF4",
otilde: "\xF5",
ouml: "\xF6",
divide: "\xF7",
oslash: "\xF8",
ugrave: "\xF9",
uacute: "\xFA",
ucirc: "\xFB",
uuml: "\xFC",
yacute: "\xFD",
thorn: "\xFE",
yuml: "\xFF",
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"
};
var lineBreak = /\r\n?|\n|\u2028|\u2029/;
var lineBreakG = new RegExp(lineBreak.source, "g");
function isNewLine(code) {
return code === 10 || code === 13 || code === 0x2028 || code === 0x2029;
}
var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
var TokContext = function TokContext(token, isExpr, preserveSpace, override) {
this.token = token;
this.isExpr = !!isExpr;
this.preserveSpace = !!preserveSpace;
this.override = override;
};
var types$1 = {
braceStatement: new TokContext("{", false),
braceExpression: new TokContext("{", true),
templateQuasi: new TokContext("${", true),
parenStatement: new TokContext("(", false),
parenExpression: new TokContext("(", true),
template: new TokContext("`", true, true, function (p) {
return p.readTmplToken();
}),
functionExpression: new TokContext("function", true)
};
types.parenR.updateContext = types.braceR.updateContext = function () {
if (this.state.context.length === 1) {
this.state.exprAllowed = true;
return;
}
var out = this.state.context.pop();
if (out === types$1.braceStatement && this.curContext() === types$1.functionExpression) {
this.state.context.pop();
this.state.exprAllowed = false;
} else if (out === types$1.templateQuasi) {
this.state.exprAllowed = true;
} else {
this.state.exprAllowed = !out.isExpr;
}
};
types.name.updateContext = function (prevType) {
if (this.state.value === "of" && this.curContext() === types$1.parenStatement) {
this.state.exprAllowed = !prevType.beforeExpr;
return;
}
this.state.exprAllowed = false;
if (prevType === types._let || prevType === types._const || prevType === types._var) {
if (lineBreak.test(this.input.slice(this.state.end))) {
this.state.exprAllowed = true;
}
}
if (this.state.isIterator) {
this.state.isIterator = false;
}
};
types.braceL.updateContext = function (prevType) {
this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpression);
this.state.exprAllowed = true;
};
types.dollarBraceL.updateContext = function () {
this.state.context.push(types$1.templateQuasi);
this.state.exprAllowed = true;
};
types.parenL.updateContext = function (prevType) {
var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression);
this.state.exprAllowed = true;
};
types.incDec.updateContext = function () {};
types._function.updateContext = function (prevType) {
if (this.state.exprAllowed && !this.braceIsBlock(prevType)) {
this.state.context.push(types$1.functionExpression);
}
this.state.exprAllowed = false;
};
types.backQuote.updateContext = function () {
if (this.curContext() === types$1.template) {
this.state.context.pop();
} else {
this.state.context.push(types$1.template);
}
this.state.exprAllowed = false;
};
var HEX_NUMBER = /^[\da-fA-F]+$/;
var DECIMAL_NUMBER = /^\d+$/;
types$1.j_oTag = new TokContext("<tag", false);
types$1.j_cTag = new TokContext("</tag", false);
types$1.j_expr = new TokContext("<tag>...</tag>", true, true);
types.jsxName = new TokenType("jsxName");
types.jsxText = new TokenType("jsxText", {
beforeExpr: true
});
types.jsxTagStart = new TokenType("jsxTagStart", {
startsExpr: true
});
types.jsxTagEnd = new TokenType("jsxTagEnd");
types.jsxTagStart.updateContext = function () {
this.state.context.push(types$1.j_expr);
this.state.context.push(types$1.j_oTag);
this.state.exprAllowed = false;
};
types.jsxTagEnd.updateContext = function (prevType) {
var out = this.state.context.pop();
if (out === types$1.j_oTag && prevType === types.slash || out === types$1.j_cTag) {
this.state.context.pop();
this.state.exprAllowed = this.curContext() === types$1.j_expr;
} else {
this.state.exprAllowed = true;
}
};
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 = function jsx(superClass) {
return function (_superClass) {
_inheritsLoose(_class, _superClass);
function _class() {
return _superClass.apply(this, arguments) || this;
}
var _proto = _class.prototype;
_proto.jsxReadToken = function jsxReadToken() {
var out = "";
var chunkStart = this.state.pos;
for (;;) {
if (this.state.pos >= this.input.length) {
this.raise(this.state.start, "Unterminated JSX contents");
}
var 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.exprAllowed) {
++this.state.pos;
return this.finishToken(types.jsxTagStart);
}
return this.getTokenFromCode(ch);
}
out += this.input.slice(chunkStart, this.state.pos);
return this.finishToken(types.jsxText, out);
case 38:
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadEntity();
chunkStart = this.state.pos;
break;
default:
if (isNewLine(ch)) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadNewLine(true);
chunkStart = this.state.pos;
} else {
++this.state.pos;
}
}
}
};
_proto.jsxReadNewLine = function jsxReadNewLine(normalizeCRLF) {
var ch = this.input.charCodeAt(this.state.pos);
var 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;
};
_proto.jsxReadString = function jsxReadString(quote) {
var out = "";
var chunkStart = ++this.state.pos;
for (;;) {
if (this.state.pos >= this.input.length) {
this.raise(this.state.start, "Unterminated string constant");
}
var 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++);
return this.finishToken(types.string, out);
};
_proto.jsxReadEntity = function jsxReadEntity() {
var str = "";
var count = 0;
var entity;
var ch = this.input[this.state.pos];
var startPos = ++this.state.pos;
while (this.state.pos < this.input.length && count++ < 10) {
ch = this.input[this.state.pos++];
if (ch === ";") {
if (str[0] === "#") {
if (str[1] === "x") {
str = str.substr(2);
if (HEX_NUMBER.test(str)) {
entity = String.fromCodePoint(parseInt(str, 16));
}
} else {
str = str.substr(1);
if (DECIMAL_NUMBER.test(str)) {
entity = String.fromCodePoint(parseInt(str, 10));
}
}
} else {
entity = entities[str];
}
break;
}
str += ch;
}
if (!entity) {
this.state.pos = startPos;
return "&";
}
return entity;
};
_proto.jsxReadWord = function jsxReadWord() {
var ch;
var start = this.state.pos;
do {
ch = this.input.charCodeAt(++this.state.pos);
} while (isIdentifierChar(ch) || ch === 45);
return this.finishToken(types.jsxName, this.input.slice(start, this.state.pos));
};
_proto.jsxParseIdentifier = function jsxParseIdentifier() {
var node = this.startNode();
if (this.match(types.jsxName)) {
node.name = this.state.value;
} else if (this.state.type.keyword) {
node.name = this.state.type.keyword;
} else {
this.unexpected();
}
this.next();
return this.finishNode(node, "JSXIdentifier");
};
_proto.jsxParseNamespacedName = function jsxParseNamespacedName() {
var startPos = this.state.start;
var startLoc = this.state.startLoc;
var name = this.jsxParseIdentifier();
if (!this.eat(types.colon)) return name;
var node = this.startNodeAt(startPos, startLoc);
node.namespace = name;
node.name = this.jsxParseIdentifier();
return this.finishNode(node, "JSXNamespacedName");
};
_proto.jsxParseElementName = function jsxParseElementName() {
var startPos = this.state.start;
var startLoc = this.state.startLoc;
var node = this.jsxParseNamespacedName();
while (this.eat(types.dot)) {
var newNode = this.startNodeAt(startPos, startLoc);
newNode.object = node;
newNode.property = this.jsxParseIdentifier();
node = this.finishNode(newNode, "JSXMemberExpression");
}
return node;
};
_proto.jsxParseAttributeValue = function jsxParseAttributeValue() {
var node;
switch (this.state.type) {
case types.braceL:
node = this.jsxParseExpressionContainer();
if (node.expression.type === "JSXEmptyExpression") {
throw this.raise(node.start, "JSX attributes must only be assigned a non-empty expression");
} else {
return node;
}
case types.jsxTagStart:
case types.string:
return this.parseExprAtom();
default:
throw this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text");
}
};
_proto.jsxParseEmptyExpression = function jsxParseEmptyExpression() {
var node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc);
return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc);
};
_proto.jsxParseSpreadChild = function jsxParseSpreadChild() {
var node = this.startNode();
this.expect(types.braceL);
this.expect(types.ellipsis);
node.expression = this.parseExpression();
this.expect(types.braceR);
return this.finishNode(node, "JSXSpreadChild");
};
_proto.jsxParseExpressionContainer = function jsxParseExpressionContainer() {
var node = this.startNode();
this.next();
if (this.match(types.braceR)) {
node.expression = this.jsxParseEmptyExpression();
} else {
node.expression = this.parseExpression();
}
this.expect(types.braceR);
return this.finishNode(node, "JSXExpressionContainer");
};
_proto.jsxParseAttribute = function jsxParseAttribute() {
var node = this.startNode();
if (this.eat(types.braceL)) {
this.expect(types.ellipsis);
node.argument = this.parseMaybeAssign();
this.expect(types.braceR);
return this.finishNode(node, "JSXSpreadAttribute");
}
node.name = this.jsxParseNamespacedName();
node.value = this.eat(types.eq) ? this.jsxParseAttributeValue() : null;
return this.finishNode(node, "JSXAttribute");
};
_proto.jsxParseOpeningElementAt = function jsxParseOpeningElementAt(startPos, startLoc) {
var node = this.startNodeAt(startPos, startLoc);
if (this.match(types.jsxTagEnd)) {
this.expect(types.jsxTagEnd);
return this.finishNode(node, "JSXOpeningFragment");
}
node.attributes = [];
node.name = this.jsxParseElementName();
while (!this.match(types.slash) && !this.match(types.jsxTagEnd)) {
node.attributes.push(this.jsxParseAttribute());
}
node.selfClosing = this.eat(types.slash);
this.expect(types.jsxTagEnd);
return this.finishNode(node, "JSXOpeningElement");
};
_proto.jsxParseClosingElementAt = function jsxParseClosingElementAt(startPos, startLoc) {
var node = this.startNodeAt(startPos, startLoc);
if (this.match(types.jsxTagEnd)) {
this.expect(types.jsxTagEnd);
return this.finishNode(node, "JSXClosingFragment");
}
node.name = this.jsxParseElementName();
this.expect(types.jsxTagEnd);
return this.finishNode(node, "JSXClosingElement");
};
_proto.jsxParseElementAt = function jsxParseElementAt(startPos, startLoc) {
var node = this.startNodeAt(startPos, startLoc);
var children = [];
var openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);
var closingElement = null;
if (!openingElement.selfClosing) {
contents: for (;;) {
switch (this.state.type) {
case types.jsxTagStart:
startPos = this.state.start;
startLoc = this.state.startLoc;
this.next();
if (this.eat(types.slash)) {
closingElement = this.jsxParseClosingElementAt(startPos, startLoc);
break contents;
}
children.push(this.jsxParseElementAt(startPos, startLoc));
break;
case types.jsxText:
children.push(this.parseExprAtom());
break;
case types.braceL:
if (this.lookahead().type === types.ellipsis) {
children.push(this.jsxParseSpreadChild());
} else {
children.push(this.jsxParseExpressionContainer());
}
break;
default:
throw this.unexpected();
}
}
if (isFragment(openingElement) && !isFragment(closingElement)) {
this.raise(closingElement.start, "Expected corresponding JSX closing tag for <>");
} else if (!isFragment(openingElement) && isFragment(closingElement)) {
this.raise(closingElement.start, "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">");
} else if (!isFragment(openingElement) && !isFragment(closingElement)) {
if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
this.raise(closingElement.start, "Expected corresponding JSX closing tag for <" + 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(types.relational) && this.state.value === "<") {
this.raise(this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag. " + "Did you want a JSX fragment <>...</>?");
}
return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
};
_proto.jsxParseElement = function jsxParseElement() {
var startPos = this.state.start;
var startLoc = this.state.startLoc;
this.next();
return this.jsxParseElementAt(startPos, startLoc);
};
_proto.parseExprAtom = function parseExprAtom(refShortHandDefaultPos) {
if (this.match(types.jsxText)) {
return this.parseLiteral(this.state.value, "JSXText");
} else if (this.match(types.jsxTagStart)) {
return this.jsxParseElement();
} else {
return _superClass.prototype.parseExprAtom.call(this, refShortHandDefaultPos);
}
};
_proto.readToken = function readToken(code) {
if (this.state.inPropertyName) return _superClass.prototype.readToken.call(this, code);
var context = this.curContext();
if (context === types$1.j_expr) {
return this.jsxReadToken();
}
if (context === types$1.j_oTag || context === types$1.j_cTag) {
if (isIdentifierStart(code)) {
return this.jsxReadWord();
}
if (code === 62) {
++this.state.pos;
return this.finishToken(types.jsxTagEnd);
}
if ((code === 34 || code === 39) && context === types$1.j_oTag) {
return this.jsxReadString(code);
}
}
if (code === 60 && this.state.exprAllowed) {
++this.state.pos;
return this.finishToken(types.jsxTagStart);
}
return _superClass.prototype.readToken.call(this, code);
};
_proto.updateContext = function updateContext(prevType) {
if (this.match(types.braceL)) {
var curContext = this.curContext();
if (curContext === types$1.j_oTag) {
this.state.context.push(types$1.braceExpression);
} else if (curContext === types$1.j_expr) {
this.state.context.push(types$1.templateQuasi);
} else {
_superClass.prototype.updateContext.call(this, prevType);
}
this.state.exprAllowed = true;
} else if (this.match(types.slash) && prevType === types.jsxTagStart) {
this.state.context.length -= 2;
this.state.context.push(types$1.j_cTag);
this.state.exprAllowed = false;
} else {
return _superClass.prototype.updateContext.call(this, prevType);
}
};
return _class;
}(superClass);
};
var defaultOptions = {
sourceType: "script",
sourceFilename: undefined,
startLine: 1,
allowAwaitOutsideFunction: false,
allowReturnOutsideFunction: false,
allowImportExportEverywhere: false,
allowSuperOutsideMethod: false,
plugins: [],
strictMode: null,
ranges: false,
tokens: false
};
function getOptions(opts) {
var options = {};
for (var key in defaultOptions) {
options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];
}
return options;
}
var Position = function Position(line, col) {
this.line = line;
this.column = col;
};
var SourceLocation = function SourceLocation(start, end) {
this.start = start;
this.end = end;
};
function getLineInfo(input, offset) {
for (var line = 1, cur = 0;;) {
lineBreakG.lastIndex = cur;
var match = lineBreakG.exec(input);
if (match && match.index < offset) {
++line;
cur = match.index + match[0].length;
} else {
return new Position(line, offset - cur);
}
}
throw new Error("Unreachable");
}
var BaseParser = function () {
function BaseParser() {
this.sawUnambiguousESM = false;
}
var _proto = BaseParser.prototype;
_proto.isReservedWord = function isReservedWord(word) {
if (word === "await") {
return this.inModule;
} else {
return reservedWords[6](word);
}
};
_proto.hasPlugin = function hasPlugin(name) {
return Object.hasOwnProperty.call(this.plugins, name);
};
_proto.getPluginOption = function getPluginOption(plugin, name) {
if (this.hasPlugin(plugin)) return this.plugins[plugin][name];
};
return BaseParser;
}();
function last(stack) {
return stack[stack.length - 1];
}
var CommentsParser = function (_BaseParser) {
_inheritsLoose(CommentsParser, _BaseParser);
function CommentsParser() {
return _BaseParser.apply(this, arguments) || this;
}
var _proto = CommentsParser.prototype;
_proto.addComment = function addComment(comment) {
if (this.filename) comment.loc.filename = this.filename;
this.state.trailingComments.push(comment);
this.state.leadingComments.push(comment);
};
_proto.processComment = function processComment(node) {
if (node.type === "Program" && node.body.length > 0) return;
var stack = this.state.commentStack;
var firstChild, lastChild, trailingComments, i, j;
if (this.state.trailingComments.length > 0) {
if (this.state.trailingComments[0].start >= node.end) {
trailingComments = this.state.trailingComments;
this.state.trailingComments = [];
} else {
this.state.trailingComments.length = 0;
}
} else if (stack.length > 0) {
var lastInStack = last(stack);
if (lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) {
trailingComments = lastInStack.trailingComments;
delete lastInStack.trailingComments;
}
}
if (stack.length > 0 && last(stack).start >= node.start) {
firstChild = stack.pop();
}
while (stack.length > 0 && last(stack).start >= node.start) {
lastChild = stack.pop();
}
if (!lastChild && firstChild) lastChild = firstChild;
if (firstChild && this.state.leadingComments.length > 0) {
var lastComment = last(this.state.leadingComments);
if (firstChild.type === "ObjectProperty") {
if (lastComment.start >= node.start) {
if (this.state.commentPreviousNode) {
for (j = 0; j < this.state.leadingComments.length; j++) {
if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
this.state.leadingComments.splice(j, 1);
j--;
}
}
if (this.state.leadingComments.length > 0) {
firstChild.trailingComments = this.state.leadingComments;
this.state.leadingComments = [];
}
}
}
} else if (node.type === "CallExpression" && node.arguments && node.arguments.length) {
var lastArg = last(node.arguments);
if (lastArg && lastComment.start >= lastArg.start && lastComment.end <= node.end) {
if (this.state.commentPreviousNode) {
if (this.state.leadingComments.length > 0) {
lastArg.trailingComments = this.state.leadingComments;
this.state.leadingComments = [];
}
}
}
}
}
if (lastChild) {
if (lastChild.leadingComments) {
if (lastChild !== node && lastChild.leadingComments.length > 0 && last(lastChild.leadingComments).end <= node.start) {
node.leadingComments = lastChild.leadingComments;
delete lastChild.leadingComments;
} else {
for (i = lastChild.leadingComments.length - 2; i >= 0; --i) {
if (lastChild.leadingComments[i].end <= node.start) {
node.leadingComments = lastChild.leadingComments.splice(0, i + 1);
break;
}
}
}
}
} else if (this.state.leadingComments.length > 0) {
if (last(this.state.leadingComments).end <= node.start) {
if (this.state.commentPreviousNode) {
for (j = 0; j < this.state.leadingComments.length; j++) {
if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
this.state.leadingComments.splice(j, 1);
j--;
}
}
}
if (this.state.leadingComments.length > 0) {
node.leadingComments = this.state.leadingComments;
this.state.leadingComments = [];
}
} else {
for (i = 0; i < this.state.leadingComments.length; i++) {
if (this.state.leadingComments[i].end > node.start) {
break;
}
}
var leadingComments = this.state.leadingComments.slice(0, i);
if (leadingComments.length) {
node.leadingComments = leadingComments;
}
trailingComments = this.state.leadingComments.slice(i);
if (trailingComments.length === 0) {
trailingComments = null;
}
}
}
this.state.commentPreviousNode = node;
if (trailingComments) {
if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) {
node.innerComments = trailingComments;
} else {
node.trailingComments = trailingComments;
}
}
stack.push(node);
};
return CommentsParser;
}(BaseParser);
var LocationParser = function (_CommentsParser) {
_inheritsLoose(LocationParser, _CommentsParser);
function LocationParser() {
return _CommentsParser.apply(this, arguments) || this;
}
var _proto = LocationParser.prototype;
_proto.raise = function raise(pos, message, _temp) {
var _ref = _temp === void 0 ? {} : _temp,
missingPluginNames = _ref.missingPluginNames,
code = _ref.code;
var loc = getLineInfo(this.input, pos);
message += " (" + loc.line + ":" + loc.column + ")";
var err = new SyntaxError(message);
err.pos = pos;
err.loc = loc;
if (missingPluginNames) {
err.missingPlugin = missingPluginNames;
}
if (code !== undefined) {
err.code = code;
}
throw err;
};
return LocationParser;
}(CommentsParser);
var State = function () {
function State() {}
var _proto = State.prototype;
_proto.init = function init(options, input) {
this.strict = options.strictMode === false ? false : options.sourceType === "module";
this.input = input;
this.potentialArrowAt = -1;
this.noArrowAt = [];
this.noArrowParamsConversionAt = [];
this.inMethod = false;
this.inFunction = false;
this.inParameters = false;
this.maybeInArrowParameters = false;
this.inGenerator = false;
this.inAsync = false;
this.inPropertyName = false;
this.inType = false;
this.inClassProperty = false;
this.noAnonFunctionType = false;
this.hasFlowComment = false;
this.isIterator = false;
this.classLevel = 0;
this.labels = [];
this.decoratorStack = [[]];
this.yieldInPossibleArrowParameters = null;
this.tokens = [];
this.comments = [];
this.trailingComments = [];
this.leadingComments = [];
this.commentStack = [];
this.commentPreviousNode = null;
this.pos = this.lineStart = 0;
this.curLine = options.startLine;
this.type = types.eof;
this.value = null;
this.start = this.end = this.pos;
this.startLoc = this.endLoc = this.curPosition();
this.lastTokEndLoc = this.lastTokStartLoc = null;
this.lastTokStart = this.lastTokEnd = this.pos;
this.context = [types$1.braceStatement];
this.exprAllowed = true;
this.containsEsc = this.containsOctal = false;
this.octalPosition = null;
this.invalidTemplateEscapePosition = null;
this.exportedIdentifiers = [];
};
_proto.curPosition = function curPosition() {
return new Position(this.curLine, this.pos - this.lineStart);
};
_proto.clone = function clone(skipArrays) {
var _this = this;
var state = new State();
Object.keys(this).forEach(function (key) {
var val = _this[key];
if ((!skipArrays || key === "context") && Array.isArray(val)) {
val = val.slice();
}
state[key] = val;
});
return state;
};
return State;
}();
var _isDigit = function isDigit(code) {
return code >= 48 && code <= 57;
};
var VALID_REGEX_FLAGS = "gmsiyu";
var forbiddenNumericSeparatorSiblings = {
decBinOct: [46, 66, 69, 79, 95, 98, 101, 111],
hex: [46, 88, 95, 120]
};
var allowedNumericSeparatorSiblings = {};
allowedNumericSeparatorSiblings.bin = [48, 49];
allowedNumericSeparatorSiblings.oct = allowedNumericSeparatorSiblings.bin.concat([50, 51, 52, 53, 54, 55]);
allowedNumericSeparatorSiblings.dec = allowedNumericSeparatorSiblings.oct.concat([56, 57]);
allowedNumericSeparatorSiblings.hex = allowedNumericSeparatorSiblings.dec.concat([65, 66, 67, 68, 69, 70, 97, 98, 99, 100, 101, 102]);
var Token = function Token(state) {
this.type = state.type;
this.value = state.value;
this.start = state.start;
this.end = state.end;
this.loc = new SourceLocation(state.startLoc, state.endLoc);
};
function codePointToString(code) {
if (code <= 0xffff) {
return String.fromCharCode(code);
} else {
return String.fromCharCode((code - 0x10000 >> 10) + 0xd800, (code - 0x10000 & 1023) + 0xdc00);
}
}
var Tokenizer = function (_LocationParser) {
_inheritsLoose(Tokenizer, _LocationParser);
function Tokenizer(options, input) {
var _this;
_this = _LocationParser.call(this) || this;
_this.state = new State();
_this.state.init(options, input);
_this.isLookahead = false;
return _this;
}
var _proto = Tokenizer.prototype;
_proto.next = function next() {
if (this.options.tokens && !this.isLookahead) {
this.state.tokens.push(new Token(this.state));
}
this.state.lastTokEnd = this.state.end;
this.state.lastTokStart = this.state.start;
this.state.lastTokEndLoc = this.state.endLoc;
this.state.lastTokStartLoc = this.state.startLoc;
this.nextToken();
};
_proto.eat = function eat(type) {
if (this.match(type)) {
this.next();
return true;
} else {
return false;
}
};
_proto.match = function match(type) {
return this.state.type === type;
};
_proto.isKeyword = function isKeyword$$1(word) {
return isKeyword(word);
};
_proto.lookahead = function lookahead() {
var old = this.state;
this.state = old.clone(true);
this.isLookahead = true;
this.next();
this.isLookahead = false;
var curr = this.state;
this.state = old;
return curr;
};
_proto.setStrict = function setStrict(strict) {
this.state.strict = strict;
if (!this.match(types.num) && !this.match(types.string)) return;
this.state.pos = this.state.start;
while (this.state.pos < this.state.lineStart) {
this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1;
--this.state.curLine;
}
this.nextToken();
};
_proto.curContext = function curContext() {
return this.state.context[this.state.context.length - 1];
};
_proto.nextToken = function nextToken() {
var curContext = this.curContext();
if (!curContext || !curContext.preserveSpace) this.skipSpace();
this.state.containsOctal = false;
this.state.octalPosition = null;
this.state.start = this.state.pos;
this.state.startLoc = this.state.curPosition();
if (this.state.pos >= this.input.length) {
this.finishToken(types.eof);
return;
}
if (curContext.override) {
curContext.override(this);
} else {
this.readToken(this.fullCharCodeAtPos());
}
};
_proto.readToken = function readToken(code) {
if (isIdentifierStart(code) || code === 92) {
this.readWord();
} else {
this.getTokenFromCode(code);
}
};
_proto.fullCharCodeAtPos = function fullCharCodeAtPos() {
var code = this.input.charCodeAt(this.state.pos);
if (code <= 0xd7ff || code >= 0xe000) return code;
var next = this.input.charCodeAt(this.state.pos + 1);
return (code << 10) + next - 0x35fdc00;
};
_proto.pushComment = function pushComment(block, text, start, end, startLoc, endLoc) {
var comment = {
type: block ? "CommentBlock" : "CommentLine",
value: text,
start: start,
end: end,
loc: new SourceLocation(startLoc, endLoc)
};
if (!this.isLookahead) {
if (this.options.tokens) this.state.tokens.push(comment);
this.state.comments.push(comment);
this.addComment(comment);
}
};
_proto.skipBlockComment = function skipBlockComment() {
var startLoc = this.state.curPosition();
var start = this.state.pos;
var end = this.input.indexOf("*/", this.state.pos += 2);
if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment");
this.state.pos = end + 2;
lineBreakG.lastIndex = start;
var match;
while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) {
++this.state.curLine;
this.state.lineStart = match.index + match[0].length;
}
this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition());
};
_proto.skipLineComment = function skipLineComment(startSkip) {
var start = this.state.pos;
var startLoc = this.state.curPosition();
var ch = this.input.charCodeAt(this.state.pos += startSkip);
if (this.state.pos < this.input.length) {
while (ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233 && ++this.state.pos < this.input.length) {
ch = this.input.charCodeAt(this.state.pos);
}
}
this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition());
};
_proto.skipSpace = function skipSpace() {
loop: while (this.state.pos < this.input.length) {
var ch = this.input.charCodeAt(this.state.pos);
switch (ch) {
case 32:
case 160:
++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:
this.skipBlockComment();
break;
case 47:
this.skipLineComment(2);
break;
default:
break loop;
}
break;
default:
if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
++this.state.pos;
} else {
break loop;
}
}
}
};
_proto.finishToken = function finishToken(type, val) {
this.state.end = this.state.pos;
this.state.endLoc = this.state.curPosition();
var prevType = this.state.type;
this.state.type = type;
this.state.value = val;
this.updateContext(prevType);
};
_proto.readToken_dot = function readToken_dot() {
var next = this.input.charCodeAt(this.state.pos + 1);
if (next >= 48 && next <= 57) {
this.readNumber(true);
return;
}
var next2 = this.input.charCodeAt(this.state.pos + 2);
if (next === 46 && next2 === 46) {
this.state.pos += 3;
this.finishToken(types.ellipsis);
} else {
++this.state.pos;
this.finishToken(types.dot);
}
};
_proto.readToken_slash = function readToken_slash() {
if (this.state.exprAllowed) {
++this.state.pos;
this.readRegexp();
return;
}
var next = this.input.charCodeAt(this.state.pos + 1);
if (next === 61) {
this.finishOp(types.assign, 2);
} else {
this.finishOp(types.slash, 1);
}
};
_proto.readToken_interpreter = function readToken_interpreter() {
if (this.state.pos !== 0 || this.state.input.length < 2) return false;
var start = this.state.pos;
this.state.pos += 1;
var ch = this.input.charCodeAt(this.state.pos);
if (ch !== 33) return false;
while (ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233 && ++this.state.pos < this.input.length) {
ch = this.input.charCodeAt(this.state.pos);
}
var value = this.input.slice(start + 2, this.state.pos);
this.finishToken(types.interpreterDirective, value);
return true;
};
_proto.readToken_mult_modulo = function readToken_mult_modulo(code) {
var type = code === 42 ? types.star : types.modulo;
var width = 1;
var next = this.input.charCodeAt(this.state.pos + 1);
var exprAllowed = this.state.exprAllowed;
if (code === 42 && next === 42) {
width++;
next = this.input.charCodeAt(this.state.pos + 2);
type = types.exponent;
}
if (next === 61 && !exprAllowed) {
width++;
type = types.assign;
}
this.finishOp(type, width);
};
_proto.readToken_pipe_amp = function readToken_pipe_amp(code) {
var next = this.input.charCodeAt(this.state.pos + 1);
if (next === code) {
if (this.input.charCodeAt(this.state.pos + 2) === 61) {
this.finishOp(types.assign, 3);
} else {
this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2);
}
return;
}
if (code === 124) {
if (next === 62) {
this.finishOp(types.pipeline, 2);
return;
} else if (next === 125 && this.hasPlugin("flow")) {
this.finishOp(types.braceBarR, 2);
return;
}
}
if (next === 61) {
this.finishOp(types.assign, 2);
return;
}
this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1);
};
_proto.readToken_caret = function readToken_caret() {
var next = this.input.charCodeAt(this.state.pos + 1);
if (next === 61) {
this.finishOp(types.assign, 2);
} else {
this.finishOp(types.bitwiseXOR, 1);
}
};
_proto.readToken_plus_min = function readToken_plus_min(code) {
var next = this.input.charCodeAt(this.state.pos + 1);
if (next === code) {
if (next === 45 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 62 && lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos))) {
this.skipLineComment(3);
this.skipSpace();
this.nextToken();
return;
}
this.finishOp(types.incDec, 2);
return;
}
if (next === 61) {
this.finishOp(types.assign, 2);
} else {
this.finishOp(types.plusMin, 1);
}
};
_proto.readToken_lt_gt = function readToken_lt_gt(code) {
var next = this.input.charCodeAt(this.state.pos + 1);
var size = 1;
if (next === code) {
size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2;
if (this.input.charCodeAt(this.state.pos + size) === 61) {
this.finishOp(types.assign, size + 1);
return;
}
this.finishOp(types.bitShift, size);
return;
}
if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) {
this.skipLineComment(4);
this.skipSpace();
this.nextToken();
return;
}
if (next === 61) {
size = 2;
}
this.finishOp(types.relational, size);
};
_proto.readToken_eq_excl = function readToken_eq_excl(code) {
var next = this.input.charCodeAt(this.state.pos + 1);
if (next === 61) {
this.finishOp(types.equality, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
return;
}
if (code === 61 && next === 62) {
this.state.pos += 2;
this.finishToken(types.arrow);
return;
}
this.finishOp(code === 61 ? types.eq : types.bang, 1);
};
_proto.readToken_question = function readToken_question() {
var next = this.input.charCodeAt(this.state.pos + 1);
var next2 = this.input.charCodeAt(this.state.pos + 2);
if (next === 63 && !this.state.inType) {
if (next2 === 61) {
this.finishOp(types.assign, 3);
} else {
this.finishOp(types.nullishCoalescing, 2);
}
} else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
this.state.pos += 2;
this.finishToken(types.questionDot);
} else {
++this.state.pos;
this.finishToken(types.question);
}
};
_proto.getTokenFromCode = function getTokenFromCode(code) {
switch (code) {
case 35:
if (this.state.pos === 0 && this.readToken_interpreter()) {
return;
}
if ((this.hasPlugin("classPrivateProperties") || this.hasPlugin("classPrivateMethods")) && this.state.classLevel > 0) {
++this.state.pos;
this.finishToken(types.hash);
return;
} else {
this.raise(this.state.pos, "Unexpected character '" + codePointToString(code) + "'");
}
case 46:
this.readToken_dot();
return;
case 40:
++this.state.pos;
this.finishToken(types.parenL);
return;
case 41:
++this.state.pos;
this.finishToken(types.parenR);
return;
case 59:
++this.state.pos;
this.finishToken(types.semi);
return;
case 44:
++this.state.pos;
this.finishToken(types.comma);
return;
case 91:
++this.state.pos;
this.finishToken(types.bracketL);
return;
case 93:
++this.state.pos;
this.finishToken(types.bracketR);
return;
case 123:
if (this.hasPlugin("flow") && this.input.charCodeAt(this.state.pos + 1) === 124) {
this.finishOp(types.braceBarL, 2);
} else {
++this.state.pos;
this.finishToken(types.braceL);
}
return;
case 125:
++this.state.pos;
this.finishToken(types.braceR);
return;
case 58:
if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
this.finishOp(types.doubleColon, 2);
} else {
++this.state.pos;
this.finishToken(types.colon);
}
return;
case 63:
this.readToken_question();
return;
case 64:
++this.state.pos;
this.finishToken(types.at);
return;
case 96:
++this.state.pos;
this.finishToken(types.backQuote);
return;
case 48:
{
var 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:
case 62:
this.readToken_lt_gt(code);
return;
case 61:
case 33:
this.readToken_eq_excl(code);
return;
case 126:
this.finishOp(types.tilde, 1);
return;
}
this.raise(this.state.pos, "Unexpected character '" + codePointToString(code) + "'");
};
_proto.finishOp = function finishOp(type, size) {
var str = this.input.slice(this.state.pos, this.state.pos + size);
this.state.pos += size;
this.finishToken(type, str);
};
_proto.readRegexp = function readRegexp() {
var start = this.state.pos;
var escaped, inClass;
for (;;) {
if (this.state.pos >= this.input.length) {
this.raise(start, "Unterminated regular expression");
}
var ch = this.input.charAt(this.state.pos);
if (lineBreak.test(ch)) {
this.raise(start, "Unterminated regular expression");
}
if (escaped) {
escaped = false;
} else {
if (ch === "[") {
inClass = true;
} else if (ch === "]" && inClass) {
inClass = false;
} else if (ch === "/" && !inClass) {
break;
}
escaped = ch === "\\";
}
++this.state.pos;
}
var content = this.input.slice(start, this.state.pos);
++this.state.pos;
var mods = "";
while (this.state.pos < this.input.length) {
var char = this.input[this.state.pos];
var charCode = this.fullCharCodeAtPos();
if (VALID_REGEX_FLAGS.indexOf(char) > -1) {
if (mods.indexOf(char) > -1) {
this.raise(this.state.pos + 1, "Duplicate regular expression flag");
}
++this.state.pos;
mods += char;
} else if (isIdentifierChar(charCode) || charCode === 92) {
this.raise(this.state.pos + 1, "Invalid regular expression flag");
} else {
break;
}
}
this.finishToken(types.regexp, {
pattern: content,
flags: mods
});
};
_proto.readInt = function readInt(radix, len) {
var start = this.state.pos;
var forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
var allowedSiblings = radix === 16 ? allowedNumericSeparatorSiblings.hex : radix === 10 ? allowedNumericSeparatorSiblings.dec : radix === 8 ? allowedNumericSeparatorSiblings.oct : allowedNumericSeparatorSiblings.bin;
var total = 0;
for (var i = 0, e = len == null ? Infinity : len; i < e; ++i) {
var code = this.input.charCodeAt(this.state.pos);
var val = void 0;
if (this.hasPlugin("numericSeparator")) {
var prev = this.input.charCodeAt(this.state.pos - 1);
var next = this.input.charCodeAt(this.state.pos + 1);
if (code === 95) {
if (allowedSiblings.indexOf(next) === -1) {
this.raise(this.state.pos, "Invalid or unexpected token");
}
if (forbiddenSiblings.indexOf(prev) > -1 || forbiddenSiblings.indexOf(next) > -1 || Number.isNaN(next)) {
this.raise(this.state.pos, "Invalid or unexpected token");
}
++this.state.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) break;
++this.state.pos;
total = total * radix + val;
}
if (this.state.pos === start || len != null && this.state.pos - start !== len) {
return null;
}
return total;
};
_proto.readRadixNumber = function readRadixNumber(radix) {
var start = this.state.pos;
var isBigInt = false;
this.state.pos += 2;
var val = this.readInt(radix);
if (val == null) {
this.raise(this.state.start + 2, "Expected number in radix " + radix);
}
if (this.hasPlugin("bigInt")) {
if (this.input.charCodeAt(this.state.pos) === 110) {
++this.state.pos;
isBigInt = true;
}
}
if (isIdentifierStart(this.fullCharCodeAtPos())) {
this.raise(this.state.pos, "Identifier directly after number");
}
if (isBigInt) {
var str = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
this.finishToken(types.bigint, str);
return;
}
this.finishToken(types.num, val);
};
_proto.readNumber = function readNumber(startsWithDot) {
var start = this.state.pos;
var octal = this.input.charCodeAt(start) === 48;
var isFloat = false;
var isBigInt = false;
if (!startsWithDot && this.readInt(10) === null) {
this.raise(start, "Invalid number");
}
if (octal && this.state.pos == start + 1) octal = false;
var next = this.input.charCodeAt(this.state.pos);
if (next === 46 && !octal) {
++this.state.pos;
this.readInt(10);
isFloat = true;
next = this.input.charCodeAt(this.state.pos);
}
if ((next === 69 || next === 101) && !octal) {
next = this.input.charCodeAt(++this.state.pos);
if (next === 43 || next === 45) {
++this.state.pos;
}
if (this.readInt(10) === null) this.raise(start, "Invalid number");
isFloat = true;
next = this.input.charCodeAt(this.state.pos);
}
if (this.hasPlugin("bigInt")) {
if (next === 110) {
if (isFloat || octal) this.raise(start, "Invalid BigIntLiteral");
++this.state.pos;
isBigInt = true;
}
}
if (isIdentifierStart(this.fullCharCodeAtPos())) {
this.raise(this.state.pos, "Identifier directly after number");
}
var str = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
if (isBigInt) {
this.finishToken(types.bigint, str);
return;
}
var val;
if (isFloat) {
val = parseFloat(str);
} else if (!octal || str.length === 1) {
val = parseInt(str, 10);
} else if (this.state.strict) {
this.raise(start, "Invalid number");
} else if (/[89]/.test(str)) {
val = parseInt(str, 10);
} else {
val = parseInt(str, 8);
}
this.finishToken(types.num, val);
};
_proto.readCodePoint = function readCodePoint(throwOnInvalid) {
var ch = this.input.charCodeAt(this.state.pos);
var code;
if (ch === 123) {
var codePos = ++this.state.pos;
code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, throwOnInvalid);
++this.state.pos;
if (code === null) {
--this.state.invalidTemplateEscapePosition;
} else if (code > 0x10ffff) {
if (throwOnInvalid) {
this.raise(codePos, "Code point out of bounds");
} else {
this.state.invalidTemplateEscapePosition = codePos - 2;
return null;
}
}
} else {
code = this.readHexChar(4, throwOnInvalid);
}
return code;
};
_proto.readString = function readString(quote) {
var out = "",
chunkStart = ++this.state.pos;
var hasJsonStrings = this.hasPlugin("jsonStrings");
for (;;) {
if (this.state.pos >= this.input.length) {
this.raise(this.state.start, "Unterminated string constant");
}
var ch = this.input.charCodeAt(this.state.pos);
if (ch === quote) break;
if (ch === 92) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.readEscapedChar(false);
chunkStart = this.state.pos;
} else if (hasJsonStrings && (ch === 8232 || ch === 8233)) {
++this.state.pos;
} else if (isNewLine(ch)) {
this.raise(this.state.start, "Unterminated string constant");
} else {
++this.state.pos;
}
}
out += this.input.slice(chunkStart, this.state.pos++);
this.finishToken(types.string, out);
};
_proto.readTmplToken = function readTmplToken() {
var out = "",
chunkStart = this.state.pos,
containsInvalid = false;
for (;;) {
if (this.state.pos >= this.input.length) {
this.raise(this.state.start, "Unterminated template");
}
var ch = this.input.charCodeAt(this.state.pos);
if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) {
if (this.state.pos === this.state.start && this.match(types.template)) {
if (ch === 36) {
this.state.pos += 2;
this.finishToken(types.dollarBraceL);
return;
} else {
++this.state.pos;
this.finishToken(types.backQuote);
return;
}
}
out += this.input.slice(chunkStart, this.state.pos);
this.finishToken(types.template, containsInvalid ? null : out);
return;
}
if (ch === 92) {
out += this.input.slice(chunkStart, this.state.pos);
var escaped = this.readEscapedChar(true);
if (escaped === null) {
containsInvalid = true;
} else {
out += escaped;
}
chunkStart = this.state.pos;
} else if (isNewLine(ch)) {
out += this.input.slice(chunkStart, this.state.pos);
++this.state.pos;
switch (ch) {
case 13:
if (this.input.charCodeAt(this.state.pos) === 10) {
++this.state.pos;
}
case 10:
out += "\n";
break;
default:
out += String.fromCharCode(ch);
break;
}
++this.state.curLine;
this.state.lineStart = this.state.pos;
chunkStart = this.state.pos;
} else {
++this.state.pos;
}
}
};
_proto.readEscapedChar = function readEscapedChar(inTemplate) {
var throwOnInvalid = !inTemplate;
var ch = this.input.charCodeAt(++this.state.pos);
++this.state.pos;
switch (ch) {
case 110:
return "\n";
case 114:
return "\r";
case 120:
{
var code = this.readHexChar(2, throwOnInvalid);
return code === null ? null : String.fromCharCode(code);
}
case 117:
{
var _code = this.readCodePoint(throwOnInvalid);
return _code === null ? null : codePointToString(_code);
}
case 116:
return "\t";
case 98:
return "\b";
case 118:
return "\x0B";
case 102:
return "\f";
case 13:
if (this.input.charCodeAt(this.state.pos) === 10) {
++this.state.pos;
}
case 10:
this.state.lineStart = this.state.pos;
++this.state.curLine;
return "";
default:
if (ch >= 48 && ch <= 55) {
var codePos = this.state.pos - 1;
var octalStr = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/)[0];
var octal = parseInt(octalStr, 8);
if (octal > 255) {
octalStr = octalStr.slice(0, -1);
octal = parseInt(octalStr, 8);
}
if (octal > 0) {
if (inTemplate) {
this.state.invalidTemplateEscapePosition = codePos;
return null;
} else if (this.state.strict) {
this.raise(codePos, "Octal literal in strict mode");
} else if (!this.state.containsOctal) {
this.state.containsOctal = true;
this.state.octalPosition = codePos;
}
}
this.state.pos += octalStr.length - 1;
return String.fromCharCode(octal);
}
return String.fromCharCode(ch);
}
};
_proto.readHexChar = function readHexChar(len, throwOnInvalid) {
var codePos = this.state.pos;
var n = this.readInt(16, len);
if (n === null) {
if (throwOnInvalid) {
this.raise(codePos, "Bad character escape sequence");
} else {
this.state.pos = codePos - 1;
this.state.invalidTemplateEscapePosition = codePos - 1;
}
}
return n;
};
_proto.readWord1 = function readWord1() {
this.state.containsEsc = false;
var word = "",
first = true,
chunkStart = this.state.pos;
while (this.state.pos < this.input.length) {
var ch = this.fullCharCodeAtPos();
if (isIdentifierChar(ch)) {
this.state.pos += ch <= 0xffff ? 1 : 2;
} else if (this.state.isIterator && ch === 64) {
this.state.pos += 1;
} else if (ch === 92) {
this.state.containsEsc = true;
word += this.input.slice(chunkStart, this.state.pos);
var escStart = this.state.pos;
if (this.input.charCodeAt(++this.state.pos) !== 117) {
this.raise(this.state.pos, "Expecting Unicode escape sequence \\uXXXX");
}
++this.state.pos;
var esc = this.readCodePoint(true);
if (!(first ? isIdentifierStart : isIdentifierChar)(esc, true)) {
this.raise(escStart, "Invalid Unicode escape");
}
word += codePointToString(esc);
chunkStart = this.state.pos;
} else {
break;
}
first = false;
}
return word + this.input.slice(chunkStart, this.state.pos);
};
_proto.isIterator = function isIterator(word) {
return word === "@@iterator" || word === "@@asyncIterator";
};
_proto.readWord = function readWord() {
var word = this.readWord1();
var type = types.name;
if (this.isKeyword(word)) {
if (this.state.containsEsc) {
this.raise(this.state.pos, "Escape sequence in keyword " + word);
}
type = keywords[word];
}
if (this.state.isIterator && (!this.isIterator(word) || !this.state.inType)) {
this.raise(this.state.pos, "Invalid identifier " + word);
}
this.finishToken(type, word);
};
_proto.braceIsBlock = function braceIsBlock(prevType) {
if (prevType === types.colon) {
var parent = this.curContext();
if (parent === types$1.braceStatement || parent === types$1.braceExpression) {
return !parent.isExpr;
}
}
if (prevType === types._return) {
return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
}
if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR) {
return true;
}
if (prevType === types.braceL) {
return this.curContext() === types$1.braceStatement;
}
if (prevType === types.relational) {
return true;
}
return !this.state.exprAllowed;
};
_proto.updateContext = function updateContext(prevType) {
var type = this.state.type;
var update;
if (type.keyword && (prevType === types.dot || prevType === types.questionDot)) {
this.state.exprAllowed = false;
} else if (update = type.updateContext) {
update.call(this, prevType);
} else {
this.state.exprAllowed = type.beforeExpr;
}
};
return Tokenizer;
}(LocationParser);
var UtilParser = function (_Tokenizer) {
_inheritsLoose(UtilParser, _Tokenizer);
function UtilParser() {
return _Tokenizer.apply(this, arguments) || this;
}
var _proto = UtilParser.prototype;
_proto.addExtra = function addExtra(node, key, val) {
if (!node) return;
var extra = node.extra = node.extra || {};
extra[key] = val;
};
_proto.isRelational = function isRelational(op) {
return this.match(types.relational) && this.state.value === op;
};
_proto.isLookaheadRelational = function isLookaheadRelational(op) {
var l = this.lookahead();
return l.type == types.relational && l.value == op;
};
_proto.expectRelational = function expectRelational(op) {
if (this.isRelational(op)) {
this.next();
} else {
this.unexpected(null, types.relational);
}
};
_proto.eatRelational = function eatRelational(op) {
if (this.isRelational(op)) {
this.next();
return true;
}
return false;
};
_proto.isContextual = function isContextual(name) {
return this.match(types.name) && this.state.value === name && !this.state.containsEsc;
};
_proto.isLookaheadContextual = function isLookaheadContextual(name) {
var l = this.lookahead();
return l.type === types.name && l.value === name;
};
_proto.eatContextual = function eatContextual(name) {
return this.isContextual(name) && this.eat(types.name);
};
_proto.expectContextual = function expectContextual(name, message) {
if (!this.eatContextual(name)) this.unexpected(null, message);
};
_proto.canInsertSemicolon = function canInsertSemicolon() {
return this.match(types.eof) || this.match(types.braceR) || this.hasPrecedingLineBreak();
};
_proto.hasPrecedingLineBreak = function hasPrecedingLineBreak() {
return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
};
_proto.isLineTerminator = function isLineTerminator() {
return this.eat(types.semi) || this.canInsertSemicolon();
};
_proto.semicolon = function semicolon() {
if (!this.isLineTerminator()) this.unexpected(null, types.semi);
};
_proto.expect = function expect(type, pos) {
this.eat(type) || this.unexpected(pos, type);
};
_proto.unexpected = function unexpected(pos, messageOrType) {
if (messageOrType === void 0) {
messageOrType = "Unexpected token";
}
if (typeof messageOrType !== "string") {
messageOrType = "Unexpected token, expected \"" + messageOrType.label + "\"";
}
throw this.raise(pos != null ? pos : this.state.start, messageOrType);
};
_proto.expectPlugin = function expectPlugin(name, pos) {
if (!this.hasPlugin(name)) {
throw this.raise(pos != null ? pos : this.state.start, "This experimental syntax requires enabling the parser plugin: '" + name + "'", {
missingPluginNames: [name]
});
}
return true;
};
_proto.expectOnePlugin = function expectOnePlugin(names, pos) {
var _this = this;
if (!names.some(function (n) {
return _this.hasPlugin(n);
})) {
throw this.raise(pos != null ? pos : this.state.start, "This experimental syntax requires enabling one of the following parser plugin(s): '" + names.join(", ") + "'", {
missingPluginNames: names
});
}
};
return UtilParser;
}(Tokenizer);
var commentKeys = ["leadingComments", "trailingComments", "innerComments"];
var Node = function () {
function Node(parser, pos, loc) {
this.type = "";
this.start = pos;
this.end = 0;
this.loc = new SourceLocation(loc);
if (parser && parser.options.ranges) this.range = [pos, 0];
if (parser && parser.filename) this.loc.filename = parser.filename;
}
var _proto = Node.prototype;
_proto.__clone = function __clone() {
var _this = this;
var node2 = new Node();
Object.keys(this).forEach(function (key) {
if (commentKeys.indexOf(key) < 0) {
node2[key] = _this[key];
}
});
return node2;
};
return Node;
}();
var NodeUtils = function (_UtilParser) {
_inheritsLoose(NodeUtils, _UtilParser);
function NodeUtils() {
return _UtilParser.apply(this, arguments) || this;
}
var _proto2 = NodeUtils.prototype;
_proto2.startNode = function startNode() {
return new Node(this, this.state.start, this.state.startLoc);
};
_proto2.startNodeAt = function startNodeAt(pos, loc) {
return new Node(this, pos, loc);
};
_proto2.startNodeAtNode = function startNodeAtNode(type) {
return this.startNodeAt(type.start, type.loc.start);
};
_proto2.finishNode = function finishNode(node, type) {
return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc);
};
_proto2.finishNodeAt = function finishNodeAt(node, type, pos, loc) {
node.type = type;
node.end = pos;
node.loc.end = loc;
if (this.options.ranges) node.range[1] = pos;
this.processComment(node);
return node;
};
_proto2.resetStartLocationFromNode = function resetStartLocationFromNode(node, locationNode) {
node.start = locationNode.start;
node.loc.start = locationNode.loc.start;
if (this.options.ranges) node.range[0] = locationNode.range[0];
};
return NodeUtils;
}(UtilParser);
var LValParser = function (_NodeUtils) {
_inheritsLoose(LValParser, _NodeUtils);
function LValParser() {
return _NodeUtils.apply(this, arguments) || this;
}
var _proto = LValParser.prototype;
_proto.toAssignable = function toAssignable(node, isBinding, contextDescription) {
if (node) {
switch (node.type) {
case "Identifier":
case "ObjectPattern":
case "ArrayPattern":
case "AssignmentPattern":
break;
case "ObjectExpression":
node.type = "ObjectPattern";
for (var index = 0; index < node.properties.length; index++) {
var prop = node.properties[index];
var isLast = index === node.properties.length - 1;
this.toAssignableObjectExpressionProp(prop, isBinding, isLast);
}
break;
case "ObjectProperty":
this.toAssignable(node.value, isBinding, contextDescription);
break;
case "SpreadElement":
{
this.checkToRestConversion(node);
node.type = "RestElement";
var arg = node.argument;
this.toAssignable(arg, isBinding, contextDescription);
break;
}
case "ArrayExpression":
node.type = "ArrayPattern";
this.toAssignableList(node.elements, isBinding, contextDescription);
break;
case "AssignmentExpression":
if (node.operator === "=") {
node.type = "AssignmentPattern";
delete node.operator;
} else {
this.raise(node.left.end, "Only '=' operator can be used for specifying default value.");
}
break;
case "MemberExpression":
if (!isBinding) break;
default:
{
var message = "Invalid left-hand side" + (contextDescription ? " in " + contextDescription : "expression");
this.raise(node.start, message);
}
}
}
return node;
};
_proto.toAssignableObjectExpressionProp = function toAssignableObjectExpressionProp(prop, isBinding, isLast) {
if (prop.type === "ObjectMethod") {
var error = prop.kind === "get" || prop.kind === "set" ? "Object pattern can't contain getter or setter" : "Object pattern can't contain methods";
this.raise(prop.key.start, error);
} else if (prop.type === "SpreadElement" && !isLast) {
this.raise(prop.start, "The rest element has to be the last element when destructuring");
} else {
this.toAssignable(prop, isBinding, "object destructuring pattern");
}
};
_proto.toAssignableList = function toAssignableList(exprList, isBinding, contextDescription) {
var end = exprList.length;
if (end) {
var last = exprList[end - 1];
if (last && last.type === "RestElement") {
--end;
} else if (last && last.type === "SpreadElement") {
last.type = "RestElement";
var arg = last.argument;
this.toAssignable(arg, isBinding, contextDescription);
if (["Identifier", "MemberExpression", "ArrayPattern", "ObjectPattern"].indexOf(arg.type) === -1) {
this.unexpected(arg.start);
}
--end;
}
}
for (var i = 0; i < end; i++) {
var elt = exprList[i];
if (elt && elt.type === "SpreadElement") {
this.raise(elt.start, "The rest element has to be the last element when destructuring");
}
if (elt) this.toAssignable(elt, isBinding, contextDescription);
}
return exprList;
};
_proto.toReferencedList = function toReferencedList(exprList) {
return exprList;
};
_proto.parseSpread = function parseSpread(refShorthandDefaultPos, refNeedsArrowPos) {
var node = this.startNode();
this.next();
node.argument = this.parseMaybeAssign(false, refShorthandDefaultPos, undefined, refNeedsArrowPos);
return this.finishNode(node, "SpreadElement");
};
_proto.parseRest = function parseRest() {
var node = this.startNode();
this.next();
node.argument = this.parseBindingAtom();
return this.finishNode(node, "RestElement");
};
_proto.shouldAllowYieldIdentifier = function shouldAllowYieldIdentifier() {
return this.match(types._yield) && !this.state.strict && !this.state.inGenerator;
};
_proto.parseBindingIdentifier = function parseBindingIdentifier() {
return this.parseIdentifier(this.shouldAllowYieldIdentifier());
};
_proto.parseBindingAtom = function parseBindingAtom() {
switch (this.state.type) {
case types._yield:
case types.name:
return this.parseBindingIdentifier();
case types.bracketL:
{
var node = this.startNode();
this.next();
node.elements = this.parseBindingList(types.bracketR, true);
return this.finishNode(node, "ArrayPattern");
}
case types.braceL:
return this.parseObj(true);
default:
throw this.unexpected();
}
};
_proto.parseBindingList = function parseBindingList(close, allowEmpty, allowModifiers) {
var elts = [];
var first = true;
while (!this.eat(close)) {
if (first) {
first = false;
} else {
this.expect(types.comma);
}
if (allowEmpty && this.match(types.comma)) {
elts.push(null);
} else if (this.eat(close)) {
break;
} else if (this.match(types.ellipsis)) {
elts.push(this.parseAssignableListItemTypes(this.parseRest()));
this.expect(close);
break;
} else {
var decorators = [];
if (this.match(types.at) && this.hasPlugin("decorators")) {
this.raise(this.state.start, "Stage 2 decorators cannot be used to decorate parameters");
}
while (this.match(types.at)) {
decorators.push(this.parseDecorator());
}
elts.push(this.parseAssignableListItem(allowModifiers, decorators));
}
}
return elts;
};
_proto.parseAssignableListItem = function parseAssignableListItem(allowModifiers, decorators) {
var left = this.parseMaybeDefault();
this.parseAssignableListItemTypes(left);
var elt = this.parseMaybeDefault(left.start, left.loc.start, left);
if (decorators.length) {
left.decorators = decorators;
}
return elt;
};
_proto.parseAssignableListItemTypes = function parseAssignableListItemTypes(param) {
return param;
};
_proto.parseMaybeDefault = function parseMaybeDefault(startPos, startLoc, left) {
startLoc = startLoc || this.state.startLoc;
startPos = startPos || this.state.start;
left = left || this.parseBindingAtom();
if (!this.eat(types.eq)) return left;
var node = this.startNodeAt(startPos, startLoc);
node.left = left;
node.right = this.parseMaybeAssign();
return this.finishNode(node, "AssignmentPattern");
};
_proto.checkLVal = function checkLVal(expr, isBinding, checkClashes, contextDescription) {
switch (expr.type) {
case "Identifier":
this.checkReservedWord(expr.name, expr.start, false, true);
if (checkClashes) {
var _key = "_" + expr.name;
if (checkClashes[_key]) {
this.raise(expr.start, "Argument name clash in strict mode");
} else {
checkClashes[_key] = true;
}
}
break;
case "MemberExpression":
if (isBinding) this.raise(expr.start, "Binding member expression");
break;
case "ObjectPattern":
for (var _i2 = 0, _expr$properties2 = expr.properties; _i2 < _expr$properties2.length; _i2++) {
var prop = _expr$properties2[_i2];
if (prop.type === "ObjectProperty") prop = prop.value;
this.checkLVal(prop, isBinding, checkClashes, "object destructuring pattern");
}
break;
case "ArrayPattern":
for (var _i4 = 0, _expr$elements2 = expr.elements; _i4 < _expr$elements2.length; _i4++) {
var elem = _expr$elements2[_i4];
if (elem) {
this.checkLVal(elem, isBinding, checkClashes, "array destructuring pattern");
}
}
break;
case "AssignmentPattern":
this.checkLVal(expr.left, isBinding, checkClashes, "assignment pattern");
break;
case "RestElement":
this.checkLVal(expr.argument, isBinding, checkClashes, "rest element");
break;
default:
{
var message = (isBinding ? "Binding invalid" : "Invalid") + " left-hand side" + (contextDescription ? " in " + contextDescription : "expression");
this.raise(expr.start, message);
}
}
};
_proto.checkToRestConversion = function checkToRestConversion(node) {
var validArgumentTypes = ["Identifier", "MemberExpression"];
if (validArgumentTypes.indexOf(node.argument.type) !== -1) {
return;
}
this.raise(node.argument.start, "Invalid rest operator's argument");
};
return LValParser;
}(NodeUtils);
var ExpressionParser = function (_LValParser) {
_inheritsLoose(ExpressionParser, _LValParser);
function ExpressionParser() {
return _LValParser.apply(this, arguments) || this;
}
var _proto = ExpressionParser.prototype;
_proto.checkPropClash = function checkPropClash(prop, propHash) {
if (prop.computed || prop.kind) return;
var key = prop.key;
var name = key.type === "Identifier" ? key.name : String(key.value);
if (name === "__proto__") {
if (propHash.proto) {
this.raise(key.start, "Redefinition of __proto__ property");
}
propHash.proto = true;
}
};
_proto.getExpression = function getExpression() {
this.nextToken();
var expr = this.parseExpression();
if (!this.match(types.eof)) {
this.unexpected();
}
expr.comments = this.state.comments;
return expr;
};
_proto.parseExpression = function parseExpression(noIn, refShorthandDefaultPos) {
var startPos = this.state.start;
var startLoc = this.state.startLoc;
var expr = this.parseMaybeAssign(noIn, refShorthandDefaultPos);
if (this.match(types.comma)) {
var _node = this.startNodeAt(startPos, startLoc);
_node.expressions = [expr];
while (this.eat(types.comma)) {
_node.expressions.push(this.parseMaybeAssign(noIn, refShorthandDefaultPos));
}
this.toReferencedList(_node.expressions);
return this.finishNode(_node, "SequenceExpression");
}
return expr;
};
_proto.parseMaybeAssign = function parseMaybeAssign(noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) {
var startPos = this.state.start;
var startLoc = this.state.startLoc;
if (this.match(types._yield) && this.state.inGenerator) {
var _left = this.parseYield();
if (afterLeftParse) {
_left = afterLeftParse.call(this, _left, startPos, startLoc);
}
return _left;
}
var failOnShorthandAssign;
if (refShorthandDefaultPos) {
failOnShorthandAssign = false;
} else {
refShorthandDefaultPos = {
start: 0
};
failOnShorthandAssign = true;
}
if (this.match(types.parenL) || this.match(types.name) || this.match(types._yield)) {
this.state.potentialArrowAt = this.state.start;
}
var left = this.parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos);
if (afterLeftParse) {
left = afterLeftParse.call(this, left, startPos, startLoc);
}
if (this.state.type.isAssign) {
var _node2 = this.startNodeAt(startPos, startLoc);
var operator = this.state.value;
_node2.operator = operator;
if (operator === "??=") {
this.expectPlugin("nullishCoalescingOperator");
this.expectPlugin("logicalAssignment");
}
if (operator === "||=" || operator === "&&=") {
this.expectPlugin("logicalAssignment");
}
_node2.left = this.match(types.eq) ? this.toAssignable(left, undefined, "assignment expression") : left;
refShorthandDefaultPos.start = 0;
this.checkLVal(left, undefined, undefined, "assignment expression");
if (left.extra && left.extra.parenthesized) {
var errorMsg;
if (left.type === "ObjectPattern") {
errorMsg = "`({a}) = 0` use `({a} = 0)`";
} else if (left.type === "ArrayPattern") {
errorMsg = "`([a]) = 0` use `([a] = 0)`";
}
if (errorMsg) {
this.raise(left.start, "You're trying to assign to a parenthesized expression, eg. instead of " + errorMsg);
}
}
this.next();
_node2.right = this.parseMaybeAssign(noIn);
return this.finishNode(_node2, "AssignmentExpression");
} else if (failOnShorthandAssign && refShorthandDefaultPos.start) {
this.unexpected(refShorthandDefaultPos.start);
}
return left;
};
_proto.parseMaybeConditional = function parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos) {
var startPos = this.state.start;
var startLoc = this.state.startLoc;
var potentialArrowAt = this.state.potentialArrowAt;
var expr = this.parseExprOps(noIn, refShorthandDefaultPos);
if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
return expr;
}
if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr;
return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos);
};
_proto.parseConditional = function parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) {
if (this.eat(types.question)) {
var _node3 = this.startNodeAt(startPos, startLoc);
_node3.test = expr;
_node3.consequent = this.parseMaybeAssign();
this.expect(types.colon);
_node3.alternate = this.parseMaybeAssign(noIn);
return this.finishNode(_node3, "ConditionalExpression");
}
return expr;
};
_proto.parseExprOps = function parseExprOps(noIn, refShorthandDefaultPos) {
var startPos = this.state.start;
var startLoc = this.state.startLoc;
var potentialArrowAt = this.state.potentialArrowAt;
var expr = this.parseMaybeUnary(refShorthandDefaultPos);
if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
return expr;
}
if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
return expr;
}
return this.parseExprOp(expr, startPos, startLoc, -1, noIn);
};
_proto.parseExprOp = function parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) {
var prec = this.state.type.binop;
if (prec != null && (!noIn || !this.match(types._in))) {
if (prec > minPrec) {
var _node4 = this.startNodeAt(leftStartPos, leftStartLoc);
var operator = this.state.value;
_node4.left = left;
_node4.operator = operator;
if (operator === "**" && left.type === "UnaryExpression" && !(left.extra && left.extra.parenthesized)) {
this.raise(left.argument.start, "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.");
}
var op = this.state.type;
if (op === types.nullishCoalescing) {
this.expectPlugin("nullishCoalescingOperator");
} else if (op === types.pipeline) {
this.expectPlugin("pipelineOperator");
}
this.next();
var startPos = this.state.start;
var startLoc = this.state.startLoc;
if (op === types.pipeline) {
if (this.match(types.name) && this.state.value === "await" && this.state.inAsync) {
throw this.raise(this.state.start, "Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal");
}
}
_node4.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec, noIn);
this.finishNode(_node4, op === types.logicalOR || op === types.logicalAND || op === types.nullishCoalescing ? "LogicalExpression" : "BinaryExpression");
return this.parseExprOp(_node4, leftStartPos, leftStartLoc, minPrec, noIn);
}
}
return left;
};
_proto.parseMaybeUnary = function parseMaybeUnary(refShorthandDefaultPos) {
if (this.state.type.prefix) {
var _node5 = this.startNode();
var update = this.match(types.incDec);
_node5.operator = this.state.value;
_node5.prefix = true;
if (_node5.operator === "throw") {
this.expectPlugin("throwExpressions");
}
this.next();
_node5.argument = this.parseMaybeUnary();
if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
this.unexpected(refShorthandDefaultPos.start);
}
if (update) {
this.checkLVal(_node5.argument, undefined, undefined, "prefix operation");
} else if (this.state.strict && _node5.operator === "delete") {
var arg = _node5.argument;
if (arg.type === "Identifier") {
this.raise(_node5.start, "Deleting local variable in strict mode");
} else if (arg.type === "MemberExpression" && arg.property.type === "PrivateName") {
this.raise(_node5.start, "Deleting a private field is not allowed");
}
}
return this.finishNode(_node5, update ? "UpdateExpression" : "UnaryExpression");
}
var startPos = this.state.start;
var startLoc = this.state.startLoc;
var expr = this.parseExprSubscripts(refShorthandDefaultPos);
if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr;
while (this.state.type.postfix && !this.canInsertSemicolon()) {
var _node6 = this.startNodeAt(startPos, startLoc);
_node6.operator = this.state.value;
_node6.prefix = false;
_node6.argument = expr;
this.checkLVal(expr, undefined, undefined, "postfix operation");
this.next();
expr = this.finishNode(_node6, "UpdateExpression");
}
return expr;
};
_proto.parseExprSubscripts = function parseExprSubscripts(refShorthandDefaultPos) {
var startPos = this.state.start;
var startLoc = this.state.startLoc;
var potentialArrowAt = this.state.potentialArrowAt;
var expr = this.parseExprAtom(refShorthandDefaultPos);
if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
return expr;
}
if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
return expr;
}
return this.parseSubscripts(expr, startPos, startLoc);
};
_proto.parseSubscripts = function parseSubscripts(base, startPos, startLoc, noCalls) {
var state = {
optionalChainMember: false,
stop: false
};
do {
base = this.parseSubscript(base, startPos, startLoc, noCalls, state);
} while (!state.stop);
return base;
};
_proto.parseSubscript = function parseSubscript(base, startPos, startLoc, noCalls, state) {
if (!noCalls && this.eat(types.doubleColon)) {
var _node7 = this.startNodeAt(startPos, startLoc);
_node7.object = base;
_node7.callee = this.parseNoCallExpr();
state.stop = true;
return this.parseSubscripts(this.finishNode(_node7, "BindExpression"), startPos, startLoc, noCalls);
} else if (this.match(types.questionDot)) {
this.expectPlugin("optionalChaining");
state.optionalChainMember = true;
if (noCalls && this.lookahead().type == types.parenL) {
state.stop = true;
return base;
}
this.next();
var _node8 = this.startNodeAt(startPos, startLoc);
if (this.eat(types.bracketL)) {
_node8.object = base;
_node8.property = this.parseExpression();
_node8.computed = true;
_node8.optional = true;
this.expect(types.bracketR);
return this.finishNode(_node8, "OptionalMemberExpression");
} else if (this.eat(types.parenL)) {
var possibleAsync = this.atPossibleAsync(base);
_node8.callee = base;
_node8.arguments = this.parseCallExpressionArguments(types.parenR, possibleAsync);
_node8.optional = true;
return this.finishNode(_node8, "OptionalCallExpression");
} else {
_node8.object = base;
_node8.property = this.parseIdentifier(true);
_node8.computed = false;
_node8.optional = true;
return this.finishNode(_node8, "OptionalMemberExpression");
}
} else if (this.eat(types.dot)) {
var _node9 = this.startNodeAt(startPos, startLoc);
_node9.object = base;
_node9.property = this.parseMaybePrivateName();
_node9.computed = false;
if (state.optionalChainMember) {
_node9.optional = false;
return this.finishNode(_node9, "OptionalMemberExpression");
}
return this.finishNode(_node9, "MemberExpression");
} else if (this.eat(types.bracketL)) {
var _node10 = this.startNodeAt(startPos, startLoc);
_node10.object = base;
_node10.property = this.parseExpression();
_node10.computed = true;
this.expect(types.bracketR);
if (state.optionalChainMember) {
_node10.optional = false;
return this.finishNode(_node10, "OptionalMemberExpression");
}
return this.finishNode(_node10, "MemberExpression");
} else if (!noCalls && this.match(types.parenL)) {
var _possibleAsync = this.atPossibleAsync(base);
this.next();
var _node11 = this.startNodeAt(startPos, startLoc);
_node11.callee = base;
var refTrailingCommaPos = {
start: -1
};
_node11.arguments = this.parseCallExpressionArguments(types.parenR, _possibleAsync, refTrailingCommaPos);
if (!state.optionalChainMember) {
this.finishCallExpression(_node11);
} else {
this.finishOptionalCallExpression(_node11);
}
if (_possibleAsync && this.shouldParseAsyncArrow()) {
state.stop = true;
if (refTrailingCommaPos.start > -1) {
this.raise(refTrailingCommaPos.start, "A trailing comma is not permitted after the rest element");
}
return this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), _node11);
} else {
this.toReferencedList(_node11.arguments);
}
return _node11;
} else if (this.match(types.backQuote)) {
var _node12 = this.startNodeAt(startPos, startLoc);
_node12.tag = base;
_node12.quasi = this.parseTemplate(true);
if (state.optionalChainMember) {
this.raise(startPos, "Tagged Template Literals are not allowed in optionalChain");
}
return this.finishNode(_node12, "TaggedTemplateExpression");
} else {
state.stop = true;
return base;
}
};
_proto.atPossibleAsync = function atPossibleAsync(base) {
return !this.state.containsEsc && this.state.potentialArrowAt === base.start && base.type === "Identifier" && base.name === "async" && !this.canInsertSemicolon();
};
_proto.finishCallExpression = function finishCallExpression(node) {
if (node.callee.type === "Import") {
if (node.arguments.length !== 1) {
this.raise(node.start, "import() requires exactly one argument");
}
var importArg = node.arguments[0];
if (importArg && importArg.type === "SpreadElement") {
this.raise(importArg.start, "... is not allowed in import()");
}
}
return this.finishNode(node, "CallExpression");
};
_proto.finishOptionalCallExpression = function finishOptionalCallExpression(node) {
if (node.callee.type === "Import") {
if (node.arguments.length !== 1) {
this.raise(node.start, "import() requires exactly one argument");
}
var importArg = node.arguments[0];
if (importArg && importArg.type === "SpreadElement") {
this.raise(importArg.start, "... is not allowed in import()");
}
}
return this.finishNode(node, "OptionalCallExpression");
};
_proto.parseCallExpressionArguments = function parseCallExpressionArguments(close, possibleAsyncArrow, refTrailingCommaPos) {
var elts = [];
var innerParenStart;
var first = true;
while (!this.eat(close)) {
if (first) {
first = false;
} else {
this.expect(types.comma);
if (this.eat(close)) break;
}
if (this.match(types.parenL) && !innerParenStart) {
innerParenStart = this.state.start;
}
elts.push(this.parseExprListItem(false, possibleAsyncArrow ? {
start: 0
} : undefined, possibleAsyncArrow ? {
start: 0
} : undefined, possibleAsyncArrow ? refTrailingCommaPos : undefined));
}
if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) {
this.unexpected();
}
return elts;
};
_proto.shouldParseAsyncArrow = function shouldParseAsyncArrow() {
return this.match(types.arrow);
};
_proto.parseAsyncArrowFromCallExpression = function parseAsyncArrowFromCallExpression(node, call) {
var oldYield = this.state.yieldInPossibleArrowParameters;
this.state.yieldInPossibleArrowParameters = null;
this.expect(types.arrow);
this.parseArrowExpression(node, call.arguments, true);
this.state.yieldInPossibleArrowParameters = oldYield;
return node;
};
_proto.parseNoCallExpr = function parseNoCallExpr() {
var startPos = this.state.start;
var startLoc = this.state.startLoc;
return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
};
_proto.parseExprAtom = function parseExprAtom(refShorthandDefaultPos) {
var canBeArrow = this.state.potentialArrowAt === this.state.start;
var node;
switch (this.state.type) {
case types._super:
if (!this.state.inMethod && !this.state.inClassProperty && !this.options.allowSuperOutsideMethod) {
this.raise(this.state.start, "super is only allowed in object methods and classes");
}
node = this.startNode();
this.next();
if (!this.match(types.parenL) && !this.match(types.bracketL) && !this.match(types.dot)) {
this.unexpected();
}
if (this.match(types.parenL) && this.state.inMethod !== "constructor" && !this.options.allowSuperOutsideMethod) {
this.raise(node.start, "super() is only valid inside a class constructor. " + "Make sure the method name is spelled exactly as 'constructor'.");
}
return this.finishNode(node, "Super");
case types._import:
if (this.lookahead().type === types.dot) {
return this.parseImportMetaProperty();
}
this.expectPlugin("dynamicImport");
node = this.startNode();
this.next();
if (!this.match(types.parenL)) {
this.unexpected(null, types.parenL);
}
return this.finishNode(node, "Import");
case types._this:
node = this.startNode();
this.next();
return this.finishNode(node, "ThisExpression");
case types._yield:
if (this.state.inGenerator) this.unexpected();
case types.name:
{
node = this.startNode();
var allowAwait = this.state.value === "await" && (this.state.inAsync || !this.state.inFunction && this.options.allowAwaitOutsideFunction);
var containsEsc = this.state.containsEsc;
var allowYield = this.shouldAllowYieldIdentifier();
var id = this.parseIdentifier(allowAwait || allowYield);
if (id.name === "await") {
if (this.state.inAsync || this.inModule || !this.state.inFunction && this.options.allowAwaitOutsideFunction) {
return this.parseAwait(node);
}
} else if (!containsEsc && id.name === "async" && this.match(types._function) && !this.canInsertSemicolon()) {
this.next();
return this.parseFunction(node, false, false, true);
} else if (canBeArrow && id.name === "async" && this.match(types.name)) {
var oldYield = this.state.yieldInPossibleArrowParameters;
this.state.yieldInPossibleArrowParameters = null;
var params = [this.parseIdentifier()];
this.expect(types.arrow);
this.parseArrowExpression(node, params, true);
this.state.yieldInPossibleArrowParameters = oldYield;
return node;
}
if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) {
var _oldYield = this.state.yieldInPossibleArrowParameters;
this.state.yieldInPossibleArrowParameters = null;
this.parseArrowExpression(node, [id]);
this.state.yieldInPossibleArrowParameters = _oldYield;
return node;
}
return id;
}
case types._do:
{
this.expectPlugin("doExpressions");
var _node13 = this.startNode();
this.next();
var oldInFunction = this.state.inFunction;
var oldLabels = this.state.labels;
this.state.labels = [];
this.state.inFunction = false;
_node13.body = this.parseBlock(false);
this.state.inFunction = oldInFunction;
this.state.labels = oldLabels;
return this.finishNode(_node13, "DoExpression");
}
case types.regexp:
{
var value = this.state.value;
node = this.parseLiteral(value.value, "RegExpLiteral");
node.pattern = value.pattern;
node.flags = value.flags;
return node;
}
case types.num:
return this.parseLiteral(this.state.value, "NumericLiteral");
case types.bigint:
return this.parseLiteral(this.state.value, "BigIntLiteral");
case types.string:
return this.parseLiteral(this.state.value, "StringLiteral");
case types._null:
node = this.startNode();
this.next();
return this.finishNode(node, "NullLiteral");
case types._true:
case types._false:
return this.parseBooleanLiteral();
case types.parenL:
return this.parseParenAndDistinguishExpression(canBeArrow);
case types.bracketL:
node = this.startNode();
this.next();
node.elements = this.parseExprList(types.bracketR, true, refShorthandDefaultPos);
this.toReferencedList(node.elements);
return this.finishNode(node, "ArrayExpression");
case types.braceL:
return this.parseObj(false, refShorthandDefaultPos);
case types._function:
return this.parseFunctionExpression();
case types.at:
this.parseDecorators();
case types._class:
node = this.startNode();
this.takeDecorators(node);
return this.parseClass(node, false);
case types._new:
return this.parseNew();
case types.backQuote:
return this.parseTemplate(false);
case types.doubleColon:
{
node = this.startNode();
this.next();
node.object = null;
var callee = node.callee = this.parseNoCallExpr();
if (callee.type === "MemberExpression") {
return this.finishNode(node, "BindExpression");
} else {
throw this.raise(callee.start, "Binding should be performed on object property.");
}
}
default:
throw this.unexpected();
}
};
_proto.parseBooleanLiteral = function parseBooleanLiteral() {
var node = this.startNode();
node.value = this.match(types._true);
this.next();
return this.finishNode(node, "BooleanLiteral");
};
_proto.parseMaybePrivateName = function parseMaybePrivateName() {
var isPrivate = this.match(types.hash);
if (isPrivate) {
this.expectOnePlugin(["classPrivateProperties", "classPrivateMethods"]);
var _node14 = this.startNode();
this.next();
_node14.id = this.parseIdentifier(true);
return this.finishNode(_node14, "PrivateName");
} else {
return this.parseIdentifier(true);
}
};
_proto.parseFunctionExpression = function parseFunctionExpression() {
var node = this.startNode();
var meta = this.parseIdentifier(true);
if (this.state.inGenerator && this.eat(types.dot)) {
return this.parseMetaProperty(node, meta, "sent");
}
return this.parseFunction(node, false);
};
_proto.parseMetaProperty = function parseMetaProperty(node, meta, propertyName) {
node.meta = meta;
if (meta.name === "function" && propertyName === "sent") {
if (this.isContextual(propertyName)) {
this.expectPlugin("functionSent");
} else if (!this.hasPlugin("functionSent")) {
this.unexpected();
}
}
var containsEsc = this.state.containsEsc;
node.property = this.parseIdentifier(true);
if (node.property.name !== propertyName || containsEsc) {
this.raise(node.property.start, "The only valid meta property for " + meta.name + " is " + meta.name + "." + propertyName);
}
return this.finishNode(node, "MetaProperty");
};
_proto.parseImportMetaProperty = function parseImportMetaProperty() {
var node = this.startNode();
var id = this.parseIdentifier(true);
this.expect(types.dot);
if (id.name === "import") {
if (this.isContextual("meta")) {
this.expectPlugin("importMeta");
} else if (!this.hasPlugin("importMeta")) {
this.raise(id.start, "Dynamic imports require a parameter: import('a.js').then");
}
}
if (!this.inModule) {
this.raise(id.start, "import.meta may appear only with 'sourceType: \"module\"'", {
code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
});
}
this.sawUnambiguousESM = true;
return this.parseMetaProperty(node, id, "meta");
};
_proto.parseLiteral = function parseLiteral(value, type, startPos, startLoc) {
startPos = startPos || this.state.start;
startLoc = startLoc || this.state.startLoc;
var node = this.startNodeAt(startPos, startLoc);
this.addExtra(node, "rawValue", value);
this.addExtra(node, "raw", this.input.slice(startPos, this.state.end));
node.value = value;
this.next();
return this.finishNode(node, type);
};
_proto.parseParenExpression = function parseParenExpression() {
this.expect(types.parenL);
var val = this.parseExpression();
this.expect(types.parenR);
return val;
};
_proto.parseParenAndDistinguishExpression = function parseParenAndDistinguishExpression(canBeArrow) {
var startPos = this.state.start;
var startLoc = this.state.startLoc;
var val;
this.expect(types.parenL);
var oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
var oldYield = this.state.yieldInPossibleArrowParameters;
this.state.maybeInArrowParameters = true;
this.state.yieldInPossibleArrowParameters = null;
var innerStartPos = this.state.start;
var innerStartLoc = this.state.startLoc;
var exprList = [];
var refShorthandDefaultPos = {
start: 0
};
var refNeedsArrowPos = {
start: 0
};
var first = true;
var spreadStart;
var optionalCommaStart;
while (!this.match(types.parenR)) {
if (first) {
first = false;
} else {
this.expect(types.comma, refNeedsArrowPos.start || null);
if (this.match(types.parenR)) {
optionalCommaStart = this.state.start;
break;
}
}
if (this.match(types.ellipsis)) {
var spreadNodeStartPos = this.state.start;
var spreadNodeStartLoc = this.state.startLoc;
spreadStart = this.state.start;
exprList.push(this.parseParenItem(this.parseRest(), spreadNodeStartPos, spreadNodeStartLoc));
if (this.match(types.comma) && this.lookahead().type === types.parenR) {
this.raise(this.state.start, "A trailing comma is not permitted after the rest element");
}
break;
} else {
exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos));
}
}
var innerEndPos = this.state.start;
var innerEndLoc = this.state.startLoc;
this.expect(types.parenR);
this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
var arrowNode = this.startNodeAt(startPos, startLoc);
if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) {
for (var _i2 = 0; _i2 < exprList.length; _i2++) {
var param = exprList[_i2];
if (param.extra && param.extra.parenthesized) {
this.unexpected(param.extra.parenStart);
}
}
this.parseArrowExpression(arrowNode, exprList);
this.state.yieldInPossibleArrowParameters = oldYield;
return arrowNode;
}
this.state.yieldInPossibleArrowParameters = oldYield;
if (!exprList.length) {
this.unexpected(this.state.lastTokStart);
}
if (optionalCommaStart) this.unexpected(optionalCommaStart);
if (spreadStart) this.unexpected(spreadStart);
if (refShorthandDefaultPos.start) {
this.unexpected(refShorthandDefaultPos.start);
}
if (refNeedsArrowPos.start) this.unexpected(refNeedsArrowPos.start);
if (exprList.length > 1) {
val = this.startNodeAt(innerStartPos, innerStartLoc);
val.expressions = exprList;
this.toReferencedList(val.expressions);
this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
} else {
val = exprList[0];
}
this.addExtra(val, "parenthesized", true);
this.addExtra(val, "parenStart", startPos);
return val;
};
_proto.shouldParseArrow = function shouldParseArrow() {
return !this.canInsertSemicolon();
};
_proto.parseArrow = function parseArrow(node) {
if (this.eat(types.arrow)) {
return node;
}
};
_proto.parseParenItem = function parseParenItem(node, startPos, startLoc) {
return node;
};
_proto.parseNew = function parseNew() {
var node = this.startNode();
var meta = this.parseIdentifier(true);
if (this.eat(types.dot)) {
var metaProp = this.parseMetaProperty(node, meta, "target");
if (!this.state.inFunction && !this.state.inClassProperty) {
var error = "new.target can only be used in functions";
if (this.hasPlugin("classProperties")) {
error += " or class properties";
}
this.raise(metaProp.start, error);
}
return metaProp;
}
node.callee = this.parseNoCallExpr();
if (node.callee.type === "OptionalMemberExpression" || node.callee.type === "OptionalCallExpression") {
this.raise(this.state.lastTokEnd, "constructors in/after an Optional Chain are not allowed");
}
if (this.eat(types.questionDot)) {
this.raise(this.state.start, "constructors in/after an Optional Chain are not allowed");
}
this.parseNewArguments(node);
return this.finishNode(node, "NewExpression");
};
_proto.parseNewArguments = function parseNewArguments(node) {
if (this.eat(types.parenL)) {
var args = this.parseExprList(types.parenR);
this.toReferencedList(args);
node.arguments = args;
} else {
node.arguments = [];
}
};
_proto.parseTemplateElement = function parseTemplateElement(isTagged) {
var elem = this.startNode();
if (this.state.value === null) {
if (!isTagged) {
this.raise(this.state.invalidTemplateEscapePosition || 0, "Invalid escape sequence in template");
} else {
this.state.invalidTemplateEscapePosition = null;
}
}
elem.value = {
raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"),
cooked: this.state.value
};
this.next();
elem.tail = this.match(types.backQuote);
return this.finishNode(elem, "TemplateElement");
};
_proto.parseTemplate = function parseTemplate(isTagged) {
var node = this.startNode();
this.next();
node.expressions = [];
var curElt = this.parseTemplateElement(isTagged);
node.quasis = [curElt];
while (!curElt.tail) {
this.expect(types.dollarBraceL);
node.expressions.push(this.parseExpression());
this.expect(types.braceR);
node.quasis.push(curElt = this.parseTemplateElement(isTagged));
}
this.next();
return this.finishNode(node, "TemplateLiteral");
};
_proto.parseObj = function parseObj(isPattern, refShorthandDefaultPos) {
var decorators = [];
var propHash = Object.create(null);
var first = true;
var node = this.startNode();
node.properties = [];
this.next();
var firstRestLocation = null;
while (!this.eat(types.braceR)) {
if (first) {
first = false;
} else {
this.expect(types.comma);
if (this.eat(types.braceR)) break;
}
if (this.match(types.at)) {
if (this.hasPlugin("decorators")) {
this.raise(this.state.start, "Stage 2 decorators disallow object literal property decorators");
} else {
while (this.match(types.at)) {
decorators.push(this.parseDecorator());
}
}
}
var prop = this.startNode(),
isGenerator = false,
_isAsync = false,
startPos = void 0,
startLoc = void 0;
if (decorators.length) {
prop.decorators = decorators;
decorators = [];
}
if (this.match(types.ellipsis)) {
this.expectPlugin("objectRestSpread");
prop = this.parseSpread(isPattern ? {
start: 0
} : undefined);
if (isPattern) {
this.toAssignable(prop, true, "object pattern");
}
node.properties.push(prop);
if (isPattern) {
var position = this.state.start;
if (firstRestLocation !== null) {
this.unexpected(firstRestLocation, "Cannot have multiple rest elements when destructuring");
} else if (this.eat(types.braceR)) {
break;
} else if (this.match(types.comma) && this.lookahead().type === types.braceR) {
this.unexpected(position, "A trailing comma is not permitted after the rest element");
} else {
firstRestLocation = position;
continue;
}
} else {
continue;
}
}
prop.method = false;
if (isPattern || refShorthandDefaultPos) {
startPos = this.state.start;
startLoc = this.state.startLoc;
}
if (!isPattern) {
isGenerator = this.eat(types.star);
}
var containsEsc = this.state.containsEsc;
if (!isPattern && this.isContextual("async")) {
if (isGenerator) this.unexpected();
var asyncId = this.parseIdentifier();
if (this.match(types.colon) || this.match(types.parenL) || this.match(types.braceR) || this.match(types.eq) || this.match(types.comma)) {
prop.key = asyncId;
prop.computed = false;
} else {
_isAsync = true;
if (this.match(types.star)) {
this.expectPlugin("asyncGenerators");
this.next();
isGenerator = true;
}
this.parsePropertyName(prop);
}
} else {
this.parsePropertyName(prop);
}
this.parseObjPropValue(prop, startPos, startLoc, isGenerator, _isAsync, isPattern, refShorthandDefaultPos, containsEsc);
this.checkPropClash(prop, propHash);
if (prop.shorthand) {
this.addExtra(prop, "shorthand", true);
}
node.properties.push(prop);
}
if (firstRestLocation !== null) {
this.unexpected(firstRestLocation, "The rest element has to be the last element when destructuring");
}
if (decorators.length) {
this.raise(this.state.start, "You have trailing decorators with no property");
}
return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression");
};
_proto.isGetterOrSetterMethod = function isGetterOrSetterMethod(prop, isPattern) {
return !isPattern && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.match(types.string) || this.match(types.num) || this.match(types.bracketL) || this.match(types.name) || !!this.state.type.keyword);
};
_proto.checkGetterSetterParams = function checkGetterSetterParams(method) {
var paramCount = method.kind === "get" ? 0 : 1;
var start = method.start;
if (method.params.length !== paramCount) {
if (method.kind === "get") {
this.raise(start, "getter must not have any formal parameters");
} else {
this.raise(start, "setter must have exactly one formal parameter");
}
}
if (method.kind === "set" && method.params[0].type === "RestElement") {
this.raise(start, "setter function argument must not be a rest parameter");
}
};
_proto.parseObjectMethod = function parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) {
if (isAsync || isGenerator || this.match(types.parenL)) {
if (isPattern) this.unexpected();
prop.kind = "method";
prop.method = true;
return this.parseMethod(prop, isGenerator, isAsync, false, "ObjectMethod");
}
if (!containsEsc && this.isGetterOrSetterMethod(prop, isPattern)) {
if (isGenerator || isAsync) this.unexpected();
prop.kind = prop.key.name;
this.parsePropertyName(prop);
this.parseMethod(prop, false, false, false, "ObjectMethod");
this.checkGetterSetterParams(prop);
return prop;
}
};
_proto.parseObjectProperty = function parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos) {
prop.shorthand = false;
if (this.eat(types.colon)) {
prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos);
return this.finishNode(prop, "ObjectProperty");
}
if (!prop.computed && prop.key.type === "Identifier") {
this.checkReservedWord(prop.key.name, prop.key.start, true, true);
if (isPattern) {
prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
} else if (this.match(types.eq) && refShorthandDefaultPos) {
if (!refShorthandDefaultPos.start) {
refShorthandDefaultPos.start = this.state.start;
}
prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
} else {
prop.value = prop.key.__clone();
}
prop.shorthand = true;
return this.finishNode(prop, "ObjectProperty");
}
};
_proto.parseObjPropValue = function parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos, containsEsc) {
var node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos);
if (!node) this.unexpected();
return node;
};
_proto.parsePropertyName = function parsePropertyName(prop) {
if (this.eat(types.bracketL)) {
prop.computed = true;
prop.key = this.parseMaybeAssign();
this.expect(types.bracketR);
} else {
var oldInPropertyName = this.state.inPropertyName;
this.state.inPropertyName = true;
prop.key = this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseMaybePrivateName();
if (prop.key.type !== "PrivateName") {
prop.computed = false;
}
this.state.inPropertyName = oldInPropertyName;
}
return prop.key;
};
_proto.initFunction = function initFunction(node, isAsync) {
node.id = null;
node.generator = false;
node.async = !!isAsync;
};
_proto.parseMethod = function parseMethod(node, isGenerator, isAsync, isConstructor, type) {
var oldInFunc = this.state.inFunction;
var oldInMethod = this.state.inMethod;
var oldInGenerator = this.state.inGenerator;
this.state.inFunction = true;
this.state.inMethod = node.kind || true;
this.state.inGenerator = isGenerator;
this.initFunction(node, isAsync);
node.generator = !!isGenerator;
var allowModifiers = isConstructor;
this.parseFunctionParams(node, allowModifiers);
this.parseFunctionBodyAndFinish(node, type);
this.state.inFunction = oldInFunc;
this.state.inMethod = oldInMethod;
this.state.inGenerator = oldInGenerator;
return node;
};
_proto.parseArrowExpression = function parseArrowExpression(node, params, isAsync) {
if (this.state.yieldInPossibleArrowParameters) {
this.raise(this.state.yieldInPossibleArrowParameters.start, "yield is not allowed in the parameters of an arrow function" + " inside a generator");
}
var oldInFunc = this.state.inFunction;
this.state.inFunction = true;
this.initFunction(node, isAsync);
if (params) this.setArrowFunctionParameters(node, params);
var oldInGenerator = this.state.inGenerator;
var oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
this.state.inGenerator = false;
this.state.maybeInArrowParameters = false;
this.parseFunctionBody(node, true);
this.state.inGenerator = oldInGenerator;
this.state.inFunction = oldInFunc;
this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
return this.finishNode(node, "ArrowFunctionExpression");
};
_proto.setArrowFunctionParameters = function setArrowFunctionParameters(node, params) {
node.params = this.toAssignableList(params, true, "arrow function parameters");
};
_proto.isStrictBody = function isStrictBody(node) {
var isBlockStatement = node.body.type === "BlockStatement";
if (isBlockStatement && node.body.directives.length) {
for (var _i4 = 0, _node$body$directives2 = node.body.directives; _i4 < _node$body$directives2.length; _i4++) {
var directive = _node$body$directives2[_i4];
if (directive.value.value === "use strict") {
return true;
}
}
}
return false;
};
_proto.parseFunctionBodyAndFinish = function parseFunctionBodyAndFinish(node, type, allowExpressionBody) {
this.parseFunctionBody(node, allowExpressionBody);
this.finishNode(node, type);
};
_proto.parseFunctionBody = function parseFunctionBody(node, allowExpression) {
var isExpression = allowExpression && !this.match(types.braceL);
var oldInParameters = this.state.inParameters;
var oldInAsync = this.state.inAsync;
this.state.inParameters = false;
this.state.inAsync = node.async;
if (isExpression) {
node.body = this.parseMaybeAssign();
} else {
var oldInGen = this.state.inGenerator;
var oldInFunc = this.state.inFunction;
var oldLabels = this.state.labels;
this.state.inGenerator = node.generator;
this.state.inFunction = true;
this.state.labels = [];
node.body = this.parseBlock(true);
this.state.inFunction = oldInFunc;
this.state.inGenerator = oldInGen;
this.state.labels = oldLabels;
}
this.state.inAsync = oldInAsync;
this.checkFunctionNameAndParams(node, allowExpression);
this.state.inParameters = oldInParameters;
};
_proto.checkFunctionNameAndParams = function checkFunctionNameAndParams(node, isArrowFunction) {
var isStrict = this.isStrictBody(node);
var checkLVal = this.state.strict || isStrict || isArrowFunction;
var oldStrict = this.state.strict;
if (isStrict) this.state.strict = isStrict;
if (checkLVal) {
var nameHash = Object.create(null);
if (node.id) {
this.checkLVal(node.id, true, undefined, "function name");
}
for (var _i6 = 0, _node$params2 = node.params; _i6 < _node$params2.length; _i6++) {
var param = _node$params2[_i6];
if (isStrict && param.type !== "Identifier") {
this.raise(param.start, "Non-simple parameter in strict mode");
}
this.checkLVal(param, true, nameHash, "function parameter list");
}
}
this.state.strict = oldStrict;
};
_proto.parseExprList = function parseExprList(close, allowEmpty, refShorthandDefaultPos) {
var elts = [];
var first = true;
while (!this.eat(close)) {
if (first) {
first = false;
} else {
this.expect(types.comma);
if (this.eat(close)) break;
}
elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos));
}
return elts;
};
_proto.parseExprListItem = function parseExprListItem(allowEmpty, refShorthandDefaultPos, refNeedsArrowPos, refTrailingCommaPos) {
var elt;
if (allowEmpty && this.match(types.comma)) {
elt = null;
} else if (this.match(types.ellipsis)) {
var spreadNodeStartPos = this.state.start;
var spreadNodeStartLoc = this.state.startLoc;
elt = this.parseParenItem(this.parseSpread(refShorthandDefaultPos, refNeedsArrowPos), spreadNodeStartPos, spreadNodeStartLoc);
if (refTrailingCommaPos && this.match(types.comma)) {
refTrailingCommaPos.start = this.state.start;
}
} else {
elt = this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos);
}
return elt;
};
_proto.parseIdentifier = function parseIdentifier(liberal) {
var node = this.startNode();
var name = this.parseIdentifierName(node.start, liberal);
node.name = name;
node.loc.identifierName = name;
return this.finishNode(node, "Identifier");
};
_proto.parseIdentifierName = function parseIdentifierName(pos, liberal) {
if (!liberal) {
this.checkReservedWord(this.state.value, this.state.start, !!this.state.type.keyword, false);
}
var name;
if (this.match(types.name)) {
name = this.state.value;
} else if (this.state.type.keyword) {
name = this.state.type.keyword;
} else {
throw this.unexpected();
}
if (!liberal && name === "await" && this.state.inAsync) {
this.raise(pos, "invalid use of await inside of an async function");
}
this.next();
return name;
};
_proto.checkReservedWord = function checkReservedWord(word, startLoc, checkKeywords, isBinding) {
if (this.state.strict && (reservedWords.strict(word) || isBinding && reservedWords.strictBind(word))) {
this.raise(startLoc, word + " is a reserved word in strict mode");
}
if (this.state.inGenerator && word === "yield") {
this.raise(startLoc, "yield is a reserved word inside generator functions");
}
if (this.state.inClassProperty && word === "arguments") {
this.raise(startLoc, "'arguments' is not allowed in class field initializer");
}
if (this.isReservedWord(word) || checkKeywords && this.isKeyword(word)) {
this.raise(startLoc, word + " is a reserved word");
}
};
_proto.parseAwait = function parseAwait(node) {
if (!this.state.inAsync && (this.state.inFunction || !this.options.allowAwaitOutsideFunction)) {
this.unexpected();
}
if (this.match(types.star)) {
this.raise(node.start, "await* has been removed from the async functions proposal. Use Promise.all() instead.");
}
node.argument = this.parseMaybeUnary();
return this.finishNode(node, "AwaitExpression");
};
_proto.parseYield = function parseYield() {
var node = this.startNode();
if (this.state.inParameters) {
this.raise(node.start, "yield is not allowed in generator parameters");
}
if (this.state.maybeInArrowParameters && !this.state.yieldInPossibleArrowParameters) {
this.state.yieldInPossibleArrowParameters = node;
}
this.next();
if (this.match(types.semi) || this.canInsertSemicolon() || !this.match(types.star) && !this.state.type.startsExpr) {
node.delegate = false;
node.argument = null;
} else {
node.delegate = this.eat(types.star);
node.argument = this.parseMaybeAssign();
}
return this.finishNode(node, "YieldExpression");
};
return ExpressionParser;
}(LValParser);
var empty = [];
var loopLabel = {
kind: "loop"
};
var switchLabel = {
kind: "switch"
};
var StatementParser = function (_ExpressionParser) {
_inheritsLoose(StatementParser, _ExpressionParser);
function StatementParser() {
return _ExpressionParser.apply(this, arguments) || this;
}
var _proto = StatementParser.prototype;
_proto.parseTopLevel = function parseTopLevel(file, program) {
program.sourceType = this.options.sourceType;
program.interpreter = this.parseInterpreterDirective();
this.parseBlockBody(program, true, true, types.eof);
file.program = this.finishNode(program, "Program");
file.comments = this.state.comments;
if (this.options.tokens) file.tokens = this.state.tokens;
return this.finishNode(file, "File");
};
_proto.stmtToDirective = function stmtToDirective(stmt) {
var expr = stmt.expression;
var directiveLiteral = this.startNodeAt(expr.start, expr.loc.start);
var directive = this.startNodeAt(stmt.start, stmt.loc.start);
var raw = this.input.slice(expr.start, expr.end);
var val = directiveLiteral.value = raw.slice(1, -1);
this.addExtra(directiveLiteral, "raw", raw);
this.addExtra(directiveLiteral, "rawValue", val);
directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end);
return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end);
};
_proto.parseInterpreterDirective = function parseInterpreterDirective() {
if (!this.match(types.interpreterDirective)) {
return null;
}
var node = this.startNode();
node.value = this.state.value;
this.next();
return this.finishNode(node, "InterpreterDirective");
};
_proto.parseStatement = function parseStatement(declaration, topLevel) {
if (this.match(types.at)) {
this.parseDecorators(true);
}
return this.parseStatementContent(declaration, topLevel);
};
_proto.parseStatementContent = function parseStatementContent(declaration, topLevel) {
var starttype = this.state.type;
var node = this.startNode();
switch (starttype) {
case types._break:
case types._continue:
return this.parseBreakContinueStatement(node, starttype.keyword);
case types._debugger:
return this.parseDebuggerStatement(node);
case types._do:
return this.parseDoStatement(node);
case types._for:
return this.parseForStatement(node);
case types._function:
if (this.lookahead().type === types.dot) break;
if (!declaration) this.unexpected();
return this.parseFunctionStatement(node);
case types._class:
if (!declaration) this.unexpected();
return this.parseClass(node, true);
case types._if:
return this.parseIfStatement(node);
case types._return:
return this.parseReturnStatement(node);
case types._switch:
return this.parseSwitchStatement(node);
case types._throw:
return this.parseThrowStatement(node);
case types._try:
return this.parseTryStatement(node);
case types._let:
case types._const:
if (!declaration) this.unexpected();
case types._var:
return this.parseVarStatement(node, starttype);
case types._while:
return this.parseWhileStatement(node);
case types._with:
return this.parseWithStatement(node);
case types.braceL:
return this.parseBlock();
case types.semi:
return this.parseEmptyStatement(node);
case types._export:
case types._import:
{
var nextToken = this.lookahead();
if (nextToken.type === types.parenL || nextToken.type === types.dot) {
break;
}
if (!this.options.allowImportExportEverywhere && !topLevel) {
this.raise(this.state.start, "'import' and 'export' may only appear at the top level");
}
this.next();
var result;
if (starttype == types._import) {
result = this.parseImport(node);
if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) {
this.sawUnambiguousESM = true;
}
} else {
result = this.parseExport(node);
if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") {
this.sawUnambiguousESM = true;
}
}
this.assertModuleNodeAllowed(node);
return result;
}
case types.name:
if (this.isContextual("async")) {
var state = this.state.clone();
this.next();
if (this.match(types._function) && !this.canInsertSemicolon()) {
this.expect(types._function);
return this.parseFunction(node, true, false, true);
} else {
this.state = state;
}
}
}
var maybeName = this.state.value;
var expr = this.parseExpression();
if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) {
return this.parseLabeledStatement(node, maybeName, expr);
} else {
return this.parseExpressionStatement(node, expr);
}
};
_proto.assertModuleNodeAllowed = function assertModuleNodeAllowed(node) {
if (!this.options.allowImportExportEverywhere && !this.inModule) {
this.raise(node.start, "'import' and 'export' may appear only with 'sourceType: \"module\"'", {
code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
});
}
};
_proto.takeDecorators = function takeDecorators(node) {
var decorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
if (decorators.length) {
node.decorators = decorators;
this.resetStartLocationFromNode(node, decorators[0]);
this.state.decoratorStack[this.state.decoratorStack.length - 1] = [];
}
};
_proto.canHaveLeadingDecorator = function canHaveLeadingDecorator() {
return this.match(types._class);
};
_proto.parseDecorators = function parseDecorators(allowExport) {
var currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
while (this.match(types.at)) {
var decorator = this.parseDecorator();
currentContextDecorators.push(decorator);
}
if (this.match(types._export)) {
if (!allowExport) {
this.unexpected();
}
if (this.hasPlugin("decorators") && !this.getPluginOption("decorators", "decoratorsBeforeExport")) {
this.raise(this.state.start, "Using the export keyword between a decorator and a class is not allowed. " + "Please use `export @dec class` instead.");
}
} else if (!this.canHaveLeadingDecorator()) {
this.raise(this.state.start, "Leading decorators must be attached to a class declaration");
}
};
_proto.parseDecorator = function parseDecorator() {
this.expectOnePlugin(["decorators-legacy", "decorators"]);
var node = this.startNode();
this.next();
if (this.hasPlugin("decorators")) {
this.state.decoratorStack.push([]);
var startPos = this.state.start;
var startLoc = this.state.startLoc;
var expr;
if (this.eat(types.parenL)) {
expr = this.parseExpression();
this.expect(types.parenR);
} else {
expr = this.parseIdentifier(false);
while (this.eat(types.dot)) {
var _node = this.startNodeAt(startPos, startLoc);
_node.object = expr;
_node.property = this.parseIdentifier(true);
_node.computed = false;
expr = this.finishNode(_node, "MemberExpression");
}
}
if (this.eat(types.parenL)) {
var _node2 = this.startNodeAt(startPos, startLoc);
_node2.callee = expr;
_node2.arguments = this.parseCallExpressionArguments(types.parenR, false);
this.toReferencedList(_node2.arguments);
expr = this.finishNode(_node2, "CallExpression");
}
node.expression = expr;
this.state.decoratorStack.pop();
} else {
node.expression = this.parseMaybeAssign();
}
return this.finishNode(node, "Decorator");
};
_proto.parseBreakContinueStatement = function parseBreakContinueStatement(node, keyword) {
var isBreak = keyword === "break";
this.next();
if (this.isLineTerminator()) {
node.label = null;
} else if (!this.match(types.name)) {
this.unexpected();
} else {
node.label = this.parseIdentifier();
this.semicolon();
}
var i;
for (i = 0; i < this.state.labels.length; ++i) {
var lab = this.state.labels[i];
if (node.label == null || lab.name === node.label.name) {
if (lab.kind != null && (isBreak || lab.kind === "loop")) break;
if (node.label && isBreak) break;
}
}
if (i === this.state.labels.length) {
this.raise(node.start, "Unsyntactic " + keyword);
}
return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
};
_proto.parseDebuggerStatement = function parseDebuggerStatement(node) {
this.next();
this.semicolon();
return this.finishNode(node, "DebuggerStatement");
};
_proto.parseDoStatement = function parseDoStatement(node) {
this.next();
this.state.labels.push(loopLabel);
node.body = this.parseStatement(false);
this.state.labels.pop();
this.expect(types._while);
node.test = this.parseParenExpression();
this.eat(types.semi);
return this.finishNode(node, "DoWhileStatement");
};
_proto.parseForStatement = function parseForStatement(node) {
this.next();
this.state.labels.push(loopLabel);
var forAwait = false;
if (this.state.inAsync && this.isContextual("await")) {
this.expectPlugin("asyncGenerators");
forAwait = true;
this.next();
}
this.expect(types.parenL);
if (this.match(types.semi)) {
if (forAwait) {
this.unexpected();
}
return this.parseFor(node, null);
}
if (this.match(types._var) || this.match(types._let) || this.match(types._const)) {
var _init = this.startNode();
var varKind = this.state.type;
this.next();
this.parseVar(_init, true, varKind);
this.finishNode(_init, "VariableDeclaration");
if (this.match(types._in) || this.isContextual("of")) {
if (_init.declarations.length === 1) {
var declaration = _init.declarations[0];
var isForInInitializer = varKind === types._var && declaration.init && declaration.id.type != "ObjectPattern" && declaration.id.type != "ArrayPattern" && !this.isContextual("of");
if (this.state.strict && isForInInitializer) {
this.raise(this.state.start, "for-in initializer in strict mode");
} else if (isForInInitializer || !declaration.init) {
return this.parseForIn(node, _init, forAwait);
}
}
}
if (forAwait) {
this.unexpected();
}
return this.parseFor(node, _init);
}
var refShorthandDefaultPos = {
start: 0
};
var init = this.parseExpression(true, refShorthandDefaultPos);
if (this.match(types._in) || this.isContextual("of")) {
var description = this.isContextual("of") ? "for-of statement" : "for-in statement";
this.toAssignable(init, undefined, description);
this.checkLVal(init, undefined, undefined, description);
return this.parseForIn(node, init, forAwait);
} else if (refShorthandDefaultPos.start) {
this.unexpected(refShorthandDefaultPos.start);
}
if (forAwait) {
this.unexpected();
}
return this.parseFor(node, init);
};
_proto.parseFunctionStatement = function parseFunctionStatement(node) {
this.next();
return this.parseFunction(node, true);
};
_proto.parseIfStatement = function parseIfStatement(node) {
this.next();
node.test = this.parseParenExpression();
node.consequent = this.parseStatement(false);
node.alternate = this.eat(types._else) ? this.parseStatement(false) : null;
return this.finishNode(node, "IfStatement");
};
_proto.parseReturnStatement = function parseReturnStatement(node) {
if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) {
this.raise(this.state.start, "'return' outside of function");
}
this.next();
if (this.isLineTerminator()) {
node.argument = null;
} else {
node.argument = this.parseExpression();
this.semicolon();
}
return this.finishNode(node, "ReturnStatement");
};
_proto.parseSwitchStatement = function parseSwitchStatement(node) {
this.next();
node.discriminant = this.parseParenExpression();
var cases = node.cases = [];
this.expect(types.braceL);
this.state.labels.push(switchLabel);
var cur;
for (var sawDefault; !this.match(types.braceR);) {
if (this.match(types._case) || this.match(types._default)) {
var isCase = this.match(types._case);
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(this.state.lastTokStart, "Multiple default clauses");
}
sawDefault = true;
cur.test = null;
}
this.expect(types.colon);
} else {
if (cur) {
cur.consequent.push(this.parseStatement(true));
} else {
this.unexpected();
}
}
}
if (cur) this.finishNode(cur, "SwitchCase");
this.next();
this.state.labels.pop();
return this.finishNode(node, "SwitchStatement");
};
_proto.parseThrowStatement = function parseThrowStatement(node) {
this.next();
if (lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) {
this.raise(this.state.lastTokEnd, "Illegal newline after throw");
}
node.argument = this.parseExpression();
this.semicolon();
return this.finishNode(node, "ThrowStatement");
};
_proto.parseTryStatement = function parseTryStatement(node) {
this.next();
node.block = this.parseBlock();
node.handler = null;
if (this.match(types._catch)) {
var clause = this.startNode();
this.next();
if (this.match(types.parenL)) {
this.expect(types.parenL);
clause.param = this.parseBindingAtom();
var clashes = Object.create(null);
this.checkLVal(clause.param, true, clashes, "catch clause");
this.expect(types.parenR);
} else {
this.expectPlugin("optionalCatchBinding");
clause.param = null;
}
clause.body = this.parseBlock();
node.handler = this.finishNode(clause, "CatchClause");
}
node.guardedHandlers = empty;
node.finalizer = this.eat(types._finally) ? this.parseBlock() : null;
if (!node.handler && !node.finalizer) {
this.raise(node.start, "Missing catch or finally clause");
}
return this.finishNode(node, "TryStatement");
};
_proto.parseVarStatement = function parseVarStatement(node, kind) {
this.next();
this.parseVar(node, false, kind);
this.semicolon();
return this.finishNode(node, "VariableDeclaration");
};
_proto.parseWhileStatement = function parseWhileStatement(node) {
this.next();
node.test = this.parseParenExpression();
this.state.labels.push(loopLabel);
node.body = this.parseStatement(false);
this.state.labels.pop();
return this.finishNode(node, "WhileStatement");
};
_proto.parseWithStatement = function parseWithStatement(node) {
if (this.state.strict) {
this.raise(this.state.start, "'with' in strict mode");
}
this.next();
node.object = this.parseParenExpression();
node.body = this.parseStatement(false);
return this.finishNode(node, "WithStatement");
};
_proto.parseEmptyStatement = function parseEmptyStatement(node) {
this.next();
return this.finishNode(node, "EmptyStatement");
};
_proto.parseLabeledStatement = function parseLabeledStatement(node, maybeName, expr) {
for (var _i2 = 0, _this$state$labels2 = this.state.labels; _i2 < _this$state$labels2.length; _i2++) {
var label = _this$state$labels2[_i2];
if (label.name === maybeName) {
this.raise(expr.start, "Label '" + maybeName + "' is already declared");
}
}
var kind = this.state.type.isLoop ? "loop" : this.match(types._switch) ? "switch" : null;
for (var i = this.state.labels.length - 1; i >= 0; i--) {
var _label = this.state.labels[i];
if (_label.statementStart === node.start) {
_label.statementStart = this.state.start;
_label.kind = kind;
} else {
break;
}
}
this.state.labels.push({
name: maybeName,
kind: kind,
statementStart: this.state.start
});
node.body = this.parseStatement(true);
if (node.body.type == "ClassDeclaration" || node.body.type == "VariableDeclaration" && node.body.kind !== "var" || node.body.type == "FunctionDeclaration" && (this.state.strict || node.body.generator || node.body.async)) {
this.raise(node.body.start, "Invalid labeled declaration");
}
this.state.labels.pop();
node.label = expr;
return this.finishNode(node, "LabeledStatement");
};
_proto.parseExpressionStatement = function parseExpressionStatement(node, expr) {
node.expression = expr;
this.semicolon();
return this.finishNode(node, "ExpressionStatement");
};
_proto.parseBlock = function parseBlock(allowDirectives) {
var node = this.startNode();
this.expect(types.braceL);
this.parseBlockBody(node, allowDirectives, false, types.braceR);
return this.finishNode(node, "BlockStatement");
};
_proto.isValidDirective = function isValidDirective(stmt) {
return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized;
};
_proto.parseBlockBody = function parseBlockBody(node, allowDirectives, topLevel, end) {
var body = node.body = [];
var directives = node.directives = [];
this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end);
};
_proto.parseBlockOrModuleBlockBody = function parseBlockOrModuleBlockBody(body, directives, topLevel, end) {
var parsedNonDirective = false;
var oldStrict;
var octalPosition;
while (!this.eat(end)) {
if (!parsedNonDirective && this.state.containsOctal && !octalPosition) {
octalPosition = this.state.octalPosition;
}
var stmt = this.parseStatement(true, topLevel);
if (directives && !parsedNonDirective && this.isValidDirective(stmt)) {
var directive = this.stmtToDirective(stmt);
directives.push(directive);
if (oldStrict === undefined && directive.value.value === "use strict") {
oldStrict = this.state.strict;
this.setStrict(true);
if (octalPosition) {
this.raise(octalPosition, "Octal literal in strict mode");
}
}
continue;
}
parsedNonDirective = true;
body.push(stmt);
}
if (oldStrict === false) {
this.setStrict(false);
}
};
_proto.parseFor = function parseFor(node, init) {
node.init = init;
this.expect(types.semi);
node.test = this.match(types.semi) ? null : this.parseExpression();
this.expect(types.semi);
node.update = this.match(types.parenR) ? null : this.parseExpression();
this.expect(types.parenR);
node.body = this.parseStatement(false);
this.state.labels.pop();
return this.finishNode(node, "ForStatement");
};
_proto.parseForIn = function parseForIn(node, init, forAwait) {
var type = this.match(types._in) ? "ForInStatement" : "ForOfStatement";
if (forAwait) {
this.eatContextual("of");
} else {
this.next();
}
if (type === "ForOfStatement") {
node.await = !!forAwait;
}
node.left = init;
node.right = this.parseExpression();
this.expect(types.parenR);
node.body = this.parseStatement(false);
this.state.labels.pop();
return this.finishNode(node, type);
};
_proto.parseVar = function parseVar(node, isFor, kind) {
var declarations = node.declarations = [];
node.kind = kind.keyword;
for (;;) {
var decl = this.startNode();
this.parseVarHead(decl);
if (this.eat(types.eq)) {
decl.init = this.parseMaybeAssign(isFor);
} else {
if (kind === types._const && !(this.match(types._in) || this.isContextual("of"))) {
if (!this.hasPlugin("typescript")) {
this.unexpected();
}
} else if (decl.id.type !== "Identifier" && !(isFor && (this.match(types._in) || this.isContextual("of")))) {
this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value");
}
decl.init = null;
}
declarations.push(this.finishNode(decl, "VariableDeclarator"));
if (!this.eat(types.comma)) break;
}
return node;
};
_proto.parseVarHead = function parseVarHead(decl) {
decl.id = this.parseBindingAtom();
this.checkLVal(decl.id, true, undefined, "variable declaration");
};
_proto.parseFunction = function parseFunction(node, isStatement, allowExpressionBody, isAsync, optionalId) {
var oldInFunc = this.state.inFunction;
var oldInMethod = this.state.inMethod;
var oldInGenerator = this.state.inGenerator;
var oldInClassProperty = this.state.inClassProperty;
this.state.inFunction = true;
this.state.inMethod = false;
this.state.inClassProperty = false;
this.initFunction(node, isAsync);
if (this.match(types.star)) {
if (node.async) {
this.expectPlugin("asyncGenerators");
}
node.generator = true;
this.next();
}
if (isStatement && !optionalId && !this.match(types.name) && !this.match(types._yield)) {
this.unexpected();
}
if (!isStatement) this.state.inGenerator = node.generator;
if (this.match(types.name) || this.match(types._yield)) {
node.id = this.parseBindingIdentifier();
}
if (isStatement) this.state.inGenerator = node.generator;
this.parseFunctionParams(node);
this.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression", allowExpressionBody);
this.state.inFunction = oldInFunc;
this.state.inMethod = oldInMethod;
this.state.inGenerator = oldInGenerator;
this.state.inClassProperty = oldInClassProperty;
return node;
};
_proto.parseFunctionParams = function parseFunctionParams(node, allowModifiers) {
var oldInParameters = this.state.inParameters;
this.state.inParameters = true;
this.expect(types.parenL);
node.params = this.parseBindingList(types.parenR, false, allowModifiers);
this.state.inParameters = oldInParameters;
};
_proto.parseClass = function parseClass(node, isStatement, optionalId) {
this.next();
this.takeDecorators(node);
this.parseClassId(node, isStatement, optionalId);
this.parseClassSuper(node);
this.parseClassBody(node);
return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
};
_proto.isClassProperty = function isClassProperty() {
return this.match(types.eq) || this.match(types.semi) || this.match(types.braceR);
};
_proto.isClassMethod = function isClassMethod() {
return this.match(types.parenL);
};
_proto.isNonstaticConstructor = function isNonstaticConstructor(method) {
return !method.computed && !method.static && (method.key.name === "constructor" || method.key.value === "constructor");
};
_proto.parseClassBody = function parseClassBody(node) {
var oldStrict = this.state.strict;
this.state.strict = true;
this.state.classLevel++;
var state = {
hadConstructor: false
};
var decorators = [];
var classBody = this.startNode();
classBody.body = [];
this.expect(types.braceL);
while (!this.eat(types.braceR)) {
if (this.eat(types.semi)) {
if (decorators.length > 0) {
this.raise(this.state.lastTokEnd, "Decorators must not be followed by a semicolon");
}
continue;
}
if (this.match(types.at)) {
decorators.push(this.parseDecorator());
continue;
}
var 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(member.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?");
}
}
if (decorators.length) {
this.raise(this.state.start, "You have trailing decorators with no method");
}
node.body = this.finishNode(classBody, "ClassBody");
this.state.classLevel--;
this.state.strict = oldStrict;
};
_proto.parseClassMember = function parseClassMember(classBody, member, state) {
var isStatic = false;
var containsEsc = this.state.containsEsc;
if (this.match(types.name) && this.state.value === "static") {
var key = this.parseIdentifier(true);
if (this.isClassMethod()) {
var method = member;
method.kind = "method";
method.computed = false;
method.key = key;
method.static = false;
this.pushClassMethod(classBody, method, false, false, false);
return;
} else if (this.isClassProperty()) {
var prop = member;
prop.computed = false;
prop.key = key;
prop.static = false;
classBody.body.push(this.parseClassProperty(prop));
return;
} else if (containsEsc) {
throw this.unexpected();
}
isStatic = true;
}
this.parseClassMemberWithIsStatic(classBody, member, state, isStatic);
};
_proto.parseClassMemberWithIsStatic = function parseClassMemberWithIsStatic(classBody, member, state, isStatic) {
var publicMethod = member;
var privateMethod = member;
var publicProp = member;
var privateProp = member;
var method = publicMethod;
var publicMember = publicMethod;
member.static = isStatic;
if (this.eat(types.star)) {
method.kind = "method";
this.parseClassPropertyName(method);
if (method.key.type === "PrivateName") {
this.pushClassPrivateMethod(classBody, privateMethod, true, false);
return;
}
if (this.isNonstaticConstructor(publicMethod)) {
this.raise(publicMethod.key.start, "Constructor can't be a generator");
}
this.pushClassMethod(classBody, publicMethod, true, false, false);
return;
}
var key = this.parseClassPropertyName(member);
var isPrivate = key.type === "PrivateName";
var isSimple = key.type === "Identifier";
this.parsePostMemberNameModifiers(publicMember);
if (this.isClassMethod()) {
method.kind = "method";
if (isPrivate) {
this.pushClassPrivateMethod(classBody, privateMethod, false, false);
return;
}
var isConstructor = this.isNonstaticConstructor(publicMethod);
if (isConstructor) {
publicMethod.kind = "constructor";
if (publicMethod.decorators) {
this.raise(publicMethod.start, "You can't attach decorators to a class constructor");
}
if (state.hadConstructor && !this.hasPlugin("typescript")) {
this.raise(key.start, "Duplicate constructor in the same class");
}
state.hadConstructor = true;
}
this.pushClassMethod(classBody, publicMethod, false, false, isConstructor);
} else if (this.isClassProperty()) {
if (isPrivate) {
this.pushClassPrivateProperty(classBody, privateProp);
} else {
this.pushClassProperty(classBody, publicProp);
}
} else if (isSimple && key.name === "async" && !this.isLineTerminator()) {
var isGenerator = this.match(types.star);
if (isGenerator) {
this.expectPlugin("asyncGenerators");
this.next();
}
method.kind = "method";
this.parseClassPropertyName(method);
if (method.key.type === "PrivateName") {
this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);
} else {
if (this.isNonstaticConstructor(publicMethod)) {
this.raise(publicMethod.key.start, "Constructor can't be an async function");
}
this.pushClassMethod(classBody, publicMethod, isGenerator, true, false);
}
} else if (isSimple && (key.name === "get" || key.name === "set") && !(this.isLineTerminator() && this.match(types.star))) {
method.kind = key.name;
this.parseClassPropertyName(publicMethod);
if (method.key.type === "PrivateName") {
this.pushClassPrivateMethod(classBody, privateMethod, false, false);
} else {
if (this.isNonstaticConstructor(publicMethod)) {
this.raise(publicMethod.key.start, "Constructor can't have get/set modifier");
}
this.pushClassMethod(classBody, publicMethod, false, false, false);
}
this.checkGetterSetterParams(publicMethod);
} else if (this.isLineTerminator()) {
if (isPrivate) {
this.pushClassPrivateProperty(classBody, privateProp);
} else {
this.pushClassProperty(classBody, publicProp);
}
} else {
this.unexpected();
}
};
_proto.parseClassPropertyName = function parseClassPropertyName(member) {
var key = this.parsePropertyName(member);
if (!member.computed && member.static && (key.name === "prototype" || key.value === "prototype")) {
this.raise(key.start, "Classes may not have static property named prototype");
}
if (key.type === "PrivateName" && key.id.name === "constructor") {
this.raise(key.start, "Classes may not have a private field named '#constructor'");
}
return key;
};
_proto.pushClassProperty = function pushClassProperty(classBody, prop) {
if (this.isNonstaticConstructor(prop)) {
this.raise(prop.key.start, "Classes may not have a non-static field named 'constructor'");
}
classBody.body.push(this.parseClassProperty(prop));
};
_proto.pushClassPrivateProperty = function pushClassPrivateProperty(classBody, prop) {
this.expectPlugin("classPrivateProperties", prop.key.start);
classBody.body.push(this.parseClassPrivateProperty(prop));
};
_proto.pushClassMethod = function pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor) {
classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, "ClassMethod"));
};
_proto.pushClassPrivateMethod = function pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
this.expectPlugin("classPrivateMethods", method.key.start);
classBody.body.push(this.parseMethod(method, isGenerator, isAsync, false, "ClassPrivateMethod"));
};
_proto.parsePostMemberNameModifiers = function parsePostMemberNameModifiers(methodOrProp) {};
_proto.parseAccessModifier = function parseAccessModifier() {
return undefined;
};
_proto.parseClassPrivateProperty = function parseClassPrivateProperty(node) {
var oldInMethod = this.state.inMethod;
this.state.inMethod = false;
this.state.inClassProperty = true;
node.value = this.eat(types.eq) ? this.parseMaybeAssign() : null;
this.semicolon();
this.state.inClassProperty = false;
this.state.inMethod = oldInMethod;
return this.finishNode(node, "ClassPrivateProperty");
};
_proto.parseClassProperty = function parseClassProperty(node) {
if (!node.typeAnnotation) {
this.expectPlugin("classProperties");
}
var oldInMethod = this.state.inMethod;
this.state.inMethod = false;
this.state.inClassProperty = true;
if (this.match(types.eq)) {
this.expectPlugin("classProperties");
this.next();
node.value = this.parseMaybeAssign();
} else {
node.value = null;
}
this.semicolon();
this.state.inClassProperty = false;
this.state.inMethod = oldInMethod;
return this.finishNode(node, "ClassProperty");
};
_proto.parseClassId = function parseClassId(node, isStatement, optionalId) {
if (this.match(types.name)) {
node.id = this.parseIdentifier();
} else {
if (optionalId || !isStatement) {
node.id = null;
} else {
this.unexpected(null, "A class name is required");
}
}
};
_proto.parseClassSuper = function parseClassSuper(node) {
node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null;
};
_proto.parseExport = function parseExport(node) {
if (this.shouldParseExportStar()) {
this.parseExportStar(node);
if (node.type === "ExportAllDeclaration") return node;
} else if (this.isExportDefaultSpecifier()) {
this.expectPlugin("exportDefaultFrom");
var specifier = this.startNode();
specifier.exported = this.parseIdentifier(true);
var specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
node.specifiers = specifiers;
if (this.match(types.comma) && this.lookahead().type === types.star) {
this.expect(types.comma);
var _specifier = this.startNode();
this.expect(types.star);
this.expectContextual("as");
_specifier.exported = this.parseIdentifier();
specifiers.push(this.finishNode(_specifier, "ExportNamespaceSpecifier"));
} else {
this.parseExportSpecifiersMaybe(node);
}
this.parseExportFrom(node, true);
} else if (this.eat(types._default)) {
node.declaration = this.parseExportDefaultExpression();
this.checkExport(node, true, true);
return this.finishNode(node, "ExportDefaultDeclaration");
} else if (this.shouldParseExportDeclaration()) {
if (this.isContextual("async")) {
var next = this.lookahead();
if (next.type !== types._function) {
this.unexpected(next.start, "Unexpected token, expected \"function\"");
}
}
node.specifiers = [];
node.source = null;
node.declaration = this.parseExportDeclaration(node);
} else {
node.declaration = null;
node.specifiers = this.parseExportSpecifiers();
this.parseExportFrom(node);
}
this.checkExport(node, true);
return this.finishNode(node, "ExportNamedDeclaration");
};
_proto.parseExportDefaultExpression = function parseExportDefaultExpression() {
var expr = this.startNode();
if (this.eat(types._function)) {
return this.parseFunction(expr, true, false, false, true);
} else if (this.isContextual("async") && this.lookahead().type === types._function) {
this.eatContextual("async");
this.eat(types._function);
return this.parseFunction(expr, true, false, true, true);
} else if (this.match(types._class)) {
return this.parseClass(expr, true, true);
} else if (this.match(types.at)) {
if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport")) {
this.unexpected(this.state.start, "Decorators must be placed *before* the 'export' keyword." + " You can set the 'decoratorsBeforeExport' option to false to use" + " the 'export @decorator class {}' syntax");
}
this.parseDecorators(false);
return this.parseClass(expr, true, true);
} else if (this.match(types._let) || this.match(types._const) || this.match(types._var)) {
return this.raise(this.state.start, "Only expressions, functions or classes are allowed as the `default` export.");
} else {
var res = this.parseMaybeAssign();
this.semicolon();
return res;
}
};
_proto.parseExportDeclaration = function parseExportDeclaration(node) {
return this.parseStatement(true);
};
_proto.isExportDefaultSpecifier = function isExportDefaultSpecifier() {
if (this.match(types.name)) {
return this.state.value !== "async";
}
if (!this.match(types._default)) {
return false;
}
var lookahead = this.lookahead();
return lookahead.type === types.comma || lookahead.type === types.name && lookahead.value === "from";
};
_proto.parseExportSpecifiersMaybe = function parseExportSpecifiersMaybe(node) {
if (this.eat(types.comma)) {
node.specifiers = node.specifiers.concat(this.parseExportSpecifiers());
}
};
_proto.parseExportFrom = function parseExportFrom(node, expect) {
if (this.eatContextual("from")) {
node.source = this.match(types.string) ? this.parseExprAtom() : this.unexpected();
this.checkExport(node);
} else {
if (expect) {
this.unexpected();
} else {
node.source = null;
}
}
this.semicolon();
};
_proto.shouldParseExportStar = function shouldParseExportStar() {
return this.match(types.star);
};
_proto.parseExportStar = function parseExportStar(node) {
this.expect(types.star);
if (this.isContextual("as")) {
this.parseExportNamespace(node);
} else {
this.parseExportFrom(node, true);
this.finishNode(node, "ExportAllDeclaration");
}
};
_proto.parseExportNamespace = function parseExportNamespace(node) {
this.expectPlugin("exportNamespaceFrom");
var specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc);
this.next();
specifier.exported = this.parseIdentifier(true);
node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")];
this.parseExportSpecifiersMaybe(node);
this.parseExportFrom(node, true);
};
_proto.shouldParseExportDeclaration = function shouldParseExportDeclaration() {
if (this.match(types.at)) {
this.expectOnePlugin(["decorators", "decorators-legacy"]);
if (this.hasPlugin("decorators")) {
if (this.getPluginOption("decorators", "decoratorsBeforeExport")) {
this.unexpected(this.state.start, "Decorators must be placed *before* the 'export' keyword." + " You can set the 'decoratorsBeforeExport' option to false to use" + " the 'export @decorator class {}' syntax");
} else {
return true;
}
}
}
return this.state.type.keyword === "var" || this.state.type.keyword === "const" || this.state.type.keyword === "let" || this.state.type.keyword === "function" || this.state.type.keyword === "class" || this.isContextual("async");
};
_proto.checkExport = function checkExport(node, checkNames, isDefault) {
if (checkNames) {
if (isDefault) {
this.checkDuplicateExports(node, "default");
} else if (node.specifiers && node.specifiers.length) {
for (var _i4 = 0, _node$specifiers2 = node.specifiers; _i4 < _node$specifiers2.length; _i4++) {
var specifier = _node$specifiers2[_i4];
this.checkDuplicateExports(specifier, specifier.exported.name);
}
} else if (node.declaration) {
if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") {
var id = node.declaration.id;
if (!id) throw new Error("Assertion failure");
this.checkDuplicateExports(node, id.name);
} else if (node.declaration.type === "VariableDeclaration") {
for (var _i6 = 0, _node$declaration$dec2 = node.declaration.declarations; _i6 < _node$declaration$dec2.length; _i6++) {
var declaration = _node$declaration$dec2[_i6];
this.checkDeclaration(declaration.id);
}
}
}
}
var currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
if (currentContextDecorators.length) {
var isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression");
if (!node.declaration || !isClass) {
throw this.raise(node.start, "You can only use decorators on an export when exporting a class");
}
this.takeDecorators(node.declaration);
}
};
_proto.checkDeclaration = function checkDeclaration(node) {
if (node.type === "ObjectPattern") {
for (var _i8 = 0, _node$properties2 = node.properties; _i8 < _node$properties2.length; _i8++) {
var prop = _node$properties2[_i8];
this.checkDeclaration(prop);
}
} else if (node.type === "ArrayPattern") {
for (var _i10 = 0, _node$elements2 = node.elements; _i10 < _node$elements2.length; _i10++) {
var elem = _node$elements2[_i10];
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 === "Identifier") {
this.checkDuplicateExports(node, node.name);
}
};
_proto.checkDuplicateExports = function checkDuplicateExports(node, name) {
if (this.state.exportedIdentifiers.indexOf(name) > -1) {
this.raiseDuplicateExportError(node, name);
}
this.state.exportedIdentifiers.push(name);
};
_proto.raiseDuplicateExportError = function raiseDuplicateExportError(node, name) {
throw this.raise(node.start, name === "default" ? "Only one default export allowed per module." : "`" + name + "` has already been exported. Exported identifiers must be unique.");
};
_proto.parseExportSpecifiers = function parseExportSpecifiers() {
var nodes = [];
var first = true;
var needsFrom;
this.expect(types.braceL);
while (!this.eat(types.braceR)) {
if (first) {
first = false;
} else {
this.expect(types.comma);
if (this.eat(types.braceR)) break;
}
var isDefault = this.match(types._default);
if (isDefault && !needsFrom) needsFrom = true;
var node = this.startNode();
node.local = this.parseIdentifier(isDefault);
node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone();
nodes.push(this.finishNode(node, "ExportSpecifier"));
}
if (needsFrom && !this.isContextual("from")) {
this.unexpected();
}
return nodes;
};
_proto.parseImport = function parseImport(node) {
if (this.match(types.string)) {
node.specifiers = [];
node.source = this.parseExprAtom();
} else {
node.specifiers = [];
this.parseImportSpecifiers(node);
this.expectContextual("from");
node.source = this.match(types.string) ? this.parseExprAtom() : this.unexpected();
}
this.semicolon();
return this.finishNode(node, "ImportDeclaration");
};
_proto.shouldParseDefaultImport = function shouldParseDefaultImport(node) {
return this.match(types.name);
};
_proto.parseImportSpecifierLocal = function parseImportSpecifierLocal(node, specifier, type, contextDescription) {
specifier.local = this.parseIdentifier();
this.checkLVal(specifier.local, true, undefined, contextDescription);
node.specifiers.push(this.finishNode(specifier, type));
};
_proto.parseImportSpecifiers = function parseImportSpecifiers(node) {
var first = true;
if (this.shouldParseDefaultImport(node)) {
this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier", "default import specifier");
if (!this.eat(types.comma)) return;
}
if (this.match(types.star)) {
var specifier = this.startNode();
this.next();
this.expectContextual("as");
this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier", "import namespace specifier");
return;
}
this.expect(types.braceL);
while (!this.eat(types.braceR)) {
if (first) {
first = false;
} else {
if (this.eat(types.colon)) {
this.unexpected(null, "ES2015 named imports do not destructure. " + "Use another statement for destructuring after the import.");
}
this.expect(types.comma);
if (this.eat(types.braceR)) break;
}
this.parseImportSpecifier(node);
}
};
_proto.parseImportSpecifier = function parseImportSpecifier(node) {
var specifier = this.startNode();
specifier.imported = this.parseIdentifier(true);
if (this.eatContextual("as")) {
specifier.local = this.parseIdentifier();
} else {
this.checkReservedWord(specifier.imported.name, specifier.start, true, true);
specifier.local = specifier.imported.__clone();
}
this.checkLVal(specifier.local, true, undefined, "import specifier");
node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
};
return StatementParser;
}(ExpressionParser);
var Parser = function (_StatementParser) {
_inheritsLoose(Parser, _StatementParser);
function Parser(options, input) {
var _this;
options = getOptions(options);
_this = _StatementParser.call(this, options, input) || this;
_this.options = options;
_this.inModule = _this.options.sourceType === "module";
_this.input = input;
_this.plugins = pluginsMap(_this.options.plugins);
_this.filename = options.sourceFilename;
return _this;
}
var _proto = Parser.prototype;
_proto.parse = function parse() {
var file = this.startNode();
var program = this.startNode();
this.nextToken();
return this.parseTopLevel(file, program);
};
return Parser;
}(StatementParser);
function pluginsMap(plugins) {
var pluginMap = Object.create(null);
for (var _i2 = 0; _i2 < plugins.length; _i2++) {
var plugin = plugins[_i2];
var _ref = Array.isArray(plugin) ? plugin : [plugin, {}],
name = _ref[0],
_ref$ = _ref[1],
options = _ref$ === void 0 ? {} : _ref$;
if (!pluginMap[name]) pluginMap[name] = options || {};
}
return pluginMap;
}
function nonNull(x) {
if (x == null) {
throw new Error("Unexpected " + x + " value.");
}
return x;
}
function assert(x) {
if (!x) {
throw new Error("Assert fail");
}
}
function keywordTypeFromName(value) {
switch (value) {
case "any":
return "TSAnyKeyword";
case "boolean":
return "TSBooleanKeyword";
case "never":
return "TSNeverKeyword";
case "number":
return "TSNumberKeyword";
case "object":
return "TSObjectKeyword";
case "string":
return "TSStringKeyword";
case "symbol":
return "TSSymbolKeyword";
case "undefined":
return "TSUndefinedKeyword";
default:
return undefined;
}
}
var typescript = function typescript(superClass) {
return function (_superClass) {
_inheritsLoose(_class, _superClass);
function _class() {
return _superClass.apply(this, arguments) || this;
}
var _proto = _class.prototype;
_proto.tsIsIdentifier = function tsIsIdentifier() {
return this.match(types.name);
};
_proto.tsNextTokenCanFollowModifier = function tsNextTokenCanFollowModifier() {
this.next();
return !this.hasPrecedingLineBreak() && !this.match(types.parenL) && !this.match(types.parenR) && !this.match(types.colon) && !this.match(types.eq) && !this.match(types.question);
};
_proto.tsParseModifier = function tsParseModifier(allowedModifiers) {
if (!this.match(types.name)) {
return undefined;
}
var modifier = this.state.value;
if (allowedModifiers.indexOf(modifier) !== -1 && this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {
return modifier;
}
return undefined;
};
_proto.tsIsListTerminator = function tsIsListTerminator(kind) {
switch (kind) {
case "EnumMembers":
case "TypeMembers":
return this.match(types.braceR);
case "HeritageClauseElement":
return this.match(types.braceL);
case "TupleElementTypes":
return this.match(types.bracketR);
case "TypeParametersOrArguments":
return this.isRelational(">");
}
throw new Error("Unreachable");
};
_proto.tsParseList = function tsParseList(kind, parseElement) {
var result = [];
while (!this.tsIsListTerminator(kind)) {
result.push(parseElement());
}
return result;
};
_proto.tsParseDelimitedList = function tsParseDelimitedList(kind, parseElement) {
return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true));
};
_proto.tsTryParseDelimitedList = function tsTryParseDelimitedList(kind, parseElement) {
return this.tsParseDelimitedListWorker(kind, parseElement, false);
};
_proto.tsParseDelimitedListWorker = function tsParseDelimitedListWorker(kind, parseElement, expectSuccess) {
var result = [];
while (true) {
if (this.tsIsListTerminator(kind)) {
break;
}
var element = parseElement();
if (element == null) {
return undefined;
}
result.push(element);
if (this.eat(types.comma)) {
continue;
}
if (this.tsIsListTerminator(kind)) {
break;
}
if (expectSuccess) {
this.expect(types.comma);
}
return undefined;
}
return result;
};
_proto.tsParseBracketedList = function tsParseBracketedList(kind, parseElement, bracket, skipFirstToken) {
if (!skipFirstToken) {
if (bracket) {
this.expect(types.bracketL);
} else {
this.expectRelational("<");
}
}
var result = this.tsParseDelimitedList(kind, parseElement);
if (bracket) {
this.expect(types.bracketR);
} else {
this.expectRelational(">");
}
return result;
};
_proto.tsParseEntityName = function tsParseEntityName(allowReservedWords) {
var entity = this.parseIdentifier();
while (this.eat(types.dot)) {
var node = this.startNodeAtNode(entity);
node.left = entity;
node.right = this.parseIdentifier(allowReservedWords);
entity = this.finishNode(node, "TSQualifiedName");
}
return entity;
};
_proto.tsParseTypeReference = function tsParseTypeReference() {
var node = this.startNode();
node.typeName = this.tsParseEntityName(false);
if (!this.hasPrecedingLineBreak() && this.isRelational("<")) {
node.typeParameters = this.tsParseTypeArguments();
}
return this.finishNode(node, "TSTypeReference");
};
_proto.tsParseThisTypePredicate = function tsParseThisTypePredicate(lhs) {
this.next();
var node = this.startNode();
node.parameterName = lhs;
node.typeAnnotation = this.tsParseTypeAnnotation(false);
return this.finishNode(node, "TSTypePredicate");
};
_proto.tsParseThisTypeNode = function tsParseThisTypeNode() {
var node = this.startNode();
this.next();
return this.finishNode(node, "TSThisType");
};
_proto.tsParseTypeQuery = function tsParseTypeQuery() {
var node = this.startNode();
this.expect(types._typeof);
node.exprName = this.tsParseEntityName(true);
return this.finishNode(node, "TSTypeQuery");
};
_proto.tsParseTypeParameter = function tsParseTypeParameter() {
var node = this.startNode();
node.name = this.parseIdentifierName(node.start);
node.constraint = this.tsEatThenParseType(types._extends);
node.default = this.tsEatThenParseType(types.eq);
return this.finishNode(node, "TSTypeParameter");
};
_proto.tsTryParseTypeParameters = function tsTryParseTypeParameters() {
if (this.isRelational("<")) {
return this.tsParseTypeParameters();
}
};
_proto.tsParseTypeParameters = function tsParseTypeParameters() {
var node = this.startNode();
if (this.isRelational("<") || this.match(types.jsxTagStart)) {
this.next();
} else {
this.unexpected();
}
node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this), false, true);
return this.finishNode(node, "TSTypeParameterDeclaration");
};
_proto.tsFillSignature = function tsFillSignature(returnToken, signature) {
var returnTokenRequired = returnToken === types.arrow;
signature.typeParameters = this.tsTryParseTypeParameters();
this.expect(types.parenL);
signature.parameters = this.tsParseBindingListForSignature();
if (returnTokenRequired) {
signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
} else if (this.match(returnToken)) {
signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
}
};
_proto.tsParseBindingListForSignature = function tsParseBindingListForSignature() {
var _this = this;
return this.parseBindingList(types.parenR).map(function (pattern) {
if (pattern.type !== "Identifier" && pattern.type !== "RestElement") {
throw _this.unexpected(pattern.start, "Name in a signature must be an Identifier.");
}
return pattern;
});
};
_proto.tsParseTypeMemberSemicolon = function tsParseTypeMemberSemicolon() {
if (!this.eat(types.comma)) {
this.semicolon();
}
};
_proto.tsParseSignatureMember = function tsParseSignatureMember(kind) {
var node = this.startNode();
if (kind === "TSConstructSignatureDeclaration") {
this.expect(types._new);
}
this.tsFillSignature(types.colon, node);
this.tsParseTypeMemberSemicolon();
return this.finishNode(node, kind);
};
_proto.tsIsUnambiguouslyIndexSignature = function tsIsUnambiguouslyIndexSignature() {
this.next();
return this.eat(types.name) && this.match(types.colon);
};
_proto.tsTryParseIndexSignature = function tsTryParseIndexSignature(node) {
if (!(this.match(types.bracketL) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) {
return undefined;
}
this.expect(types.bracketL);
var id = this.parseIdentifier();
this.expect(types.colon);
id.typeAnnotation = this.tsParseTypeAnnotation(false);
this.expect(types.bracketR);
node.parameters = [id];
var type = this.tsTryParseTypeAnnotation();
if (type) node.typeAnnotation = type;
this.tsParseTypeMemberSemicolon();
return this.finishNode(node, "TSIndexSignature");
};
_proto.tsParsePropertyOrMethodSignature = function tsParsePropertyOrMethodSignature(node, readonly) {
this.parsePropertyName(node);
if (this.eat(types.question)) node.optional = true;
var nodeAny = node;
if (!readonly && (this.match(types.parenL) || this.isRelational("<"))) {
var method = nodeAny;
this.tsFillSignature(types.colon, method);
this.tsParseTypeMemberSemicolon();
return this.finishNode(method, "TSMethodSignature");
} else {
var property = nodeAny;
if (readonly) property.readonly = true;
var type = this.tsTryParseTypeAnnotation();
if (type) property.typeAnnotation = type;
this.tsParseTypeMemberSemicolon();
return this.finishNode(property, "TSPropertySignature");
}
};
_proto.tsParseTypeMember = function tsParseTypeMember() {
if (this.match(types.parenL) || this.isRelational("<")) {
return this.tsParseSignatureMember("TSCallSignatureDeclaration");
}
if (this.match(types._new) && this.tsLookAhead(this.tsIsStartOfConstructSignature.bind(this))) {
return this.tsParseSignatureMember("TSConstructSignatureDeclaration");
}
var node = this.startNode();
var readonly = !!this.tsParseModifier(["readonly"]);
var idx = this.tsTryParseIndexSignature(node);
if (idx) {
if (readonly) node.readonly = true;
return idx;
}
return this.tsParsePropertyOrMethodSignature(node, readonly);
};
_proto.tsIsStartOfConstructSignature = function tsIsStartOfConstructSignature() {
this.next();
return this.match(types.parenL) || this.isRelational("<");
};
_proto.tsParseTypeLiteral = function tsParseTypeLiteral() {
var node = this.startNode();
node.members = this.tsParseObjectTypeMembers();
return this.finishNode(node, "TSTypeLiteral");
};
_proto.tsParseObjectTypeMembers = function tsParseObjectTypeMembers() {
this.expect(types.braceL);
var members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this));
this.expect(types.braceR);
return members;
};
_proto.tsIsStartOfMappedType = function tsIsStartOfMappedType() {
this.next();
if (this.eat(types.plusMin)) {
return this.isContextual("readonly");
}
if (this.isContextual("readonly")) {
this.next();
}
if (!this.match(types.bracketL)) {
return false;
}
this.next();
if (!this.tsIsIdentifier()) {
return false;
}
this.next();
return this.match(types._in);
};
_proto.tsParseMappedTypeParameter = function tsParseMappedTypeParameter() {
var node = this.startNode();
node.name = this.parseIdentifierName(node.start);
node.constraint = this.tsExpectThenParseType(types._in);
return this.finishNode(node, "TSTypeParameter");
};
_proto.tsParseMappedType = function tsParseMappedType() {
var node = this.startNode();
this.expect(types.braceL);
if (this.match(types.plusMin)) {
node.readonly = this.state.value;
this.next();
this.expectContextual("readonly");
} else if (this.eatContextual("readonly")) {
node.readonly = true;
}
this.expect(types.bracketL);
node.typeParameter = this.tsParseMappedTypeParameter();
this.expect(types.bracketR);
if (this.match(types.plusMin)) {
node.optional = this.state.value;
this.next();
this.expect(types.question);
} else if (this.eat(types.question)) {
node.optional = true;
}
node.typeAnnotation = this.tsTryParseType();
this.semicolon();
this.expect(types.braceR);
return this.finishNode(node, "TSMappedType");
};
_proto.tsParseTupleType = function tsParseTupleType() {
var node = this.startNode();
node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseType.bind(this), true, false);
return this.finishNode(node, "TSTupleType");
};
_proto.tsParseParenthesizedType = function tsParseParenthesizedType() {
var node = this.startNode();
this.expect(types.parenL);
node.typeAnnotation = this.tsParseType();
this.expect(types.parenR);
return this.finishNode(node, "TSParenthesizedType");
};
_proto.tsParseFunctionOrConstructorType = function tsParseFunctionOrConstructorType(type) {
var node = this.startNode();
if (type === "TSConstructorType") {
this.expect(types._new);
}
this.tsFillSignature(types.arrow, node);
return this.finishNode(node, type);
};
_proto.tsParseLiteralTypeNode = function tsParseLiteralTypeNode() {
var _this2 = this;
var node = this.startNode();
node.literal = function () {
switch (_this2.state.type) {
case types.num:
return _this2.parseLiteral(_this2.state.value, "NumericLiteral");
case types.string:
return _this2.parseLiteral(_this2.state.value, "StringLiteral");
case types._true:
case types._false:
return _this2.parseBooleanLiteral();
default:
throw _this2.unexpected();
}
}();
return this.finishNode(node, "TSLiteralType");
};
_proto.tsParseNonArrayType = function tsParseNonArrayType() {
switch (this.state.type) {
case types.name:
case types._void:
case types._null:
{
var type = this.match(types._void) ? "TSVoidKeyword" : this.match(types._null) ? "TSNullKeyword" : keywordTypeFromName(this.state.value);
if (type !== undefined && this.lookahead().type !== types.dot) {
var node = this.startNode();
this.next();
return this.finishNode(node, type);
}
return this.tsParseTypeReference();
}
case types.string:
case types.num:
case types._true:
case types._false:
return this.tsParseLiteralTypeNode();
case types.plusMin:
if (this.state.value === "-") {
var _node = this.startNode();
this.next();
if (!this.match(types.num)) {
throw this.unexpected();
}
_node.literal = this.parseLiteral(-this.state.value, "NumericLiteral", _node.start, _node.loc.start);
return this.finishNode(_node, "TSLiteralType");
}
break;
case types._this:
{
var thisKeyword = this.tsParseThisTypeNode();
if (this.isContextual("is") && !this.hasPrecedingLineBreak()) {
return this.tsParseThisTypePredicate(thisKeyword);
} else {
return thisKeyword;
}
}
case types._typeof:
return this.tsParseTypeQuery();
case types.braceL:
return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();
case types.bracketL:
return this.tsParseTupleType();
case types.parenL:
return this.tsParseParenthesizedType();
}
throw this.unexpected();
};
_proto.tsParseArrayTypeOrHigher = function tsParseArrayTypeOrHigher() {
var type = this.tsParseNonArrayType();
while (!this.hasPrecedingLineBreak() && this.eat(types.bracketL)) {
if (this.match(types.bracketR)) {
var node = this.startNodeAtNode(type);
node.elementType = type;
this.expect(types.bracketR);
type = this.finishNode(node, "TSArrayType");
} else {
var _node2 = this.startNodeAtNode(type);
_node2.objectType = type;
_node2.indexType = this.tsParseType();
this.expect(types.bracketR);
type = this.finishNode(_node2, "TSIndexedAccessType");
}
}
return type;
};
_proto.tsParseTypeOperator = function tsParseTypeOperator(operator) {
var node = this.startNode();
this.expectContextual(operator);
node.operator = operator;
node.typeAnnotation = this.tsParseTypeOperatorOrHigher();
return this.finishNode(node, "TSTypeOperator");
};
_proto.tsParseInferType = function tsParseInferType() {
var node = this.startNode();
this.expectContextual("infer");
var typeParameter = this.startNode();
typeParameter.name = this.parseIdentifierName(typeParameter.start);
node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
return this.finishNode(node, "TSInferType");
};
_proto.tsParseTypeOperatorOrHigher = function tsParseTypeOperatorOrHigher() {
var _this3 = this;
var operator = ["keyof", "unique"].find(function (kw) {
return _this3.isContextual(kw);
});
return operator ? this.tsParseTypeOperator(operator) : this.isContextual("infer") ? this.tsParseInferType() : this.tsParseArrayTypeOrHigher();
};
_proto.tsParseUnionOrIntersectionType = function tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
this.eat(operator);
var type = parseConstituentType();
if (this.match(operator)) {
var types$$1 = [type];
while (this.eat(operator)) {
types$$1.push(parseConstituentType());
}
var node = this.startNodeAtNode(type);
node.types = types$$1;
type = this.finishNode(node, kind);
}
return type;
};
_proto.tsParseIntersectionTypeOrHigher = function tsParseIntersectionTypeOrHigher() {
return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), types.bitwiseAND);
};
_proto.tsParseUnionTypeOrHigher = function tsParseUnionTypeOrHigher() {
return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), types.bitwiseOR);
};
_proto.tsIsStartOfFunctionType = function tsIsStartOfFunctionType() {
if (this.isRelational("<")) {
return true;
}
return this.match(types.parenL) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));
};
_proto.tsSkipParameterStart = function tsSkipParameterStart() {
if (this.match(types.name) || this.match(types._this)) {
this.next();
return true;
}
return false;
};
_proto.tsIsUnambiguouslyStartOfFunctionType = function tsIsUnambiguouslyStartOfFunctionType() {
this.next();
if (this.match(types.parenR) || this.match(types.ellipsis)) {
return true;
}
if (this.tsSkipParameterStart()) {
if (this.match(types.colon) || this.match(types.comma) || this.match(types.question) || this.match(types.eq)) {
return true;
}
if (this.match(types.parenR)) {
this.next();
if (this.match(types.arrow)) {
return true;
}
}
}
return false;
};
_proto.tsParseTypeOrTypePredicateAnnotation = function tsParseTypeOrTypePredicateAnnotation(returnToken) {
var _this4 = this;
return this.tsInType(function () {
var t = _this4.startNode();
_this4.expect(returnToken);
var typePredicateVariable = _this4.tsIsIdentifier() && _this4.tsTryParse(_this4.tsParseTypePredicatePrefix.bind(_this4));
if (!typePredicateVariable) {
return _this4.tsParseTypeAnnotation(false, t);
}
var type = _this4.tsParseTypeAnnotation(false);
var node = _this4.startNodeAtNode(typePredicateVariable);
node.parameterName = typePredicateVariable;
node.typeAnnotation = type;
t.typeAnnotation = _this4.finishNode(node, "TSTypePredicate");
return _this4.finishNode(t, "TSTypeAnnotation");
});
};
_proto.tsTryParseTypeOrTypePredicateAnnotation = function tsTryParseTypeOrTypePredicateAnnotation() {
return this.match(types.colon) ? this.tsParseTypeOrTypePredicateAnnotation(types.colon) : undefined;
};
_proto.tsTryParseTypeAnnotation = function tsTryParseTypeAnnotation() {
return this.match(types.colon) ? this.tsParseTypeAnnotation() : undefined;
};
_proto.tsTryParseType = function tsTryParseType() {
return this.tsEatThenParseType(types.colon);
};
_proto.tsParseTypePredicatePrefix = function tsParseTypePredicatePrefix() {
var id = this.parseIdentifier();
if (this.isContextual("is") && !this.hasPrecedingLineBreak()) {
this.next();
return id;
}
};
_proto.tsParseTypeAnnotation = function tsParseTypeAnnotation(eatColon, t) {
var _this5 = this;
if (eatColon === void 0) {
eatColon = true;
}
if (t === void 0) {
t = this.startNode();
}
this.tsInType(function () {
if (eatColon) _this5.expect(types.colon);
t.typeAnnotation = _this5.tsParseType();
});
return this.finishNode(t, "TSTypeAnnotation");
};
_proto.tsParseType = function tsParseType() {
assert(this.state.inType);
var type = this.tsParseNonConditionalType();
if (this.hasPrecedingLineBreak() || !this.eat(types._extends)) {
return type;
}
var node = this.startNodeAtNode(type);
node.checkType = type;
node.extendsType = this.tsParseNonConditionalType();
this.expect(types.question);
node.trueType = this.tsParseType();
this.expect(types.colon);
node.falseType = this.tsParseType();
return this.finishNode(node, "TSConditionalType");
};
_proto.tsParseNonConditionalType = function tsParseNonConditionalType() {
if (this.tsIsStartOfFunctionType()) {
return this.tsParseFunctionOrConstructorType("TSFunctionType");
}
if (this.match(types._new)) {
return this.tsParseFunctionOrConstructorType("TSConstructorType");
}
return this.tsParseUnionTypeOrHigher();
};
_proto.tsParseTypeAssertion = function tsParseTypeAssertion() {
var _this6 = this;
var node = this.startNode();
node.typeAnnotation = this.tsInType(function () {
return _this6.tsParseType();
});
this.expectRelational(">");
node.expression = this.parseMaybeUnary();
return this.finishNode(node, "TSTypeAssertion");
};
_proto.tsTryParseTypeArgumentsInExpression = function tsTryParseTypeArgumentsInExpression() {
var _this7 = this;
return this.tsTryParseAndCatch(function () {
var res = _this7.tsParseTypeArguments();
_this7.expect(types.parenL);
return res;
});
};
_proto.tsParseHeritageClause = function tsParseHeritageClause() {
return this.tsParseDelimitedList("HeritageClauseElement", this.tsParseExpressionWithTypeArguments.bind(this));
};
_proto.tsParseExpressionWithTypeArguments = function tsParseExpressionWithTypeArguments() {
var node = this.startNode();
node.expression = this.tsParseEntityName(false);
if (this.isRelational("<")) {
node.typeParameters = this.tsParseTypeArguments();
}
return this.finishNode(node, "TSExpressionWithTypeArguments");
};
_proto.tsParseInterfaceDeclaration = function tsParseInterfaceDeclaration(node) {
node.id = this.parseIdentifier();
node.typeParameters = this.tsTryParseTypeParameters();
if (this.eat(types._extends)) {
node.extends = this.tsParseHeritageClause();
}
var body = this.startNode();
body.body = this.tsParseObjectTypeMembers();
node.body = this.finishNode(body, "TSInterfaceBody");
return this.finishNode(node, "TSInterfaceDeclaration");
};
_proto.tsParseTypeAliasDeclaration = function tsParseTypeAliasDeclaration(node) {
node.id = this.parseIdentifier();
node.typeParameters = this.tsTryParseTypeParameters();
node.typeAnnotation = this.tsExpectThenParseType(types.eq);
this.semicolon();
return this.finishNode(node, "TSTypeAliasDeclaration");
};
_proto.tsInType = function tsInType(cb) {
var oldInType = this.state.inType;
this.state.inType = true;
try {
return cb();
} finally {
this.state.inType = oldInType;
}
};
_proto.tsEatThenParseType = function tsEatThenParseType(token) {
return !this.match(token) ? undefined : this.tsNextThenParseType();
};
_proto.tsExpectThenParseType = function tsExpectThenParseType(token) {
var _this8 = this;
return this.tsDoThenParseType(function () {
return _this8.expect(token);
});
};
_proto.tsNextThenParseType = function tsNextThenParseType() {
var _this9 = this;
return this.tsDoThenParseType(function () {
return _this9.next();
});
};
_proto.tsDoThenParseType = function tsDoThenParseType(cb) {
var _this10 = this;
return this.tsInType(function () {
cb();
return _this10.tsParseType();
});
};
_proto.tsParseEnumMember = function tsParseEnumMember() {
var node = this.startNode();
node.id = this.match(types.string) ? this.parseLiteral(this.state.value, "StringLiteral") : this.parseIdentifier(true);
if (this.eat(types.eq)) {
node.initializer = this.parseMaybeAssign();
}
return this.finishNode(node, "TSEnumMember");
};
_proto.tsParseEnumDeclaration = function tsParseEnumDeclaration(node, isConst) {
if (isConst) node.const = true;
node.id = this.parseIdentifier();
this.expect(types.braceL);
node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this));
this.expect(types.braceR);
return this.finishNode(node, "TSEnumDeclaration");
};
_proto.tsParseModuleBlock = function tsParseModuleBlock() {
var node = this.startNode();
this.expect(types.braceL);
this.parseBlockOrModuleBlockBody(node.body = [], undefined, true, types.braceR);
return this.finishNode(node, "TSModuleBlock");
};
_proto.tsParseModuleOrNamespaceDeclaration = function tsParseModuleOrNamespaceDeclaration(node) {
node.id = this.parseIdentifier();
if (this.eat(types.dot)) {
var inner = this.startNode();
this.tsParseModuleOrNamespaceDeclaration(inner);
node.body = inner;
} else {
node.body = this.tsParseModuleBlock();
}
return this.finishNode(node, "TSModuleDeclaration");
};
_proto.tsParseAmbientExternalModuleDeclaration = function tsParseAmbientExternalModuleDeclaration(node) {
if (this.isContextual("global")) {
node.global = true;
node.id = this.parseIdentifier();
} else if (this.match(types.string)) {
node.id = this.parseExprAtom();
} else {
this.unexpected();
}
if (this.match(types.braceL)) {
node.body = this.tsParseModuleBlock();
} else {
this.semicolon();
}
return this.finishNode(node, "TSModuleDeclaration");
};
_proto.tsParseImportEqualsDeclaration = function tsParseImportEqualsDeclaration(node, isExport) {
node.isExport = isExport || false;
node.id = this.parseIdentifier();
this.expect(types.eq);
node.moduleReference = this.tsParseModuleReference();
this.semicolon();
return this.finishNode(node, "TSImportEqualsDeclaration");
};
_proto.tsIsExternalModuleReference = function tsIsExternalModuleReference() {
return this.isContextual("require") && this.lookahead().type === types.parenL;
};
_proto.tsParseModuleReference = function tsParseModuleReference() {
return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false);
};
_proto.tsParseExternalModuleReference = function tsParseExternalModuleReference() {
var node = this.startNode();
this.expectContextual("require");
this.expect(types.parenL);
if (!this.match(types.string)) {
throw this.unexpected();
}
node.expression = this.parseLiteral(this.state.value, "StringLiteral");
this.expect(types.parenR);
return this.finishNode(node, "TSExternalModuleReference");
};
_proto.tsLookAhead = function tsLookAhead(f) {
var state = this.state.clone();
var res = f();
this.state = state;
return res;
};
_proto.tsTryParseAndCatch = function tsTryParseAndCatch(f) {
var state = this.state.clone();
try {
return f();
} catch (e) {
if (e instanceof SyntaxError) {
this.state = state;
return undefined;
}
throw e;
}
};
_proto.tsTryParse = function tsTryParse(f) {
var state = this.state.clone();
var result = f();
if (result !== undefined && result !== false) {
return result;
} else {
this.state = state;
return undefined;
}
};
_proto.nodeWithSamePosition = function nodeWithSamePosition(original, type) {
var node = this.startNodeAtNode(original);
node.type = type;
node.end = original.end;
node.loc.end = original.loc.end;
if (original.leadingComments) {
node.leadingComments = original.leadingComments;
}
if (original.trailingComments) {
node.trailingComments = original.trailingComments;
}
if (original.innerComments) node.innerComments = original.innerComments;
return node;
};
_proto.tsTryParseDeclare = function tsTryParseDeclare(nany) {
switch (this.state.type) {
case types._function:
this.next();
return this.parseFunction(nany, true);
case types._class:
return this.parseClass(nany, true, false);
case types._const:
if (this.match(types._const) && this.isLookaheadContextual("enum")) {
this.expect(types._const);
this.expectContextual("enum");
return this.tsParseEnumDeclaration(nany, true);
}
case types._var:
case types._let:
return this.parseVarStatement(nany, this.state.type);
case types.name:
{
var value = this.state.value;
if (value === "global") {
return this.tsParseAmbientExternalModuleDeclaration(nany);
} else {
return this.tsParseDeclaration(nany, value, true);
}
}
}
};
_proto.tsTryParseExportDeclaration = function tsTryParseExportDeclaration() {
return this.tsParseDeclaration(this.startNode(), this.state.value, true);
};
_proto.tsParseExpressionStatement = function tsParseExpressionStatement(node, expr) {
switch (expr.name) {
case "declare":
{
var declaration = this.tsTryParseDeclare(node);
if (declaration) {
declaration.declare = true;
return declaration;
}
break;
}
case "global":
if (this.match(types.braceL)) {
var mod = node;
mod.global = true;
mod.id = expr;
mod.body = this.tsParseModuleBlock();
return this.finishNode(mod, "TSModuleDeclaration");
}
break;
default:
return this.tsParseDeclaration(node, expr.name, false);
}
};
_proto.tsParseDeclaration = function tsParseDeclaration(node, value, next) {
switch (value) {
case "abstract":
if (next || this.match(types._class)) {
var cls = node;
cls.abstract = true;
if (next) this.next();
return this.parseClass(cls, true, false);
}
break;
case "enum":
if (next || this.match(types.name)) {
if (next) this.next();
return this.tsParseEnumDeclaration(node, false);
}
break;
case "interface":
if (next || this.match(types.name)) {
if (next) this.next();
return this.tsParseInterfaceDeclaration(node);
}
break;
case "module":
if (next) this.next();
if (this.match(types.string)) {
return this.tsParseAmbientExternalModuleDeclaration(node);
} else if (next || this.match(types.name)) {
return this.tsParseModuleOrNamespaceDeclaration(node);
}
break;
case "namespace":
if (next || this.match(types.name)) {
if (next) this.next();
return this.tsParseModuleOrNamespaceDeclaration(node);
}
break;
case "type":
if (next || this.match(types.name)) {
if (next) this.next();
return this.tsParseTypeAliasDeclaration(node);
}
break;
}
};
_proto.tsTryParseGenericAsyncArrowFunction = function tsTryParseGenericAsyncArrowFunction(startPos, startLoc) {
var _this11 = this;
var res = this.tsTryParseAndCatch(function () {
var node = _this11.startNodeAt(startPos, startLoc);
node.typeParameters = _this11.tsParseTypeParameters();
_superClass.prototype.parseFunctionParams.call(_this11, node);
node.returnType = _this11.tsTryParseTypeOrTypePredicateAnnotation();
_this11.expect(types.arrow);
return node;
});
if (!res) {
return undefined;
}
res.id = null;
res.generator = false;
res.expression = true;
res.async = true;
this.parseFunctionBody(res, true);
return this.finishNode(res, "ArrowFunctionExpression");
};
_proto.tsParseTypeArguments = function tsParseTypeArguments() {
var _this12 = this;
var node = this.startNode();
node.params = this.tsInType(function () {
_this12.expectRelational("<");
return _this12.tsParseDelimitedList("TypeParametersOrArguments", _this12.tsParseType.bind(_this12));
});
this.expectRelational(">");
return this.finishNode(node, "TSTypeParameterInstantiation");
};
_proto.tsIsDeclarationStart = function tsIsDeclarationStart() {
if (this.match(types.name)) {
switch (this.state.value) {
case "abstract":
case "declare":
case "enum":
case "interface":
case "module":
case "namespace":
case "type":
return true;
}
}
return false;
};
_proto.isExportDefaultSpecifier = function isExportDefaultSpecifier() {
if (this.tsIsDeclarationStart()) return false;
return _superClass.prototype.isExportDefaultSpecifier.call(this);
};
_proto.parseAssignableListItem = function parseAssignableListItem(allowModifiers, decorators) {
var accessibility;
var readonly = false;
if (allowModifiers) {
accessibility = this.parseAccessModifier();
readonly = !!this.tsParseModifier(["readonly"]);
}
var left = this.parseMaybeDefault();
this.parseAssignableListItemTypes(left);
var elt = this.parseMaybeDefault(left.start, left.loc.start, left);
if (accessibility || readonly) {
var pp = this.startNodeAtNode(elt);
if (decorators.length) {
pp.decorators = decorators;
}
if (accessibility) pp.accessibility = accessibility;
if (readonly) pp.readonly = readonly;
if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") {
throw this.raise(pp.start, "A parameter property may not be declared using a binding pattern.");
}
pp.parameter = elt;
return this.finishNode(pp, "TSParameterProperty");
} else {
if (decorators.length) {
left.decorators = decorators;
}
return elt;
}
};
_proto.parseFunctionBodyAndFinish = function parseFunctionBodyAndFinish(node, type, allowExpressionBody) {
if (!allowExpressionBody && this.match(types.colon)) {
node.returnType = this.tsParseTypeOrTypePredicateAnnotation(types.colon);
}
var bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" ? "TSDeclareMethod" : undefined;
if (bodilessType && !this.match(types.braceL) && this.isLineTerminator()) {
this.finishNode(node, bodilessType);
return;
}
_superClass.prototype.parseFunctionBodyAndFinish.call(this, node, type, allowExpressionBody);
};
_proto.parseSubscript = function parseSubscript(base, startPos, startLoc, noCalls, state) {
if (!this.hasPrecedingLineBreak() && this.match(types.bang)) {
this.state.exprAllowed = false;
this.next();
var nonNullExpression = this.startNodeAt(startPos, startLoc);
nonNullExpression.expression = base;
return this.finishNode(nonNullExpression, "TSNonNullExpression");
}
if (!noCalls && this.isRelational("<")) {
if (this.atPossibleAsync(base)) {
var asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startPos, startLoc);
if (asyncArrowFn) {
return asyncArrowFn;
}
}
var node = this.startNodeAt(startPos, startLoc);
node.callee = base;
var typeArguments = this.tsTryParseTypeArgumentsInExpression();
if (typeArguments) {
node.arguments = this.parseCallExpressionArguments(types.parenR, false);
node.typeParameters = typeArguments;
return this.finishCallExpression(node);
}
}
return _superClass.prototype.parseSubscript.call(this, base, startPos, startLoc, noCalls, state);
};
_proto.parseNewArguments = function parseNewArguments(node) {
var _this13 = this;
if (this.isRelational("<")) {
var typeParameters = this.tsTryParseAndCatch(function () {
var args = _this13.tsParseTypeArguments();
if (!_this13.match(types.parenL)) _this13.unexpected();
return args;
});
if (typeParameters) {
node.typeParameters = typeParameters;
}
}
_superClass.prototype.parseNewArguments.call(this, node);
};
_proto.parseExprOp = function parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) {
if (nonNull(types._in.binop) > minPrec && !this.hasPrecedingLineBreak() && this.isContextual("as")) {
var node = this.startNodeAt(leftStartPos, leftStartLoc);
node.expression = left;
node.typeAnnotation = this.tsNextThenParseType();
this.finishNode(node, "TSAsExpression");
return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn);
}
return _superClass.prototype.parseExprOp.call(this, left, leftStartPos, leftStartLoc, minPrec, noIn);
};
_proto.checkReservedWord = function checkReservedWord(word, startLoc, checkKeywords, isBinding) {};
_proto.checkDuplicateExports = function checkDuplicateExports() {};
_proto.parseImport = function parseImport(node) {
if (this.match(types.name) && this.lookahead().type === types.eq) {
return this.tsParseImportEqualsDeclaration(node);
}
return _superClass.prototype.parseImport.call(this, node);
};
_proto.parseExport = function parseExport(node) {
if (this.match(types._import)) {
this.expect(types._import);
return this.tsParseImportEqualsDeclaration(node, true);
} else if (this.eat(types.eq)) {
var assign = node;
assign.expression = this.parseExpression();
this.semicolon();
return this.finishNode(assign, "TSExportAssignment");
} else if (this.eatContextual("as")) {
var decl = node;
this.expectContextual("namespace");
decl.id = this.parseIdentifier();
this.semicolon();
return this.finishNode(decl, "TSNamespaceExportDeclaration");
} else {
return _superClass.prototype.parseExport.call(this, node);
}
};
_proto.isAbstractClass = function isAbstractClass() {
return this.isContextual("abstract") && this.lookahead().type === types._class;
};
_proto.parseExportDefaultExpression = function parseExportDefaultExpression() {
if (this.isAbstractClass()) {
var cls = this.startNode();
this.next();
this.parseClass(cls, true, true);
cls.abstract = true;
return cls;
}
return _superClass.prototype.parseExportDefaultExpression.call(this);
};
_proto.parseStatementContent = function parseStatementContent(declaration, topLevel) {
if (this.state.type === types._const) {
var ahead = this.lookahead();
if (ahead.type === types.name && ahead.value === "enum") {
var node = this.startNode();
this.expect(types._const);
this.expectContextual("enum");
return this.tsParseEnumDeclaration(node, true);
}
}
return _superClass.prototype.parseStatementContent.call(this, declaration, topLevel);
};
_proto.parseAccessModifier = function parseAccessModifier() {
return this.tsParseModifier(["public", "protected", "private"]);
};
_proto.parseClassMember = function parseClassMember(classBody, member, state) {
var accessibility = this.parseAccessModifier();
if (accessibility) member.accessibility = accessibility;
_superClass.prototype.parseClassMember.call(this, classBody, member, state);
};
_proto.parseClassMemberWithIsStatic = function parseClassMemberWithIsStatic(classBody, member, state, isStatic) {
var methodOrProp = member;
var prop = member;
var propOrIdx = member;
var abstract = false,
readonly = false;
var mod = this.tsParseModifier(["abstract", "readonly"]);
switch (mod) {
case "readonly":
readonly = true;
abstract = !!this.tsParseModifier(["abstract"]);
break;
case "abstract":
abstract = true;
readonly = !!this.tsParseModifier(["readonly"]);
break;
}
if (abstract) methodOrProp.abstract = true;
if (readonly) propOrIdx.readonly = true;
if (!abstract && !isStatic && !methodOrProp.accessibility) {
var idx = this.tsTryParseIndexSignature(member);
if (idx) {
classBody.body.push(idx);
return;
}
}
if (readonly) {
methodOrProp.static = isStatic;
this.parseClassPropertyName(prop);
this.parsePostMemberNameModifiers(methodOrProp);
this.pushClassProperty(classBody, prop);
return;
}
_superClass.prototype.parseClassMemberWithIsStatic.call(this, classBody, member, state, isStatic);
};
_proto.parsePostMemberNameModifiers = function parsePostMemberNameModifiers(methodOrProp) {
var optional = this.eat(types.question);
if (optional) methodOrProp.optional = true;
};
_proto.parseExpressionStatement = function parseExpressionStatement(node, expr) {
var decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr) : undefined;
return decl || _superClass.prototype.parseExpressionStatement.call(this, node, expr);
};
_proto.shouldParseExportDeclaration = function shouldParseExportDeclaration() {
if (this.tsIsDeclarationStart()) return true;
return _superClass.prototype.shouldParseExportDeclaration.call(this);
};
_proto.parseConditional = function parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) {
if (!refNeedsArrowPos || !this.match(types.question)) {
return _superClass.prototype.parseConditional.call(this, expr, noIn, startPos, startLoc, refNeedsArrowPos);
}
var state = this.state.clone();
try {
return _superClass.prototype.parseConditional.call(this, expr, noIn, startPos, startLoc);
} catch (err) {
if (!(err instanceof SyntaxError)) {
throw err;
}
this.state = state;
refNeedsArrowPos.start = err.pos || this.state.start;
return expr;
}
};
_proto.parseParenItem = function parseParenItem(node, startPos, startLoc) {
node = _superClass.prototype.parseParenItem.call(this, node, startPos, startLoc);
if (this.eat(types.question)) {
node.optional = true;
}
if (this.match(types.colon)) {
var typeCastNode = this.startNodeAt(startPos, startLoc);
typeCastNode.expression = node;
typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();
return this.finishNode(typeCastNode, "TSTypeCastExpression");
}
return node;
};
_proto.parseExportDeclaration = function parseExportDeclaration(node) {
var isDeclare = this.eatContextual("declare");
var declaration;
if (this.match(types.name)) {
declaration = this.tsTryParseExportDeclaration();
}
if (!declaration) {
declaration = _superClass.prototype.parseExportDeclaration.call(this, node);
}
if (declaration && isDeclare) {
declaration.declare = true;
}
return declaration;
};
_proto.parseClassId = function parseClassId(node, isStatement, optionalId) {
if ((!isStatement || optionalId) && this.isContextual("implements")) {
return;
}
_superClass.prototype.parseClassId.apply(this, arguments);
var typeParameters = this.tsTryParseTypeParameters();
if (typeParameters) node.typeParameters = typeParameters;
};
_proto.parseClassProperty = function parseClassProperty(node) {
if (!node.optional && this.eat(types.bang)) {
node.definite = true;
}
var type = this.tsTryParseTypeAnnotation();
if (type) node.typeAnnotation = type;
return _superClass.prototype.parseClassProperty.call(this, node);
};
_proto.pushClassMethod = function pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor) {
var typeParameters = this.tsTryParseTypeParameters();
if (typeParameters) method.typeParameters = typeParameters;
_superClass.prototype.pushClassMethod.call(this, classBody, method, isGenerator, isAsync, isConstructor);
};
_proto.pushClassPrivateMethod = function pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
var typeParameters = this.tsTryParseTypeParameters();
if (typeParameters) method.typeParameters = typeParameters;
_superClass.prototype.pushClassPrivateMethod.call(this, classBody, method, isGenerator, isAsync);
};
_proto.parseClassSuper = function parseClassSuper(node) {
_superClass.prototype.parseClassSuper.call(this, node);
if (node.superClass && this.isRelational("<")) {
node.superTypeParameters = this.tsParseTypeArguments();
}
if (this.eatContextual("implements")) {
node.implements = this.tsParseHeritageClause();
}
};
_proto.parseObjPropValue = function parseObjPropValue(prop) {
var _superClass$prototype;
if (this.isRelational("<")) {
throw new Error("TODO");
}
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
(_superClass$prototype = _superClass.prototype.parseObjPropValue).call.apply(_superClass$prototype, [this, prop].concat(args));
};
_proto.parseFunctionParams = function parseFunctionParams(node, allowModifiers) {
var typeParameters = this.tsTryParseTypeParameters();
if (typeParameters) node.typeParameters = typeParameters;
_superClass.prototype.parseFunctionParams.call(this, node, allowModifiers);
};
_proto.parseVarHead = function parseVarHead(decl) {
_superClass.prototype.parseVarHead.call(this, decl);
if (decl.id.type === "Identifier" && this.eat(types.bang)) {
decl.definite = true;
}
var type = this.tsTryParseTypeAnnotation();
if (type) {
decl.id.typeAnnotation = type;
this.finishNode(decl.id, decl.id.type);
}
};
_proto.parseAsyncArrowFromCallExpression = function parseAsyncArrowFromCallExpression(node, call) {
if (this.match(types.colon)) {
node.returnType = this.tsParseTypeAnnotation();
}
return _superClass.prototype.parseAsyncArrowFromCallExpression.call(this, node, call);
};
_proto.parseMaybeAssign = function parseMaybeAssign() {
var jsxError;
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
if (this.match(types.jsxTagStart)) {
var context = this.curContext();
assert(context === types$1.j_oTag);
assert(this.state.context[this.state.context.length - 2] === types$1.j_expr);
var _state = this.state.clone();
try {
var _superClass$prototype2;
return (_superClass$prototype2 = _superClass.prototype.parseMaybeAssign).call.apply(_superClass$prototype2, [this].concat(args));
} catch (err) {
if (!(err instanceof SyntaxError)) {
throw err;
}
this.state = _state;
assert(this.curContext() === types$1.j_oTag);
this.state.context.pop();
assert(this.curContext() === types$1.j_expr);
this.state.context.pop();
jsxError = err;
}
}
if (jsxError === undefined && !this.isRelational("<")) {
var _superClass$prototype3;
return (_superClass$prototype3 = _superClass.prototype.parseMaybeAssign).call.apply(_superClass$prototype3, [this].concat(args));
}
var arrowExpression;
var typeParameters;
var state = this.state.clone();
try {
var _superClass$prototype4;
typeParameters = this.tsParseTypeParameters();
arrowExpression = (_superClass$prototype4 = _superClass.prototype.parseMaybeAssign).call.apply(_superClass$prototype4, [this].concat(args));
if (arrowExpression.type !== "ArrowFunctionExpression") {
this.unexpected();
}
} catch (err) {
var _superClass$prototype5;
if (!(err instanceof SyntaxError)) {
throw err;
}
if (jsxError) {
throw jsxError;
}
assert(!this.hasPlugin("jsx"));
this.state = state;
return (_superClass$prototype5 = _superClass.prototype.parseMaybeAssign).call.apply(_superClass$prototype5, [this].concat(args));
}
if (typeParameters && typeParameters.params.length !== 0) {
this.resetStartLocationFromNode(arrowExpression, typeParameters.params[0]);
}
arrowExpression.typeParameters = typeParameters;
return arrowExpression;
};
_proto.parseMaybeUnary = function parseMaybeUnary(refShorthandDefaultPos) {
if (!this.hasPlugin("jsx") && this.eatRelational("<")) {
return this.tsParseTypeAssertion();
} else {
return _superClass.prototype.parseMaybeUnary.call(this, refShorthandDefaultPos);
}
};
_proto.parseArrow = function parseArrow(node) {
if (this.match(types.colon)) {
var state = this.state.clone();
try {
var returnType = this.tsParseTypeOrTypePredicateAnnotation(types.colon);
if (this.canInsertSemicolon()) this.unexpected();
if (!this.match(types.arrow)) this.unexpected();
node.returnType = returnType;
} catch (err) {
if (err instanceof SyntaxError) {
this.state = state;
} else {
throw err;
}
}
}
return _superClass.prototype.parseArrow.call(this, node);
};
_proto.parseAssignableListItemTypes = function parseAssignableListItemTypes(param) {
if (this.eat(types.question)) {
if (param.type !== "Identifier") {
throw this.raise(param.start, "A binding pattern parameter cannot be optional in an implementation signature.");
}
param.optional = true;
}
var type = this.tsTryParseTypeAnnotation();
if (type) param.typeAnnotation = type;
return this.finishNode(param, param.type);
};
_proto.toAssignable = function toAssignable(node, isBinding, contextDescription) {
switch (node.type) {
case "TSTypeCastExpression":
return _superClass.prototype.toAssignable.call(this, this.typeCastToParameter(node), isBinding, contextDescription);
case "TSParameterProperty":
return _superClass.prototype.toAssignable.call(this, node, isBinding, contextDescription);
case "TSAsExpression":
case "TSNonNullExpression":
case "TSTypeAssertion":
node.expression = this.toAssignable(node.expression, isBinding, contextDescription);
return node;
default:
return _superClass.prototype.toAssignable.call(this, node, isBinding, contextDescription);
}
};
_proto.checkLVal = function checkLVal(expr, isBinding, checkClashes, contextDescription) {
switch (expr.type) {
case "TSTypeCastExpression":
return;
case "TSParameterProperty":
this.checkLVal(expr.parameter, isBinding, checkClashes, "parameter property");
return;
case "TSAsExpression":
case "TSNonNullExpression":
case "TSTypeAssertion":
this.checkLVal(expr.expression, isBinding, checkClashes, contextDescription);
return;
default:
_superClass.prototype.checkLVal.call(this, expr, isBinding, checkClashes, contextDescription);
return;
}
};
_proto.parseBindingAtom = function parseBindingAtom() {
switch (this.state.type) {
case types._this:
return this.parseIdentifier(true);
default:
return _superClass.prototype.parseBindingAtom.call(this);
}
};
_proto.isClassMethod = function isClassMethod() {
return this.isRelational("<") || _superClass.prototype.isClassMethod.call(this);
};
_proto.isClassProperty = function isClassProperty() {
return this.match(types.bang) || this.match(types.colon) || _superClass.prototype.isClassProperty.call(this);
};
_proto.parseMaybeDefault = function parseMaybeDefault() {
var _superClass$prototype6;
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
var node = (_superClass$prototype6 = _superClass.prototype.parseMaybeDefault).call.apply(_superClass$prototype6, [this].concat(args));
if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, " + "e.g. instead of `age = 25: number` use `age: number = 25`");
}
return node;
};
_proto.readToken = function readToken(code) {
if (this.state.inType && (code === 62 || code === 60)) {
return this.finishOp(types.relational, 1);
} else {
return _superClass.prototype.readToken.call(this, code);
}
};
_proto.toAssignableList = function toAssignableList(exprList, isBinding, contextDescription) {
for (var i = 0; i < exprList.length; i++) {
var expr = exprList[i];
if (expr && expr.type === "TSTypeCastExpression") {
exprList[i] = this.typeCastToParameter(expr);
}
}
return _superClass.prototype.toAssignableList.call(this, exprList, isBinding, contextDescription);
};
_proto.typeCastToParameter = function typeCastToParameter(node) {
node.expression.typeAnnotation = node.typeAnnotation;
return this.finishNodeAt(node.expression, node.expression.type, node.typeAnnotation.end, node.typeAnnotation.loc.end);
};
_proto.toReferencedList = function toReferencedList(exprList) {
for (var i = 0; i < exprList.length; i++) {
var expr = exprList[i];
if (expr && expr._exprListItem && expr.type === "TsTypeCastExpression") {
this.raise(expr.start, "Did not expect a type annotation here.");
}
}
return exprList;
};
_proto.shouldParseArrow = function shouldParseArrow() {
return this.match(types.colon) || _superClass.prototype.shouldParseArrow.call(this);
};
_proto.shouldParseAsyncArrow = function shouldParseAsyncArrow() {
return this.match(types.colon) || _superClass.prototype.shouldParseAsyncArrow.call(this);
};
_proto.canHaveLeadingDecorator = function canHaveLeadingDecorator() {
return _superClass.prototype.canHaveLeadingDecorator.call(this) || this.isAbstractClass();
};
return _class;
}(superClass);
};
function hasPlugin(plugins, name) {
return plugins.some(function (plugin) {
if (Array.isArray(plugin)) {
return plugin[0] === name;
} else {
return plugin === name;
}
});
}
function validatePlugins(plugins) {
if (hasPlugin(plugins, "decorators") && hasPlugin(plugins, "decorators-legacy")) {
throw new Error("Cannot use the decorators and decorators-legacy plugin together");
}
if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) {
throw new Error("Cannot combine flow and typescript plugins.");
}
}
var mixinPluginNames = ["estree", "jsx", "flow", "typescript"];
var mixinPlugins = {
estree: estree,
jsx: jsx,
flow: flow,
typescript: typescript
};
function parse(input, options) {
if (options && options.sourceType === "unambiguous") {
options = Object.assign({}, options);
try {
options.sourceType = "module";
var parser = getParser(options, input);
var ast = parser.parse();
if (!parser.sawUnambiguousESM) ast.program.sourceType = "script";
return ast;
} catch (moduleError) {
try {
options.sourceType = "script";
return getParser(options, input).parse();
} catch (scriptError) {}
throw moduleError;
}
} else {
return getParser(options, input).parse();
}
}
function parseExpression(input, options) {
var parser = getParser(options, input);
if (parser.options.strictMode) {
parser.state.strict = true;
}
return parser.getExpression();
}
function getParser(options, input) {
var cls = Parser;
if (options && options.plugins) {
validatePlugins(options.plugins);
cls = getParserClass(options.plugins);
}
return new cls(options, input);
}
var parserClassCache = {};
function getParserClass(pluginsFromOptions) {
var pluginList = mixinPluginNames.filter(function (name) {
return hasPlugin(pluginsFromOptions, name);
});
var key = pluginList.join("/");
var cls = parserClassCache[key];
if (!cls) {
cls = Parser;
for (var _i2 = 0; _i2 < pluginList.length; _i2++) {
var plugin = pluginList[_i2];
cls = mixinPlugins[plugin](cls);
}
parserClassCache[key] = cls;
}
return cls;
}
exports.parse = parse;
exports.parseExpression = parseExpression;
exports.tokTypes = types;
/***/ }),
/* 101 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.merge = merge;
exports.validate = validate;
exports.normalizeReplacements = normalizeReplacements;
function _objectWithoutProperties(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
if (Object.getOwnPropertySymbols) {
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
for (i = 0; i < sourceSymbolKeys.length; i++) {
key = sourceSymbolKeys[i];
if (excluded.indexOf(key) >= 0) continue;
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
target[key] = source[key];
}
}
return target;
}
function merge(a, b) {
var _b$placeholderWhiteli = b.placeholderWhitelist,
placeholderWhitelist = _b$placeholderWhiteli === void 0 ? a.placeholderWhitelist : _b$placeholderWhiteli,
_b$placeholderPattern = b.placeholderPattern,
placeholderPattern = _b$placeholderPattern === void 0 ? a.placeholderPattern : _b$placeholderPattern,
_b$preserveComments = b.preserveComments,
preserveComments = _b$preserveComments === void 0 ? a.preserveComments : _b$preserveComments;
return {
parser: Object.assign({}, a.parser, b.parser),
placeholderWhitelist: placeholderWhitelist,
placeholderPattern: placeholderPattern,
preserveComments: preserveComments
};
}
function validate(opts) {
if (opts != null && typeof opts !== "object") {
throw new Error("Unknown template options.");
}
var _ref = opts || {},
placeholderWhitelist = _ref.placeholderWhitelist,
placeholderPattern = _ref.placeholderPattern,
preserveComments = _ref.preserveComments,
parser = _objectWithoutProperties(_ref, ["placeholderWhitelist", "placeholderPattern", "preserveComments"]);
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");
}
return {
parser: parser,
placeholderWhitelist: placeholderWhitelist || undefined,
placeholderPattern: placeholderPattern == null ? undefined : placeholderPattern,
preserveComments: preserveComments == null ? false : preserveComments
};
}
function normalizeReplacements(replacements) {
if (Array.isArray(replacements)) {
return replacements.reduce(function (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");
}
/***/ }),
/* 102 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.findPackageData = findPackageData;
exports.findRelativeConfig = findRelativeConfig;
exports.findRootConfig = findRootConfig;
exports.loadConfig = loadConfig;
exports.resolvePlugin = resolvePlugin;
exports.resolvePreset = resolvePreset;
exports.loadPlugin = loadPlugin;
exports.loadPreset = loadPreset;
function findPackageData(filepath) {
return {
filepath: filepath,
directories: [],
pkg: null,
isPackage: false
};
}
function findRelativeConfig(pkgData, envName) {
return {
pkg: null,
config: null,
ignore: null
};
}
function findRootConfig(dirname, envName) {
return null;
}
function loadConfig(name, dirname, envName) {
throw new Error("Cannot load " + name + " relative to " + dirname + " in a browser");
}
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");
}
/***/ }),
/* 103 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.makeStrongCache = makeStrongCache;
exports.makeWeakCache = makeWeakCache;
function makeStrongCache(handler) {
return makeCachedFunction(new Map(), handler);
}
function makeWeakCache(handler) {
return makeCachedFunction(new WeakMap(), handler);
}
function makeCachedFunction(callCache, handler) {
return function cachedFunction(arg, data) {
var cachedValue = callCache.get(arg);
if (cachedValue) {
for (var _iterator = cachedValue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref2;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref2 = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref2 = _i.value;
}
var _ref = _ref2;
var _value = _ref.value,
valid = _ref.valid;
if (valid(data)) return _value;
}
}
var cache = new CacheConfigurator(data);
var value = handler(arg, cache);
if (!cache.configured()) cache.forever();
cache.deactivate();
switch (cache.mode()) {
case "forever":
cachedValue = [{
value: value,
valid: function valid() {
return true;
}
}];
callCache.set(arg, cachedValue);
break;
case "invalidate":
cachedValue = [{
value: value,
valid: cache.validator()
}];
callCache.set(arg, cachedValue);
break;
case "valid":
if (cachedValue) {
cachedValue.push({
value: value,
valid: cache.validator()
});
} else {
cachedValue = [{
value: value,
valid: cache.validator()
}];
callCache.set(arg, cachedValue);
}
}
return value;
};
}
var CacheConfigurator = function () {
function CacheConfigurator(data) {
this._active = true;
this._never = false;
this._forever = false;
this._invalidate = false;
this._configured = false;
this._pairs = [];
this._data = data;
}
var _proto = CacheConfigurator.prototype;
_proto.simple = function simple() {
return makeSimpleConfigurator(this);
};
_proto.mode = function mode() {
if (this._never) return "never";
if (this._forever) return "forever";
if (this._invalidate) return "invalidate";
return "valid";
};
_proto.forever = function 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;
};
_proto.never = function 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;
};
_proto.using = function 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;
var key = handler(this._data);
this._pairs.push([key, handler]);
return key;
};
_proto.invalidate = function invalidate(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._invalidate = true;
this._configured = true;
var key = handler(this._data);
this._pairs.push([key, handler]);
return key;
};
_proto.validator = function validator() {
var pairs = this._pairs;
return function (data) {
return pairs.every(function (_ref3) {
var key = _ref3[0],
fn = _ref3[1];
return key === fn(data);
});
};
};
_proto.deactivate = function deactivate() {
this._active = false;
};
_proto.configured = function configured() {
return this._configured;
};
return CacheConfigurator;
}();
function makeSimpleConfigurator(cache) {
function cacheFn(val) {
if (typeof val === "boolean") {
if (val) cache.forever();else cache.never();
return;
}
return cache.using(val);
}
cacheFn.forever = function () {
return cache.forever();
};
cacheFn.never = function () {
return cache.never();
};
cacheFn.using = function (cb) {
return cache.using(function () {
return cb();
});
};
cacheFn.invalidate = function (cb) {
return cache.invalidate(function () {
return cb();
});
};
return cacheFn;
}
/***/ }),
/* 104 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var Plugin = function Plugin(plugin, options, key) {
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;
};
exports.default = Plugin;
/***/ }),
/* 105 */
/***/ (function(module, exports, __webpack_require__) {
var isDescriptor = __webpack_require__(30);
module.exports = function defineProperty(obj, prop, val) {
if (typeof obj !== 'object' && typeof obj !== 'function') {
throw new TypeError('expected an object or function.');
}
if (typeof prop !== 'string') {
throw new TypeError('expected `prop` to be a string.');
}
if (isDescriptor(val) && ('set' in val || 'get' in val)) {
return Object.defineProperty(obj, prop, val);
}
return Object.defineProperty(obj, prop, {
configurable: true,
enumerable: false,
writable: true,
value: val
});
};
/***/ }),
/* 106 */
/***/ (function(module, exports, __webpack_require__) {
var typeOf = __webpack_require__(36);
module.exports = function isNumber(num) {
var type = typeOf(num);
if (type === 'string') {
if (!num.trim()) return false;
} else if (type !== 'number') {
return false;
}
return num - num + 1 >= 0;
};
/***/ }),
/* 107 */
/***/ (function(module, exports, __webpack_require__) {
var typeOf = __webpack_require__(36);
module.exports = function toPath(args) {
if (typeOf(args) !== 'arguments') {
args = arguments;
}
return filter(args).join('.');
};
function filter(arr) {
var len = arr.length;
var idx = -1;
var res = [];
while (++idx < len) {
var ele = arr[idx];
if (typeOf(ele) === 'arguments' || Array.isArray(ele)) {
res.push.apply(res, filter(ele));
} else if (typeof ele === 'string') {
res.push(ele);
}
}
return res;
}
/***/ }),
/* 108 */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(192);
function FragmentCache(caches) {
this.caches = caches || {};
}
FragmentCache.prototype = {
cache: function cache(cacheName) {
return this.caches[cacheName] || (this.caches[cacheName] = new MapCache());
},
set: function set(cacheName, key, val) {
var cache = this.cache(cacheName);
cache.set(key, val);
return cache;
},
has: function has(cacheName, key) {
return typeof this.get(cacheName, key) !== 'undefined';
},
get: function get(name, key) {
var cache = this.cache(name);
if (typeof key === 'string') {
return cache.get(key);
}
return cache;
}
};
exports = module.exports = FragmentCache;
/***/ }),
/* 109 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.validate = validate;
var _plugin = _interopRequireDefault(__webpack_require__(104));
var _removed = _interopRequireDefault(__webpack_require__(582));
var _optionAssertions = __webpack_require__(204);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
var ROOT_VALIDATORS = {
cwd: _optionAssertions.assertString,
root: _optionAssertions.assertString,
configFile: _optionAssertions.assertConfigFileSearch,
filename: _optionAssertions.assertString,
filenameRelative: _optionAssertions.assertString,
code: _optionAssertions.assertBoolean,
ast: _optionAssertions.assertBoolean,
envName: _optionAssertions.assertString
};
var BABELRC_VALIDATORS = {
babelrc: _optionAssertions.assertBoolean,
babelrcRoots: _optionAssertions.assertBabelrcSearch
};
var NONPRESET_VALIDATORS = {
extends: _optionAssertions.assertString,
ignore: _optionAssertions.assertIgnoreList,
only: _optionAssertions.assertIgnoreList
};
var COMMON_VALIDATORS = {
inputSourceMap: _optionAssertions.assertInputSourceMap,
presets: _optionAssertions.assertPluginList,
plugins: _optionAssertions.assertPluginList,
passPerPreset: _optionAssertions.assertBoolean,
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,
getModuleId: _optionAssertions.assertFunction,
moduleRoot: _optionAssertions.assertString,
moduleIds: _optionAssertions.assertBoolean,
moduleId: _optionAssertions.assertString,
parserOpts: _optionAssertions.assertObject,
generatorOpts: _optionAssertions.assertObject
};
function validate(type, opts) {
assertNoDuplicateSourcemap(opts);
Object.keys(opts).forEach(function (key) {
if (type === "preset" && NONPRESET_VALIDATORS[key]) {
throw new Error("." + key + " is not allowed in preset options");
}
if (type !== "arguments" && ROOT_VALIDATORS[key]) {
throw new Error("." + key + " is only allowed in root programmatic options");
}
if (type !== "arguments" && type !== "configfile" && BABELRC_VALIDATORS[key]) {
if (type === "babelrcfile" || type === "extendsfile") {
throw new Error("." + key + " is not allowed in .babelrc or \"extend\"ed files, only in root programmatic options, " + "or babel.config.js/config file options");
}
throw new Error("." + key + " is only allowed in root programmatic options, or babel.config.js/config file options");
}
if (type === "env" && key === "env") {
throw new Error("." + key + " is not allowed inside another env block");
}
if (type === "env" && key === "overrides") {
throw new Error("." + key + " is not allowed inside an env block");
}
if (type === "override" && key === "overrides") {
throw new Error("." + key + " is not allowed inside an overrides block");
}
var validator = COMMON_VALIDATORS[key] || NONPRESET_VALIDATORS[key] || BABELRC_VALIDATORS[key] || ROOT_VALIDATORS[key];
if (validator) validator(key, opts[key]);else throw buildUnknownError(key);
});
return opts;
}
function buildUnknownError(key) {
if (_removed.default[key]) {
var _removed$default$key = _removed.default[key],
message = _removed$default$key.message,
_removed$default$key$ = _removed$default$key.version,
version = _removed$default$key$ === void 0 ? 5 : _removed$default$key$;
throw new ReferenceError("Using removed Babel " + version + " option: ." + key + " - " + message);
} else {
var unknownOptErr = "Unknown option: ." + key + ". Check out http://babeljs.io/docs/usage/options/ for more information about options.";
throw new ReferenceError(unknownOptErr);
}
}
function has(obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key);
}
function assertNoDuplicateSourcemap(opts) {
if (has(opts, "sourceMap") && has(opts, "sourceMaps")) {
throw new Error(".sourceMap is an alias for .sourceMaps, cannot use both");
}
}
function assertEnvSet(key, value) {
var obj = (0, _optionAssertions.assertObject)(key, value);
if (obj) {
var _arr = Object.keys(obj);
for (var _i = 0; _i < _arr.length; _i++) {
var _key = _arr[_i];
var env = (0, _optionAssertions.assertObject)(_key, obj[_key]);
if (env) validate("env", env);
}
}
return obj;
}
function assertOverridesList(key, value) {
var arr = (0, _optionAssertions.assertArray)(key, value);
if (arr) {
for (var _iterator = arr.entries(), _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i2 >= _iterator.length) break;
_ref = _iterator[_i2++];
} else {
_i2 = _iterator.next();
if (_i2.done) break;
_ref = _i2.value;
}
var _ref2 = _ref,
index = _ref2[0],
item = _ref2[1];
var env = (0, _optionAssertions.assertObject)("" + index, item);
if (!env) throw new Error("." + key + "[" + index + "] must be an object");
validate("override", env);
}
}
return arr;
}
/***/ }),
/* 110 */
/***/ (function(module, exports, __webpack_require__) {
var isArray = __webpack_require__(10),
isSymbol = __webpack_require__(42);
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
reIsPlainProp = /^\w*$/;
function isKey(value, object) {
if (isArray(value)) {
return false;
}
var type = typeof value;
if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
return true;
}
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
}
module.exports = isKey;
/***/ }),
/* 111 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _helperPluginUtils() {
var data = __webpack_require__(2);
_helperPluginUtils = function _helperPluginUtils() {
return data;
};
return data;
}
var _default = (0, _helperPluginUtils().declare)(function (api, options) {
api.assertVersion(7);
var all = options.all;
if (typeof all !== "boolean" && typeof all !== "undefined") {
throw new Error(".all must be a boolean, or undefined");
}
return {
manipulateOptions: function manipulateOptions(opts, parserOpts) {
if (parserOpts.plugins.some(function (p) {
return (Array.isArray(p) ? p[0] : p) === "typescript";
})) {
return;
}
parserOpts.plugins.push(["flow", {
all: all
}]);
}
};
});
exports.default = _default;
/***/ }),
/* 112 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = annotateAsPure;
function t() {
var data = _interopRequireWildcard(__webpack_require__(4));
t = function t() {
return data;
};
return data;
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
var PURE_ANNOTATION = "#__PURE__";
var isPureAnnotated = function isPureAnnotated(_ref) {
var leadingComments = _ref.leadingComments;
return !!leadingComments && leadingComments.some(function (comment) {
return /[@#]__PURE__/.test(comment.value);
});
};
function annotateAsPure(pathOrNode) {
var node = pathOrNode.node || pathOrNode;
if (isPureAnnotated(node)) {
return;
}
t().addComment(node, "leading", PURE_ANNOTATION);
}
/***/ }),
/* 113 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addDefault = addDefault;
exports.addNamed = addNamed;
exports.addNamespace = addNamespace;
exports.addSideEffect = addSideEffect;
Object.defineProperty(exports, "ImportInjector", {
enumerable: true,
get: function get() {
return _importInjector.default;
}
});
Object.defineProperty(exports, "isModule", {
enumerable: true,
get: function get() {
return _isModule.default;
}
});
var _importInjector = _interopRequireDefault(__webpack_require__(628));
var _isModule = _interopRequireDefault(__webpack_require__(235));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
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);
}
/***/ }),
/* 114 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.environmentVisitor = void 0;
function _traverse() {
var data = _interopRequireDefault(__webpack_require__(12));
_traverse = function _traverse() {
return data;
};
return data;
}
function _helperMemberExpressionToFunctions() {
var data = _interopRequireDefault(__webpack_require__(238));
_helperMemberExpressionToFunctions = function _helperMemberExpressionToFunctions() {
return data;
};
return data;
}
function _helperOptimiseCallExpression() {
var data = _interopRequireDefault(__webpack_require__(115));
_helperOptimiseCallExpression = function _helperOptimiseCallExpression() {
return data;
};
return data;
}
function t() {
var data = _interopRequireWildcard(__webpack_require__(4));
t = function t() {
return data;
};
return data;
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function getPrototypeOfExpression(objectRef, isStatic, file) {
objectRef = t().cloneNode(objectRef);
var targetRef = isStatic ? objectRef : t().memberExpression(objectRef, t().identifier("prototype"));
return t().callExpression(file.addHelper("getPrototypeOf"), [targetRef]);
}
function skipAllButComputedKey(path) {
if (!path.node.computed) {
path.skip();
return;
}
var keys = t().VISITOR_KEYS[path.type];
for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var key = _ref;
if (key !== "key") path.skipKey(key);
}
}
var environmentVisitor = {
Function: function Function(path) {
if (path.isMethod()) return;
if (path.isArrowFunctionExpression()) return;
path.skip();
},
Method: function Method(path) {
skipAllButComputedKey(path);
},
"ClassProperty|ClassPrivateProperty": function ClassPropertyClassPrivateProperty(path) {
if (path.node.static) return;
skipAllButComputedKey(path);
}
};
exports.environmentVisitor = environmentVisitor;
var visitor = _traverse().default.visitors.merge([environmentVisitor, {
Super: function Super(path, state) {
var node = path.node,
parentPath = path.parentPath;
if (!parentPath.isMemberExpression({
object: node
})) return;
state.handle(parentPath);
}
}]);
var specHandlers = {
memoise: function memoise(superMember, count) {
var scope = superMember.scope,
node = superMember.node;
var computed = node.computed,
property = node.property;
if (!computed) {
return;
}
var memo = scope.maybeGenerateMemoised(property);
if (!memo) {
return;
}
this.memoiser.set(property, memo, count);
},
prop: function prop(superMember) {
var _superMember$node = superMember.node,
computed = _superMember$node.computed,
property = _superMember$node.property;
if (this.memoiser.has(property)) {
return t().cloneNode(this.memoiser.get(property));
}
if (computed) {
return t().cloneNode(property);
}
return t().stringLiteral(property.name);
},
get: function get(superMember) {
return t().callExpression(this.file.addHelper("get"), [getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file), this.prop(superMember), t().thisExpression()]);
},
set: function set(superMember, value) {
return t().callExpression(this.file.addHelper("set"), [getPrototypeOfExpression(this.getObjectRef(), this.isStatic, this.file), this.prop(superMember), value, t().thisExpression(), t().booleanLiteral(superMember.isInStrictMode())]);
},
call: function call(superMember, args) {
return (0, _helperOptimiseCallExpression().default)(this.get(superMember), t().thisExpression(), args);
}
};
var looseHandlers = Object.assign({}, specHandlers, {
prop: function prop(superMember) {
var property = superMember.node.property;
if (this.memoiser.has(property)) {
return t().cloneNode(this.memoiser.get(property));
}
return t().cloneNode(property);
},
get: function get(superMember) {
var isStatic = this.isStatic,
superRef = this.superRef;
var computed = superMember.node.computed;
var prop = this.prop(superMember);
var object;
if (isStatic) {
object = superRef ? t().cloneNode(superRef) : t().memberExpression(t().identifier("Function"), t().identifier("prototype"));
} else {
object = superRef ? t().memberExpression(t().cloneNode(superRef), t().identifier("prototype")) : t().memberExpression(t().identifier("Object"), t().identifier("prototype"));
}
return t().memberExpression(object, prop, computed);
},
set: function set(superMember, value) {
var computed = superMember.node.computed;
var prop = this.prop(superMember);
return t().assignmentExpression("=", t().memberExpression(t().thisExpression(), prop, computed), value);
}
});
var ReplaceSupers = function () {
function ReplaceSupers(opts) {
var path = opts.methodPath;
this.methodPath = path;
this.isStatic = path.isClassMethod({
static: true
}) || path.isObjectMethod();
this.file = opts.file;
this.superRef = opts.superRef;
this.isLoose = opts.isLoose;
this.opts = opts;
}
var _proto = ReplaceSupers.prototype;
_proto.getObjectRef = function getObjectRef() {
return t().cloneNode(this.opts.objectRef || this.opts.getObjectRef());
};
_proto.replace = function replace() {
var handler = this.isLoose ? looseHandlers : specHandlers;
(0, _helperMemberExpressionToFunctions().default)(this.methodPath, visitor, Object.assign({
file: this.file,
isStatic: this.isStatic,
getObjectRef: this.getObjectRef.bind(this),
superRef: this.superRef
}, handler));
};
return ReplaceSupers;
}();
exports.default = ReplaceSupers;
/***/ }),
/* 115 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
function t() {
var data = _interopRequireWildcard(__webpack_require__(4));
t = function t() {
return data;
};
return data;
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function _default(callee, thisNode, args) {
if (args.length === 1 && t().isSpreadElement(args[0]) && t().isIdentifier(args[0].argument, {
name: "arguments"
})) {
return t().callExpression(t().memberExpression(callee, t().identifier("apply")), [thisNode, args[0].argument]);
} else {
return t().callExpression(t().memberExpression(callee, t().identifier("call")), [thisNode].concat(args));
}
}
/***/ }),
/* 116 */
/***/ (function(module, exports, __webpack_require__) {
function _templateObject11() {
var data = _taggedTemplateLiteralLoose(["EXPORTS.NAME = VALUE"]);
_templateObject11 = function _templateObject11() {
return data;
};
return data;
}
function _templateObject10() {
var data = _taggedTemplateLiteralLoose(["\n if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;\n "]);
_templateObject10 = function _templateObject10() {
return data;
};
return data;
}
function _templateObject9() {
var data = _taggedTemplateLiteralLoose(["\n Object.keys(NAMESPACE).forEach(function(key) {\n if (key === \"default\" || key === \"__esModule\") return;\n VERIFY_NAME_LIST;\n\n Object.defineProperty(EXPORTS, key, {\n enumerable: true,\n get: function() {\n return NAMESPACE[key];\n },\n });\n });\n "]);
_templateObject9 = function _templateObject9() {
return data;
};
return data;
}
function _templateObject8() {
var data = _taggedTemplateLiteralLoose(["\n Object.keys(NAMESPACE).forEach(function(key) {\n if (key === \"default\" || key === \"__esModule\") return;\n VERIFY_NAME_LIST;\n\n EXPORTS[key] = NAMESPACE[key];\n });\n "]);
_templateObject8 = function _templateObject8() {
return data;
};
return data;
}
function _templateObject7() {
var data = _taggedTemplateLiteralLoose(["\n Object.defineProperty(EXPORTS, \"__esModule\", {\n value: true,\n });\n "]);
_templateObject7 = function _templateObject7() {
return data;
};
return data;
}
function _templateObject6() {
var data = _taggedTemplateLiteralLoose(["\n EXPORTS.__esModule = true;\n "]);
_templateObject6 = function _templateObject6() {
return data;
};
return data;
}
function _templateObject5() {
var data = _taggedTemplateLiteralLoose(["\n Object.defineProperty(EXPORTS, \"EXPORT_NAME\", {\n enumerable: true,\n get: function() {\n return NAMESPACE.IMPORT_NAME;\n },\n });\n "]);
_templateObject5 = function _templateObject5() {
return data;
};
return data;
}
function _templateObject4() {
var data = _taggedTemplateLiteralLoose(["EXPORTS.EXPORT_NAME = NAMESPACE.IMPORT_NAME;"]);
_templateObject4 = function _templateObject4() {
return data;
};
return data;
}
function _templateObject3() {
var data = _taggedTemplateLiteralLoose(["EXPORTS.NAME = NAMESPACE;"]);
_templateObject3 = function _templateObject3() {
return data;
};
return data;
}
function _templateObject2() {
var data = _taggedTemplateLiteralLoose(["\n Object.defineProperty(EXPORTS, \"NAME\", {\n enumerable: true,\n get: function() {\n return NAMESPACE;\n }\n });\n "]);
_templateObject2 = function _templateObject2() {
return data;
};
return data;
}
function _templateObject() {
var data = _taggedTemplateLiteralLoose(["var NAME = SOURCE;"]);
_templateObject = function _templateObject() {
return data;
};
return data;
}
function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.rewriteModuleStatementsAndPrepareHeader = rewriteModuleStatementsAndPrepareHeader;
exports.ensureStatementsHoisted = ensureStatementsHoisted;
exports.wrapInterop = wrapInterop;
exports.buildNamespaceInitStatements = buildNamespaceInitStatements;
Object.defineProperty(exports, "isModule", {
enumerable: true,
get: function get() {
return _helperModuleImports().isModule;
}
});
Object.defineProperty(exports, "hasExports", {
enumerable: true,
get: function get() {
return _normalizeAndLoadMetadata.hasExports;
}
});
Object.defineProperty(exports, "isSideEffectImport", {
enumerable: true,
get: function get() {
return _normalizeAndLoadMetadata.isSideEffectImport;
}
});
function _assert() {
var data = _interopRequireDefault(__webpack_require__(19));
_assert = function _assert() {
return data;
};
return data;
}
function t() {
var data = _interopRequireWildcard(__webpack_require__(4));
t = function t() {
return data;
};
return data;
}
function _template() {
var data = _interopRequireDefault(__webpack_require__(29));
_template = function _template() {
return data;
};
return data;
}
function _chunk() {
var data = _interopRequireDefault(__webpack_require__(1029));
_chunk = function _chunk() {
return data;
};
return data;
}
function _helperModuleImports() {
var data = __webpack_require__(113);
_helperModuleImports = function _helperModuleImports() {
return data;
};
return data;
}
var _rewriteThis = _interopRequireDefault(__webpack_require__(1031));
var _rewriteLiveReferences = _interopRequireDefault(__webpack_require__(1032));
var _normalizeAndLoadMetadata = _interopRequireWildcard(__webpack_require__(1033));
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function rewriteModuleStatementsAndPrepareHeader(path, _ref) {
var exportName = _ref.exportName,
strict = _ref.strict,
allowTopLevelThis = _ref.allowTopLevelThis,
strictMode = _ref.strictMode,
loose = _ref.loose,
noInterop = _ref.noInterop,
lazy = _ref.lazy,
esNamespaceOnly = _ref.esNamespaceOnly;
(0, _assert().default)((0, _helperModuleImports().isModule)(path), "Cannot process module statements in a script");
path.node.sourceType = "script";
var meta = (0, _normalizeAndLoadMetadata.default)(path, exportName, {
noInterop: noInterop,
loose: loose,
lazy: lazy,
esNamespaceOnly: esNamespaceOnly
});
if (!allowTopLevelThis) {
(0, _rewriteThis.default)(path);
}
(0, _rewriteLiveReferences.default)(path, meta);
if (strictMode !== false) {
var hasStrict = path.node.directives.some(function (directive) {
return directive.value.value === "use strict";
});
if (!hasStrict) {
path.unshiftContainer("directives", t().directive(t().directiveLiteral("use strict")));
}
}
var headers = [];
if ((0, _normalizeAndLoadMetadata.hasExports)(meta) && !strict) {
headers.push(buildESModuleHeader(meta, loose));
}
var nameList = buildExportNameListDeclaration(path, meta);
if (nameList) {
meta.exportNameListName = nameList.name;
headers.push(nameList.statement);
}
headers.push.apply(headers, buildExportInitializationStatements(path, meta, loose));
return {
meta: meta,
headers: headers
};
}
function ensureStatementsHoisted(statements) {
statements.forEach(function (header) {
header._blockHoist = 3;
});
}
function wrapInterop(programPath, expr, type) {
if (type === "none") {
return null;
}
var helper;
if (type === "default") {
helper = "interopRequireDefault";
} else if (type === "namespace") {
helper = "interopRequireWildcard";
} else {
throw new Error("Unknown interop: " + type);
}
return t().callExpression(programPath.hub.file.addHelper(helper), [expr]);
}
function buildNamespaceInitStatements(metadata, sourceMetadata, loose) {
if (loose === void 0) {
loose = false;
}
var statements = [];
var srcNamespace = t().identifier(sourceMetadata.name);
if (sourceMetadata.lazy) srcNamespace = t().callExpression(srcNamespace, []);
for (var _iterator = sourceMetadata.importsNamespace, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref2;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref2 = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref2 = _i.value;
}
var localName = _ref2;
if (localName === sourceMetadata.name) continue;
statements.push(_template().default.statement(_templateObject())({
NAME: localName,
SOURCE: t().cloneNode(srcNamespace)
}));
}
if (loose) {
statements.push.apply(statements, buildReexportsFromMeta(metadata, sourceMetadata, loose));
}
for (var _iterator2 = sourceMetadata.reexportNamespace, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
var _ref3;
if (_isArray2) {
if (_i2 >= _iterator2.length) break;
_ref3 = _iterator2[_i2++];
} else {
_i2 = _iterator2.next();
if (_i2.done) break;
_ref3 = _i2.value;
}
var exportName = _ref3;
statements.push((sourceMetadata.lazy ? _template().default.statement(_templateObject2()) : _template().default.statement(_templateObject3()))({
EXPORTS: metadata.exportName,
NAME: exportName,
NAMESPACE: t().cloneNode(srcNamespace)
}));
}
if (sourceMetadata.reexportAll) {
var statement = buildNamespaceReexport(metadata, t().cloneNode(srcNamespace), loose);
statement.loc = sourceMetadata.reexportAll.loc;
statements.push(statement);
}
return statements;
}
var getTemplateForReexport = function getTemplateForReexport(loose) {
return loose ? _template().default.statement(_templateObject4()) : _template().default(_templateObject5());
};
var buildReexportsFromMeta = function buildReexportsFromMeta(meta, metadata, loose) {
var namespace = metadata.lazy ? t().callExpression(t().identifier(metadata.name), []) : t().identifier(metadata.name);
var templateForCurrentMode = getTemplateForReexport(loose);
return Array.from(metadata.reexports, function (_ref4) {
var exportName = _ref4[0],
importName = _ref4[1];
return templateForCurrentMode({
EXPORTS: meta.exportName,
EXPORT_NAME: exportName,
NAMESPACE: t().cloneNode(namespace),
IMPORT_NAME: importName
});
});
};
function buildESModuleHeader(metadata, enumerable) {
if (enumerable === void 0) {
enumerable = false;
}
return (enumerable ? _template().default.statement(_templateObject6()) : _template().default.statement(_templateObject7()))({
EXPORTS: metadata.exportName
});
}
function buildNamespaceReexport(metadata, namespace, loose) {
return (loose ? _template().default.statement(_templateObject8()) : _template().default.statement(_templateObject9()))({
NAMESPACE: namespace,
EXPORTS: metadata.exportName,
VERIFY_NAME_LIST: metadata.exportNameListName ? _template().default(_templateObject10())({
EXPORTS_LIST: metadata.exportNameListName
}) : null
});
}
function buildExportNameListDeclaration(programPath, metadata) {
var exportedVars = Object.create(null);
for (var _iterator3 = metadata.local.values(), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
var _ref5;
if (_isArray3) {
if (_i3 >= _iterator3.length) break;
_ref5 = _iterator3[_i3++];
} else {
_i3 = _iterator3.next();
if (_i3.done) break;
_ref5 = _i3.value;
}
var data = _ref5;
for (var _iterator5 = data.names, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
var _ref7;
if (_isArray5) {
if (_i5 >= _iterator5.length) break;
_ref7 = _iterator5[_i5++];
} else {
_i5 = _iterator5.next();
if (_i5.done) break;
_ref7 = _i5.value;
}
var _name = _ref7;
exportedVars[_name] = true;
}
}
var hasReexport = false;
for (var _iterator4 = metadata.source.values(), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
var _ref6;
if (_isArray4) {
if (_i4 >= _iterator4.length) break;
_ref6 = _iterator4[_i4++];
} else {
_i4 = _iterator4.next();
if (_i4.done) break;
_ref6 = _i4.value;
}
var _data = _ref6;
for (var _iterator6 = _data.reexports.keys(), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
var _ref8;
if (_isArray6) {
if (_i6 >= _iterator6.length) break;
_ref8 = _iterator6[_i6++];
} else {
_i6 = _iterator6.next();
if (_i6.done) break;
_ref8 = _i6.value;
}
var exportName = _ref8;
exportedVars[exportName] = true;
}
for (var _iterator7 = _data.reexportNamespace, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
var _ref9;
if (_isArray7) {
if (_i7 >= _iterator7.length) break;
_ref9 = _iterator7[_i7++];
} else {
_i7 = _iterator7.next();
if (_i7.done) break;
_ref9 = _i7.value;
}
var _exportName = _ref9;
exportedVars[_exportName] = true;
}
hasReexport = hasReexport || _data.reexportAll;
}
if (!hasReexport || Object.keys(exportedVars).length === 0) return null;
var name = programPath.scope.generateUidIdentifier("exportNames");
delete exportedVars.default;
return {
name: name.name,
statement: t().variableDeclaration("var", [t().variableDeclarator(name, t().valueToNode(exportedVars))])
};
}
function buildExportInitializationStatements(programPath, metadata, loose) {
if (loose === void 0) {
loose = false;
}
var initStatements = [];
var exportNames = [];
for (var _iterator8 = metadata.local, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
var _ref10;
if (_isArray8) {
if (_i8 >= _iterator8.length) break;
_ref10 = _iterator8[_i8++];
} else {
_i8 = _iterator8.next();
if (_i8.done) break;
_ref10 = _i8.value;
}
var _ref12 = _ref10,
localName = _ref12[0],
data = _ref12[1];
if (data.kind === "import") {} else if (data.kind === "hoisted") {
initStatements.push(buildInitStatement(metadata, data.names, t().identifier(localName)));
} else {
exportNames.push.apply(exportNames, data.names);
}
}
for (var _iterator9 = metadata.source.values(), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) {
var _ref11;
if (_isArray9) {
if (_i9 >= _iterator9.length) break;
_ref11 = _iterator9[_i9++];
} else {
_i9 = _iterator9.next();
if (_i9.done) break;
_ref11 = _i9.value;
}
var data = _ref11;
if (!loose) {
initStatements.push.apply(initStatements, buildReexportsFromMeta(metadata, data, loose));
}
for (var _iterator10 = data.reexportNamespace, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) {
var _ref13;
if (_isArray10) {
if (_i10 >= _iterator10.length) break;
_ref13 = _iterator10[_i10++];
} else {
_i10 = _iterator10.next();
if (_i10.done) break;
_ref13 = _i10.value;
}
var exportName = _ref13;
exportNames.push(exportName);
}
}
initStatements.push.apply(initStatements, (0, _chunk().default)(exportNames, 100).map(function (members) {
return buildInitStatement(metadata, members, programPath.scope.buildUndefinedNode());
}));
return initStatements;
}
function buildInitStatement(metadata, exportNames, initExpr) {
return t().expressionStatement(exportNames.reduce(function (acc, exportName) {
return _template().default.expression(_templateObject11())({
EXPORTS: metadata.exportName,
NAME: exportName,
VALUE: acc
});
}, initExpr));
}
/***/ }),
/* 117 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
function _esutils() {
var data = _interopRequireDefault(__webpack_require__(86));
_esutils = function _esutils() {
return data;
};
return data;
}
function t() {
var data = _interopRequireWildcard(__webpack_require__(4));
t = function t() {
return data;
};
return data;
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function _default(opts) {
var visitor = {};
visitor.JSXNamespacedName = function (path) {
if (opts.throwIfNamespace) {
throw path.buildCodeFrameError("Namespace tags are not supported by default. React's JSX doesn't support namespace tags. You can turn on the 'throwIfNamespace' flag to bypass this warning.");
}
};
visitor.JSXElement = {
exit: function exit(path, file) {
var callExpr = buildElementCall(path, file);
if (callExpr) {
path.replaceWith(t().inherits(callExpr, path.node));
}
}
};
visitor.JSXFragment = {
exit: function exit(path, file) {
if (opts.compat) {
throw path.buildCodeFrameError("Fragment tags are only supported in React 16 and up.");
}
var callExpr = buildFragmentCall(path, file);
if (callExpr) {
path.replaceWith(t().inherits(callExpr, path.node));
}
}
};
return visitor;
function convertJSXIdentifier(node, parent) {
if (t().isJSXIdentifier(node)) {
if (node.name === "this" && t().isReferenced(node, parent)) {
return t().thisExpression();
} else if (_esutils().default.keyword.isIdentifierNameES6(node.name)) {
node.type = "Identifier";
} else {
return t().stringLiteral(node.name);
}
} else if (t().isJSXMemberExpression(node)) {
return t().memberExpression(convertJSXIdentifier(node.object, node), convertJSXIdentifier(node.property, node));
} else if (t().isJSXNamespacedName(node)) {
return t().stringLiteral(node.namespace.name + ":" + node.name.name);
}
return node;
}
function convertAttributeValue(node) {
if (t().isJSXExpressionContainer(node)) {
return node.expression;
} else {
return node;
}
}
function convertAttribute(node) {
var value = convertAttributeValue(node.value || t().booleanLiteral(true));
if (t().isStringLiteral(value) && !t().isJSXExpressionContainer(node.value)) {
value.value = value.value.replace(/\n\s+/g, " ");
if (value.extra && value.extra.raw) {
delete value.extra.raw;
}
}
if (t().isJSXNamespacedName(node.name)) {
node.name = t().stringLiteral(node.name.namespace.name + ":" + node.name.name.name);
} else if (_esutils().default.keyword.isIdentifierNameES6(node.name.name)) {
node.name.type = "Identifier";
} else {
node.name = t().stringLiteral(node.name.name);
}
return t().inherits(t().objectProperty(node.name, value), node);
}
function buildElementCall(path, file) {
if (opts.filter && !opts.filter(path.node, file)) return;
var openingPath = path.get("openingElement");
openingPath.parent.children = t().react.buildChildren(openingPath.parent);
var tagExpr = convertJSXIdentifier(openingPath.node.name, openingPath.node);
var args = [];
var tagName;
if (t().isIdentifier(tagExpr)) {
tagName = tagExpr.name;
} else if (t().isLiteral(tagExpr)) {
tagName = tagExpr.value;
}
var state = {
tagExpr: tagExpr,
tagName: tagName,
args: args
};
if (opts.pre) {
opts.pre(state, file);
}
var attribs = openingPath.node.attributes;
if (attribs.length) {
attribs = buildOpeningElementAttributes(attribs, file);
} else {
attribs = t().nullLiteral();
}
args.push.apply(args, [attribs].concat(path.node.children));
if (opts.post) {
opts.post(state, file);
}
return state.call || t().callExpression(state.callee, args);
}
function pushProps(_props, objs) {
if (!_props.length) return _props;
objs.push(t().objectExpression(_props));
return [];
}
function buildOpeningElementAttributes(attribs, file) {
var _props = [];
var objs = [];
var useBuiltIns = file.opts.useBuiltIns || false;
if (typeof useBuiltIns !== "boolean") {
throw new Error("transform-react-jsx currently only accepts a boolean option for " + "useBuiltIns (defaults to false)");
}
while (attribs.length) {
var prop = attribs.shift();
if (t().isJSXSpreadAttribute(prop)) {
_props = pushProps(_props, objs);
objs.push(prop.argument);
} else {
_props.push(convertAttribute(prop));
}
}
pushProps(_props, objs);
if (objs.length === 1) {
attribs = objs[0];
} else {
if (!t().isObjectExpression(objs[0])) {
objs.unshift(t().objectExpression([]));
}
var helper = useBuiltIns ? t().memberExpression(t().identifier("Object"), t().identifier("assign")) : file.addHelper("extends");
attribs = t().callExpression(helper, objs);
}
return attribs;
}
function buildFragmentCall(path, file) {
if (opts.filter && !opts.filter(path.node, file)) return;
var openingPath = path.get("openingElement");
openingPath.parent.children = t().react.buildChildren(openingPath.parent);
var args = [];
var tagName = null;
var tagExpr = file.get("jsxFragIdentifier")();
var state = {
tagExpr: tagExpr,
tagName: tagName,
args: args
};
if (opts.pre) {
opts.pre(state, file);
}
args.push.apply(args, [t().nullLiteral()].concat(path.node.children));
if (opts.post) {
opts.post(state, file);
}
file.set("usedFragment", true);
return state.call || t().callExpression(state.callee, args);
}
}
/***/ }),
/* 118 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _helperPluginUtils() {
var data = __webpack_require__(2);
_helperPluginUtils = function _helperPluginUtils() {
return data;
};
return data;
}
function _pluginTransformTemplateLiterals() {
var data = _interopRequireDefault(__webpack_require__(269));
_pluginTransformTemplateLiterals = function _pluginTransformTemplateLiterals() {
return data;
};
return data;
}
function _pluginTransformLiterals() {
var data = _interopRequireDefault(__webpack_require__(257));
_pluginTransformLiterals = function _pluginTransformLiterals() {
return data;
};
return data;
}
function _pluginTransformFunctionName() {
var data = _interopRequireDefault(__webpack_require__(255));
_pluginTransformFunctionName = function _pluginTransformFunctionName() {
return data;
};
return data;
}
function _pluginTransformArrowFunctions() {
var data = _interopRequireDefault(__webpack_require__(244));
_pluginTransformArrowFunctions = function _pluginTransformArrowFunctions() {
return data;
};
return data;
}
function _pluginTransformBlockScopedFunctions() {
var data = _interopRequireDefault(__webpack_require__(245));
_pluginTransformBlockScopedFunctions = function _pluginTransformBlockScopedFunctions() {
return data;
};
return data;
}
function _pluginTransformClasses() {
var data = _interopRequireDefault(__webpack_require__(247));
_pluginTransformClasses = function _pluginTransformClasses() {
return data;
};
return data;
}
function _pluginTransformObjectSuper() {
var data = _interopRequireDefault(__webpack_require__(264));
_pluginTransformObjectSuper = function _pluginTransformObjectSuper() {
return data;
};
return data;
}
function _pluginTransformShorthandProperties() {
var data = _interopRequireDefault(__webpack_require__(266));
_pluginTransformShorthandProperties = function _pluginTransformShorthandProperties() {
return data;
};
return data;
}
function _pluginTransformDuplicateKeys() {
var data = _interopRequireDefault(__webpack_require__(253));
_pluginTransformDuplicateKeys = function _pluginTransformDuplicateKeys() {
return data;
};
return data;
}
function _pluginTransformComputedProperties() {
var data = _interopRequireDefault(__webpack_require__(249));
_pluginTransformComputedProperties = function _pluginTransformComputedProperties() {
return data;
};
return data;
}
function _pluginTransformForOf() {
var data = _interopRequireDefault(__webpack_require__(254));
_pluginTransformForOf = function _pluginTransformForOf() {
return data;
};
return data;
}
function _pluginTransformStickyRegex() {
var data = _interopRequireDefault(__webpack_require__(268));
_pluginTransformStickyRegex = function _pluginTransformStickyRegex() {
return data;
};
return data;
}
function _pluginTransformUnicodeRegex() {
var data = _interopRequireDefault(__webpack_require__(272));
_pluginTransformUnicodeRegex = function _pluginTransformUnicodeRegex() {
return data;
};
return data;
}
function _pluginTransformSpread() {
var data = _interopRequireDefault(__webpack_require__(267));
_pluginTransformSpread = function _pluginTransformSpread() {
return data;
};
return data;
}
function _pluginTransformParameters() {
var data = _interopRequireDefault(__webpack_require__(265));
_pluginTransformParameters = function _pluginTransformParameters() {
return data;
};
return data;
}
function _pluginTransformDestructuring() {
var data = _interopRequireDefault(__webpack_require__(250));
_pluginTransformDestructuring = function _pluginTransformDestructuring() {
return data;
};
return data;
}
function _pluginTransformBlockScoping() {
var data = _interopRequireDefault(__webpack_require__(246));
_pluginTransformBlockScoping = function _pluginTransformBlockScoping() {
return data;
};
return data;
}
function _pluginTransformTypeofSymbol() {
var data = _interopRequireDefault(__webpack_require__(270));
_pluginTransformTypeofSymbol = function _pluginTransformTypeofSymbol() {
return data;
};
return data;
}
function _pluginTransformModulesCommonjs() {
var data = _interopRequireDefault(__webpack_require__(260));
_pluginTransformModulesCommonjs = function _pluginTransformModulesCommonjs() {
return data;
};
return data;
}
function _pluginTransformModulesSystemjs() {
var data = _interopRequireDefault(__webpack_require__(261));
_pluginTransformModulesSystemjs = function _pluginTransformModulesSystemjs() {
return data;
};
return data;
}
function _pluginTransformModulesAmd() {
var data = _interopRequireDefault(__webpack_require__(258));
_pluginTransformModulesAmd = function _pluginTransformModulesAmd() {
return data;
};
return data;
}
function _pluginTransformModulesUmd() {
var data = _interopRequireDefault(__webpack_require__(263));
_pluginTransformModulesUmd = function _pluginTransformModulesUmd() {
return data;
};
return data;
}
function _pluginTransformInstanceof() {
var data = _interopRequireDefault(__webpack_require__(256));
_pluginTransformInstanceof = function _pluginTransformInstanceof() {
return data;
};
return data;
}
function _pluginTransformRegenerator() {
var data = _interopRequireDefault(__webpack_require__(282));
_pluginTransformRegenerator = function _pluginTransformRegenerator() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
var _default = (0, _helperPluginUtils().declare)(function (api, opts) {
api.assertVersion(7);
var moduleTypes = ["commonjs", "cjs", "amd", "umd", "systemjs"];
var loose = false;
var modules = "commonjs";
var spec = false;
if (opts !== undefined) {
if (opts.loose !== undefined) loose = opts.loose;
if (opts.modules !== undefined) modules = opts.modules;
if (opts.spec !== undefined) spec = opts.spec;
}
if (typeof loose !== "boolean") {
throw new Error("Preset es2015 'loose' option must be a boolean.");
}
if (typeof spec !== "boolean") {
throw new Error("Preset es2015 'spec' option must be a boolean.");
}
if (modules !== false && moduleTypes.indexOf(modules) === -1) {
throw new Error("Preset es2015 'modules' option must be 'false' to indicate no modules\n" + "or a module type which be be one of: 'commonjs' (default), 'amd', 'umd', 'systemjs'");
}
var optsLoose = {
loose: loose
};
return {
plugins: [[_pluginTransformTemplateLiterals().default, {
loose: loose,
spec: spec
}], _pluginTransformLiterals().default, _pluginTransformFunctionName().default, [_pluginTransformArrowFunctions().default, {
spec: spec
}], _pluginTransformBlockScopedFunctions().default, [_pluginTransformClasses().default, optsLoose], _pluginTransformObjectSuper().default, _pluginTransformShorthandProperties().default, _pluginTransformDuplicateKeys().default, [_pluginTransformComputedProperties().default, optsLoose], [_pluginTransformForOf().default, optsLoose], _pluginTransformStickyRegex().default, _pluginTransformUnicodeRegex().default, [_pluginTransformSpread().default, optsLoose], [_pluginTransformParameters().default, optsLoose], [_pluginTransformDestructuring().default, optsLoose], _pluginTransformBlockScoping().default, _pluginTransformTypeofSymbol().default, _pluginTransformInstanceof().default, (modules === "commonjs" || modules === "cjs") && [_pluginTransformModulesCommonjs().default, optsLoose], modules === "systemjs" && [_pluginTransformModulesSystemjs().default, optsLoose], modules === "amd" && [_pluginTransformModulesAmd().default, optsLoose], modules === "umd" && [_pluginTransformModulesUmd().default, optsLoose], [_pluginTransformRegenerator().default, {
async: false,
asyncGenerators: false
}]].filter(Boolean)
};
});
exports.default = _default;
/***/ }),
/* 119 */
/***/ (function(module, exports, __webpack_require__) {
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, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function helpers() {
var data = _interopRequireWildcard(__webpack_require__(120));
helpers = function helpers() {
return data;
};
return data;
}
function _traverse() {
var data = _interopRequireWildcard(__webpack_require__(12));
_traverse = function _traverse() {
return data;
};
return data;
}
function _codeFrame() {
var data = __webpack_require__(63);
_codeFrame = function _codeFrame() {
return data;
};
return data;
}
function t() {
var data = _interopRequireWildcard(__webpack_require__(4));
t = function t() {
return data;
};
return data;
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
var errorVisitor = {
enter: function enter(path, state) {
var loc = path.node.loc;
if (loc) {
state.loc = loc;
path.stop();
}
}
};
var File = function () {
function File(options, _ref) {
var code = _ref.code,
ast = _ref.ast,
inputMap = _ref.inputMap;
this._map = new Map();
this.declarations = {};
this.path = null;
this.ast = {};
this.metadata = {};
this.hub = new (_traverse().Hub)(this);
this.code = "";
this.inputMap = null;
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;
}
var _proto = File.prototype;
_proto.set = function set(key, val) {
this._map.set(key, val);
};
_proto.get = function get(key) {
return this._map.get(key);
};
_proto.has = function has(key) {
return this._map.has(key);
};
_proto.getModuleName = function getModuleName() {
var _this$opts = this.opts,
filename = _this$opts.filename,
_this$opts$filenameRe = _this$opts.filenameRelative,
filenameRelative = _this$opts$filenameRe === void 0 ? filename : _this$opts$filenameRe,
moduleId = _this$opts.moduleId,
_this$opts$moduleIds = _this$opts.moduleIds,
moduleIds = _this$opts$moduleIds === void 0 ? !!moduleId : _this$opts$moduleIds,
getModuleId = _this$opts.getModuleId,
sourceRootTmp = _this$opts.sourceRoot,
_this$opts$moduleRoot = _this$opts.moduleRoot,
moduleRoot = _this$opts$moduleRoot === void 0 ? sourceRootTmp : _this$opts$moduleRoot,
_this$opts$sourceRoot = _this$opts.sourceRoot,
sourceRoot = _this$opts$sourceRoot === void 0 ? moduleRoot : _this$opts$sourceRoot;
if (!moduleIds) return null;
if (moduleId != null && !getModuleId) {
return moduleId;
}
var moduleName = moduleRoot != null ? moduleRoot + "/" : "";
if (filenameRelative) {
var 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;
}
};
_proto.resolveModuleSource = function resolveModuleSource(source) {
return source;
};
_proto.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'.");
};
_proto.addHelper = function addHelper(name) {
var _this = this;
var declar = this.declarations[name];
if (declar) return t().cloneNode(declar);
var generator = this.get("helperGenerator");
var runtime = this.get("helpersNamespace");
if (generator) {
var res = generator(name);
if (res) return res;
} else if (runtime) {
return t().memberExpression(t().cloneNode(runtime), t().identifier(name));
}
var uid = this.declarations[name] = this.scope.generateUidIdentifier(name);
var dependencies = {};
for (var _iterator = helpers().getDependencies(name), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref2;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref2 = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref2 = _i.value;
}
var dep = _ref2;
dependencies[dep] = this.addHelper(dep);
}
var _helpers$get = helpers().get(name, function (dep) {
return dependencies[dep];
}, uid, Object.keys(this.scope.getAllBindings())),
nodes = _helpers$get.nodes,
globals = _helpers$get.globals;
globals.forEach(function (name) {
if (_this.path.scope.hasBinding(name, true)) {
_this.path.scope.rename(name);
}
});
nodes.forEach(function (node) {
node._compact = true;
});
this.path.unshiftContainer("body", nodes);
this.path.get("body").forEach(function (path) {
if (nodes.indexOf(path.node) === -1) return;
if (path.isVariableDeclaration()) _this.scope.registerDeclaration(path);
});
return uid;
};
_proto.addTemplateObject = function addTemplateObject() {
throw new Error("This function has been moved into the template literal transform itself.");
};
_proto.buildCodeFrameError = function buildCodeFrameError(node, msg, Error) {
if (Error === void 0) {
Error = SyntaxError;
}
var loc = node && (node.loc || node._loc);
msg = this.opts.filename + ": " + msg;
if (!loc && node) {
var state = {
loc: null
};
(0, _traverse().default)(node, errorVisitor, this.scope, state);
loc = state.loc;
var txt = "This is an error on an internal node. Probably an internal error.";
if (loc) txt += " Location has been estimated.";
msg += " (" + txt + ")";
}
if (loc) {
var _this$opts$highlightC = this.opts.highlightCode,
highlightCode = _this$opts$highlightC === void 0 ? true : _this$opts$highlightC;
msg += "\n" + (0, _codeFrame().codeFrameColumns)(this.code, {
start: {
line: loc.start.line,
column: loc.start.column + 1
}
}, {
highlightCode: highlightCode
});
}
return new Error(msg);
};
_createClass(File, [{
key: "shebang",
get: function get() {
var interpreter = this.path.node.interpreter;
return interpreter ? interpreter.value : "";
},
set: function set(value) {
if (value) {
this.path.get("interpreter").replaceWith(t().interpreterDirective(value));
} else {
this.path.get("interpreter").remove();
}
}
}]);
return File;
}();
exports.default = File;
/***/ }),
/* 120 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.get = get;
exports.getDependencies = getDependencies;
exports.default = exports.list = void 0;
function _traverse() {
var data = _interopRequireDefault(__webpack_require__(12));
_traverse = function _traverse() {
return data;
};
return data;
}
function t() {
var data = _interopRequireWildcard(__webpack_require__(4));
t = function t() {
return data;
};
return data;
}
var _helpers = _interopRequireDefault(__webpack_require__(485));
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function makePath(path) {
var parts = [];
for (; path.parentPath; path = path.parentPath) {
parts.push(path.key);
if (path.inList) parts.push(path.listKey);
}
return parts.reverse().join(".");
}
function getHelperMetadata(file) {
var globals = new Set();
var localBindingNames = new Set();
var dependencies = new Map();
var exportName;
var exportPath;
var exportBindingAssignments = [];
var importPaths = [];
var importBindingsReferences = [];
(0, _traverse().default)(file, {
ImportDeclaration: function ImportDeclaration(child) {
var name = child.node.source.value;
if (!_helpers.default[name]) {
throw child.buildCodeFrameError("Unknown helper " + name);
}
if (child.get("specifiers").length !== 1 || !child.get("specifiers.0").isImportDefaultSpecifier()) {
throw child.buildCodeFrameError("Helpers can only import a default value");
}
var bindingIdentifier = child.node.specifiers[0].local;
dependencies.set(bindingIdentifier, name);
importPaths.push(makePath(child));
},
ExportDefaultDeclaration: function ExportDefaultDeclaration(child) {
var decl = child.get("declaration");
if (decl.isFunctionDeclaration()) {
if (!decl.node.id) {
throw decl.buildCodeFrameError("Helpers should give names to their exported func declaration");
}
exportName = decl.node.id.name;
}
exportPath = makePath(child);
},
ExportAllDeclaration: function ExportAllDeclaration(child) {
throw child.buildCodeFrameError("Helpers can only export default");
},
ExportNamedDeclaration: function ExportNamedDeclaration(child) {
throw child.buildCodeFrameError("Helpers can only export default");
},
Statement: function Statement(child) {
if (child.isModuleDeclaration()) return;
child.skip();
}
});
(0, _traverse().default)(file, {
Program: function Program(path) {
var bindings = path.scope.getAllBindings();
Object.keys(bindings).forEach(function (name) {
if (name === exportName) return;
if (dependencies.has(bindings[name].identifier)) return;
localBindingNames.add(name);
});
},
ReferencedIdentifier: function ReferencedIdentifier(child) {
var name = child.node.name;
var binding = child.scope.getBinding(name, true);
if (!binding) {
globals.add(name);
} else if (dependencies.has(binding.identifier)) {
importBindingsReferences.push(makePath(child));
}
},
AssignmentExpression: function AssignmentExpression(child) {
var left = child.get("left");
if (!(exportName in left.getBindingIdentifiers())) return;
if (!left.isIdentifier()) {
throw left.buildCodeFrameError("Only simple assignments to exports are allowed in helpers");
}
var binding = child.scope.getBinding(exportName);
if (binding && binding.scope.path.isProgram()) {
exportBindingAssignments.push(makePath(child));
}
}
});
if (!exportPath) throw new Error("Helpers must default-export something.");
exportBindingAssignments.reverse();
return {
globals: Array.from(globals),
localBindingNames: Array.from(localBindingNames),
dependencies: dependencies,
exportBindingAssignments: exportBindingAssignments,
exportPath: exportPath,
exportName: exportName,
importBindingsReferences: importBindingsReferences,
importPaths: importPaths
};
}
function permuteHelperAST(file, metadata, id, localBindings, getDependency) {
if (localBindings && !id) {
throw new Error("Unexpected local bindings for module-based helpers.");
}
if (!id) return;
var localBindingNames = metadata.localBindingNames,
dependencies = metadata.dependencies,
exportBindingAssignments = metadata.exportBindingAssignments,
exportPath = metadata.exportPath,
exportName = metadata.exportName,
importBindingsReferences = metadata.importBindingsReferences,
importPaths = metadata.importPaths;
var dependenciesRefs = {};
dependencies.forEach(function (name, id) {
dependenciesRefs[id.name] = typeof getDependency === "function" && getDependency(name) || id;
});
var toRename = {};
var bindings = new Set(localBindings || []);
localBindingNames.forEach(function (name) {
var newName = name;
while (bindings.has(newName)) {
newName = "_" + newName;
}
if (newName !== name) toRename[name] = newName;
});
if (id.type === "Identifier" && exportName !== id.name) {
toRename[exportName] = id.name;
}
(0, _traverse().default)(file, {
Program: function Program(path) {
var exp = path.get(exportPath);
var imps = importPaths.map(function (p) {
return path.get(p);
});
var impsBindingRefs = importBindingsReferences.map(function (p) {
return path.get(p);
});
var decl = exp.get("declaration");
if (id.type === "Identifier") {
if (decl.isFunctionDeclaration()) {
exp.replaceWith(decl);
} else {
exp.replaceWith(t().variableDeclaration("var", [t().variableDeclarator(id, decl.node)]));
}
} else if (id.type === "MemberExpression") {
if (decl.isFunctionDeclaration()) {
exportBindingAssignments.forEach(function (assignPath) {
var assign = path.get(assignPath);
assign.replaceWith(t().assignmentExpression("=", id, assign.node));
});
exp.replaceWith(decl);
path.pushContainer("body", t().expressionStatement(t().assignmentExpression("=", id, t().identifier(exportName))));
} else {
exp.replaceWith(t().expressionStatement(t().assignmentExpression("=", id, decl.node)));
}
} else {
throw new Error("Unexpected helper format.");
}
Object.keys(toRename).forEach(function (name) {
path.scope.rename(name, toRename[name]);
});
for (var _iterator = imps, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var _path = _ref;
_path.remove();
}
for (var _iterator2 = impsBindingRefs, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
var _ref2;
if (_isArray2) {
if (_i2 >= _iterator2.length) break;
_ref2 = _iterator2[_i2++];
} else {
_i2 = _iterator2.next();
if (_i2.done) break;
_ref2 = _i2.value;
}
var _path2 = _ref2;
var node = t().cloneNode(dependenciesRefs[_path2.node.name]);
_path2.replaceWith(node);
}
path.stop();
}
});
}
var helperData = {};
function loadHelper(name) {
if (!helperData[name]) {
if (!_helpers.default[name]) throw new ReferenceError("Unknown helper " + name);
var fn = function fn() {
return t().file(_helpers.default[name]());
};
var metadata = getHelperMetadata(fn());
helperData[name] = {
build: function build(getDependency, id, localBindings) {
var file = fn();
permuteHelperAST(file, metadata, id, localBindings, getDependency);
return {
nodes: file.program.body,
globals: metadata.globals
};
},
dependencies: metadata.dependencies
};
}
return helperData[name];
}
function get(name, getDependency, id, localBindings) {
return loadHelper(name).build(getDependency, id, localBindings);
}
function getDependencies(name) {
return Array.from(loadHelper(name).dependencies.values());
}
var list = Object.keys(_helpers.default).map(function (name) {
return name.replace(/^_/, "");
}).filter(function (name) {
return name !== "__esModule";
});
exports.list = list;
var _default = get;
exports.default = _default;
/***/ }),
/* 121 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ForAwaitStatement = exports.NumericLiteralTypeAnnotation = exports.ExistentialTypeParam = exports.SpreadProperty = exports.RestProperty = exports.Flow = exports.Pure = exports.Generated = exports.User = exports.Var = exports.BlockScoped = exports.Referenced = exports.Scope = exports.Expression = exports.Statement = exports.BindingIdentifier = exports.ReferencedMemberExpression = exports.ReferencedIdentifier = void 0;
function t() {
var data = _interopRequireWildcard(__webpack_require__(4));
t = function t() {
return data;
};
return data;
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
var ReferencedIdentifier = {
types: ["Identifier", "JSXIdentifier"],
checkPath: function checkPath(_ref, opts) {
var node = _ref.node,
parent = _ref.parent;
if (!t().isIdentifier(node, opts) && !t().isJSXMemberExpression(parent, opts)) {
if (t().isJSXIdentifier(node, opts)) {
if (t().react.isCompatTag(node.name)) return false;
} else {
return false;
}
}
return t().isReferenced(node, parent);
}
};
exports.ReferencedIdentifier = ReferencedIdentifier;
var ReferencedMemberExpression = {
types: ["MemberExpression"],
checkPath: function checkPath(_ref2) {
var node = _ref2.node,
parent = _ref2.parent;
return t().isMemberExpression(node) && t().isReferenced(node, parent);
}
};
exports.ReferencedMemberExpression = ReferencedMemberExpression;
var BindingIdentifier = {
types: ["Identifier"],
checkPath: function checkPath(_ref3) {
var node = _ref3.node,
parent = _ref3.parent;
return t().isIdentifier(node) && t().isBinding(node, parent);
}
};
exports.BindingIdentifier = BindingIdentifier;
var Statement = {
types: ["Statement"],
checkPath: function checkPath(_ref4) {
var node = _ref4.node,
parent = _ref4.parent;
if (t().isStatement(node)) {
if (t().isVariableDeclaration(node)) {
if (t().isForXStatement(parent, {
left: node
})) return false;
if (t().isForStatement(parent, {
init: node
})) return false;
}
return true;
} else {
return false;
}
}
};
exports.Statement = Statement;
var Expression = {
types: ["Expression"],
checkPath: function checkPath(path) {
if (path.isIdentifier()) {
return path.isReferencedIdentifier();
} else {
return t().isExpression(path.node);
}
}
};
exports.Expression = Expression;
var Scope = {
types: ["Scopable"],
checkPath: function checkPath(path) {
return t().isScope(path.node, path.parent);
}
};
exports.Scope = Scope;
var Referenced = {
checkPath: function checkPath(path) {
return t().isReferenced(path.node, path.parent);
}
};
exports.Referenced = Referenced;
var BlockScoped = {
checkPath: function checkPath(path) {
return t().isBlockScoped(path.node);
}
};
exports.BlockScoped = BlockScoped;
var Var = {
types: ["VariableDeclaration"],
checkPath: function checkPath(path) {
return t().isVar(path.node);
}
};
exports.Var = Var;
var User = {
checkPath: function checkPath(path) {
return path.node && !!path.node.loc;
}
};
exports.User = User;
var Generated = {
checkPath: function checkPath(path) {
return !path.isUser();
}
};
exports.Generated = Generated;
var Pure = {
checkPath: function checkPath(path, opts) {
return path.scope.isPure(path.node, opts);
}
};
exports.Pure = Pure;
var Flow = {
types: ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"],
checkPath: function checkPath(_ref5) {
var node = _ref5.node;
if (t().isFlow(node)) {
return true;
} else if (t().isImportDeclaration(node)) {
return node.importKind === "type" || node.importKind === "typeof";
} else if (t().isExportDeclaration(node)) {
return node.exportKind === "type";
} else if (t().isImportSpecifier(node)) {
return node.importKind === "type" || node.importKind === "typeof";
} else {
return false;
}
}
};
exports.Flow = Flow;
var RestProperty = {
types: ["RestElement"],
checkPath: function checkPath(path) {
return path.parentPath && path.parentPath.isObjectPattern();
}
};
exports.RestProperty = RestProperty;
var SpreadProperty = {
types: ["RestElement"],
checkPath: function checkPath(path) {
return path.parentPath && path.parentPath.isObjectExpression();
}
};
exports.SpreadProperty = SpreadProperty;
var ExistentialTypeParam = {
types: ["ExistsTypeAnnotation"]
};
exports.ExistentialTypeParam = ExistentialTypeParam;
var NumericLiteralTypeAnnotation = {
types: ["NumberLiteralTypeAnnotation"]
};
exports.NumericLiteralTypeAnnotation = NumericLiteralTypeAnnotation;
var ForAwaitStatement = {
types: ["ForOfStatement"],
checkPath: function checkPath(_ref6) {
var node = _ref6.node;
return node.await === true;
}
};
exports.ForAwaitStatement = ForAwaitStatement;
/***/ }),
/* 122 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = buildMatchMemberExpression;
var _matchesPattern = _interopRequireDefault(__webpack_require__(123));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function buildMatchMemberExpression(match, allowPartial) {
var parts = match.split(".");
return function (member) {
return (0, _matchesPattern.default)(member, parts, allowPartial);
};
}
/***/ }),
/* 123 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = matchesPattern;
var _generated = __webpack_require__(5);
function matchesPattern(member, match, allowPartial) {
if (!(0, _generated.isMemberExpression)(member)) return false;
var parts = Array.isArray(match) ? match : match.split(".");
var nodes = [];
var node;
for (node = member; (0, _generated.isMemberExpression)(node); node = node.object) {
nodes.push(node.property);
}
nodes.push(node);
if (nodes.length < parts.length) return false;
if (!allowPartial && nodes.length > parts.length) return false;
for (var i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {
var _node = nodes[j];
var value = void 0;
if ((0, _generated.isIdentifier)(_node)) {
value = _node.name;
} else if ((0, _generated.isStringLiteral)(_node)) {
value = _node.value;
} else {
return false;
}
if (parts[i] !== value) return false;
}
return true;
}
/***/ }),
/* 124 */
/***/ (function(module, exports, __webpack_require__) {
var baseClone = __webpack_require__(296);
var CLONE_SYMBOLS_FLAG = 4;
function clone(value) {
return baseClone(value, CLONE_SYMBOLS_FLAG);
}
module.exports = clone;
/***/ }),
/* 125 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(20),
isObject = __webpack_require__(21);
var asyncTag = '[object AsyncFunction]',
funcTag = '[object Function]',
genTag = '[object GeneratorFunction]',
proxyTag = '[object Proxy]';
function isFunction(value) {
if (!isObject(value)) {
return false;
}
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
module.exports = isFunction;
/***/ }),
/* 126 */
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
module.exports = freeGlobal;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9)));
/***/ }),
/* 127 */
/***/ (function(module, exports) {
var funcProto = Function.prototype;
var funcToString = funcProto.toString;
function toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return func + '';
} catch (e) {}
}
return '';
}
module.exports = toSource;
/***/ }),
/* 128 */
/***/ (function(module, exports, __webpack_require__) {
var baseAssignValue = __webpack_require__(129),
eq = __webpack_require__(38);
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
baseAssignValue(object, key, value);
}
}
module.exports = assignValue;
/***/ }),
/* 129 */
/***/ (function(module, exports, __webpack_require__) {
var defineProperty = __webpack_require__(130);
function baseAssignValue(object, key, value) {
if (key == '__proto__' && defineProperty) {
defineProperty(object, key, {
'configurable': true,
'enumerable': true,
'value': value,
'writable': true
});
} else {
object[key] = value;
}
}
module.exports = baseAssignValue;
/***/ }),
/* 130 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(26);
var defineProperty = function () {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
} catch (e) {}
}();
module.exports = defineProperty;
/***/ }),
/* 131 */
/***/ (function(module, exports, __webpack_require__) {
var baseTimes = __webpack_require__(327),
isArguments = __webpack_require__(76),
isArray = __webpack_require__(10),
isBuffer = __webpack_require__(77),
isIndex = __webpack_require__(78),
isTypedArray = __webpack_require__(132);
var objectProto = Object.prototype;
var hasOwnProperty = objectProto.hasOwnProperty;
function arrayLikeKeys(value, inherited) {
var isArr = isArray(value),
isArg = !isArr && isArguments(value),
isBuff = !isArr && !isArg && isBuffer(value),
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
skipIndexes = isArr || isArg || isBuff || isType,
result = skipIndexes ? baseTimes(value.length, String) : [],
length = result.length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isBuff && (key == 'offset' || key == 'parent') || isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
module.exports = arrayLikeKeys;
/***/ }),
/* 132 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsTypedArray = __webpack_require__(330),
baseUnary = __webpack_require__(34),
nodeUtil = __webpack_require__(54);
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
module.exports = isTypedArray;
/***/ }),
/* 133 */
/***/ (function(module, exports) {
function overArg(func, transform) {
return function (arg) {
return func(transform(arg));
};
}
module.exports = overArg;
/***/ }),
/* 134 */
/***/ (function(module, exports) {
function copyArray(source, array) {
var index = -1,
length = source.length;
array || (array = Array(length));
while (++index < length) {
array[index] = source[index];
}
return array;
}
module.exports = copyArray;
/***/ }),
/* 135 */
/***/ (function(module, exports) {
function stubArray() {
return [];
}
module.exports = stubArray;
/***/ }),
/* 136 */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(82),
getPrototype = __webpack_require__(83),
getSymbols = __webpack_require__(81),
stubArray = __webpack_require__(135);
var nativeGetSymbols = Object.getOwnPropertySymbols;
var getSymbolsIn = !nativeGetSymbols ? stubArray : function (object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
object = getPrototype(object);
}
return result;
};
module.exports = getSymbolsIn;
/***/ }),
/* 137 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetAllKeys = __webpack_require__(138),
getSymbols = __webpack_require__(81),
keys = __webpack_require__(33);
function getAllKeys(object) {
return baseGetAllKeys(object, keys, getSymbols);
}
module.exports = getAllKeys;
/***/ }),
/* 138 */
/***/ (function(module, exports, __webpack_require__) {
var arrayPush = __webpack_require__(82),
isArray = __webpack_require__(10);
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
module.exports = baseGetAllKeys;
/***/ }),
/* 139 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(26),
root = __webpack_require__(13);
var Set = getNative(root, 'Set');
module.exports = Set;
/***/ }),
/* 140 */
/***/ (function(module, exports, __webpack_require__) {
var root = __webpack_require__(13);
var Uint8Array = root.Uint8Array;
module.exports = Uint8Array;
/***/ }),
/* 141 */
/***/ (function(module, exports) {
(function () {
var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch;
ES5Regex = {
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-\u08B2\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\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\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\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-\u13F4\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\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\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-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\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-\uAB5F\uAB64\uAB65\uABC0-\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]/,
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-\u08B2\u08E4-\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\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\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\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\u0D57\u0D60-\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-\u13F4\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\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\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-\uAB5F\uAB64\uAB65\uABC0-\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-\uFE2D\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 = {
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-\u08B2\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\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\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\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-\u13F4\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\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\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-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\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-\uAB5F\uAB64\uAB65\uABC0-\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\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\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]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\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]|\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]|\uD87E[\uDC00-\uDE1D]/,
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-\u08B2\u08E4-\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\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\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\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\u0D57\u0D60-\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-\u13F4\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\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\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-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\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-\uAB5F\uAB64\uAB65\uABC0-\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-\uFE2D\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\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\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]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\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]|\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]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\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]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
};
function isDecimalDigit(ch) {
return 0x30 <= ch && ch <= 0x39;
}
function isHexDigit(ch) {
return 0x30 <= ch && ch <= 0x39 || 0x61 <= ch && ch <= 0x66 || 0x41 <= ch && ch <= 0x46;
}
function isOctalDigit(ch) {
return ch >= 0x30 && ch <= 0x37;
}
NON_ASCII_WHITESPACES = [0x1680, 0x180E, 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;
}
function isLineTerminator(ch) {
return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;
}
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 || ch >= 0x41 && ch <= 0x5A || ch === 0x24 || ch === 0x5F;
}
IDENTIFIER_PART = new Array(0x80);
for (ch = 0; ch < 0x80; ++ch) {
IDENTIFIER_PART[ch] = ch >= 0x61 && ch <= 0x7A || ch >= 0x41 && ch <= 0x5A || ch >= 0x30 && ch <= 0x39 || ch === 0x24 || ch === 0x5F;
}
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
};
})();
/***/ }),
/* 142 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = validate;
var _definitions = __webpack_require__(15);
function validate(node, key, val) {
if (!node) return;
var fields = _definitions.NODE_FIELDS[node.type];
if (!fields) return;
var field = fields[key];
if (!field || !field.validate) return;
if (field.optional && val == null) return;
field.validate(node, key, val);
}
/***/ }),
/* 143 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isNode;
var _definitions = __webpack_require__(15);
function isNode(node) {
return !!(node && _definitions.VISITOR_KEYS[node.type]);
}
/***/ }),
/* 144 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = removeTypeDuplicates;
var _generated = __webpack_require__(5);
function removeTypeDuplicates(nodes) {
var generics = {};
var bases = {};
var typeGroups = [];
var types = [];
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
if (!node) continue;
if (types.indexOf(node) >= 0) {
continue;
}
if ((0, _generated.isAnyTypeAnnotation)(node)) {
return [node];
}
if ((0, _generated.isFlowBaseAnnotation)(node)) {
bases[node.type] = node;
continue;
}
if ((0, _generated.isUnionTypeAnnotation)(node)) {
if (typeGroups.indexOf(node.types) < 0) {
nodes = nodes.concat(node.types);
typeGroups.push(node.types);
}
continue;
}
if ((0, _generated.isGenericTypeAnnotation)(node)) {
var name = node.id.name;
if (generics[name]) {
var existing = generics[name];
if (existing.typeParameters) {
if (node.typeParameters) {
existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params));
}
} else {
existing = node.typeParameters;
}
} else {
generics[name] = node;
}
continue;
}
types.push(node);
}
for (var type in bases) {
types.push(bases[type]);
}
for (var _name in generics) {
types.push(generics[_name]);
}
return types;
}
/***/ }),
/* 145 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = clone;
var _cloneNode = _interopRequireDefault(__webpack_require__(41));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function clone(node) {
return (0, _cloneNode.default)(node, false);
}
/***/ }),
/* 146 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = addComments;
function addComments(node, type, comments) {
if (!comments || !node) return node;
var key = type + "Comments";
if (node[key]) {
if (type === "leading") {
node[key] = comments.concat(node[key]);
} else {
node[key] = node[key].concat(comments);
}
} else {
node[key] = comments;
}
return node;
}
/***/ }),
/* 147 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = inheritInnerComments;
var _inherit = _interopRequireDefault(__webpack_require__(90));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function inheritInnerComments(child, parent) {
(0, _inherit.default)("innerComments", child, parent);
}
/***/ }),
/* 148 */
/***/ (function(module, exports, __webpack_require__) {
var MapCache = __webpack_require__(75),
setCacheAdd = __webpack_require__(373),
setCacheHas = __webpack_require__(374);
function SetCache(values) {
var index = -1,
length = values == null ? 0 : values.length;
this.__data__ = new MapCache();
while (++index < length) {
this.add(values[index]);
}
}
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
SetCache.prototype.has = setCacheHas;
module.exports = SetCache;
/***/ }),
/* 149 */
/***/ (function(module, exports) {
function cacheHas(cache, key) {
return cache.has(key);
}
module.exports = cacheHas;
/***/ }),
/* 150 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = inheritLeadingComments;
var _inherit = _interopRequireDefault(__webpack_require__(90));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function inheritLeadingComments(child, parent) {
(0, _inherit.default)("leadingComments", child, parent);
}
/***/ }),
/* 151 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = inheritsComments;
var _inheritTrailingComments = _interopRequireDefault(__webpack_require__(152));
var _inheritLeadingComments = _interopRequireDefault(__webpack_require__(150));
var _inheritInnerComments = _interopRequireDefault(__webpack_require__(147));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function inheritsComments(child, parent) {
(0, _inheritTrailingComments.default)(child, parent);
(0, _inheritLeadingComments.default)(child, parent);
(0, _inheritInnerComments.default)(child, parent);
return child;
}
/***/ }),
/* 152 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = inheritTrailingComments;
var _inherit = _interopRequireDefault(__webpack_require__(90));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function inheritTrailingComments(child, parent) {
(0, _inherit.default)("trailingComments", child, parent);
}
/***/ }),
/* 153 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = toBlock;
var _generated = __webpack_require__(5);
var _generated2 = __webpack_require__(8);
function toBlock(node, parent) {
if ((0, _generated.isBlockStatement)(node)) {
return node;
}
var blockNodes = [];
if ((0, _generated.isEmptyStatement)(node)) {
blockNodes = [];
} else {
if (!(0, _generated.isStatement)(node)) {
if ((0, _generated.isFunction)(parent)) {
node = (0, _generated2.returnStatement)(node);
} else {
node = (0, _generated2.expressionStatement)(node);
}
}
blockNodes = [node];
}
return (0, _generated2.blockStatement)(blockNodes);
}
/***/ }),
/* 154 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = toIdentifier;
var _isValidIdentifier = _interopRequireDefault(__webpack_require__(40));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function toIdentifier(name) {
name = name + "";
name = name.replace(/[^a-zA-Z0-9$_]/g, "-");
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 || "_";
}
/***/ }),
/* 155 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = removePropertiesDeep;
var _traverseFast = _interopRequireDefault(__webpack_require__(156));
var _removeProperties = _interopRequireDefault(__webpack_require__(157));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function removePropertiesDeep(tree, opts) {
(0, _traverseFast.default)(tree, _removeProperties.default, opts);
return tree;
}
/***/ }),
/* 156 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = traverseFast;
var _definitions = __webpack_require__(15);
function traverseFast(node, enter, opts) {
if (!node) return;
var keys = _definitions.VISITOR_KEYS[node.type];
if (!keys) return;
opts = opts || {};
enter(node, opts);
for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var key = _ref;
var subNode = node[key];
if (Array.isArray(subNode)) {
for (var _iterator2 = subNode, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
var _ref2;
if (_isArray2) {
if (_i2 >= _iterator2.length) break;
_ref2 = _iterator2[_i2++];
} else {
_i2 = _iterator2.next();
if (_i2.done) break;
_ref2 = _i2.value;
}
var _node = _ref2;
traverseFast(_node, enter, opts);
}
} else {
traverseFast(subNode, enter, opts);
}
}
}
/***/ }),
/* 157 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = removeProperties;
var _constants = __webpack_require__(27);
var CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"];
var CLEAR_KEYS_PLUS_COMMENTS = _constants.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS);
function removeProperties(node, opts) {
if (opts === void 0) {
opts = {};
}
var map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
for (var _iterator = map, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var _key = _ref;
if (node[_key] != null) node[_key] = undefined;
}
for (var key in node) {
if (key[0] === "_" && node[key] != null) node[key] = undefined;
}
var symbols = Object.getOwnPropertySymbols(node);
for (var _iterator2 = symbols, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
var _ref2;
if (_isArray2) {
if (_i2 >= _iterator2.length) break;
_ref2 = _iterator2[_i2++];
} else {
_i2 = _iterator2.next();
if (_i2.done) break;
_ref2 = _i2.value;
}
var sym = _ref2;
node[sym] = null;
}
}
/***/ }),
/* 158 */
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isLet;
var _generated = __webpack_require__(5);
var _constants = __webpack_require__(27);
function isLet(node) {
return (0, _generated.isVariableDeclaration)(node) && (node.kind !== "var" || node[_constants.BLOCK_SCOPED_SYMBOL]);
}
/***/ }),
/* 159 */
/***/ (function(module, exports, __webpack_require__) {
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, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _includes() {
var data = _interopRequireDefault(__webpack_require__(95));
_includes = function _includes() {
return data;
};
return data;
}
function _repeat() {
var data = _interopRequireDefault(__webpack_require__(161));
_repeat = function _repeat() {
return data;
};
return data;
}
var _renamer = _interopRequireDefault(__webpack_require__(418));
var _index = _interopRequireDefault(__webpack_require__(12));
function _defaults() {
var data = _interopRequireDefault(__webpack_require__(419));
_defaults = function _defaults() {
return data;
};
return data;
}
var _binding = _interopRequireDefault(__webpack_require__(163));
function _globals() {
var data = _interopRequireDefault(__webpack_require__(164));
_globals = function _globals() {
return data;
};
return data;
}
function t() {
var data = _interopRequireWildcard(__webpack_require__(4));
t = function t() {
return data;
};
return data;
}
var _cache = __webpack_require__(62);
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function gatherNodeParts(node, parts) {
if (t().isModuleDeclaration(node)) {
if (node.source) {
gatherNodeParts(node.source, parts);
} else if (node.specifiers && node.specifiers.length) {
for (var _iterator = node.specifiers, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
var _ref;
if (_isArray) {
if (_i >= _iterator.length) break;
_ref = _iterator[_i++];
} else {
_i = _iterator.next();
if (_i.done) break;
_ref = _i.value;
}
var specifier = _ref;
gatherNodeParts(specifier, parts);
}
} else if (node.declaration) {
gatherNodeParts(node.declaration, parts);
}
} else if (t().isModuleSpecifier(node)) {
gatherNodeParts(node.local, parts);
} else if (t().isMemberExpression(node)) {
gatherNodeParts(node.object, parts);
gatherNodeParts(node.property, parts);
} else if (t().isIdentifier(node)) {
parts.push(node.name);
} else if (t().isLiteral(node)) {
parts.push(node.value);
} else if (t().isCallExpression(node)) {
gatherNodeParts(node.callee, parts);
} else if (t().isObjectExpression(node) || t().isObjectPattern(node)) {
for (var _iterator2 = node.properties, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
var _ref2;
if (_isArray2) {
if (_i2 >= _iterator2.length) break;
_ref2 = _iterator2[_i2++];
} else {
_i2 = _iterator2.next();
if (_i2.done) break;
_ref2 = _i2.value;
}
var prop = _ref2;
gatherNodeParts(prop.key || prop.argument, parts);
}
} else if (t().isPrivateName(node)) {
gatherNodeParts(node.id, parts);
} else if (t().isThisExpression(node)) {
parts.push("this");
} else if (t().isSuper(node)) {
parts.push("super");
}
}
var collectorVisitor = {
For: function For(path) {
for (var _iterator3 = t().FOR_INIT_KEYS, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
var _ref3;
if (_isArray3) {
if (_i3 >= _iterator3.length) break;
_ref3 = _iterator3[_i3++];
} else {
_i3 = _iterator3.next();
if (_i3.done) break;
_ref3 = _i3.value;
}
var key = _ref3;
var declar = path.get(key);
if (declar.isVar()) {
var parentScope = path.scope.getFunctionParent() || path.scope.getProgramParent();
parentScope.registerBinding("var", declar);
}
}
},
Declaration: function Declaration(path) {
if (path.isBlockScoped()) return;
if (path.isExportDeclaration() && path.get("declaration").isDeclaration()) {
return;
}
var parent = path.scope.getFunctionParent() || path.scope.getProgramParent();
parent.registerDeclaration(path);
},
ReferencedIdentifier: function ReferencedIdentifier(path, state) {
state.references.push(path);
},
ForXStatement: function ForXStatement(path, state) {
var left = path.get("left");
if (left.isPattern() || left.isIdentifier()) {
state.constantViolations.push(path);
}
},
ExportDeclaration: {
exit: function exit(path) {
var node = path.node,
scope = path.scope;
var declar = node.declaration;
if (t().isClassDeclaration(declar) || t().isFunctionDeclaration(declar)) {
var id = declar.id;
if (!id) return;
var binding = scope.getBinding(id.name);
if (binding) binding.reference(path);
} else if (t().isVariableDeclaration(declar)) {
for (var _iterator4 = declar.declarations, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
var _ref4;
if (_isArray4) {
if (_i4 >= _iterator4.length) break;
_ref4 = _iterator4[_i4++];
} else {
_i4 = _iterator4.next();
if (_i4.done) break;
_ref4 = _i4.value;
}
var decl = _ref4;
var ids = t().getBindingIdentifiers(decl);
for (var name in ids) {
var _binding2 = scope.getBinding(name);
if (_binding2) _binding2.reference(path);
}
}
}
}
},
LabeledStatement: function LabeledStatement(path) {
path.scope.getProgramParent().addGlobal(path.node);
path.scope.getBlockParent().registerDeclaration(path);
},
AssignmentExpression: function AssignmentExpression(path, state) {
state.assignments.push(path);
},
UpdateExpression: function UpdateExpression(path, state) {
state.constantViolations.push(path);
},
UnaryExpression: function UnaryExpression(path, state) {
if (path.node.operator === "delete") {
state.constantViolations.push(path);
}
},
BlockScoped: function BlockScoped(path) {
var scope = path.scope;
if (scope.path === path) scope = scope.parent;
scope.getBlockParent().registerDeclaration(path);
},
ClassDeclaration: function ClassDeclaration(path) {
var id = path.node.id;
if (!id) return;
var name = id.name;
path.scope.bindings[name] = path.scope.getBinding(name);
},
Block: function Block(path) {
var paths = path.get("body");
for (var _iterator5 = paths, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
var _ref5;
if (_isArray5) {
if (_i5 >= _iterator5.length) break;
_ref5 = _iterator5[_i5++];
} else {
_i5 = _iterator5.next();
if (_i5.done) break;
_ref5 = _i5.value;
}
var bodyPath = _ref5;
if (bodyPath.isFunctionDeclaration()) {
path.scope.getBlockParent().registerDeclaration(bodyPath);
}
}
}
};
var uid = 0;
var Scope = function () {
function Scope(path) {
var node = path.node;
var cached = _cache.scope.get(node);
if (cached && cached.path === path) {
return cached;
}
_cache.scope.set(node, this);
this.uid = uid++;
this.block = node;
this.path = path;
this.labels = new Map();
}
var _proto = Scope.prototype;
_proto.traverse = function traverse(node, opts, state) {
(0, _index.default)(node, opts, this, state, this.path);
};
_proto.generateDeclaredUidIdentifier = function generateDeclaredUidIdentifier(name) {
var id = this.generateUidIdentifier(name);
this.push({
id: id
});
return t().cloneNode(id);
};
_proto.generateUidIdentifier = function generateUidIdentifier(name) {
return t().identifier(this.generateUid(name));
};
_proto.generateUid = function generateUid(name) {
if (name === void 0) {
name = "temp";
}
name = t().toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, "");
var uid;
var i = 0;
do {
uid = this._generateUid(name, i);
i++;
} while (this.hasLabel(uid) || this.hasBinding(uid) || this.hasGlobal(uid) || this.hasReference(uid));
var program = this.getProgramParent();
program.references[uid] = true;
program.uids[uid] = true;
return uid;
};
_proto._generateUid = function _generateUid(name, i) {
var id = name;
if (i > 1) id += i;
return "_" + id;
};
_proto.generateUidBasedOnNode = function generateUidBasedOnNode(parent, defaultName) {
var node = parent;
if (t().isAssignmentExpression(parent)) {
node = parent.left;
} else if (t().isVariableDeclarator(parent)) {
node = parent.id;
} else if (t().isObjectProperty(node) || t().isObjectMethod(node)) {
node = node.key;
}
var parts = [];
gatherNodeParts(node, parts);
var id = parts.join("$");
id = id.replace(/^_/, "") || defaultName || "ref";
return this.generateUid(id.slice(0, 20));
};
_proto.generateUidIdentifierBasedOnNode = function generateUidIdentifierBasedOnNode(parent, defaultName) {
return t().identifier(this.generateUidBasedOnNode(parent, defaultName));
};
_proto.isStatic = function isStatic(node) {
if (t().isThisExpression(node) || t().isSuper(node)) {
return true;
}
if (t().isIdentifier(node)) {
var binding = this.getBinding(node.name);
if (binding) {
return binding.constant;
} else {
return this.hasBinding(node.name);
}
}
return false;
};
_proto.maybeGenerateMemoised = function maybeGenerateMemoised(node, dontPush) {
if (this.isStatic(node)) {
return null;
} else {
var id = this.generateUidIdentifierBasedOnNode(node);
if (!dontPush) {
this.push({
id: id
});
return t().cloneNode(id);
}
return id;
}
};
_proto.checkBlockScopedCollisions = function checkBlockScopedCollisions(local, kind, name, id) {
if (kind === "param") return;
if (local.kind === "local") return;
if (kind === "hoisted" && local.kind === "let") return;
var duplicate = kind === "let" || local.kind === "let" || local.kind === "const" || local.kind === "module" || local.kind === "param" && (kind === "let" || kind === "const");
if (duplicate) {
throw this.hub.file.buildCodeFrameError(id, "Duplicate declaration \"" + name + "\"", TypeError);
}
};
_proto.rename = function rename(oldName, newName, block) {
var binding = this.getBinding(oldName);
if (binding) {
newName = newName || this.generateUidIdentifier(oldName).name;
return new _renamer.default(binding, oldName, newName).rename(block);
}
};
_proto._renameFromMap = function _renameFromMap(map, oldName, newName, value) {
if (map[oldName]) {
map[newName] = value;
map[oldName] = null;
}
};
_proto.dump = function dump() {
var sep = (0, _repeat().default)("-", 60);
console.log(sep);
var scope = this;
do {
console.log("#", scope.block.type);
for (var name in scope.bindings) {
var 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);
};
_proto.toArray = function toArray(node, i) {
var file = this.hub.file;
if (t().isIdentifier(node)) {
var binding = this.getBinding(node.name);
if (binding && binding.constant && binding.path.isGenericType("Array")) {
return node;
}
}
if (t().isArrayExpression(node)) {
return node;
}
if (t().isIdentifier(node, {
name: "arguments"
})) {
return t().callExpression(t().memberExpression(t().memberExpression(t().memberExpression(t().identifier("Array"), t().identifier("prototype")), t().identifier("slice")), t().identifier("call")), [node]);
}
var helperName;
var args = [node];
if (i === true) {
helperName = "toConsumableArray";
} else if (i) {
args.push(t().numericLiteral(i));
helperName = "slicedToArray";
} else {
helperName = "toArray";
}
return t().callExpression(file.addHelper(helperName), args);
};
_proto.hasLabel = function hasLabel(name) {
return !!this.getLabel(name);
};
_proto.getLabel = function getLabel(name) {
return this.labels.get(name);
};
_proto.registerLabel = function registerLabel(path) {
this.labels.set(path.node.label.name, path);
};
_proto.registerDeclaration = function registerDeclaration(path) {
if (path.isLabeledStatement()) {
this.registerLabel(path);
} else if (path.isFunctionDeclaration()) {
this.registerBinding("hoisted", path.get("id"), path);
} else if (path.isVariableDeclaration()) {
var declarations = path.get("declarations");
for (var _iterator6 = declarations, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
var _ref6;
if (_isArray6) {
if (_i6 >= _iterator6.length) break;
_ref6 = _iterator6[_i6++];
} else {
_i6 = _iterator6.next();
if (_i6.done) break;
_ref6 = _i6.value;
}
var declar = _ref6;
this.registerBinding(path.node.kind, declar);
}
} else if (path.isClassDeclaration()) {
this.registerBinding("let", path);
} else if (path.isImportDeclaration()) {
var specifiers = path.get("specifiers");
for (var _iterator7 = specifiers, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
var _ref7;
if (_isArray7) {
if (_i7 >= _iterator7.length) break;
_ref7 = _iterator7[_i7++];
} else {
_i7 = _iterator7.next();
if (_i7.done) break;
_ref7 = _i7.value;
}
var specifier = _ref7;
this.registerBinding("module", specifier);
}
} else if (path.isExportDeclaration()) {
var _declar = path.get("declaration");
if (_declar.isClassDeclaration() || _declar.isFunctionDeclaration() || _declar.isVariableDeclaration()) {
this.registerDeclaration(_declar);
}
} else {
this.registerBinding("unknown", path);
}
};
_proto.buildUndefinedNode = function buildUndefinedNode() {
if (this.hasBinding("undefined")) {
return t().unaryExpression("void", t().numericLiteral(0), true);
} else {
return t().identifier("undefined");
}
};
_proto.registerConstantViolation = function registerConstantViolation(path) {
var ids = path.getBindingIdentifiers();
for (var name in ids) {
var binding = this.getBinding(name);
if (binding) binding.reassign(path);
}
};
_proto.registerBinding = function registerBinding(kind, path, bindingPath) {
if (bindingPath === void 0) {
bindingPath = path;
}
if (!kind) throw new ReferenceError("no `kind`");
if (path.isVariableDeclaration()) {
var declarators = path.get("declarations");
for (var _iterator8 = declarators, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
var _ref8;
if (_isArray8) {
if (_i8 >= _iterator8.length) break;
_ref8 = _iterator8[_i8++];
} else {
_i8 = _iterator8.next();
if (_i8.done) break;
_ref8 = _i8.value;
}
var declar = _ref8;
this.registerBinding(kind, declar);
}
return;
}
var parent = this.getProgramParent();
var ids = path.getBindingIdentifiers(true);
for (var name in ids) {
for (var _iterator9 = ids[name], _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) {
var _ref9;
if (_isArray9) {
if (_i9 >= _iterator9.length) break;
_ref9 = _iterator9[_i9++];
} else {
_i9 = _iterator9.next();
if (_i9.done) break;
_ref9 = _i9.value;
}
var id = _ref9;
var local = this.getOwnBinding(name);
if (local) {
if (local.identifier === id) continue;
this.checkBlockScopedCollisions(local, kind, name, id);
}
parent.references[name] = true;
if (local) {
this.registerConstantViolation(bindingPath);
} else {
this.bindings[name] = new _binding.default({
identifier: id,
scope: this,
path: bindingPath,
kind: kind
});
}
}
}
};
_proto.addGlobal = function addGlobal(node) {
this.globals[node.name] = node;
};
_proto.hasUid = function hasUid(name) {
var scope = this;
do {
if (scope.uids[name]) return true;
} while (scope = scope.parent);
return false;
};
_proto.hasGlobal = function hasGlobal(name) {
var scope = this;
do {
if (scope.globals[name]) return true;
} while (scope = scope.parent);
return false;
};
_proto.hasReference = function hasReference(name) {
var scope = this;
do {
if (scope.references[name]) return true;
} while (scope = scope.parent);
return false;
};
_proto.isPure = function isPure(node, constantsOnly) {
if (t().isIdentifier(node)) {
var binding = this.getBinding(node.name);
if (!binding) return false;
if (constantsOnly) return binding.constant;
return true;
} else if (t().isClass(node)) {
if (node.superClass && !this.isPure(node.superClass, constantsOnly)) {
return false;
}
return this.isPure(node.body, constantsOnly);
} else if (t().isClassBody(node)) {
for (var _iterator10 = node.body, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) {
var _ref10;
if (_isArray10) {
if (_i10 >= _iterator10.length) break;
_ref10 = _iterator10[_i10++];
} else {
_i10 = _iterator10.next();
if (_i10.done) break;
_ref10 = _i10.value;
}
var method = _ref10;
if (!this.isPure(method, constantsOnly)) return false;
}
return true;
} else if (t().isBinary(node)) {
return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly);
} else if (t().isArrayExpression(node)) {
for (var _iterator11 = node.elements, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) {
var _ref11;
if (_isArray11) {
if (_i11 >= _iterator11.length) break;
_ref11 = _iterator11[_i11++];
} else {
_i11 = _iterator11.next();
if (_i11.done) break;
_ref11 = _i11.value;
}
var elem = _ref11;
if (!this.isPure(elem, constantsOnly)) return false;
}
return true;
} else if (t().isObjectExpression(node)) {
for (var _iterator12 = node.properties, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) {
var _ref12;
if (_isArray12) {
if (_i12 >= _iterator12.length) break;
_ref12 = _iterator12[_i12++];
} else {
_i12 = _iterator12.next();
if (_i12.done) break;
_ref12 = _i12.value;
}
var prop = _ref12;
if (!this.isPure(prop, constantsOnly)) return false;
}
return true;
} else if (t().isClassMethod(node)) {
if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
if (node.kind === "get" || node.kind === "set") return false;
return true;
} else if (t().isProperty(node)) {
if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
return this.isPure(node.value, constantsOnly);
} else if (t().isUnaryExpression(node)) {
return this.isPure(node.argument, constantsOnly);
} else if (t().isTaggedTemplateExpression(node)) {
return t().matchesPattern(node.tag, "String.raw") && !this.hasBinding("String", true) && this.isPure(node.quasi, constantsOnly);
} else if (t().isTemplateLiteral(node)) {
for (var _iterator13 = node.expressions, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) {
var _ref13;
if (_isArray13) {
if (_i13 >= _iterator13.length) break;
_ref13 = _iterator13[_i13++];
} else {
_i13 = _iterator13.next();
if (_i13.done) break;
_ref13 = _i13.value;
}
var expression = _ref13;
if (!this.isPure(expression, constantsOnly)) return false;
}
return true;
} else {
return t().isPureish(node);
}
};
_proto.setData = function setData(key, val) {
return this.data[key] = val;
};
_proto.getData = function getData(key) {
var scope = this;
do {
var data = scope.data[key];
if (data != null) return data;
} while (scope = scope.parent);
};
_proto.removeData = function removeData(key) {
var scope = this;
do {
var data = scope.data[key];
if (data != null) scope.data[key] = null;
} while (scope = scope.parent);
};
_proto.init = function init() {
if (!this.references) this.crawl();
};
_proto.crawl = function crawl() {
var path = this.path;
this.references = Object.create(null);
this.bindings = Object.create(null);
this.globals = Object.create(null);
this.uids = Object.create(null);
this.data = Object.create(null);
if (path.isLoop()) {
for (var _iterator14 = t().FOR_INIT_KEYS, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) {
var _ref14;
if (_isArray14) {
if (_i14 >= _iterator14.length) break;
_ref14 = _iterator14[_i14++];
} else {
_i14 = _iterator14.next();
if (_i14.done) break;
_ref14 = _i14.value;
}
var key = _ref14;
var node = path.get(key);
if (node.isBlockScoped()) this.registerBinding(node.node.kind, node);
}
}
if (path.isFunctionExpression() && path.has("id")) {
if (!path.get("id").node[t().NOT_LOCAL_BINDING]) {
this.registerBinding("local", path.get("id"), path);
}
}
if (path.isClassExpression() && path.has("id")) {
if (!path.get("id").node[t().NOT_LOCAL_BINDING]) {
this.registerBinding("local", path);
}
}
if (path.isFunction()) {
var params = path.get("params");
for (var _iterator15 = params, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) {
var _ref15;
if (_isArray15) {
if (_i15 >= _iterator15.length) break;
_ref15 = _iterator15[_i15++];
} else {
_i15 = _iterator15.next();
if (_i15.done) break;
_ref15 = _i15.value;
}
var param = _ref15;
this.registerBinding("param", param);
}
}
if (path.isCatchClause()) {
this.registerBinding("let", path);
}
var parent = this.getProgramParent();
if (parent.crawling) return;
var state = {
references: [],
constantViolations: [],
assignments: []
};
this.crawling = true;
path.traverse(collectorVisitor, state);
this.crawling = false;
for (var _iterator16 = state.assignments, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) {
var _ref16;
if (_isArray16) {
if (_i16 >= _iterator16.length) break;
_ref16 = _iterator16[_i16++];
} else {
_i16 = _iterator16.next();
if (_i16.done) break;
_ref16 = _i16.value;
}
var _path = _ref16;
var ids = _path.getBindingIdentifiers();
var programParent = void 0;
for (var name in ids) {
if (_path.scope.getBinding(name)) continue;
programParent = programParent || _path.scope.getProgramParent();
programParent.addGlobal(ids[name]);
}
_path.scope.registerConstantViolation(_path);
}
for (var _iterator17 = state.references, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : _iterator17[Symbol.iterator]();;) {
var _ref17;
if (_isArray17) {
if (_i17 >= _iterator17.length) break;
_ref17 = _iterator17[_i17++];
} else {
_i17 = _iterator17.next();
if (_i17.done) break;
_ref17 = _i17.value;
}
var ref = _ref17;
var binding = ref.scope.getBinding(ref.node.name);
if (binding) {
binding.reference(ref);
} else {
ref.scope.getProgramParent().addGlobal(ref.node);
}
}
for (var _iterator18 = state.constantViolations, _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : _iterator18[Symbol.iterator]();;) {
var _ref18;
if (_isArray18) {
if (_i18 >= _iterator18.length) break;
_ref18 = _iterator18[_i18++];
} else {
_i18 = _iterator18.next();
if (_i18.done) break;
_ref18 = _i18.value;
}
var _path2 = _ref18;
_path2.scope.registerConstantViolation(_path2);
}
};
_proto.push = function push(opts) {
var path = this.path;
if (!path.isBlockStatement() && !path.isProgram()) {
path = this.getBlockParent().path;
}
if (path.isSwitchStatement()) {
path = (this.getFunctionParent() || this.getProgramParent()).path;
}
if (path.isLoop() || path.isCatchClause() || path.isFunction()) {
path.ensureBlock();
path = path.get("body");
}
var unique = opts.unique;
var kind = opts.kind || "var";
var blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist;
var dataKey = "declaration:" + kind + ":" + blockHoist;
var declarPath = !unique && path.getData(dataKey);
if (!declarPath) {
var declar = t().variableDeclaration(kind, []);
declar._blockHoist = blockHoist;
var _path$unshiftContaine = path.unshiftContainer("body", [declar]);
declarPath = _path$unshiftContaine[0];
if (!unique) path.setData(dataKey, declarPath);
}
var declarator = t().variableDeclarator(opts.id, opts.init);
declarPath.node.declarations.push(declarator);
this.registerBinding(kind, declarPath.get("declarations").pop());
};
_proto.getProgramParent = function getProgramParent() {
var scope = this;
do {
if (scope.path.isProgram()) {
return scope;
}
} while (scope = scope.parent);
throw new Error("Couldn't find a Program");
};
_proto.getFunctionParent = function getFunctionParent() {
var scope = this;
do {
if (scope.path.isFunctionParent()) {
return scope;
}
} while (scope = scope.parent);
return null;
};
_proto.getBlockParent = function getBlockParent() {
var 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...");
};
_proto.getAllBindings = function getAllBindings() {
var ids = Object.create(null);
var scope = this;
do {
(0, _defaults().default)(ids, scope.bindings);
scope = scope.p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment