!function(e){function t(e){Object.defineProperty(this,e,{enumerable:!0,get:function(){return this[v][e]}})}function r(e){if("undefined"!=typeof System&&System.isModule?System.isModule(e):"[object Module]"===Object.prototype.toString.call(e))return e;var t={default:e,__useDefault:e};if(e&&e.__esModule)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return new o(t)}function o(e){Object.defineProperty(this,v,{value:e}),Object.keys(e).forEach(t,this)}function n(e){return"@node/"===e.substr(0,6)?c(e,r(m(e.substr(6))),{}):p[e]}function u(e){var t=n(e);if(!t)throw new Error('Module "'+e+'" expected, but not contained in build.');if(t.module)return t.module;var r=t.linkRecord;return i(t,r),a(t,r,[]),t.module}function i(e,t){if(!t.depLoads){t.declare&&d(e,t),t.depLoads=[];for(var r=0;r1)for(var a=1;a 1 && arguments[1] !== undefined ? arguments[1] : "global"; var namespace = t.identifier("babelHelpers"); var builder = function builder(body) { return buildHelpers(body, namespace, whitelist); }; var tree = void 0; var build = { global: buildGlobal, umd: buildUmd, var: buildVar }[outputType]; if (build) { tree = build(namespace, builder); } else { throw new Error(messages.get("unsupportedOutputType", outputType)); } return (0, _babelGenerator2.default)(tree).code; }; var _babelHelpers = $__require("d"); var helpers = _interopRequireWildcard(_babelHelpers); var _babelGenerator = $__require("e"); var _babelGenerator2 = _interopRequireDefault(_babelGenerator); var _babelMessages = $__require("f"); var messages = _interopRequireWildcard(_babelMessages); var _babelTemplate = $__require("10"); var _babelTemplate2 = _interopRequireDefault(_babelTemplate); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } var buildUmdWrapper = (0, _babelTemplate2.default)("\n (function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === \"object\") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n"); function buildGlobal(namespace, builder) { var body = []; var container = t.functionExpression(null, [t.identifier("global")], t.blockStatement(body)); var tree = t.program([t.expressionStatement(t.callExpression(container, [helpers.get("selfGlobal")]))]); body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.assignmentExpression("=", t.memberExpression(t.identifier("global"), namespace), t.objectExpression([])))])); builder(body); return tree; } function buildUmd(namespace, builder) { var body = []; body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.identifier("global"))])); builder(body); return t.program([buildUmdWrapper({ FACTORY_PARAMETERS: t.identifier("global"), BROWSER_ARGUMENTS: t.assignmentExpression("=", t.memberExpression(t.identifier("root"), namespace), t.objectExpression([])), COMMON_ARGUMENTS: t.identifier("exports"), AMD_ARGUMENTS: t.arrayExpression([t.stringLiteral("exports")]), FACTORY_BODY: body, UMD_ROOT: t.identifier("this") })]); } function buildVar(namespace, builder) { var body = []; body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.objectExpression([]))])); builder(body); body.push(t.expressionStatement(namespace)); return t.program(body); } function buildHelpers(body, namespace, whitelist) { helpers.list.forEach(function (name) { if (whitelist && whitelist.indexOf(name) < 0) return; var key = t.identifier(name); body.push(t.expressionStatement(t.assignmentExpression("=", t.memberExpression(namespace, key), helpers.get(name)))); }); } module.exports = exports["default"]; }); $__System.registerDynamic("12", [], true, function() { return { "name": "babel-core", "version": "6.25.0", "description": "Babel compiler core.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", "repository": "https://github.com/babel/babel/tree/master/packages/babel-core", "keywords": [ "6to5", "babel", "classes", "const", "es6", "harmony", "let", "modules", "transpile", "transpiler", "var", "babel-core", "compiler" ], "scripts": { "bench": "make bench", "test": "make test" }, "dependencies": { "babel-code-frame": "^6.22.0", "babel-generator": "^6.25.0", "babel-helpers": "^6.24.1", "babel-messages": "^6.23.0", "babel-template": "^6.25.0", "babel-runtime": "^6.22.0", "babel-register": "^6.24.1", "babel-traverse": "^6.25.0", "babel-types": "^6.25.0", "babylon": "^6.17.2", "convert-source-map": "^1.1.0", "debug": "^2.1.1", "json5": "^0.5.0", "lodash": "^4.2.0", "minimatch": "^3.0.2", "path-is-absolute": "^1.0.0", "private": "^0.1.6", "slash": "^1.0.0", "source-map": "^0.5.0" }, "devDependencies": { "babel-helper-fixtures": "^6.22.0", "babel-helper-transform-fixture-test-runner": "^6.24.1", "babel-polyfill": "^6.23.0" } }; }); $__System.registerDynamic("13", ["11", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (ast, comments, tokens) { if (ast) { if (ast.type === "Program") { return t.file(ast, comments || [], tokens || []); } else if (ast.type === "File") { return ast; } } throw new Error("Not a valid ast?"); }; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } module.exports = exports["default"]; }); $__System.registerDynamic("14", ["10"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _babelTemplate = $__require("10"); var _babelTemplate2 = _interopRequireDefault(_babelTemplate); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var helpers = {}; exports.default = helpers; helpers.typeof = (0, _babelTemplate2.default)("\n (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\")\n ? function (obj) { return typeof obj; }\n : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype\n ? \"symbol\"\n : typeof obj;\n };\n"); helpers.jsx = (0, _babelTemplate2.default)("\n (function () {\n var REACT_ELEMENT_TYPE = (typeof Symbol === \"function\" && Symbol.for && Symbol.for(\"react.element\")) || 0xeac7;\n\n return function createRawReactElement (type, props, key, children) {\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n // If we're going to assign props.children, we create a new object now\n // to avoid mutating defaultProps.\n props = {};\n }\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : '' + key,\n ref: null,\n props: props,\n _owner: null,\n };\n };\n\n })()\n"); helpers.asyncIterator = (0, _babelTemplate2.default)("\n (function (iterable) {\n if (typeof Symbol === \"function\") {\n if (Symbol.asyncIterator) {\n var method = iterable[Symbol.asyncIterator];\n if (method != null) return method.call(iterable);\n }\n if (Symbol.iterator) {\n return iterable[Symbol.iterator]();\n }\n }\n throw new TypeError(\"Object is not async iterable\");\n })\n"); helpers.asyncGenerator = (0, _babelTemplate2.default)("\n (function () {\n function AwaitValue(value) {\n this.value = value;\n }\n\n function AsyncGenerator(gen) {\n var front, back;\n\n function send(key, arg) {\n return new Promise(function (resolve, reject) {\n var request = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key, arg) {\n try {\n var result = gen[key](arg)\n var value = result.value;\n if (value instanceof AwaitValue) {\n Promise.resolve(value.value).then(\n function (arg) { resume(\"next\", arg); },\n function (arg) { resume(\"throw\", arg); });\n } else {\n settle(result.done ? \"return\" : \"normal\", result.value);\n }\n } catch (err) {\n settle(\"throw\", err);\n }\n }\n\n function settle(type, value) {\n switch (type) {\n case \"return\":\n front.resolve({ value: value, done: true });\n break;\n case \"throw\":\n front.reject(value);\n break;\n default:\n front.resolve({ value: value, done: false });\n break;\n }\n\n front = front.next;\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n // Hide \"return\" method if generator return is not supported\n if (typeof gen.return !== \"function\") {\n this.return = undefined;\n }\n }\n\n if (typeof Symbol === \"function\" && Symbol.asyncIterator) {\n AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; };\n }\n\n AsyncGenerator.prototype.next = function (arg) { return this._invoke(\"next\", arg); };\n AsyncGenerator.prototype.throw = function (arg) { return this._invoke(\"throw\", arg); };\n AsyncGenerator.prototype.return = function (arg) { return this._invoke(\"return\", arg); };\n\n return {\n wrap: function (fn) {\n return function () {\n return new AsyncGenerator(fn.apply(this, arguments));\n };\n },\n await: function (value) {\n return new AwaitValue(value);\n }\n };\n\n })()\n"); helpers.asyncGeneratorDelegate = (0, _babelTemplate2.default)("\n (function (inner, awaitWrap) {\n var iter = {}, waiting = false;\n\n function pump(key, value) {\n waiting = true;\n value = new Promise(function (resolve) { resolve(inner[key](value)); });\n return { done: false, value: awaitWrap(value) };\n };\n\n if (typeof Symbol === \"function\" && Symbol.iterator) {\n iter[Symbol.iterator] = function () { return this; };\n }\n\n iter.next = function (value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump(\"next\", value);\n };\n\n if (typeof inner.throw === \"function\") {\n iter.throw = function (value) {\n if (waiting) {\n waiting = false;\n throw value;\n }\n return pump(\"throw\", value);\n };\n }\n\n if (typeof inner.return === \"function\") {\n iter.return = function (value) {\n return pump(\"return\", value);\n };\n }\n\n return iter;\n })\n"); helpers.asyncToGenerator = (0, _babelTemplate2.default)("\n (function (fn) {\n return function () {\n var gen = fn.apply(this, arguments);\n return new Promise(function (resolve, reject) {\n function step(key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n return Promise.resolve(value).then(function (value) {\n step(\"next\", value);\n }, function (err) {\n step(\"throw\", err);\n });\n }\n }\n\n return step(\"next\");\n });\n };\n })\n"); helpers.classCallCheck = (0, _babelTemplate2.default)("\n (function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n });\n"); helpers.createClass = (0, _babelTemplate2.default)("\n (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i ++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n })()\n"); helpers.defineEnumerableProperties = (0, _babelTemplate2.default)("\n (function (obj, descs) {\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if (\"value\" in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n return obj;\n })\n"); helpers.defaults = (0, _babelTemplate2.default)("\n (function (obj, defaults) {\n var keys = Object.getOwnPropertyNames(defaults);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = Object.getOwnPropertyDescriptor(defaults, key);\n if (value && value.configurable && obj[key] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n return obj;\n })\n"); helpers.defineProperty = (0, _babelTemplate2.default)("\n (function (obj, key, value) {\n // Shortcircuit the slow defineProperty path when possible.\n // We are trying to avoid issues where setters defined on the\n // prototype cause side effects under the fast path of simple\n // assignment. By checking for existence of the property with\n // the in operator, we can optimize most of this overhead away.\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n });\n"); helpers.extends = (0, _babelTemplate2.default)("\n Object.assign || (function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n })\n"); helpers.get = (0, _babelTemplate2.default)("\n (function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n });\n"); helpers.inherits = (0, _babelTemplate2.default)("\n (function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n })\n"); helpers.instanceof = (0, _babelTemplate2.default)("\n (function (left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\n return right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n });\n"); helpers.interopRequireDefault = (0, _babelTemplate2.default)("\n (function (obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n })\n"); helpers.interopRequireWildcard = (0, _babelTemplate2.default)("\n (function (obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];\n }\n }\n newObj.default = obj;\n return newObj;\n }\n })\n"); helpers.newArrowCheck = (0, _babelTemplate2.default)("\n (function (innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError(\"Cannot instantiate an arrow function\");\n }\n });\n"); helpers.objectDestructuringEmpty = (0, _babelTemplate2.default)("\n (function (obj) {\n if (obj == null) throw new TypeError(\"Cannot destructure undefined\");\n });\n"); helpers.objectWithoutProperties = (0, _babelTemplate2.default)("\n (function (obj, keys) {\n var target = {};\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n return target;\n })\n"); helpers.possibleConstructorReturn = (0, _babelTemplate2.default)("\n (function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n });\n"); helpers.selfGlobal = (0, _babelTemplate2.default)("\n typeof global === \"undefined\" ? self : global\n"); helpers.set = (0, _babelTemplate2.default)("\n (function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if (\"value\" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n });\n"); helpers.slicedToArray = (0, _babelTemplate2.default)("\n (function () {\n // Broken out into a separate function to avoid deoptimizations due to the try/catch for the\n // array iterator case.\n function sliceIterator(arr, i) {\n // this is an expanded form of `for...of` that properly supports abrupt completions of\n // iterators etc. variable names have been minimised to reduce the size of this massive\n // helper. sometimes spec compliancy is annoying :(\n //\n // _n = _iteratorNormalCompletion\n // _d = _didIteratorError\n // _e = _iteratorError\n // _i = _iterator\n // _s = _step\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n })();\n"); helpers.slicedToArrayLoose = (0, _babelTemplate2.default)("\n (function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n var _arr = [];\n for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {\n _arr.push(_step.value);\n if (i && _arr.length === i) break;\n }\n return _arr;\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n });\n"); helpers.taggedTemplateLiteral = (0, _babelTemplate2.default)("\n (function (strings, raw) {\n return Object.freeze(Object.defineProperties(strings, {\n raw: { value: Object.freeze(raw) }\n }));\n });\n"); helpers.taggedTemplateLiteralLoose = (0, _babelTemplate2.default)("\n (function (strings, raw) {\n strings.raw = raw;\n return strings;\n });\n"); helpers.temporalRef = (0, _babelTemplate2.default)("\n (function (val, name, undef) {\n if (val === undef) {\n throw new ReferenceError(name + \" is not defined - temporal dead zone\");\n } else {\n return val;\n }\n })\n"); helpers.temporalUndefined = (0, _babelTemplate2.default)("\n ({})\n"); helpers.toArray = (0, _babelTemplate2.default)("\n (function (arr) {\n return Array.isArray(arr) ? arr : Array.from(arr);\n });\n"); helpers.toConsumableArray = (0, _babelTemplate2.default)("\n (function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n return arr2;\n } else {\n return Array.from(arr);\n }\n });\n"); module.exports = exports["default"]; }); $__System.registerDynamic("d", ["15", "14"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.list = undefined; var _keys = $__require("15"); var _keys2 = _interopRequireDefault(_keys); exports.get = get; var _helpers = $__require("14"); var _helpers2 = _interopRequireDefault(_helpers); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function get(name) { var fn = _helpers2.default[name]; if (!fn) throw new ReferenceError("Unknown helper " + name); return fn().expression; } var list = exports.list = (0, _keys2.default)(_helpers2.default).map(function (name) { return name.replace(/^_/, ""); }).filter(function (name) { return name !== "__esModule"; }); exports.default = get; }); $__System.registerDynamic("16", ["17", "11", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.ImportDeclaration = exports.ModuleDeclaration = undefined; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.ExportDeclaration = ExportDeclaration; exports.Scope = Scope; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var ModuleDeclaration = exports.ModuleDeclaration = { enter: function enter(path, file) { var node = path.node; if (node.source) { node.source.value = file.resolveModuleSource(node.source.value); } } }; var ImportDeclaration = exports.ImportDeclaration = { exit: function exit(path, file) { var node = path.node; var specifiers = []; var imported = []; file.metadata.modules.imports.push({ source: node.source.value, imported: imported, specifiers: specifiers }); for (var _iterator = path.get("specifiers"), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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; var local = specifier.node.local.name; if (specifier.isImportDefaultSpecifier()) { imported.push("default"); specifiers.push({ kind: "named", imported: "default", local: local }); } if (specifier.isImportSpecifier()) { var importedName = specifier.node.imported.name; imported.push(importedName); specifiers.push({ kind: "named", imported: importedName, local: local }); } if (specifier.isImportNamespaceSpecifier()) { imported.push("*"); specifiers.push({ kind: "namespace", local: local }); } } } }; function ExportDeclaration(path, file) { var node = path.node; var source = node.source ? node.source.value : null; var exports = file.metadata.modules.exports; var declar = path.get("declaration"); if (declar.isStatement()) { var bindings = declar.getBindingIdentifiers(); for (var name in bindings) { exports.exported.push(name); exports.specifiers.push({ kind: "local", local: name, exported: path.isExportDefaultDeclaration() ? "default" : name }); } } if (path.isExportNamedDeclaration() && node.specifiers) { for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var specifier = _ref2; var exported = specifier.exported.name; exports.exported.push(exported); if (t.isExportDefaultSpecifier(specifier)) { exports.specifiers.push({ kind: "external", local: exported, exported: exported, source: source }); } if (t.isExportNamespaceSpecifier(specifier)) { exports.specifiers.push({ kind: "external-namespace", exported: exported, source: source }); } var local = specifier.local; if (!local) continue; if (source) { exports.specifiers.push({ kind: "external", local: local.name, exported: exported, source: source }); } if (!source) { exports.specifiers.push({ kind: "local", local: local.name, exported: exported }); } } } if (path.isExportAllDeclaration()) { exports.specifiers.push({ kind: "external-all", source: source }); } } function Scope(path) { path.skip(); } }); $__System.registerDynamic('18', ['@node/fs', '@node/path', '19'], true, function ($__require, exports, module) { 'use strict'; var Buffer = $__require('19'); var global = this || self, GLOBAL = global; var fs = $__require('@node/fs'); var path = $__require('@node/path'); Object.defineProperty(exports, 'commentRegex', { get: function getCommentRegex() { return (/^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/mg ); } }); Object.defineProperty(exports, 'mapFileCommentRegex', { get: function getMapFileCommentRegex() { //Example (Extra space between slashes added to solve Safari bug. Exclude space in production): // / /# sourceMappingURL=foo.js.map /*# sourceMappingURL=foo.js.map */ return (/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg ); } }); function decodeBase64(base64) { return new Buffer(base64, 'base64').toString(); } function stripComment(sm) { return sm.split(',').pop(); } function readFromFileMap(sm, dir) { // NOTE: this will only work on the server since it attempts to read the map file var r = exports.mapFileCommentRegex.exec(sm); // for some odd reason //# .. captures in 1 and /* .. */ in 2 var filename = r[1] || r[2]; var filepath = path.resolve(dir, filename); try { return fs.readFileSync(filepath, 'utf8'); } catch (e) { throw new Error('An error occurred while trying to read the map file at ' + filepath + '\n' + e); } } function Converter(sm, opts) { opts = opts || {}; if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir); if (opts.hasComment) sm = stripComment(sm); if (opts.isEncoded) sm = decodeBase64(sm); if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm); this.sourcemap = sm; } Converter.prototype.toJSON = function (space) { return JSON.stringify(this.sourcemap, null, space); }; Converter.prototype.toBase64 = function () { var json = this.toJSON(); return new Buffer(json).toString('base64'); }; Converter.prototype.toComment = function (options) { var base64 = this.toBase64(); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; }; // returns copy instead of original Converter.prototype.toObject = function () { return JSON.parse(this.toJSON()); }; Converter.prototype.addProperty = function (key, value) { if (this.sourcemap.hasOwnProperty(key)) throw new Error('property %s already exists on the sourcemap, use set property instead'); return this.setProperty(key, value); }; Converter.prototype.setProperty = function (key, value) { this.sourcemap[key] = value; return this; }; Converter.prototype.getProperty = function (key) { return this.sourcemap[key]; }; exports.fromObject = function (obj) { return new Converter(obj); }; exports.fromJSON = function (json) { return new Converter(json, { isJSON: true }); }; exports.fromBase64 = function (base64) { return new Converter(base64, { isEncoded: true }); }; exports.fromComment = function (comment) { comment = comment.replace(/^\/\*/g, '//').replace(/\*\/$/g, ''); return new Converter(comment, { isEncoded: true, hasComment: true }); }; exports.fromMapFileComment = function (comment, dir) { return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true }); }; // Finds last sourcemap comment in file or returns null if none was found exports.fromSource = function (content) { var m = content.match(exports.commentRegex); return m ? exports.fromComment(m.pop()) : null; }; // Finds last sourcemap comment in file or returns null if none was found exports.fromMapFileSource = function (content, dir) { var m = content.match(exports.mapFileCommentRegex); return m ? exports.fromMapFileComment(m.pop(), dir) : null; }; exports.removeComments = function (src) { return src.replace(exports.commentRegex, ''); }; exports.removeMapFileComments = function (src) { return src.replace(exports.mapFileCommentRegex, ''); }; exports.generateMapFileComment = function (file, options) { var data = 'sourceMappingURL=' + file; return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data; }; }); $__System.registerDynamic("1a", ["1d", "1e", "1f", "1b", "1c", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _possibleConstructorReturn2 = $__require("1e"); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = $__require("1f"); var _inherits3 = _interopRequireDefault(_inherits2); var _store = $__require("1b"); var _store2 = _interopRequireDefault(_store); var _file5 = $__require("1c"); var _file6 = _interopRequireDefault(_file5); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var PluginPass = function (_Store) { (0, _inherits3.default)(PluginPass, _Store); function PluginPass(file, plugin) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; (0, _classCallCheck3.default)(this, PluginPass); var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); _this.plugin = plugin; _this.key = plugin.key; _this.file = file; _this.opts = options; return _this; } PluginPass.prototype.addHelper = function addHelper() { var _file; return (_file = this.file).addHelper.apply(_file, arguments); }; PluginPass.prototype.addImport = function addImport() { var _file2; return (_file2 = this.file).addImport.apply(_file2, arguments); }; PluginPass.prototype.getModuleName = function getModuleName() { var _file3; return (_file3 = this.file).getModuleName.apply(_file3, arguments); }; PluginPass.prototype.buildCodeFrameError = function buildCodeFrameError() { var _file4; return (_file4 = this.file).buildCodeFrameError.apply(_file4, arguments); }; return PluginPass; }(_store2.default); exports.default = PluginPass; module.exports = exports["default"]; }); $__System.registerDynamic('20', [], true, function ($__require, exports, module) { 'use strict'; var global = this || self, GLOBAL = global; module.exports = Number.isNaN || function (x) { return x !== x; }; }); $__System.registerDynamic('21', ['20'], true, function ($__require, exports, module) { 'use strict'; var global = this || self, GLOBAL = global; var numberIsNan = $__require('20'); module.exports = Number.isFinite || function (val) { return !(typeof val !== 'number' || numberIsNan(val) || val === Infinity || val === -Infinity); }; }); $__System.registerDynamic('22', ['21'], true, function ($__require, exports, module) { 'use strict'; var global = this || self, GLOBAL = global; var isFinite = $__require('21'); module.exports = function (str, n) { if (typeof str !== 'string') { throw new TypeError('Expected `input` to be a string'); } if (n < 0 || !isFinite(n)) { throw new TypeError('Expected `count` to be a positive finite number'); } var ret = ''; do { if (n & 1) { ret += str; } str += str; } while (n >>= 1); return ret; }; }); $__System.registerDynamic('23', ['22'], true, function ($__require, exports, module) { /* eslint-disable guard-for-in */ 'use strict'; var global = this || self, GLOBAL = global; var repeating = $__require('22'); // detect either spaces or tabs but not both to properly handle tabs // for indentation and spaces for alignment var INDENT_RE = /^(?:( )+|\t+)/; function getMostUsed(indents) { var result = 0; var maxUsed = 0; var maxWeight = 0; for (var n in indents) { var indent = indents[n]; var u = indent[0]; var w = indent[1]; if (u > maxUsed || u === maxUsed && w > maxWeight) { maxUsed = u; maxWeight = w; result = Number(n); } } return result; } module.exports = function (str) { if (typeof str !== 'string') { throw new TypeError('Expected a string'); } // used to see if tabs or spaces are the most used var tabs = 0; var spaces = 0; // remember the size of previous line's indentation var prev = 0; // remember how many indents/unindents as occurred for a given size // and how much lines follow a given indentation // // indents = { // 3: [1, 0], // 4: [1, 5], // 5: [1, 0], // 12: [1, 0], // } var indents = {}; // pointer to the array of last used indent var current; // whether the last action was an indent (opposed to an unindent) var isIndent; str.split(/\n/g).forEach(function (line) { if (!line) { // ignore empty lines return; } var indent; var matches = line.match(INDENT_RE); if (!matches) { indent = 0; } else { indent = matches[0].length; if (matches[1]) { spaces++; } else { tabs++; } } var diff = indent - prev; prev = indent; if (diff) { // an indent or unindent has been detected isIndent = diff > 0; current = indents[isIndent ? diff : -diff]; if (current) { current[0]++; } else { current = indents[diff] = [1, 0]; } } else if (current) { // if the last action was an indent, increment the weight current[1] += Number(isIndent); } }); var amount = getMostUsed(indents); var type; var actual; if (!amount) { type = null; actual = ''; } else if (spaces >= tabs) { type = 'space'; actual = repeating(' ', amount); } else { type = 'tab'; actual = repeating('\t', amount); } return { amount: amount, type: type, indent: actual }; }; }); $__System.registerDynamic("24", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ exports.GREATEST_LOWER_BOUND = 1; exports.LEAST_UPPER_BOUND = 2; /** * Recursive implementation of binary search. * * @param aLow Indices here and lower do not contain the needle. * @param aHigh Indices here and higher do not contain the needle. * @param aNeedle The element being searched for. * @param aHaystack The non-empty array being searched. * @param aCompare Function which takes two elements and returns -1, 0, or 1. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the * closest element that is smaller than or greater than the one we are * searching for, respectively, if the exact element cannot be found. */ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { // This function terminates when one of the following is true: // // 1. We find the exact element we are looking for. // // 2. We did not find the exact element, but we can return the index of // the next-closest element. // // 3. We did not find the exact element, and there is no next-closest // element than the one we are searching for, so we return -1. var mid = Math.floor((aHigh - aLow) / 2) + aLow; var cmp = aCompare(aNeedle, aHaystack[mid], true); if (cmp === 0) { // Found the element we are looking for. return mid; } else if (cmp > 0) { // Our needle is greater than aHaystack[mid]. if (aHigh - mid > 1) { // The element is in the upper half. return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); } // The exact needle element was not found in this haystack. Determine if // we are in termination case (3) or (2) and return the appropriate thing. if (aBias == exports.LEAST_UPPER_BOUND) { return aHigh < aHaystack.length ? aHigh : -1; } else { return mid; } } else { // Our needle is less than aHaystack[mid]. if (mid - aLow > 1) { // The element is in the lower half. return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); } // we are in termination case (3) or (2) and return the appropriate thing. if (aBias == exports.LEAST_UPPER_BOUND) { return mid; } else { return aLow < 0 ? -1 : aLow; } } } /** * This is an implementation of binary search which will always try and return * the index of the closest element if there is no exact hit. This is because * mappings between original and generated line/col pairs are single points, * and there is an implicit region between each of them, so a miss just means * that you aren't on the very start of a region. * * @param aNeedle The element you are looking for. * @param aHaystack The array that is being searched. * @param aCompare A function which takes the needle and an element in the * array and returns -1, 0, or 1 depending on whether the needle is less * than, equal to, or greater than the element, respectively. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the * closest element that is smaller than or greater than the one we are * searching for, respectively, if the exact element cannot be found. * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. */ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { if (aHaystack.length === 0) { return -1; } var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND); if (index < 0) { return -1; } // We have found either the exact element, or the next-closest element than // the one we are searching for. However, there may be more than one such // element. Make sure we always return the smallest of these. while (index - 1 >= 0) { if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { break; } --index; } return index; }; }); $__System.registerDynamic("25", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ // It turns out that some (most?) JavaScript engines don't self-host // `Array.prototype.sort`. This makes sense because C++ will likely remain // faster than JS when doing raw CPU-intensive sorting. However, when using a // custom comparator function, calling back and forth between the VM's C++ and // JIT'd JS is rather slow *and* loses JIT type information, resulting in // worse generated code for the comparator function than would be optimal. In // fact, when sorting with a comparator, these costs outweigh the benefits of // sorting in C++. By using our own JS-implemented Quick Sort (below), we get // a ~3500ms mean speed-up in `bench/bench.html`. /** * Swap the elements indexed by `x` and `y` in the array `ary`. * * @param {Array} ary * The array. * @param {Number} x * The index of the first item. * @param {Number} y * The index of the second item. */ function swap(ary, x, y) { var temp = ary[x]; ary[x] = ary[y]; ary[y] = temp; } /** * Returns a random integer within the range `low .. high` inclusive. * * @param {Number} low * The lower bound on the range. * @param {Number} high * The upper bound on the range. */ function randomIntInRange(low, high) { return Math.round(low + Math.random() * (high - low)); } /** * The Quick Sort algorithm. * * @param {Array} ary * An array to sort. * @param {function} comparator * Function to use to compare two items. * @param {Number} p * Start index of the array * @param {Number} r * End index of the array */ function doQuickSort(ary, comparator, p, r) { // If our lower bound is less than our upper bound, we (1) partition the // array into two pieces and (2) recurse on each half. If it is not, this is // the empty array and our base case. if (p < r) { // (1) Partitioning. // // The partitioning chooses a pivot between `p` and `r` and moves all // elements that are less than or equal to the pivot to the before it, and // all the elements that are greater than it after it. The effect is that // once partition is done, the pivot is in the exact place it will be when // the array is put in sorted order, and it will not need to be moved // again. This runs in O(n) time. // Always choose a random pivot so that an input array which is reverse // sorted does not cause O(n^2) running time. var pivotIndex = randomIntInRange(p, r); var i = p - 1; swap(ary, pivotIndex, r); var pivot = ary[r]; // Immediately after `j` is incremented in this loop, the following hold // true: // // * Every element in `ary[p .. i]` is less than or equal to the pivot. // // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. for (var j = p; j < r; j++) { if (comparator(ary[j], pivot) <= 0) { i += 1; swap(ary, i, j); } } swap(ary, i + 1, j); var q = i + 1; // (2) Recurse on each half. doQuickSort(ary, comparator, p, q - 1); doQuickSort(ary, comparator, q + 1, r); } } /** * Sort the given array in-place with the given comparator function. * * @param {Array} ary * An array to sort. * @param {function} comparator * Function to use to compare two items. */ exports.quickSort = function (ary, comparator) { doQuickSort(ary, comparator, 0, ary.length - 1); }; }); $__System.registerDynamic('26', ['27', '24', '28', '29', '25'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var util = $__require('27'); var binarySearch = $__require('24'); var ArraySet = $__require('28').ArraySet; var base64VLQ = $__require('29'); var quickSort = $__require('25').quickSort; function SourceMapConsumer(aSourceMap) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); } return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap) : new BasicSourceMapConsumer(sourceMap); } SourceMapConsumer.fromSourceMap = function (aSourceMap) { return BasicSourceMapConsumer.fromSourceMap(aSourceMap); }; /** * The version of the source mapping spec that we are consuming. */ SourceMapConsumer.prototype._version = 3; // `__generatedMappings` and `__originalMappings` are arrays that hold the // parsed mapping coordinates from the source map's "mappings" attribute. They // are lazily instantiated, accessed via the `_generatedMappings` and // `_originalMappings` getters respectively, and we only parse the mappings // and create these arrays once queried for a source location. We jump through // these hoops because there can be many thousands of mappings, and parsing // them is expensive, so we only want to do it if we must. // // Each object in the arrays is of the form: // // { // generatedLine: The line number in the generated code, // generatedColumn: The column number in the generated code, // source: The path to the original source file that generated this // chunk of code, // originalLine: The line number in the original source that // corresponds to this chunk of generated code, // originalColumn: The column number in the original source that // corresponds to this chunk of generated code, // name: The name of the original symbol which generated this chunk of // code. // } // // All properties except for `generatedLine` and `generatedColumn` can be // `null`. // // `_generatedMappings` is ordered by the generated positions. // // `_originalMappings` is ordered by the original positions. SourceMapConsumer.prototype.__generatedMappings = null; Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { get: function () { if (!this.__generatedMappings) { this._parseMappings(this._mappings, this.sourceRoot); } return this.__generatedMappings; } }); SourceMapConsumer.prototype.__originalMappings = null; Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { get: function () { if (!this.__originalMappings) { this._parseMappings(this._mappings, this.sourceRoot); } return this.__originalMappings; } }); SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) { var c = aStr.charAt(index); return c === ";" || c === ","; }; /** * Parse the mappings in a string in to a data structure which we can easily * query (the ordered arrays in the `this.__generatedMappings` and * `this.__originalMappings` properties). */ SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { throw new Error("Subclasses must implement _parseMappings"); }; SourceMapConsumer.GENERATED_ORDER = 1; SourceMapConsumer.ORIGINAL_ORDER = 2; SourceMapConsumer.GREATEST_LOWER_BOUND = 1; SourceMapConsumer.LEAST_UPPER_BOUND = 2; /** * Iterate over each mapping between an original source/line/column and a * generated line/column in this source map. * * @param Function aCallback * The function that is called with each mapping. * @param Object aContext * Optional. If specified, this object will be the value of `this` every * time that `aCallback` is called. * @param aOrder * Either `SourceMapConsumer.GENERATED_ORDER` or * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to * iterate over the mappings sorted by the generated file's line/column * order or the original's source/line/column order, respectively. Defaults to * `SourceMapConsumer.GENERATED_ORDER`. */ SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { var context = aContext || null; var order = aOrder || SourceMapConsumer.GENERATED_ORDER; var mappings; switch (order) { case SourceMapConsumer.GENERATED_ORDER: mappings = this._generatedMappings; break; case SourceMapConsumer.ORIGINAL_ORDER: mappings = this._originalMappings; break; default: throw new Error("Unknown order of iteration."); } var sourceRoot = this.sourceRoot; mappings.map(function (mapping) { var source = mapping.source === null ? null : this._sources.at(mapping.source); if (source != null && sourceRoot != null) { source = util.join(sourceRoot, source); } return { source: source, generatedLine: mapping.generatedLine, generatedColumn: mapping.generatedColumn, originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, name: mapping.name === null ? null : this._names.at(mapping.name) }; }, this).forEach(aCallback, context); }; /** * Returns all generated line and column information for the original source, * line, and column provided. If no column is provided, returns all mappings * corresponding to a either the line we are searching for or the next * closest line that has any mappings. Otherwise, returns all mappings * corresponding to the given line and either the column we are searching for * or the next closest column that has any offsets. * * The only argument is an object with the following properties: * * - source: The filename of the original source. * - line: The line number in the original source. * - column: Optional. the column number in the original source. * * and an array of objects is returned, each with the following properties: * * - line: The line number in the generated source, or null. * - column: The column number in the generated source, or null. */ SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { var line = util.getArg(aArgs, 'line'); // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping // returns the index of the closest mapping less than the needle. By // setting needle.originalColumn to 0, we thus find the last mapping for // the given line, provided such a mapping exists. var needle = { source: util.getArg(aArgs, 'source'), originalLine: line, originalColumn: util.getArg(aArgs, 'column', 0) }; if (this.sourceRoot != null) { needle.source = util.relative(this.sourceRoot, needle.source); } if (!this._sources.has(needle.source)) { return []; } needle.source = this._sources.indexOf(needle.source); var mappings = []; var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND); if (index >= 0) { var mapping = this._originalMappings[index]; if (aArgs.column === undefined) { var originalLine = mapping.originalLine; // Iterate until either we run out of mappings, or we run into // a mapping for a different line than the one we found. Since // mappings are sorted, this is guaranteed to find all mappings for // the line we found. while (mapping && mapping.originalLine === originalLine) { mappings.push({ line: util.getArg(mapping, 'generatedLine', null), column: util.getArg(mapping, 'generatedColumn', null), lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }); mapping = this._originalMappings[++index]; } } else { var originalColumn = mapping.originalColumn; // Iterate until either we run out of mappings, or we run into // a mapping for a different line than the one we were searching for. // Since mappings are sorted, this is guaranteed to find all mappings for // the line we are searching for. while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) { mappings.push({ line: util.getArg(mapping, 'generatedLine', null), column: util.getArg(mapping, 'generatedColumn', null), lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }); mapping = this._originalMappings[++index]; } } } return mappings; }; exports.SourceMapConsumer = SourceMapConsumer; /** * A BasicSourceMapConsumer instance represents a parsed source map which we can * query for information about the original file positions by giving it a file * position in the generated source. * * The only parameter is the raw source map (either as a JSON string, or * already parsed to an object). According to the spec, source maps have the * following attributes: * * - version: Which version of the source map spec this map is following. * - sources: An array of URLs to the original source files. * - names: An array of identifiers which can be referrenced by individual mappings. * - sourceRoot: Optional. The URL root from which all sources are relative. * - sourcesContent: Optional. An array of contents of the original source files. * - mappings: A string of base64 VLQs which contain the actual mappings. * - file: Optional. The generated file this source map is associated with. * * Here is an example source map, taken from the source map spec[0]: * * { * version : 3, * file: "out.js", * sourceRoot : "", * sources: ["foo.js", "bar.js"], * names: ["src", "maps", "are", "fun"], * mappings: "AA,AB;;ABCDE;" * } * * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# */ function BasicSourceMapConsumer(aSourceMap) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); } var version = util.getArg(sourceMap, 'version'); var sources = util.getArg(sourceMap, 'sources'); // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which // requires the array) to play nice here. var names = util.getArg(sourceMap, 'names', []); var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); var mappings = util.getArg(sourceMap, 'mappings'); var file = util.getArg(sourceMap, 'file', null); // Once again, Sass deviates from the spec and supplies the version as a // string rather than a number, so we use loose equality checking here. if (version != this._version) { throw new Error('Unsupported version: ' + version); } sources = sources.map(String) // Some source maps produce relative source paths like "./foo.js" instead of // "foo.js". Normalize these first so that future comparisons will succeed. // See bugzil.la/1090768. .map(util.normalize) // Always ensure that absolute sources are internally stored relative to // the source root, if the source root is absolute. Not doing this would // be particularly problematic when the source root is a prefix of the // source (valid, but why??). See github issue #199 and bugzil.la/1188982. .map(function (source) { return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source; }); // Pass `true` below to allow duplicate names and sources. While source maps // are intended to be compressed and deduplicated, the TypeScript compiler // sometimes generates source maps with duplicates in them. See Github issue // #72 and bugzil.la/889492. this._names = ArraySet.fromArray(names.map(String), true); this._sources = ArraySet.fromArray(sources, true); this.sourceRoot = sourceRoot; this.sourcesContent = sourcesContent; this._mappings = mappings; this.file = file; } BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; /** * Create a BasicSourceMapConsumer from a SourceMapGenerator. * * @param SourceMapGenerator aSourceMap * The source map that will be consumed. * @returns BasicSourceMapConsumer */ BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap) { var smc = Object.create(BasicSourceMapConsumer.prototype); var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); smc.sourceRoot = aSourceMap._sourceRoot; smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot); smc.file = aSourceMap._file; // Because we are modifying the entries (by converting string sources and // names to indices into the sources and names ArraySets), we have to make // a copy of the entry or else bad things happen. Shared mutable state // strikes again! See github issue #191. var generatedMappings = aSourceMap._mappings.toArray().slice(); var destGeneratedMappings = smc.__generatedMappings = []; var destOriginalMappings = smc.__originalMappings = []; for (var i = 0, length = generatedMappings.length; i < length; i++) { var srcMapping = generatedMappings[i]; var destMapping = new Mapping(); destMapping.generatedLine = srcMapping.generatedLine; destMapping.generatedColumn = srcMapping.generatedColumn; if (srcMapping.source) { destMapping.source = sources.indexOf(srcMapping.source); destMapping.originalLine = srcMapping.originalLine; destMapping.originalColumn = srcMapping.originalColumn; if (srcMapping.name) { destMapping.name = names.indexOf(srcMapping.name); } destOriginalMappings.push(destMapping); } destGeneratedMappings.push(destMapping); } quickSort(smc.__originalMappings, util.compareByOriginalPositions); return smc; }; /** * The version of the source mapping spec that we are consuming. */ BasicSourceMapConsumer.prototype._version = 3; /** * The list of original sources. */ Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { get: function () { return this._sources.toArray().map(function (s) { return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s; }, this); } }); /** * Provide the JIT with a nice shape / hidden class. */ function Mapping() { this.generatedLine = 0; this.generatedColumn = 0; this.source = null; this.originalLine = null; this.originalColumn = null; this.name = null; } /** * Parse the mappings in a string in to a data structure which we can easily * query (the ordered arrays in the `this.__generatedMappings` and * `this.__originalMappings` properties). */ BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { var generatedLine = 1; var previousGeneratedColumn = 0; var previousOriginalLine = 0; var previousOriginalColumn = 0; var previousSource = 0; var previousName = 0; var length = aStr.length; var index = 0; var cachedSegments = {}; var temp = {}; var originalMappings = []; var generatedMappings = []; var mapping, str, segment, end, value; while (index < length) { if (aStr.charAt(index) === ';') { generatedLine++; index++; previousGeneratedColumn = 0; } else if (aStr.charAt(index) === ',') { index++; } else { mapping = new Mapping(); mapping.generatedLine = generatedLine; // Because each offset is encoded relative to the previous one, // many segments often have the same encoding. We can exploit this // fact by caching the parsed variable length fields of each segment, // allowing us to avoid a second parse if we encounter the same // segment again. for (end = index; end < length; end++) { if (this._charIsMappingSeparator(aStr, end)) { break; } } str = aStr.slice(index, end); segment = cachedSegments[str]; if (segment) { index += str.length; } else { segment = []; while (index < end) { base64VLQ.decode(aStr, index, temp); value = temp.value; index = temp.rest; segment.push(value); } if (segment.length === 2) { throw new Error('Found a source, but no line and column'); } if (segment.length === 3) { throw new Error('Found a source and line, but no column'); } cachedSegments[str] = segment; } // Generated column. mapping.generatedColumn = previousGeneratedColumn + segment[0]; previousGeneratedColumn = mapping.generatedColumn; if (segment.length > 1) { // Original source. mapping.source = previousSource + segment[1]; previousSource += segment[1]; // Original line. mapping.originalLine = previousOriginalLine + segment[2]; previousOriginalLine = mapping.originalLine; // Lines are stored 0-based mapping.originalLine += 1; // Original column. mapping.originalColumn = previousOriginalColumn + segment[3]; previousOriginalColumn = mapping.originalColumn; if (segment.length > 4) { // Original name. mapping.name = previousName + segment[4]; previousName += segment[4]; } } generatedMappings.push(mapping); if (typeof mapping.originalLine === 'number') { originalMappings.push(mapping); } } } quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); this.__generatedMappings = generatedMappings; quickSort(originalMappings, util.compareByOriginalPositions); this.__originalMappings = originalMappings; }; /** * Find the mapping that best matches the hypothetical "needle" mapping that * we are searching for in the given "haystack" of mappings. */ BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) { // To return the position we are searching for, we must first find the // mapping for the given position and then return the opposite position it // points to. Because the mappings are sorted, we can use binary search to // find the best mapping. if (aNeedle[aLineName] <= 0) { throw new TypeError('Line must be greater than or equal to 1, got ' + aNeedle[aLineName]); } if (aNeedle[aColumnName] < 0) { throw new TypeError('Column must be greater than or equal to 0, got ' + aNeedle[aColumnName]); } return binarySearch.search(aNeedle, aMappings, aComparator, aBias); }; /** * Compute the last column for each generated mapping. The last column is * inclusive. */ BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() { for (var index = 0; index < this._generatedMappings.length; ++index) { var mapping = this._generatedMappings[index]; // Mappings do not contain a field for the last generated columnt. We // can come up with an optimistic estimate, however, by assuming that // mappings are contiguous (i.e. given two consecutive mappings, the // first mapping ends where the second one starts). if (index + 1 < this._generatedMappings.length) { var nextMapping = this._generatedMappings[index + 1]; if (mapping.generatedLine === nextMapping.generatedLine) { mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; continue; } } // The last mapping for each line spans the entire line. mapping.lastGeneratedColumn = Infinity; } }; /** * Returns the original source, line, and column information for the generated * source's line and column positions provided. The only argument is an object * with the following properties: * * - line: The line number in the generated source. * - column: The column number in the generated source. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the * closest element that is smaller than or greater than the one we are * searching for, respectively, if the exact element cannot be found. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. * * and an object is returned with the following properties: * * - source: The original source file, or null. * - line: The line number in the original source, or null. * - column: The column number in the original source, or null. * - name: The original identifier, or null. */ BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) { var needle = { generatedLine: util.getArg(aArgs, 'line'), generatedColumn: util.getArg(aArgs, 'column') }; var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)); if (index >= 0) { var mapping = this._generatedMappings[index]; if (mapping.generatedLine === needle.generatedLine) { var source = util.getArg(mapping, 'source', null); if (source !== null) { source = this._sources.at(source); if (this.sourceRoot != null) { source = util.join(this.sourceRoot, source); } } var name = util.getArg(mapping, 'name', null); if (name !== null) { name = this._names.at(name); } return { source: source, line: util.getArg(mapping, 'originalLine', null), column: util.getArg(mapping, 'originalColumn', null), name: name }; } } return { source: null, line: null, column: null, name: null }; }; /** * Return true if we have the source content for every source in the source * map, false otherwise. */ BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() { if (!this.sourcesContent) { return false; } return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function (sc) { return sc == null; }); }; /** * Returns the original source content. The only argument is the url of the * original source file. Returns null if no original source content is * available. */ BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { if (!this.sourcesContent) { return null; } if (this.sourceRoot != null) { aSource = util.relative(this.sourceRoot, aSource); } if (this._sources.has(aSource)) { return this.sourcesContent[this._sources.indexOf(aSource)]; } var url; if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) { // XXX: file:// URIs and absolute paths lead to unexpected behavior for // many users. We can help them out when they expect file:// URIs to // behave like it would if they were running a local HTTP server. See // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) { return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]; } if ((!url.path || url.path == "/") && this._sources.has("/" + aSource)) { return this.sourcesContent[this._sources.indexOf("/" + aSource)]; } } // This function is used recursively from // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we // don't want to throw if we can't find the source - we just want to // return null, so we provide a flag to exit gracefully. if (nullOnMissing) { return null; } else { throw new Error('"' + aSource + '" is not in the SourceMap.'); } }; /** * Returns the generated line and column information for the original source, * line, and column positions provided. The only argument is an object with * the following properties: * * - source: The filename of the original source. * - line: The line number in the original source. * - column: The column number in the original source. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the * closest element that is smaller than or greater than the one we are * searching for, respectively, if the exact element cannot be found. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. * * and an object is returned with the following properties: * * - line: The line number in the generated source, or null. * - column: The column number in the generated source, or null. */ BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) { var source = util.getArg(aArgs, 'source'); if (this.sourceRoot != null) { source = util.relative(this.sourceRoot, source); } if (!this._sources.has(source)) { return { line: null, column: null, lastColumn: null }; } source = this._sources.indexOf(source); var needle = { source: source, originalLine: util.getArg(aArgs, 'line'), originalColumn: util.getArg(aArgs, 'column') }; var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)); if (index >= 0) { var mapping = this._originalMappings[index]; if (mapping.source === needle.source) { return { line: util.getArg(mapping, 'generatedLine', null), column: util.getArg(mapping, 'generatedColumn', null), lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }; } } return { line: null, column: null, lastColumn: null }; }; exports.BasicSourceMapConsumer = BasicSourceMapConsumer; /** * An IndexedSourceMapConsumer instance represents a parsed source map which * we can query for information. It differs from BasicSourceMapConsumer in * that it takes "indexed" source maps (i.e. ones with a "sections" field) as * input. * * The only parameter is a raw source map (either as a JSON string, or already * parsed to an object). According to the spec for indexed source maps, they * have the following attributes: * * - version: Which version of the source map spec this map is following. * - file: Optional. The generated file this source map is associated with. * - sections: A list of section definitions. * * Each value under the "sections" field has two fields: * - offset: The offset into the original specified at which this section * begins to apply, defined as an object with a "line" and "column" * field. * - map: A source map definition. This source map could also be indexed, * but doesn't have to be. * * Instead of the "map" field, it's also possible to have a "url" field * specifying a URL to retrieve a source map from, but that's currently * unsupported. * * Here's an example source map, taken from the source map spec[0], but * modified to omit a section which uses the "url" field. * * { * version : 3, * file: "app.js", * sections: [{ * offset: {line:100, column:10}, * map: { * version : 3, * file: "section.js", * sources: ["foo.js", "bar.js"], * names: ["src", "maps", "are", "fun"], * mappings: "AAAA,E;;ABCDE;" * } * }], * } * * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt */ function IndexedSourceMapConsumer(aSourceMap) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); } var version = util.getArg(sourceMap, 'version'); var sections = util.getArg(sourceMap, 'sections'); if (version != this._version) { throw new Error('Unsupported version: ' + version); } this._sources = new ArraySet(); this._names = new ArraySet(); var lastOffset = { line: -1, column: 0 }; this._sections = sections.map(function (s) { if (s.url) { // The url field will require support for asynchronicity. // See https://github.com/mozilla/source-map/issues/16 throw new Error('Support for url field in sections not implemented.'); } var offset = util.getArg(s, 'offset'); var offsetLine = util.getArg(offset, 'line'); var offsetColumn = util.getArg(offset, 'column'); if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) { throw new Error('Section offsets must be ordered and non-overlapping.'); } lastOffset = offset; return { generatedOffset: { // The offset fields are 0-based, but we use 1-based indices when // encoding/decoding from VLQ. generatedLine: offsetLine + 1, generatedColumn: offsetColumn + 1 }, consumer: new SourceMapConsumer(util.getArg(s, 'map')) }; }); } IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; /** * The version of the source mapping spec that we are consuming. */ IndexedSourceMapConsumer.prototype._version = 3; /** * The list of original sources. */ Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { get: function () { var sources = []; for (var i = 0; i < this._sections.length; i++) { for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { sources.push(this._sections[i].consumer.sources[j]); } } return sources; } }); /** * Returns the original source, line, and column information for the generated * source's line and column positions provided. The only argument is an object * with the following properties: * * - line: The line number in the generated source. * - column: The column number in the generated source. * * and an object is returned with the following properties: * * - source: The original source file, or null. * - line: The line number in the original source, or null. * - column: The column number in the original source, or null. * - name: The original identifier, or null. */ IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) { var needle = { generatedLine: util.getArg(aArgs, 'line'), generatedColumn: util.getArg(aArgs, 'column') }; // Find the section containing the generated position we're trying to map // to an original position. var sectionIndex = binarySearch.search(needle, this._sections, function (needle, section) { var cmp = needle.generatedLine - section.generatedOffset.generatedLine; if (cmp) { return cmp; } return needle.generatedColumn - section.generatedOffset.generatedColumn; }); var section = this._sections[sectionIndex]; if (!section) { return { source: null, line: null, column: null, name: null }; } return section.consumer.originalPositionFor({ line: needle.generatedLine - (section.generatedOffset.generatedLine - 1), column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), bias: aArgs.bias }); }; /** * Return true if we have the source content for every source in the source * map, false otherwise. */ IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() { return this._sections.every(function (s) { return s.consumer.hasContentsOfAllSources(); }); }; /** * Returns the original source content. The only argument is the url of the * original source file. Returns null if no original source content is * available. */ IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; var content = section.consumer.sourceContentFor(aSource, true); if (content) { return content; } } if (nullOnMissing) { return null; } else { throw new Error('"' + aSource + '" is not in the SourceMap.'); } }; /** * Returns the generated line and column information for the original source, * line, and column positions provided. The only argument is an object with * the following properties: * * - source: The filename of the original source. * - line: The line number in the original source. * - column: The column number in the original source. * * and an object is returned with the following properties: * * - line: The line number in the generated source, or null. * - column: The column number in the generated source, or null. */ IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; // Only consider this section if the requested source is in the list of // sources of the consumer. if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) { continue; } var generatedPosition = section.consumer.generatedPositionFor(aArgs); if (generatedPosition) { var ret = { line: generatedPosition.line + (section.generatedOffset.generatedLine - 1), column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0) }; return ret; } } return { line: null, column: null }; }; /** * Parse the mappings in a string in to a data structure which we can easily * query (the ordered arrays in the `this.__generatedMappings` and * `this.__originalMappings` properties). */ IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { this.__generatedMappings = []; this.__originalMappings = []; for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; var sectionMappings = section.consumer._generatedMappings; for (var j = 0; j < sectionMappings.length; j++) { var mapping = sectionMappings[j]; var source = section.consumer._sources.at(mapping.source); if (section.consumer.sourceRoot !== null) { source = util.join(section.consumer.sourceRoot, source); } this._sources.add(source); source = this._sources.indexOf(source); var name = section.consumer._names.at(mapping.name); this._names.add(name); name = this._names.indexOf(name); // The mappings coming from the consumer for the section have // generated positions relative to the start of the section, so we // need to offset them to be relative to the start of the concatenated // generated file. var adjustedMapping = { source: source, generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1), generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, name: name }; this.__generatedMappings.push(adjustedMapping); if (typeof adjustedMapping.originalLine === 'number') { this.__originalMappings.push(adjustedMapping); } } } quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); quickSort(this.__originalMappings, util.compareByOriginalPositions); }; exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; }); $__System.registerDynamic('2a', [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); /** * Encode an integer in the range of 0 to 63 to a single base 64 digit. */ exports.encode = function (number) { if (0 <= number && number < intToCharMap.length) { return intToCharMap[number]; } throw new TypeError("Must be between 0 and 63: " + number); }; /** * Decode a single base 64 character code digit to an integer. Returns -1 on * failure. */ exports.decode = function (charCode) { var bigA = 65; // 'A' var bigZ = 90; // 'Z' var littleA = 97; // 'a' var littleZ = 122; // 'z' var zero = 48; // '0' var nine = 57; // '9' var plus = 43; // '+' var slash = 47; // '/' var littleOffset = 26; var numberOffset = 52; // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ if (bigA <= charCode && charCode <= bigZ) { return charCode - bigA; } // 26 - 51: abcdefghijklmnopqrstuvwxyz if (littleA <= charCode && charCode <= littleZ) { return charCode - littleA + littleOffset; } // 52 - 61: 0123456789 if (zero <= charCode && charCode <= nine) { return charCode - zero + numberOffset; } // 62: + if (charCode == plus) { return 62; } // 63: / if (charCode == slash) { return 63; } // Invalid base64 digit. return -1; }; }); $__System.registerDynamic("29", ["2a"], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause * * Based on the Base 64 VLQ implementation in Closure Compiler: * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java * * Copyright 2011 The Closure Compiler Authors. All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ var base64 = $__require("2a"); // A single base 64 digit can contain 6 bits of data. For the base 64 variable // length quantities we use in the source map spec, the first bit is the sign, // the next four bits are the actual value, and the 6th bit is the // continuation bit. The continuation bit tells us whether there are more // digits in this value following this digit. // // Continuation // | Sign // | | // V V // 101011 var VLQ_BASE_SHIFT = 5; // binary: 100000 var VLQ_BASE = 1 << VLQ_BASE_SHIFT; // binary: 011111 var VLQ_BASE_MASK = VLQ_BASE - 1; // binary: 100000 var VLQ_CONTINUATION_BIT = VLQ_BASE; /** * Converts from a two-complement value to a value where the sign bit is * placed in the least significant bit. For example, as decimals: * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) */ function toVLQSigned(aValue) { return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0; } /** * Converts to a two-complement value from a value where the sign bit is * placed in the least significant bit. For example, as decimals: * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 */ function fromVLQSigned(aValue) { var isNegative = (aValue & 1) === 1; var shifted = aValue >> 1; return isNegative ? -shifted : shifted; } /** * Returns the base 64 VLQ encoded value. */ exports.encode = function base64VLQ_encode(aValue) { var encoded = ""; var digit; var vlq = toVLQSigned(aValue); do { digit = vlq & VLQ_BASE_MASK; vlq >>>= VLQ_BASE_SHIFT; if (vlq > 0) { // There are still more digits in this value, so we must make sure the // continuation bit is marked. digit |= VLQ_CONTINUATION_BIT; } encoded += base64.encode(digit); } while (vlq > 0); return encoded; }; /** * Decodes the next base 64 VLQ value from the given string and returns the * value and the rest of the string via the out parameter. */ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { var strLen = aStr.length; var result = 0; var shift = 0; var continuation, digit; do { if (aIndex >= strLen) { throw new Error("Expected more digits in base 64 VLQ value."); } digit = base64.decode(aStr.charCodeAt(aIndex++)); if (digit === -1) { throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); } continuation = !!(digit & VLQ_CONTINUATION_BIT); digit &= VLQ_BASE_MASK; result = result + (digit << shift); shift += VLQ_BASE_SHIFT; } while (continuation); aOutParam.value = fromVLQSigned(result); aOutParam.rest = aIndex; }; }); $__System.registerDynamic('28', ['27'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var util = $__require('27'); var has = Object.prototype.hasOwnProperty; /** * A data structure which is a combination of an array and a set. Adding a new * member is O(1), testing for membership is O(1), and finding the index of an * element is O(1). Removing elements from the set is not supported. Only * strings are supported for membership. */ function ArraySet() { this._array = []; this._set = Object.create(null); } /** * Static method for creating ArraySet instances from an existing array. */ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { var set = new ArraySet(); for (var i = 0, len = aArray.length; i < len; i++) { set.add(aArray[i], aAllowDuplicates); } return set; }; /** * Return how many unique items are in this ArraySet. If duplicates have been * added, than those do not count towards the size. * * @returns Number */ ArraySet.prototype.size = function ArraySet_size() { return Object.getOwnPropertyNames(this._set).length; }; /** * Add the given string to this set. * * @param String aStr */ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { var sStr = util.toSetString(aStr); var isDuplicate = has.call(this._set, sStr); var idx = this._array.length; if (!isDuplicate || aAllowDuplicates) { this._array.push(aStr); } if (!isDuplicate) { this._set[sStr] = idx; } }; /** * Is the given string a member of this set? * * @param String aStr */ ArraySet.prototype.has = function ArraySet_has(aStr) { var sStr = util.toSetString(aStr); return has.call(this._set, sStr); }; /** * What is the index of the given string in the array? * * @param String aStr */ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { var sStr = util.toSetString(aStr); if (has.call(this._set, sStr)) { return this._set[sStr]; } throw new Error('"' + aStr + '" is not in the set.'); }; /** * What is the element at the given index? * * @param Number aIdx */ ArraySet.prototype.at = function ArraySet_at(aIdx) { if (aIdx >= 0 && aIdx < this._array.length) { return this._array[aIdx]; } throw new Error('No element indexed by ' + aIdx); }; /** * Returns the array representation of this set (which has the proper indices * indicated by indexOf). Note that this is a copy of the internal array used * for storing the members so that no one can mess with internal state. */ ArraySet.prototype.toArray = function ArraySet_toArray() { return this._array.slice(); }; exports.ArraySet = ArraySet; }); $__System.registerDynamic('2b', ['27'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2014 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var util = $__require('27'); /** * Determine whether mappingB is after mappingA with respect to generated * position. */ function generatedPositionAfter(mappingA, mappingB) { // Optimized for most common case var lineA = mappingA.generatedLine; var lineB = mappingB.generatedLine; var columnA = mappingA.generatedColumn; var columnB = mappingB.generatedColumn; return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; } /** * A data structure to provide a sorted view of accumulated mappings in a * performance conscious manner. It trades a neglibable overhead in general * case for a large speedup in case of mappings being added in order. */ function MappingList() { this._array = []; this._sorted = true; // Serves as infimum this._last = { generatedLine: -1, generatedColumn: 0 }; } /** * Iterate through internal items. This method takes the same arguments that * `Array.prototype.forEach` takes. * * NOTE: The order of the mappings is NOT guaranteed. */ MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) { this._array.forEach(aCallback, aThisArg); }; /** * Add the given source mapping. * * @param Object aMapping */ MappingList.prototype.add = function MappingList_add(aMapping) { if (generatedPositionAfter(this._last, aMapping)) { this._last = aMapping; this._array.push(aMapping); } else { this._sorted = false; this._array.push(aMapping); } }; /** * Returns the flat, sorted array of mappings. The mappings are sorted by * generated position. * * WARNING: This method returns internal data without copying, for * performance. The return value must NOT be mutated, and should be treated as * an immutable borrow. If you want to take ownership, you must make your own * copy. */ MappingList.prototype.toArray = function MappingList_toArray() { if (!this._sorted) { this._array.sort(util.compareByGeneratedPositionsInflated); this._sorted = true; } return this._array; }; exports.MappingList = MappingList; }); $__System.registerDynamic('2c', ['29', '27', '28', '2b'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var base64VLQ = $__require('29'); var util = $__require('27'); var ArraySet = $__require('28').ArraySet; var MappingList = $__require('2b').MappingList; /** * An instance of the SourceMapGenerator represents a source map which is * being built incrementally. You may pass an object with the following * properties: * * - file: The filename of the generated source. * - sourceRoot: A root for all relative URLs in this source map. */ function SourceMapGenerator(aArgs) { if (!aArgs) { aArgs = {}; } this._file = util.getArg(aArgs, 'file', null); this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); this._skipValidation = util.getArg(aArgs, 'skipValidation', false); this._sources = new ArraySet(); this._names = new ArraySet(); this._mappings = new MappingList(); this._sourcesContents = null; } SourceMapGenerator.prototype._version = 3; /** * Creates a new SourceMapGenerator based on a SourceMapConsumer * * @param aSourceMapConsumer The SourceMap. */ SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { var sourceRoot = aSourceMapConsumer.sourceRoot; var generator = new SourceMapGenerator({ file: aSourceMapConsumer.file, sourceRoot: sourceRoot }); aSourceMapConsumer.eachMapping(function (mapping) { var newMapping = { generated: { line: mapping.generatedLine, column: mapping.generatedColumn } }; if (mapping.source != null) { newMapping.source = mapping.source; if (sourceRoot != null) { newMapping.source = util.relative(sourceRoot, newMapping.source); } newMapping.original = { line: mapping.originalLine, column: mapping.originalColumn }; if (mapping.name != null) { newMapping.name = mapping.name; } } generator.addMapping(newMapping); }); aSourceMapConsumer.sources.forEach(function (sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { generator.setSourceContent(sourceFile, content); } }); return generator; }; /** * Add a single mapping from original source line and column to the generated * source's line and column for this source map being created. The mapping * object should have the following properties: * * - generated: An object with the generated line and column positions. * - original: An object with the original line and column positions. * - source: The original source file (relative to the sourceRoot). * - name: An optional original token name for this mapping. */ SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) { var generated = util.getArg(aArgs, 'generated'); var original = util.getArg(aArgs, 'original', null); var source = util.getArg(aArgs, 'source', null); var name = util.getArg(aArgs, 'name', null); if (!this._skipValidation) { this._validateMapping(generated, original, source, name); } if (source != null) { source = String(source); if (!this._sources.has(source)) { this._sources.add(source); } } if (name != null) { name = String(name); if (!this._names.has(name)) { this._names.add(name); } } this._mappings.add({ generatedLine: generated.line, generatedColumn: generated.column, originalLine: original != null && original.line, originalColumn: original != null && original.column, source: source, name: name }); }; /** * Set the source content for a source file. */ SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { var source = aSourceFile; if (this._sourceRoot != null) { source = util.relative(this._sourceRoot, source); } if (aSourceContent != null) { // Add the source content to the _sourcesContents map. // Create a new _sourcesContents map if the property is null. if (!this._sourcesContents) { this._sourcesContents = Object.create(null); } this._sourcesContents[util.toSetString(source)] = aSourceContent; } else if (this._sourcesContents) { // Remove the source file from the _sourcesContents map. // If the _sourcesContents map is empty, set the property to null. delete this._sourcesContents[util.toSetString(source)]; if (Object.keys(this._sourcesContents).length === 0) { this._sourcesContents = null; } } }; /** * Applies the mappings of a sub-source-map for a specific source file to the * source map being generated. Each mapping to the supplied source file is * rewritten using the supplied source map. Note: The resolution for the * resulting mappings is the minimium of this map and the supplied map. * * @param aSourceMapConsumer The source map to be applied. * @param aSourceFile Optional. The filename of the source file. * If omitted, SourceMapConsumer's file property will be used. * @param aSourceMapPath Optional. The dirname of the path to the source map * to be applied. If relative, it is relative to the SourceMapConsumer. * This parameter is needed when the two source maps aren't in the same * directory, and the source map to be applied contains relative source * paths. If so, those relative source paths need to be rewritten * relative to the SourceMapGenerator. */ SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { var sourceFile = aSourceFile; // If aSourceFile is omitted, we will use the file property of the SourceMap if (aSourceFile == null) { if (aSourceMapConsumer.file == null) { throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + 'or the source map\'s "file" property. Both were omitted.'); } sourceFile = aSourceMapConsumer.file; } var sourceRoot = this._sourceRoot; // Make "sourceFile" relative if an absolute Url is passed. if (sourceRoot != null) { sourceFile = util.relative(sourceRoot, sourceFile); } // Applying the SourceMap can add and remove items from the sources and // the names array. var newSources = new ArraySet(); var newNames = new ArraySet(); // Find mappings for the "sourceFile" this._mappings.unsortedForEach(function (mapping) { if (mapping.source === sourceFile && mapping.originalLine != null) { // Check if it can be mapped by the source map, then update the mapping. var original = aSourceMapConsumer.originalPositionFor({ line: mapping.originalLine, column: mapping.originalColumn }); if (original.source != null) { // Copy mapping mapping.source = original.source; if (aSourceMapPath != null) { mapping.source = util.join(aSourceMapPath, mapping.source); } if (sourceRoot != null) { mapping.source = util.relative(sourceRoot, mapping.source); } mapping.originalLine = original.line; mapping.originalColumn = original.column; if (original.name != null) { mapping.name = original.name; } } } var source = mapping.source; if (source != null && !newSources.has(source)) { newSources.add(source); } var name = mapping.name; if (name != null && !newNames.has(name)) { newNames.add(name); } }, this); this._sources = newSources; this._names = newNames; // Copy sourcesContents of applied map. aSourceMapConsumer.sources.forEach(function (sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { if (aSourceMapPath != null) { sourceFile = util.join(aSourceMapPath, sourceFile); } if (sourceRoot != null) { sourceFile = util.relative(sourceRoot, sourceFile); } this.setSourceContent(sourceFile, content); } }, this); }; /** * A mapping can have one of the three levels of data: * * 1. Just the generated position. * 2. The Generated position, original position, and original source. * 3. Generated and original position, original source, as well as a name * token. * * To maintain consistency, we validate that any new mapping being added falls * in to one of these categories. */ SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) { if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) { // Case 1. return; } else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) { // Cases 2 and 3. return; } else { throw new Error('Invalid mapping: ' + JSON.stringify({ generated: aGenerated, source: aSource, original: aOriginal, name: aName })); } }; /** * Serialize the accumulated mappings in to the stream of base 64 VLQs * specified by the source map format. */ SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() { var previousGeneratedColumn = 0; var previousGeneratedLine = 1; var previousOriginalColumn = 0; var previousOriginalLine = 0; var previousName = 0; var previousSource = 0; var result = ''; var next; var mapping; var nameIdx; var sourceIdx; var mappings = this._mappings.toArray(); for (var i = 0, len = mappings.length; i < len; i++) { mapping = mappings[i]; next = ''; if (mapping.generatedLine !== previousGeneratedLine) { previousGeneratedColumn = 0; while (mapping.generatedLine !== previousGeneratedLine) { next += ';'; previousGeneratedLine++; } } else { if (i > 0) { if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { continue; } next += ','; } } next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn); previousGeneratedColumn = mapping.generatedColumn; if (mapping.source != null) { sourceIdx = this._sources.indexOf(mapping.source); next += base64VLQ.encode(sourceIdx - previousSource); previousSource = sourceIdx; // lines are stored 0-based in SourceMap spec version 3 next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine); previousOriginalLine = mapping.originalLine - 1; next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn); previousOriginalColumn = mapping.originalColumn; if (mapping.name != null) { nameIdx = this._names.indexOf(mapping.name); next += base64VLQ.encode(nameIdx - previousName); previousName = nameIdx; } } result += next; } return result; }; SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { return aSources.map(function (source) { if (!this._sourcesContents) { return null; } if (aSourceRoot != null) { source = util.relative(aSourceRoot, source); } var key = util.toSetString(source); return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null; }, this); }; /** * Externalize the source map. */ SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() { var map = { version: this._version, sources: this._sources.toArray(), names: this._names.toArray(), mappings: this._serializeMappings() }; if (this._file != null) { map.file = this._file; } if (this._sourceRoot != null) { map.sourceRoot = this._sourceRoot; } if (this._sourcesContents) { map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); } return map; }; /** * Render the source map being generated to a string. */ SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() { return JSON.stringify(this.toJSON()); }; exports.SourceMapGenerator = SourceMapGenerator; }); $__System.registerDynamic('27', [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ /** * This is a helper function for getting values from parameter/options * objects. * * @param args The object we are extracting values from * @param name The name of the property we are getting. * @param defaultValue An optional value to return if the property is missing * from the object. If this is not specified and the property is missing, an * error will be thrown. */ 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; /** * Normalizes a path, or the path portion of a URL: * * - Replaces consecutive slashes with one slash. * - Removes unnecessary '.' parts. * - Removes unnecessary '/..' parts. * * Based on code in the Node.js 'path' core module. * * @param aPath The path or url to normalize. */ 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 === '') { // The first part is blank if the path is absolute. Trying to go // above the root is a no-op. Therefore we can remove all '..' parts // directly after the root. 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; /** * Joins two paths/URLs. * * @param aRoot The root path or URL. * @param aPath The path or URL to be joined with the root. * * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a * scheme-relative URL: Then the scheme of aRoot, if any, is prepended * first. * - Otherwise aPath is a path. If aRoot is a URL, then its path portion * is updated with the result and aRoot is returned. Otherwise the result * is returned. * - If aPath is absolute, the result is aPath. * - Otherwise the two paths are joined with a slash. * - Joining for example 'http://' and 'www.example.com' is also supported. */ function join(aRoot, aPath) { if (aRoot === "") { aRoot = "."; } if (aPath === "") { aPath = "."; } var aPathUrl = urlParse(aPath); var aRootUrl = urlParse(aRoot); if (aRootUrl) { aRoot = aRootUrl.path || '/'; } // `join(foo, '//www.example.org')` if (aPathUrl && !aPathUrl.scheme) { if (aRootUrl) { aPathUrl.scheme = aRootUrl.scheme; } return urlGenerate(aPathUrl); } if (aPathUrl || aPath.match(dataUrlRegexp)) { return aPath; } // `join('http://', 'www.example.com')` 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); }; /** * Make a path relative to a URL or another path. * * @param aRoot The root path or URL. * @param aPath The path or URL to be made relative to aRoot. */ function relative(aRoot, aPath) { if (aRoot === "") { aRoot = "."; } aRoot = aRoot.replace(/\/$/, ''); // It is possible for the path to be above the root. In this case, simply // checking whether the root is a prefix of the path won't work. Instead, we // need to remove components from the root one by one, until either we find // a prefix that fits, or we run out of components to remove. var level = 0; while (aPath.indexOf(aRoot + '/') !== 0) { var index = aRoot.lastIndexOf("/"); if (index < 0) { return aPath; } // If the only part of the root that is left is the scheme (i.e. http://, // file:///, etc.), one or more slashes (/), or simply nothing at all, we // have exhausted all components, so the path is not relative to the root. aRoot = aRoot.slice(0, index); if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { return aPath; } ++level; } // Make sure we add a "../" for each component we removed from the root. 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; } /** * Because behavior goes wacky when you set `__proto__` on objects, we * have to prefix all the strings in our set with an arbitrary character. * * See https://github.com/mozilla/source-map/pull/31 and * https://github.com/mozilla/source-map/issues/30 * * @param String aStr */ 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 /* "__proto__".length */) { return false; } if (s.charCodeAt(length - 1) !== 95 /* '_' */ || s.charCodeAt(length - 2) !== 95 /* '_' */ || s.charCodeAt(length - 3) !== 111 /* 'o' */ || s.charCodeAt(length - 4) !== 116 /* 't' */ || s.charCodeAt(length - 5) !== 111 /* 'o' */ || s.charCodeAt(length - 6) !== 114 /* 'r' */ || s.charCodeAt(length - 7) !== 112 /* 'p' */ || 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; } /** * Comparator between two mappings where the original positions are compared. * * Optionally pass in `true` as `onlyCompareGenerated` to consider two * mappings with the same original source/line/column, but different generated * line and column the same. Useful when searching for a mapping with a * stubbed out mapping. */ 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; /** * Comparator between two mappings with deflated source and name indices where * the generated positions are compared. * * Optionally pass in `true` as `onlyCompareGenerated` to consider two * mappings with the same generated line and column, but different * source/name/original line and column the same. Useful when searching for a * mapping with a stubbed out mapping. */ 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; } /** * Comparator between two mappings with inflated source and name strings where * the generated positions are compared. */ 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; }); $__System.registerDynamic('2d', ['2c', '27'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var SourceMapGenerator = $__require('2c').SourceMapGenerator; var util = $__require('27'); // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other // operating systems these days (capturing the result). var REGEX_NEWLINE = /(\r?\n)/; // Newline character code for charCodeAt() comparisons var NEWLINE_CODE = 10; // Private symbol for identifying `SourceNode`s when multiple versions of // the source-map library are loaded. This MUST NOT CHANGE across // versions! var isSourceNode = "$$$isSourceNode$$$"; /** * SourceNodes provide a way to abstract over interpolating/concatenating * snippets of generated JavaScript source code while maintaining the line and * column information associated with the original source code. * * @param aLine The original line number. * @param aColumn The original column number. * @param aSource The original source's filename. * @param aChunks Optional. An array of strings which are snippets of * generated JS, or other SourceNodes. * @param aName The original identifier. */ function SourceNode(aLine, aColumn, aSource, aChunks, aName) { this.children = []; this.sourceContents = {}; this.line = aLine == null ? null : aLine; this.column = aColumn == null ? null : aColumn; this.source = aSource == null ? null : aSource; this.name = aName == null ? null : aName; this[isSourceNode] = true; if (aChunks != null) this.add(aChunks); } /** * Creates a SourceNode from generated code and a SourceMapConsumer. * * @param aGeneratedCode The generated code * @param aSourceMapConsumer The SourceMap for the generated code * @param aRelativePath Optional. The path that relative sources in the * SourceMapConsumer should be relative to. */ SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { // The SourceNode we want to fill with the generated code // and the SourceMap var node = new SourceNode(); // All even indices of this array are one line of the generated code, // while all odd indices are the newlines between two adjacent lines // (since `REGEX_NEWLINE` captures its match). // Processed fragments are removed from this array, by calling `shiftNextLine`. var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); var shiftNextLine = function () { var lineContents = remainingLines.shift(); // The last line of a file might not have a newline. var newLine = remainingLines.shift() || ""; return lineContents + newLine; }; // We need to remember the position of "remainingLines" var lastGeneratedLine = 1, lastGeneratedColumn = 0; // The generate SourceNodes we need a code range. // To extract it current and last mapping is used. // Here we store the last mapping. var lastMapping = null; aSourceMapConsumer.eachMapping(function (mapping) { if (lastMapping !== null) { // We add the code from "lastMapping" to "mapping": // First check if there is a new line in between. if (lastGeneratedLine < mapping.generatedLine) { // Associate first line with "lastMapping" addMappingWithCode(lastMapping, shiftNextLine()); lastGeneratedLine++; lastGeneratedColumn = 0; // The remaining code is added without mapping } else { // There is no new line in between. // Associate the code between "lastGeneratedColumn" and // "mapping.generatedColumn" with "lastMapping" var nextLine = remainingLines[0]; var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn); remainingLines[0] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn); lastGeneratedColumn = mapping.generatedColumn; addMappingWithCode(lastMapping, code); // No more remaining code, continue lastMapping = mapping; return; } } // We add the generated code until the first mapping // to the SourceNode without any mapping. // Each line is added as separate string. while (lastGeneratedLine < mapping.generatedLine) { node.add(shiftNextLine()); lastGeneratedLine++; } if (lastGeneratedColumn < mapping.generatedColumn) { var nextLine = remainingLines[0]; node.add(nextLine.substr(0, mapping.generatedColumn)); remainingLines[0] = nextLine.substr(mapping.generatedColumn); lastGeneratedColumn = mapping.generatedColumn; } lastMapping = mapping; }, this); // We have processed all mappings. if (remainingLines.length > 0) { if (lastMapping) { // Associate the remaining code in the current line with "lastMapping" addMappingWithCode(lastMapping, shiftNextLine()); } // and add the remaining lines without any mapping node.add(remainingLines.join("")); } // Copy sourcesContent into SourceNode aSourceMapConsumer.sources.forEach(function (sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { if (aRelativePath != null) { sourceFile = util.join(aRelativePath, sourceFile); } node.setSourceContent(sourceFile, content); } }); return node; function addMappingWithCode(mapping, code) { if (mapping === null || mapping.source === undefined) { node.add(code); } else { var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source; node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name)); } } }; /** * Add a chunk of generated JS to this source node. * * @param aChunk A string snippet of generated JS code, another instance of * SourceNode, or an array where each member is one of those things. */ SourceNode.prototype.add = function SourceNode_add(aChunk) { if (Array.isArray(aChunk)) { aChunk.forEach(function (chunk) { this.add(chunk); }, this); } else if (aChunk[isSourceNode] || typeof aChunk === "string") { if (aChunk) { this.children.push(aChunk); } } else { throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk); } return this; }; /** * Add a chunk of generated JS to the beginning of this source node. * * @param aChunk A string snippet of generated JS code, another instance of * SourceNode, or an array where each member is one of those things. */ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { if (Array.isArray(aChunk)) { for (var i = aChunk.length - 1; i >= 0; i--) { this.prepend(aChunk[i]); } } else if (aChunk[isSourceNode] || typeof aChunk === "string") { this.children.unshift(aChunk); } else { throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk); } return this; }; /** * Walk over the tree of JS snippets in this node and its children. The * walking function is called once for each snippet of JS and is passed that * snippet and the its original associated source's line/column location. * * @param aFn The traversal function. */ SourceNode.prototype.walk = function SourceNode_walk(aFn) { var chunk; for (var i = 0, len = this.children.length; i < len; i++) { chunk = this.children[i]; if (chunk[isSourceNode]) { chunk.walk(aFn); } else { if (chunk !== '') { aFn(chunk, { source: this.source, line: this.line, column: this.column, name: this.name }); } } } }; /** * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between * each of `this.children`. * * @param aSep The separator. */ SourceNode.prototype.join = function SourceNode_join(aSep) { var newChildren; var i; var len = this.children.length; if (len > 0) { newChildren = []; for (i = 0; i < len - 1; i++) { newChildren.push(this.children[i]); newChildren.push(aSep); } newChildren.push(this.children[i]); this.children = newChildren; } return this; }; /** * Call String.prototype.replace on the very right-most source snippet. Useful * for trimming whitespace from the end of a source node, etc. * * @param aPattern The pattern to replace. * @param aReplacement The thing to replace the pattern with. */ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { var lastChild = this.children[this.children.length - 1]; if (lastChild[isSourceNode]) { lastChild.replaceRight(aPattern, aReplacement); } else if (typeof lastChild === 'string') { this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); } else { this.children.push(''.replace(aPattern, aReplacement)); } return this; }; /** * Set the source content for a source file. This will be added to the SourceMapGenerator * in the sourcesContent field. * * @param aSourceFile The filename of the source file * @param aSourceContent The content of the source file */ SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) { this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; }; /** * Walk over the tree of SourceNodes. The walking function is called for each * source file content and is passed the filename and source content. * * @param aFn The traversal function. */ SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { for (var i = 0, len = this.children.length; i < len; i++) { if (this.children[i][isSourceNode]) { this.children[i].walkSourceContents(aFn); } } var sources = Object.keys(this.sourceContents); for (var i = 0, len = sources.length; i < len; i++) { aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); } }; /** * Return the string representation of this source node. Walks over the tree * and concatenates all the various snippets together to one string. */ SourceNode.prototype.toString = function SourceNode_toString() { var str = ""; this.walk(function (chunk) { str += chunk; }); return str; }; /** * Returns the string representation of this source node along with a source * map. */ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { var generated = { code: "", line: 1, column: 0 }; var map = new SourceMapGenerator(aArgs); var sourceMappingActive = false; var lastOriginalSource = null; var lastOriginalLine = null; var lastOriginalColumn = null; var lastOriginalName = null; this.walk(function (chunk, original) { generated.code += chunk; if (original.source !== null && original.line !== null && original.column !== null) { if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) { map.addMapping({ source: original.source, original: { line: original.line, column: original.column }, generated: { line: generated.line, column: generated.column }, name: original.name }); } lastOriginalSource = original.source; lastOriginalLine = original.line; lastOriginalColumn = original.column; lastOriginalName = original.name; sourceMappingActive = true; } else if (sourceMappingActive) { map.addMapping({ generated: { line: generated.line, column: generated.column } }); lastOriginalSource = null; sourceMappingActive = false; } for (var idx = 0, length = chunk.length; idx < length; idx++) { if (chunk.charCodeAt(idx) === NEWLINE_CODE) { generated.line++; generated.column = 0; // Mappings end at eol if (idx + 1 === length) { lastOriginalSource = null; sourceMappingActive = false; } else if (sourceMappingActive) { map.addMapping({ source: original.source, original: { line: original.line, column: original.column }, generated: { line: generated.line, column: generated.column }, name: original.name }); } } else { generated.column++; } } }); this.walkSourceContents(function (sourceFile, sourceContent) { map.setSourceContent(sourceFile, sourceContent); }); return { code: generated.code, map: map }; }; exports.SourceNode = SourceNode; }); $__System.registerDynamic('2e', ['2c', '26', '2d'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /* * Copyright 2009-2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE.txt or: * http://opensource.org/licenses/BSD-3-Clause */ exports.SourceMapGenerator = $__require('2c').SourceMapGenerator; exports.SourceMapConsumer = $__require('26').SourceMapConsumer; exports.SourceNode = $__require('2d').SourceNode; }); $__System.registerDynamic("2f", ["15", "30", "1d", "2e"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _keys = $__require("15"); var _keys2 = _interopRequireDefault(_keys); var _typeof2 = $__require("30"); var _typeof3 = _interopRequireDefault(_typeof2); var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _sourceMap = $__require("2e"); var _sourceMap2 = _interopRequireDefault(_sourceMap); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var SourceMap = function () { function SourceMap(opts, code) { (0, _classCallCheck3.default)(this, SourceMap); this._cachedMap = null; this._code = code; this._opts = opts; this._rawMappings = []; } SourceMap.prototype.get = function get() { if (!this._cachedMap) { var map = this._cachedMap = new _sourceMap2.default.SourceMapGenerator({ file: this._opts.sourceMapTarget, sourceRoot: this._opts.sourceRoot }); var code = this._code; if (typeof code === "string") { map.setSourceContent(this._opts.sourceFileName, code); } else if ((typeof code === "undefined" ? "undefined" : (0, _typeof3.default)(code)) === "object") { (0, _keys2.default)(code).forEach(function (sourceFileName) { map.setSourceContent(sourceFileName, code[sourceFileName]); }); } this._rawMappings.forEach(map.addMapping, map); } return this._cachedMap.toJSON(); }; SourceMap.prototype.getRawMappings = function getRawMappings() { return this._rawMappings.slice(); }; SourceMap.prototype.mark = function mark(generatedLine, generatedColumn, line, column, identifierName, filename) { if (this._lastGenLine !== generatedLine && line === null) return; if (this._lastGenLine === generatedLine && this._lastSourceLine === line && this._lastSourceColumn === column) { return; } this._cachedMap = null; this._lastGenLine = generatedLine; this._lastSourceLine = line; this._lastSourceColumn = column; this._rawMappings.push({ name: identifierName || undefined, generated: { line: generatedLine, column: generatedColumn }, source: line == null ? undefined : filename || this._opts.sourceFileName, original: line == null ? undefined : { line: line, column: column } }); }; return SourceMap; }(); exports.default = SourceMap; module.exports = exports["default"]; }); $__System.registerDynamic('31', ['32', '33', 'c'], true, function ($__require, exports, module) { 'use strict'; var process = $__require('c'); var global = this || self, GLOBAL = global; var weak = $__require('32'); // 23.4 WeakSet Objects $__require('33')('WeakSet', function (get) { return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.4.3.1 WeakSet.prototype.add(value) add: function add(value) { return weak.def(this, value, true); } }, weak, false, true); }); $__System.registerDynamic('34', ['35', '36', '31', '37', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; $__require('35'); $__require('36'); $__require('31'); module.exports = $__require('37').WeakSet; }); $__System.registerDynamic("38", ["34"], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; module.exports = { "default": $__require("34"), __esModule: true }; }); $__System.registerDynamic('39', ['3a', '3b', '3c'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseFindIndex = $__require('3a'), baseIteratee = $__require('3b'), toInteger = $__require('3c'); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * This method is like `_.find` except that it returns the index of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.findIndex(users, function(o) { return o.user == 'barney'; }); * // => 0 * * // The `_.matches` iteratee shorthand. * _.findIndex(users, { 'user': 'fred', 'active': false }); * // => 1 * * // The `_.matchesProperty` iteratee shorthand. * _.findIndex(users, ['active', false]); * // => 0 * * // The `_.property` iteratee shorthand. * _.findIndex(users, 'active'); * // => 2 */ function findIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseFindIndex(array, baseIteratee(predicate, 3), index); } module.exports = findIndex; }); $__System.registerDynamic('3d', ['3e', '39'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var createFind = $__require('3e'), findIndex = $__require('39'); /** * Iterates over elements of `collection`, returning the first element * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false }, * { 'user': 'pebbles', 'age': 1, 'active': true } * ]; * * _.find(users, function(o) { return o.age < 40; }); * // => object for 'barney' * * // The `_.matches` iteratee shorthand. * _.find(users, { 'age': 1, 'active': true }); * // => object for 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.find(users, ['active', false]); * // => object for 'fred' * * // The `_.property` iteratee shorthand. * _.find(users, 'active'); * // => object for 'barney' */ var find = createFind(findIndex); module.exports = find; }); $__System.registerDynamic('3e', ['3b', '3f', '40'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseIteratee = $__require('3b'), isArrayLike = $__require('3f'), keys = $__require('40'); /** * Creates a `_.find` or `_.findLast` function. * * @private * @param {Function} findIndexFunc The function to find the collection index. * @returns {Function} Returns the new find function. */ function createFind(findIndexFunc) { return function (collection, predicate, fromIndex) { var iterable = Object(collection); if (!isArrayLike(collection)) { var iteratee = baseIteratee(predicate, 3); collection = keys(collection); predicate = function (key) { return iteratee(iterable[key], key, iterable); }; } var index = findIndexFunc(collection, predicate, fromIndex); return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } module.exports = createFind; }); $__System.registerDynamic('41', ['3a', '3b', '3c'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseFindIndex = $__require('3a'), baseIteratee = $__require('3b'), toInteger = $__require('3c'); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max, nativeMin = Math.min; /** * This method is like `_.findIndex` except that it iterates over elements * of `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); * // => 2 * * // The `_.matches` iteratee shorthand. * _.findLastIndex(users, { 'user': 'barney', 'active': true }); * // => 0 * * // The `_.matchesProperty` iteratee shorthand. * _.findLastIndex(users, ['active', false]); * // => 2 * * // The `_.property` iteratee shorthand. * _.findLastIndex(users, 'active'); * // => 0 */ function findLastIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length - 1; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return baseFindIndex(array, baseIteratee(predicate, 3), index, true); } module.exports = findLastIndex; }); $__System.registerDynamic('42', ['3e', '41'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var createFind = $__require('3e'), findLastIndex = $__require('41'); /** * This method is like `_.find` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=collection.length-1] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * _.findLast([1, 2, 3, 4], function(n) { * return n % 2 == 1; * }); * // => 3 */ var findLast = createFind(findLastIndex); module.exports = findLast; }); $__System.registerDynamic('43', ['3c'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var toInteger = $__require('3c'); /** * Checks if `value` is an integer. * * **Note:** This method is based on * [`Number.isInteger`](https://mdn.io/Number/isInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an integer, else `false`. * @example * * _.isInteger(3); * // => true * * _.isInteger(Number.MIN_VALUE); * // => false * * _.isInteger(Infinity); * // => false * * _.isInteger('3'); * // => false */ function isInteger(value) { return typeof value == 'number' && value == toInteger(value); } module.exports = isInteger; }); $__System.registerDynamic('44', [], true, function ($__require, exports, module) { 'use strict'; var global = this || self, GLOBAL = global; module.exports = function (str) { var tail = str.length; while (/[\s\uFEFF\u00A0]/.test(str[tail - 1])) { tail--; } return str.slice(0, tail); }; }); $__System.registerDynamic('19', ['@node/buffer'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; module.exports = $__require('@node/buffer').Buffer; }); $__System.registerDynamic("45", ["1d", "44", "19"], true, function ($__require, exports, module) { "use strict"; var Buffer = $__require("19"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _trimRight = $__require("44"); var _trimRight2 = _interopRequireDefault(_trimRight); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var SPACES_RE = /^[ \t]+$/; var Buffer = function () { function Buffer(map) { (0, _classCallCheck3.default)(this, Buffer); this._map = null; this._buf = []; this._last = ""; this._queue = []; this._position = { line: 1, column: 0 }; this._sourcePosition = { identifierName: null, line: null, column: null, filename: null }; this._map = map; } Buffer.prototype.get = function get() { this._flush(); var map = this._map; var result = { code: (0, _trimRight2.default)(this._buf.join("")), map: null, rawMappings: map && map.getRawMappings() }; if (map) { Object.defineProperty(result, "map", { configurable: true, enumerable: true, get: function get() { return this.map = map.get(); }, set: function set(value) { Object.defineProperty(this, "map", { value: value, writable: true }); } }); } return result; }; Buffer.prototype.append = function append(str) { this._flush(); var _sourcePosition = this._sourcePosition, line = _sourcePosition.line, column = _sourcePosition.column, filename = _sourcePosition.filename, identifierName = _sourcePosition.identifierName; this._append(str, line, column, identifierName, filename); }; Buffer.prototype.queue = function queue(str) { if (str === "\n") while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) { this._queue.shift(); }var _sourcePosition2 = this._sourcePosition, line = _sourcePosition2.line, column = _sourcePosition2.column, filename = _sourcePosition2.filename, identifierName = _sourcePosition2.identifierName; this._queue.unshift([str, line, column, identifierName, filename]); }; Buffer.prototype._flush = function _flush() { var item = void 0; while (item = this._queue.pop()) { this._append.apply(this, item); } }; Buffer.prototype._append = function _append(str, line, column, identifierName, filename) { if (this._map && str[0] !== "\n") { this._map.mark(this._position.line, this._position.column, line, column, identifierName, filename); } this._buf.push(str); this._last = str[str.length - 1]; for (var i = 0; i < str.length; i++) { if (str[i] === "\n") { this._position.line++; this._position.column = 0; } else { this._position.column++; } } }; Buffer.prototype.removeTrailingNewline = function removeTrailingNewline() { if (this._queue.length > 0 && this._queue[0][0] === "\n") this._queue.shift(); }; Buffer.prototype.removeLastSemicolon = function removeLastSemicolon() { if (this._queue.length > 0 && this._queue[0][0] === ";") this._queue.shift(); }; Buffer.prototype.endsWith = function endsWith(suffix) { if (suffix.length === 1) { var last = void 0; if (this._queue.length > 0) { var str = this._queue[0][0]; last = str[str.length - 1]; } else { last = this._last; } return last === suffix; } var end = this._last + this._queue.reduce(function (acc, item) { return item[0] + acc; }, ""); if (suffix.length <= end.length) { return end.slice(-suffix.length) === suffix; } return false; }; Buffer.prototype.hasContent = function hasContent() { return this._queue.length > 0 || !!this._last; }; Buffer.prototype.source = function source(prop, loc) { if (prop && !loc) return; var pos = loc ? loc[prop] : null; this._sourcePosition.identifierName = loc && loc.identifierName || null; this._sourcePosition.line = pos ? pos.line : null; this._sourcePosition.column = pos ? pos.column : null; this._sourcePosition.filename = loc && loc.filename || null; }; Buffer.prototype.withSource = function withSource(prop, loc, cb) { if (!this._map) return cb(); var originalLine = this._sourcePosition.line; var originalColumn = this._sourcePosition.column; var originalFilename = this._sourcePosition.filename; var originalIdentifierName = this._sourcePosition.identifierName; this.source(prop, loc); cb(); this._sourcePosition.line = originalLine; this._sourcePosition.column = originalColumn; this._sourcePosition.filename = originalFilename; this._sourcePosition.identifierName = originalIdentifierName; }; Buffer.prototype.getCurrentColumn = function getCurrentColumn() { var extra = this._queue.reduce(function (acc, item) { return item[0] + acc; }, ""); var lastIndex = extra.lastIndexOf("\n"); return lastIndex === -1 ? this._position.column + extra.length : extra.length - 1 - lastIndex; }; Buffer.prototype.getCurrentLine = function getCurrentLine() { var extra = this._queue.reduce(function (acc, item) { return item[0] + acc; }, ""); var count = 0; for (var i = 0; i < extra.length; i++) { if (extra[i] === "\n") count++; } return this._position.line + count; }; return Buffer; }(); exports.default = Buffer; module.exports = exports["default"]; }); $__System.registerDynamic("46", ["1d"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Whitespace = function () { function Whitespace(tokens) { (0, _classCallCheck3.default)(this, Whitespace); this.tokens = tokens; this.used = {}; } Whitespace.prototype.getNewlinesBefore = function getNewlinesBefore(node) { var startToken = void 0; var endToken = void 0; var tokens = this.tokens; var index = this._findToken(function (token) { return token.start - node.start; }, 0, tokens.length); if (index >= 0) { while (index && node.start === tokens[index - 1].start) { --index; }startToken = tokens[index - 1]; endToken = tokens[index]; } return this._getNewlinesBetween(startToken, endToken); }; Whitespace.prototype.getNewlinesAfter = function getNewlinesAfter(node) { var startToken = void 0; var endToken = void 0; var tokens = this.tokens; var index = this._findToken(function (token) { return token.end - node.end; }, 0, tokens.length); if (index >= 0) { while (index && node.end === tokens[index - 1].end) { --index; }startToken = tokens[index]; endToken = tokens[index + 1]; if (endToken.type.label === ",") endToken = tokens[index + 2]; } if (endToken && endToken.type.label === "eof") { return 1; } else { return this._getNewlinesBetween(startToken, endToken); } }; Whitespace.prototype._getNewlinesBetween = function _getNewlinesBetween(startToken, endToken) { if (!endToken || !endToken.loc) return 0; var start = startToken ? startToken.loc.end.line : 1; var end = endToken.loc.start.line; var lines = 0; for (var line = start; line < end; line++) { if (typeof this.used[line] === "undefined") { this.used[line] = true; lines++; } } return lines; }; Whitespace.prototype._findToken = function _findToken(test, start, end) { if (start >= end) return -1; var middle = start + end >>> 1; var match = test(this.tokens[middle]); if (match < 0) { return this._findToken(test, middle + 1, end); } else if (match > 0) { return this._findToken(test, start, middle); } else if (match === 0) { return middle; } return -1; }; return Whitespace; }(); exports.default = Whitespace; module.exports = exports["default"]; }); $__System.registerDynamic("47", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.TaggedTemplateExpression = TaggedTemplateExpression; exports.TemplateElement = TemplateElement; exports.TemplateLiteral = TemplateLiteral; function TaggedTemplateExpression(node) { this.print(node.tag, node); this.print(node.quasi, node); } function TemplateElement(node, parent) { var isFirst = parent.quasis[0] === node; var isLast = parent.quasis[parent.quasis.length - 1] === node; var value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${"); this.token(value); } function TemplateLiteral(node) { var quasis = node.quasis; for (var i = 0; i < quasis.length; i++) { this.print(quasis[i], node); if (i + 1 < quasis.length) { this.print(node.expressions[i], node); } } } }); $__System.registerDynamic('48', ['49', '3b', '4a', '4b'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var arrayMap = $__require('49'), baseIteratee = $__require('3b'), baseMap = $__require('4a'), isArray = $__require('4b'); /** * Creates an array of values by running each element in `collection` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. * * The guarded methods are: * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * * function square(n) { * return n * n; * } * * _.map([4, 8], square); * // => [16, 64] * * _.map({ 'a': 4, 'b': 8 }, square); * // => [16, 64] (iteration order is not guaranteed) * * var users = [ * { 'user': 'barney' }, * { 'user': 'fred' } * ]; * * // The `_.property` iteratee shorthand. * _.map(users, 'user'); * // => ['barney', 'fred'] */ function map(collection, iteratee) { var func = isArray(collection) ? arrayMap : baseMap; return func(collection, baseIteratee(iteratee, 3)); } module.exports = map; }); $__System.registerDynamic("4c", ["48", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; var _map = $__require("48"); var _map2 = _interopRequireDefault(_map); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function crawl(node) { var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; if (t.isMemberExpression(node)) { crawl(node.object, state); if (node.computed) crawl(node.property, state); } else if (t.isBinary(node) || t.isAssignmentExpression(node)) { crawl(node.left, state); crawl(node.right, state); } else if (t.isCallExpression(node)) { state.hasCall = true; crawl(node.callee, state); } else if (t.isFunction(node)) { state.hasFunction = true; } else if (t.isIdentifier(node)) { state.hasHelper = state.hasHelper || isHelper(node.callee); } return state; } function isHelper(node) { if (t.isMemberExpression(node)) { return isHelper(node.object) || isHelper(node.property); } else if (t.isIdentifier(node)) { return node.name === "require" || node.name[0] === "_"; } else if (t.isCallExpression(node)) { return isHelper(node.callee); } else if (t.isBinary(node) || t.isAssignmentExpression(node)) { return t.isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right); } else { return false; } } function isType(node) { return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node); } exports.nodes = { AssignmentExpression: function AssignmentExpression(node) { var state = crawl(node.right); if (state.hasCall && state.hasHelper || state.hasFunction) { return { before: state.hasFunction, after: true }; } }, SwitchCase: function SwitchCase(node, parent) { return { before: node.consequent.length || parent.cases[0] === node }; }, LogicalExpression: function LogicalExpression(node) { if (t.isFunction(node.left) || t.isFunction(node.right)) { return { after: true }; } }, Literal: function Literal(node) { if (node.value === "use strict") { return { after: true }; } }, CallExpression: function CallExpression(node) { if (t.isFunction(node.callee) || isHelper(node)) { return { before: true, after: true }; } }, VariableDeclaration: function VariableDeclaration(node) { for (var i = 0; i < node.declarations.length; i++) { var declar = node.declarations[i]; var enabled = isHelper(declar.id) && !isType(declar.init); if (!enabled) { var state = crawl(declar.init); enabled = isHelper(declar.init) && state.hasCall || state.hasFunction; } if (enabled) { return { before: true, after: true }; } } }, IfStatement: function IfStatement(node) { if (t.isBlockStatement(node.consequent)) { return { before: true, after: true }; } } }; exports.nodes.ObjectProperty = exports.nodes.ObjectTypeProperty = exports.nodes.ObjectMethod = exports.nodes.SpreadProperty = function (node, parent) { if (parent.properties[0] === node) { return { before: true }; } }; exports.list = { VariableDeclaration: function VariableDeclaration(node) { return (0, _map2.default)(node.declarations, "init"); }, ArrayExpression: function ArrayExpression(node) { return node.elements; }, ObjectExpression: function ObjectExpression(node) { return node.properties; } }; [["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function (_ref) { var type = _ref[0], amounts = _ref[1]; if (typeof amounts === "boolean") { amounts = { after: amounts, before: amounts }; } [type].concat(t.FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) { exports.nodes[type] = function () { return amounts; }; }); }); }); $__System.registerDynamic("4d", ["11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.AwaitExpression = exports.FunctionTypeAnnotation = undefined; exports.NullableTypeAnnotation = NullableTypeAnnotation; exports.UpdateExpression = UpdateExpression; exports.ObjectExpression = ObjectExpression; exports.DoExpression = DoExpression; exports.Binary = Binary; exports.BinaryExpression = BinaryExpression; exports.SequenceExpression = SequenceExpression; exports.YieldExpression = YieldExpression; exports.ClassExpression = ClassExpression; exports.UnaryLike = UnaryLike; exports.FunctionExpression = FunctionExpression; exports.ArrowFunctionExpression = ArrowFunctionExpression; exports.ConditionalExpression = ConditionalExpression; exports.AssignmentExpression = AssignmentExpression; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } var PRECEDENCE = { "||": 0, "&&": 1, "|": 2, "^": 3, "&": 4, "==": 5, "===": 5, "!=": 5, "!==": 5, "<": 6, ">": 6, "<=": 6, ">=": 6, in: 6, instanceof: 6, ">>": 7, "<<": 7, ">>>": 7, "+": 8, "-": 8, "*": 9, "/": 9, "%": 9, "**": 10 }; function NullableTypeAnnotation(node, parent) { return t.isArrayTypeAnnotation(parent); } exports.FunctionTypeAnnotation = NullableTypeAnnotation; function UpdateExpression(node, parent) { return t.isMemberExpression(parent) && parent.object === node; } function ObjectExpression(node, parent, printStack) { return isFirstInStatement(printStack, { considerArrow: true }); } function DoExpression(node, parent, printStack) { return isFirstInStatement(printStack); } function Binary(node, parent) { if ((t.isCallExpression(parent) || t.isNewExpression(parent)) && parent.callee === node || t.isUnaryLike(parent) || t.isMemberExpression(parent) && parent.object === node || t.isAwaitExpression(parent)) { return true; } if (t.isBinary(parent)) { var parentOp = parent.operator; var parentPos = PRECEDENCE[parentOp]; var nodeOp = node.operator; var nodePos = PRECEDENCE[nodeOp]; if (parentPos === nodePos && parent.right === node && !t.isLogicalExpression(parent) || parentPos > nodePos) { return true; } } return false; } function BinaryExpression(node, parent) { return node.operator === "in" && (t.isVariableDeclarator(parent) || t.isFor(parent)); } function SequenceExpression(node, parent) { if (t.isForStatement(parent) || t.isThrowStatement(parent) || t.isReturnStatement(parent) || t.isIfStatement(parent) && parent.test === node || t.isWhileStatement(parent) && parent.test === node || t.isForInStatement(parent) && parent.right === node || t.isSwitchStatement(parent) && parent.discriminant === node || t.isExpressionStatement(parent) && parent.expression === node) { return false; } return true; } function YieldExpression(node, parent) { return t.isBinary(parent) || t.isUnaryLike(parent) || t.isCallExpression(parent) || t.isMemberExpression(parent) || t.isNewExpression(parent) || t.isConditionalExpression(parent) && node === parent.test; } exports.AwaitExpression = YieldExpression; function ClassExpression(node, parent, printStack) { return isFirstInStatement(printStack, { considerDefaultExports: true }); } function UnaryLike(node, parent) { return t.isMemberExpression(parent, { object: node }) || t.isCallExpression(parent, { callee: node }) || t.isNewExpression(parent, { callee: node }); } function FunctionExpression(node, parent, printStack) { return isFirstInStatement(printStack, { considerDefaultExports: true }); } function ArrowFunctionExpression(node, parent) { if (t.isExportDeclaration(parent) || t.isBinaryExpression(parent) || t.isLogicalExpression(parent) || t.isUnaryExpression(parent) || t.isTaggedTemplateExpression(parent)) { return true; } return UnaryLike(node, parent); } function ConditionalExpression(node, parent) { if (t.isUnaryLike(parent) || t.isBinary(parent) || t.isConditionalExpression(parent, { test: node }) || t.isAwaitExpression(parent)) { return true; } return UnaryLike(node, parent); } function AssignmentExpression(node) { if (t.isObjectPattern(node.left)) { return true; } else { return ConditionalExpression.apply(undefined, arguments); } } function isFirstInStatement(printStack) { var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref$considerArrow = _ref.considerArrow, considerArrow = _ref$considerArrow === undefined ? false : _ref$considerArrow, _ref$considerDefaultE = _ref.considerDefaultExports, considerDefaultExports = _ref$considerDefaultE === undefined ? false : _ref$considerDefaultE; var i = printStack.length - 1; var node = printStack[i]; i--; var parent = printStack[i]; while (i > 0) { if (t.isExpressionStatement(parent, { expression: node }) || t.isTaggedTemplateExpression(parent) || considerDefaultExports && t.isExportDefaultDeclaration(parent, { declaration: node }) || considerArrow && t.isArrowFunctionExpression(parent, { body: node })) { return true; } if (t.isCallExpression(parent, { callee: node }) || t.isSequenceExpression(parent) && parent.expressions[0] === node || t.isMemberExpression(parent, { object: node }) || t.isConditional(parent, { test: node }) || t.isBinary(parent, { left: node }) || t.isAssignmentExpression(parent, { left: node })) { node = parent; i--; parent = printStack[i]; } else { return false; } } return false; } }); $__System.registerDynamic("4e", ["17", "15", "4c", "4d", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _keys = $__require("15"); var _keys2 = _interopRequireDefault(_keys); exports.needsWhitespace = needsWhitespace; exports.needsWhitespaceBefore = needsWhitespaceBefore; exports.needsWhitespaceAfter = needsWhitespaceAfter; exports.needsParens = needsParens; var _whitespace = $__require("4c"); var _whitespace2 = _interopRequireDefault(_whitespace); var _parentheses = $__require("4d"); var parens = _interopRequireWildcard(_parentheses); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function expandAliases(obj) { var newObj = {}; function add(type, func) { var fn = newObj[type]; newObj[type] = fn ? function (node, parent, stack) { var result = fn(node, parent, stack); return result == null ? func(node, parent, stack) : result; } : func; } for (var _iterator = (0, _keys2.default)(obj), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 type = _ref; var aliases = t.FLIPPED_ALIAS_KEYS[type]; if (aliases) { for (var _iterator2 = aliases, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var alias = _ref2; add(alias, obj[type]); } } else { add(type, obj[type]); } } return newObj; } var expandedParens = expandAliases(parens); var expandedWhitespaceNodes = expandAliases(_whitespace2.default.nodes); var expandedWhitespaceList = expandAliases(_whitespace2.default.list); function find(obj, node, parent, printStack) { var fn = obj[node.type]; return fn ? fn(node, parent, printStack) : null; } function isOrHasCallExpression(node) { if (t.isCallExpression(node)) { return true; } if (t.isMemberExpression(node)) { return isOrHasCallExpression(node.object) || !node.computed && isOrHasCallExpression(node.property); } else { return false; } } function needsWhitespace(node, parent, type) { if (!node) return 0; if (t.isExpressionStatement(node)) { node = node.expression; } var linesInfo = find(expandedWhitespaceNodes, node, parent); if (!linesInfo) { var items = find(expandedWhitespaceList, node, parent); if (items) { for (var i = 0; i < items.length; i++) { linesInfo = needsWhitespace(items[i], node, type); if (linesInfo) break; } } } return linesInfo && linesInfo[type] || 0; } function needsWhitespaceBefore(node, parent) { return needsWhitespace(node, parent, "before"); } function needsWhitespaceAfter(node, parent) { return needsWhitespace(node, parent, "after"); } function needsParens(node, parent, printStack) { if (!parent) return false; if (t.isNewExpression(parent) && parent.callee === node) { if (isOrHasCallExpression(node)) return true; } return find(expandedParens, node, parent, printStack); } }); $__System.registerDynamic("4f", ["11", "4e"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.LogicalExpression = exports.BinaryExpression = exports.AwaitExpression = exports.YieldExpression = undefined; exports.UnaryExpression = UnaryExpression; exports.DoExpression = DoExpression; exports.ParenthesizedExpression = ParenthesizedExpression; exports.UpdateExpression = UpdateExpression; exports.ConditionalExpression = ConditionalExpression; exports.NewExpression = NewExpression; exports.SequenceExpression = SequenceExpression; exports.ThisExpression = ThisExpression; exports.Super = Super; exports.Decorator = Decorator; exports.CallExpression = CallExpression; exports.Import = Import; exports.EmptyStatement = EmptyStatement; exports.ExpressionStatement = ExpressionStatement; exports.AssignmentPattern = AssignmentPattern; exports.AssignmentExpression = AssignmentExpression; exports.BindExpression = BindExpression; exports.MemberExpression = MemberExpression; exports.MetaProperty = MetaProperty; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); var _node = $__require("4e"); var n = _interopRequireWildcard(_node); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function UnaryExpression(node) { if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof") { this.word(node.operator); this.space(); } else { this.token(node.operator); } this.print(node.argument, node); } function DoExpression(node) { this.word("do"); this.space(); this.print(node.body, node); } function ParenthesizedExpression(node) { this.token("("); this.print(node.expression, node); this.token(")"); } function UpdateExpression(node) { if (node.prefix) { this.token(node.operator); this.print(node.argument, node); } else { this.print(node.argument, node); this.token(node.operator); } } function ConditionalExpression(node) { this.print(node.test, node); this.space(); this.token("?"); this.space(); this.print(node.consequent, node); this.space(); this.token(":"); this.space(); this.print(node.alternate, node); } function NewExpression(node, parent) { this.word("new"); this.space(); this.print(node.callee, node); if (node.arguments.length === 0 && this.format.minified && !t.isCallExpression(parent, { callee: node }) && !t.isMemberExpression(parent) && !t.isNewExpression(parent)) return; this.token("("); this.printList(node.arguments, node); this.token(")"); } function SequenceExpression(node) { this.printList(node.expressions, node); } function ThisExpression() { this.word("this"); } function Super() { this.word("super"); } function Decorator(node) { this.token("@"); this.print(node.expression, node); this.newline(); } function commaSeparatorNewline() { this.token(","); this.newline(); if (!this.endsWith("\n")) this.space(); } function CallExpression(node) { this.print(node.callee, node); this.token("("); var isPrettyCall = node._prettyCall; var separator = void 0; if (isPrettyCall) { separator = commaSeparatorNewline; this.newline(); this.indent(); } this.printList(node.arguments, node, { separator: separator }); if (isPrettyCall) { this.newline(); this.dedent(); } this.token(")"); } function Import() { this.word("import"); } function buildYieldAwait(keyword) { return function (node) { this.word(keyword); if (node.delegate) { this.token("*"); } if (node.argument) { this.space(); var terminatorState = this.startTerminatorless(); this.print(node.argument, node); this.endTerminatorless(terminatorState); } }; } var YieldExpression = exports.YieldExpression = buildYieldAwait("yield"); var AwaitExpression = exports.AwaitExpression = buildYieldAwait("await"); function EmptyStatement() { this.semicolon(true); } function ExpressionStatement(node) { this.print(node.expression, node); this.semicolon(); } function AssignmentPattern(node) { this.print(node.left, node); if (node.left.optional) this.token("?"); this.print(node.left.typeAnnotation, node); this.space(); this.token("="); this.space(); this.print(node.right, node); } function AssignmentExpression(node, parent) { var parens = this.inForStatementInitCounter && node.operator === "in" && !n.needsParens(node, parent); if (parens) { this.token("("); } this.print(node.left, node); this.space(); if (node.operator === "in" || node.operator === "instanceof") { this.word(node.operator); } else { this.token(node.operator); } this.space(); this.print(node.right, node); if (parens) { this.token(")"); } } function BindExpression(node) { this.print(node.object, node); this.token("::"); this.print(node.callee, node); } exports.BinaryExpression = AssignmentExpression; exports.LogicalExpression = AssignmentExpression; function MemberExpression(node) { this.print(node.object, node); if (!node.computed && t.isMemberExpression(node.property)) { throw new TypeError("Got a MemberExpression for MemberExpression property"); } var computed = node.computed; if (t.isLiteral(node.property) && typeof node.property.value === "number") { computed = true; } if (computed) { this.token("["); this.print(node.property, node); this.token("]"); } else { this.token("."); this.print(node.property, node); } } function MetaProperty(node) { this.print(node.meta, node); this.token("."); this.print(node.property, node); } }); $__System.registerDynamic("50", ["17", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.ThrowStatement = exports.BreakStatement = exports.ReturnStatement = exports.ContinueStatement = exports.ForAwaitStatement = exports.ForOfStatement = exports.ForInStatement = undefined; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.WithStatement = WithStatement; exports.IfStatement = IfStatement; exports.ForStatement = ForStatement; exports.WhileStatement = WhileStatement; exports.DoWhileStatement = DoWhileStatement; exports.LabeledStatement = LabeledStatement; exports.TryStatement = TryStatement; exports.CatchClause = CatchClause; exports.SwitchStatement = SwitchStatement; exports.SwitchCase = SwitchCase; exports.DebuggerStatement = DebuggerStatement; exports.VariableDeclaration = VariableDeclaration; exports.VariableDeclarator = VariableDeclarator; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function WithStatement(node) { this.word("with"); this.space(); this.token("("); this.print(node.object, node); this.token(")"); this.printBlock(node); } function IfStatement(node) { this.word("if"); this.space(); this.token("("); this.print(node.test, node); this.token(")"); this.space(); var needsBlock = node.alternate && t.isIfStatement(getLastStatement(node.consequent)); if (needsBlock) { this.token("{"); this.newline(); this.indent(); } this.printAndIndentOnComments(node.consequent, node); if (needsBlock) { this.dedent(); this.newline(); this.token("}"); } if (node.alternate) { if (this.endsWith("}")) this.space(); this.word("else"); this.space(); this.printAndIndentOnComments(node.alternate, node); } } function getLastStatement(statement) { if (!t.isStatement(statement.body)) return statement; return getLastStatement(statement.body); } function ForStatement(node) { this.word("for"); this.space(); this.token("("); this.inForStatementInitCounter++; this.print(node.init, node); this.inForStatementInitCounter--; this.token(";"); if (node.test) { this.space(); this.print(node.test, node); } this.token(";"); if (node.update) { this.space(); this.print(node.update, node); } this.token(")"); this.printBlock(node); } function WhileStatement(node) { this.word("while"); this.space(); this.token("("); this.print(node.test, node); this.token(")"); this.printBlock(node); } var buildForXStatement = function buildForXStatement(op) { return function (node) { this.word("for"); this.space(); if (op === "await") { this.word("await"); this.space(); } this.token("("); this.print(node.left, node); this.space(); this.word(op === "await" ? "of" : op); this.space(); this.print(node.right, node); this.token(")"); this.printBlock(node); }; }; var ForInStatement = exports.ForInStatement = buildForXStatement("in"); var ForOfStatement = exports.ForOfStatement = buildForXStatement("of"); var ForAwaitStatement = exports.ForAwaitStatement = buildForXStatement("await"); function DoWhileStatement(node) { this.word("do"); this.space(); this.print(node.body, node); this.space(); this.word("while"); this.space(); this.token("("); this.print(node.test, node); this.token(")"); this.semicolon(); } function buildLabelStatement(prefix) { var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "label"; return function (node) { this.word(prefix); var label = node[key]; if (label) { this.space(); var terminatorState = this.startTerminatorless(); this.print(label, node); this.endTerminatorless(terminatorState); } this.semicolon(); }; } var ContinueStatement = exports.ContinueStatement = buildLabelStatement("continue"); var ReturnStatement = exports.ReturnStatement = buildLabelStatement("return", "argument"); var BreakStatement = exports.BreakStatement = buildLabelStatement("break"); var ThrowStatement = exports.ThrowStatement = buildLabelStatement("throw", "argument"); function LabeledStatement(node) { this.print(node.label, node); this.token(":"); this.space(); this.print(node.body, node); } function TryStatement(node) { this.word("try"); this.space(); this.print(node.block, node); this.space(); if (node.handlers) { this.print(node.handlers[0], node); } else { this.print(node.handler, node); } if (node.finalizer) { this.space(); this.word("finally"); this.space(); this.print(node.finalizer, node); } } function CatchClause(node) { this.word("catch"); this.space(); this.token("("); this.print(node.param, node); this.token(")"); this.space(); this.print(node.body, node); } function SwitchStatement(node) { this.word("switch"); this.space(); this.token("("); this.print(node.discriminant, node); this.token(")"); this.space(); this.token("{"); this.printSequence(node.cases, node, { indent: true, addNewlines: function addNewlines(leading, cas) { if (!leading && node.cases[node.cases.length - 1] === cas) return -1; } }); this.token("}"); } function SwitchCase(node) { if (node.test) { this.word("case"); this.space(); this.print(node.test, node); this.token(":"); } else { this.word("default"); this.token(":"); } if (node.consequent.length) { this.newline(); this.printSequence(node.consequent, node, { indent: true }); } } function DebuggerStatement() { this.word("debugger"); this.semicolon(); } function variableDeclarationIdent() { this.token(","); this.newline(); if (this.endsWith("\n")) for (var i = 0; i < 4; i++) { this.space(true); } } function constDeclarationIdent() { this.token(","); this.newline(); if (this.endsWith("\n")) for (var i = 0; i < 6; i++) { this.space(true); } } function VariableDeclaration(node, parent) { this.word(node.kind); this.space(); var hasInits = false; if (!t.isFor(parent)) { for (var _iterator = node.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 declar = _ref; if (declar.init) { hasInits = true; } } } var separator = void 0; if (hasInits) { separator = node.kind === "const" ? constDeclarationIdent : variableDeclarationIdent; } this.printList(node.declarations, node, { separator: separator }); if (t.isFor(parent)) { if (parent.left === node || parent.init === node) return; } this.semicolon(); } function VariableDeclarator(node) { this.print(node.id, node); this.print(node.id.typeAnnotation, node); if (node.init) { this.space(); this.token("="); this.space(); this.print(node.init, node); } } }); $__System.registerDynamic("51", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.ClassDeclaration = ClassDeclaration; exports.ClassBody = ClassBody; exports.ClassProperty = ClassProperty; exports.ClassMethod = ClassMethod; function ClassDeclaration(node) { this.printJoin(node.decorators, node); this.word("class"); if (node.id) { this.space(); this.print(node.id, node); } this.print(node.typeParameters, node); if (node.superClass) { this.space(); this.word("extends"); this.space(); this.print(node.superClass, node); this.print(node.superTypeParameters, node); } if (node.implements) { this.space(); this.word("implements"); this.space(); this.printList(node.implements, node); } this.space(); this.print(node.body, node); } exports.ClassExpression = ClassDeclaration; function ClassBody(node) { this.token("{"); this.printInnerComments(node); if (node.body.length === 0) { this.token("}"); } else { this.newline(); this.indent(); this.printSequence(node.body, node); this.dedent(); if (!this.endsWith("\n")) this.newline(); this.rightBrace(); } } function ClassProperty(node) { this.printJoin(node.decorators, node); if (node.static) { this.word("static"); this.space(); } if (node.computed) { this.token("["); this.print(node.key, node); this.token("]"); } else { this._variance(node); this.print(node.key, node); } this.print(node.typeAnnotation, node); if (node.value) { this.space(); this.token("="); this.space(); this.print(node.value, node); } this.semicolon(); } function ClassMethod(node) { this.printJoin(node.decorators, node); if (node.static) { this.word("static"); this.space(); } if (node.kind === "constructorCall") { this.word("call"); this.space(); } this._method(node); } }); $__System.registerDynamic("52", ["11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.FunctionDeclaration = undefined; exports._params = _params; exports._method = _method; exports.FunctionExpression = FunctionExpression; exports.ArrowFunctionExpression = ArrowFunctionExpression; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _params(node) { var _this = this; this.print(node.typeParameters, node); this.token("("); this.printList(node.params, node, { iterator: function iterator(node) { if (node.optional) _this.token("?"); _this.print(node.typeAnnotation, node); } }); this.token(")"); if (node.returnType) { this.print(node.returnType, node); } } function _method(node) { var kind = node.kind; var key = node.key; if (kind === "method" || kind === "init") { if (node.generator) { this.token("*"); } } if (kind === "get" || kind === "set") { this.word(kind); this.space(); } if (node.async) { this.word("async"); this.space(); } if (node.computed) { this.token("["); this.print(key, node); this.token("]"); } else { this.print(key, node); } this._params(node); this.space(); this.print(node.body, node); } function FunctionExpression(node) { if (node.async) { this.word("async"); this.space(); } this.word("function"); if (node.generator) this.token("*"); if (node.id) { this.space(); this.print(node.id, node); } else { this.space(); } this._params(node); this.space(); this.print(node.body, node); } exports.FunctionDeclaration = FunctionExpression; function ArrowFunctionExpression(node) { if (node.async) { this.word("async"); this.space(); } var firstParam = node.params[0]; if (node.params.length === 1 && t.isIdentifier(firstParam) && !hasTypes(node, firstParam)) { this.print(firstParam, node); } else { this._params(node); } this.space(); this.token("=>"); this.space(); this.print(node.body, node); } function hasTypes(node, param) { return node.typeParameters || node.returnType || param.typeAnnotation || param.optional || param.trailingComments; } }); $__System.registerDynamic("53", ["11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.ImportSpecifier = ImportSpecifier; exports.ImportDefaultSpecifier = ImportDefaultSpecifier; exports.ExportDefaultSpecifier = ExportDefaultSpecifier; exports.ExportSpecifier = ExportSpecifier; exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier; exports.ExportAllDeclaration = ExportAllDeclaration; exports.ExportNamedDeclaration = ExportNamedDeclaration; exports.ExportDefaultDeclaration = ExportDefaultDeclaration; exports.ImportDeclaration = ImportDeclaration; exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function ImportSpecifier(node) { if (node.importKind === "type" || node.importKind === "typeof") { this.word(node.importKind); this.space(); } this.print(node.imported, node); if (node.local && node.local.name !== node.imported.name) { this.space(); this.word("as"); this.space(); this.print(node.local, node); } } function ImportDefaultSpecifier(node) { this.print(node.local, node); } function ExportDefaultSpecifier(node) { this.print(node.exported, node); } function ExportSpecifier(node) { this.print(node.local, node); if (node.exported && node.local.name !== node.exported.name) { this.space(); this.word("as"); this.space(); this.print(node.exported, node); } } function ExportNamespaceSpecifier(node) { this.token("*"); this.space(); this.word("as"); this.space(); this.print(node.exported, node); } function ExportAllDeclaration(node) { this.word("export"); this.space(); this.token("*"); this.space(); this.word("from"); this.space(); this.print(node.source, node); this.semicolon(); } function ExportNamedDeclaration() { this.word("export"); this.space(); ExportDeclaration.apply(this, arguments); } function ExportDefaultDeclaration() { this.word("export"); this.space(); this.word("default"); this.space(); ExportDeclaration.apply(this, arguments); } function ExportDeclaration(node) { if (node.declaration) { var declar = node.declaration; this.print(declar, node); if (!t.isStatement(declar)) this.semicolon(); } else { if (node.exportKind === "type") { this.word("type"); this.space(); } var specifiers = node.specifiers.slice(0); var hasSpecial = false; while (true) { var first = specifiers[0]; if (t.isExportDefaultSpecifier(first) || t.isExportNamespaceSpecifier(first)) { hasSpecial = true; this.print(specifiers.shift(), node); if (specifiers.length) { this.token(","); this.space(); } } else { break; } } if (specifiers.length || !specifiers.length && !hasSpecial) { this.token("{"); if (specifiers.length) { this.space(); this.printList(specifiers, node); this.space(); } this.token("}"); } if (node.source) { this.space(); this.word("from"); this.space(); this.print(node.source, node); } this.semicolon(); } } function ImportDeclaration(node) { this.word("import"); this.space(); if (node.importKind === "type" || node.importKind === "typeof") { this.word(node.importKind); this.space(); } var specifiers = node.specifiers.slice(0); if (specifiers && specifiers.length) { while (true) { var first = specifiers[0]; if (t.isImportDefaultSpecifier(first) || t.isImportNamespaceSpecifier(first)) { this.print(specifiers.shift(), node); if (specifiers.length) { this.token(","); this.space(); } } else { break; } } if (specifiers.length) { this.token("{"); this.space(); this.printList(specifiers, node); this.space(); this.token("}"); } this.space(); this.word("from"); this.space(); } this.print(node.source, node); this.semicolon(); } function ImportNamespaceSpecifier(node) { this.token("*"); this.space(); this.word("as"); this.space(); this.print(node.local, node); } }); $__System.registerDynamic("54", ["55"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.AnyTypeAnnotation = AnyTypeAnnotation; exports.ArrayTypeAnnotation = ArrayTypeAnnotation; exports.BooleanTypeAnnotation = BooleanTypeAnnotation; exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation; exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation; exports.DeclareClass = DeclareClass; exports.DeclareFunction = DeclareFunction; exports.DeclareInterface = DeclareInterface; exports.DeclareModule = DeclareModule; exports.DeclareModuleExports = DeclareModuleExports; exports.DeclareTypeAlias = DeclareTypeAlias; exports.DeclareVariable = DeclareVariable; exports.ExistentialTypeParam = ExistentialTypeParam; exports.FunctionTypeAnnotation = FunctionTypeAnnotation; exports.FunctionTypeParam = FunctionTypeParam; exports.InterfaceExtends = InterfaceExtends; exports._interfaceish = _interfaceish; exports._variance = _variance; exports.InterfaceDeclaration = InterfaceDeclaration; exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation; exports.MixedTypeAnnotation = MixedTypeAnnotation; exports.EmptyTypeAnnotation = EmptyTypeAnnotation; exports.NullableTypeAnnotation = NullableTypeAnnotation; var _types = $__require("55"); Object.defineProperty(exports, "NumericLiteralTypeAnnotation", { enumerable: true, get: function get() { return _types.NumericLiteral; } }); Object.defineProperty(exports, "StringLiteralTypeAnnotation", { enumerable: true, get: function get() { return _types.StringLiteral; } }); exports.NumberTypeAnnotation = NumberTypeAnnotation; exports.StringTypeAnnotation = StringTypeAnnotation; exports.ThisTypeAnnotation = ThisTypeAnnotation; exports.TupleTypeAnnotation = TupleTypeAnnotation; exports.TypeofTypeAnnotation = TypeofTypeAnnotation; exports.TypeAlias = TypeAlias; exports.TypeAnnotation = TypeAnnotation; exports.TypeParameter = TypeParameter; exports.TypeParameterInstantiation = TypeParameterInstantiation; exports.ObjectTypeAnnotation = ObjectTypeAnnotation; exports.ObjectTypeCallProperty = ObjectTypeCallProperty; exports.ObjectTypeIndexer = ObjectTypeIndexer; exports.ObjectTypeProperty = ObjectTypeProperty; exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty; exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier; exports.UnionTypeAnnotation = UnionTypeAnnotation; exports.TypeCastExpression = TypeCastExpression; exports.VoidTypeAnnotation = VoidTypeAnnotation; function AnyTypeAnnotation() { this.word("any"); } function ArrayTypeAnnotation(node) { this.print(node.elementType, node); this.token("["); this.token("]"); } function BooleanTypeAnnotation() { this.word("boolean"); } function BooleanLiteralTypeAnnotation(node) { this.word(node.value ? "true" : "false"); } function NullLiteralTypeAnnotation() { this.word("null"); } function DeclareClass(node) { this.word("declare"); this.space(); this.word("class"); this.space(); this._interfaceish(node); } function DeclareFunction(node) { this.word("declare"); this.space(); this.word("function"); this.space(); this.print(node.id, node); this.print(node.id.typeAnnotation.typeAnnotation, node); this.semicolon(); } function DeclareInterface(node) { this.word("declare"); this.space(); this.InterfaceDeclaration(node); } function DeclareModule(node) { this.word("declare"); this.space(); this.word("module"); this.space(); this.print(node.id, node); this.space(); this.print(node.body, node); } function DeclareModuleExports(node) { this.word("declare"); this.space(); this.word("module"); this.token("."); this.word("exports"); this.print(node.typeAnnotation, node); } function DeclareTypeAlias(node) { this.word("declare"); this.space(); this.TypeAlias(node); } function DeclareVariable(node) { this.word("declare"); this.space(); this.word("var"); this.space(); this.print(node.id, node); this.print(node.id.typeAnnotation, node); this.semicolon(); } function ExistentialTypeParam() { this.token("*"); } function FunctionTypeAnnotation(node, parent) { this.print(node.typeParameters, node); this.token("("); this.printList(node.params, node); if (node.rest) { if (node.params.length) { this.token(","); this.space(); } this.token("..."); this.print(node.rest, node); } this.token(")"); if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction") { this.token(":"); } else { this.space(); this.token("=>"); } this.space(); this.print(node.returnType, node); } function FunctionTypeParam(node) { this.print(node.name, node); if (node.optional) this.token("?"); this.token(":"); this.space(); this.print(node.typeAnnotation, node); } function InterfaceExtends(node) { this.print(node.id, node); this.print(node.typeParameters, node); } exports.ClassImplements = InterfaceExtends; exports.GenericTypeAnnotation = InterfaceExtends; function _interfaceish(node) { this.print(node.id, node); this.print(node.typeParameters, node); if (node.extends.length) { this.space(); this.word("extends"); this.space(); this.printList(node.extends, node); } if (node.mixins && node.mixins.length) { this.space(); this.word("mixins"); this.space(); this.printList(node.mixins, node); } this.space(); this.print(node.body, node); } function _variance(node) { if (node.variance === "plus") { this.token("+"); } else if (node.variance === "minus") { this.token("-"); } } function InterfaceDeclaration(node) { this.word("interface"); this.space(); this._interfaceish(node); } function andSeparator() { this.space(); this.token("&"); this.space(); } function IntersectionTypeAnnotation(node) { this.printJoin(node.types, node, { separator: andSeparator }); } function MixedTypeAnnotation() { this.word("mixed"); } function EmptyTypeAnnotation() { this.word("empty"); } function NullableTypeAnnotation(node) { this.token("?"); this.print(node.typeAnnotation, node); } function NumberTypeAnnotation() { this.word("number"); } function StringTypeAnnotation() { this.word("string"); } function ThisTypeAnnotation() { this.word("this"); } function TupleTypeAnnotation(node) { this.token("["); this.printList(node.types, node); this.token("]"); } function TypeofTypeAnnotation(node) { this.word("typeof"); this.space(); this.print(node.argument, node); } function TypeAlias(node) { this.word("type"); this.space(); this.print(node.id, node); this.print(node.typeParameters, node); this.space(); this.token("="); this.space(); this.print(node.right, node); this.semicolon(); } function TypeAnnotation(node) { this.token(":"); this.space(); if (node.optional) this.token("?"); this.print(node.typeAnnotation, node); } function TypeParameter(node) { this._variance(node); this.word(node.name); if (node.bound) { this.print(node.bound, node); } if (node.default) { this.space(); this.token("="); this.space(); this.print(node.default, node); } } function TypeParameterInstantiation(node) { this.token("<"); this.printList(node.params, node, {}); this.token(">"); } exports.TypeParameterDeclaration = TypeParameterInstantiation; function ObjectTypeAnnotation(node) { var _this = this; if (node.exact) { this.token("{|"); } else { this.token("{"); } var props = node.properties.concat(node.callProperties, node.indexers); if (props.length) { this.space(); this.printJoin(props, node, { addNewlines: function addNewlines(leading) { if (leading && !props[0]) return 1; }, indent: true, statement: true, iterator: function iterator() { if (props.length !== 1) { if (_this.format.flowCommaSeparator) { _this.token(","); } else { _this.semicolon(); } _this.space(); } } }); this.space(); } if (node.exact) { this.token("|}"); } else { this.token("}"); } } function ObjectTypeCallProperty(node) { if (node.static) { this.word("static"); this.space(); } this.print(node.value, node); } function ObjectTypeIndexer(node) { if (node.static) { this.word("static"); this.space(); } this._variance(node); this.token("["); this.print(node.id, node); this.token(":"); this.space(); this.print(node.key, node); this.token("]"); this.token(":"); this.space(); this.print(node.value, node); } function ObjectTypeProperty(node) { if (node.static) { this.word("static"); this.space(); } this._variance(node); this.print(node.key, node); if (node.optional) this.token("?"); this.token(":"); this.space(); this.print(node.value, node); } function ObjectTypeSpreadProperty(node) { this.token("..."); this.print(node.argument, node); } function QualifiedTypeIdentifier(node) { this.print(node.qualification, node); this.token("."); this.print(node.id, node); } function orSeparator() { this.space(); this.token("|"); this.space(); } function UnionTypeAnnotation(node) { this.printJoin(node.types, node, { separator: orSeparator }); } function TypeCastExpression(node) { this.token("("); this.print(node.expression, node); this.print(node.typeAnnotation, node); this.token(")"); } function VoidTypeAnnotation() { this.word("void"); } }); $__System.registerDynamic('56', [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /*! https://mths.be/jsesc v1.3.0 by @mathias */ ;(function (root) { // Detect free variables `exports` var freeExports = typeof exports == 'object' && exports; // Detect free variable `module` var freeModule = typeof module == 'object' && module && module.exports == freeExports && module; // Detect free variable `global`, from Node.js or Browserified code, // and use it as `root` var freeGlobal = typeof global == 'object' && global; if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { root = freeGlobal; } /*--------------------------------------------------------------------------*/ var object = {}; var hasOwnProperty = object.hasOwnProperty; var forOwn = function (object, callback) { var key; for (key in object) { if (hasOwnProperty.call(object, key)) { callback(key, object[key]); } } }; var extend = function (destination, source) { if (!source) { return destination; } forOwn(source, function (key, value) { destination[key] = value; }); return destination; }; var forEach = function (array, callback) { var length = array.length; var index = -1; while (++index < length) { callback(array[index]); } }; var toString = object.toString; var isArray = function (value) { return toString.call(value) == '[object Array]'; }; var isObject = function (value) { // This is a very simple check, but it’s good enough for what we need. return toString.call(value) == '[object Object]'; }; var isString = function (value) { return typeof value == 'string' || toString.call(value) == '[object String]'; }; var isNumber = function (value) { return typeof value == 'number' || toString.call(value) == '[object Number]'; }; var isFunction = function (value) { // In a perfect world, the `typeof` check would be sufficient. However, // in Chrome 1–12, `typeof /x/ == 'object'`, and in IE 6–8 // `typeof alert == 'object'` and similar for other host objects. return typeof value == 'function' || toString.call(value) == '[object Function]'; }; var isMap = function (value) { return toString.call(value) == '[object Map]'; }; var isSet = function (value) { return toString.call(value) == '[object Set]'; }; /*--------------------------------------------------------------------------*/ // https://mathiasbynens.be/notes/javascript-escapes#single var singleEscapes = { '"': '\\"', '\'': '\\\'', '\\': '\\\\', '\b': '\\b', '\f': '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t' // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'. // '\v': '\\x0B' }; var regexSingleEscape = /["'\\\b\f\n\r\t]/; var regexDigit = /[0-9]/; var regexWhitelist = /[ !#-&\(-\[\]-~]/; var jsesc = function (argument, options) { // Handle options var defaults = { 'escapeEverything': false, 'escapeEtago': false, 'quotes': 'single', 'wrap': false, 'es6': false, 'json': false, 'compact': true, 'lowercaseHex': false, 'numbers': 'decimal', 'indent': '\t', '__indent__': '', '__inline1__': false, '__inline2__': false }; var json = options && options.json; if (json) { defaults.quotes = 'double'; defaults.wrap = true; } options = extend(defaults, options); if (options.quotes != 'single' && options.quotes != 'double') { options.quotes = 'single'; } var quote = options.quotes == 'double' ? '"' : '\''; var compact = options.compact; var indent = options.indent; var lowercaseHex = options.lowercaseHex; var oldIndent = ''; var inline1 = options.__inline1__; var inline2 = options.__inline2__; var newLine = compact ? '' : '\n'; var result; var isEmpty = true; var useBinNumbers = options.numbers == 'binary'; var useOctNumbers = options.numbers == 'octal'; var useDecNumbers = options.numbers == 'decimal'; var useHexNumbers = options.numbers == 'hexadecimal'; if (json && argument && isFunction(argument.toJSON)) { argument = argument.toJSON(); } if (!isString(argument)) { if (isMap(argument)) { if (argument.size == 0) { return 'new Map()'; } if (!compact) { options.__inline1__ = true; } return 'new Map(' + jsesc(Array.from(argument), options) + ')'; } if (isSet(argument)) { if (argument.size == 0) { return 'new Set()'; } return 'new Set(' + jsesc(Array.from(argument), options) + ')'; } if (isArray(argument)) { result = []; options.wrap = true; if (inline1) { options.__inline1__ = false; options.__inline2__ = true; } else { oldIndent = options.__indent__; indent += oldIndent; options.__indent__ = indent; } forEach(argument, function (value) { isEmpty = false; if (inline2) { options.__inline2__ = false; } result.push((compact || inline2 ? '' : indent) + jsesc(value, options)); }); if (isEmpty) { return '[]'; } if (inline2) { return '[' + result.join(', ') + ']'; } return '[' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + ']'; } else if (isNumber(argument)) { if (json) { // Some number values (e.g. `Infinity`) cannot be represented in JSON. return JSON.stringify(argument); } if (useDecNumbers) { return String(argument); } if (useHexNumbers) { var tmp = argument.toString(16); if (!lowercaseHex) { tmp = tmp.toUpperCase(); } return '0x' + tmp; } if (useBinNumbers) { return '0b' + argument.toString(2); } if (useOctNumbers) { return '0o' + argument.toString(8); } } else if (!isObject(argument)) { if (json) { // For some values (e.g. `undefined`, `function` objects), // `JSON.stringify(value)` returns `undefined` (which isn’t valid // JSON) instead of `'null'`. return JSON.stringify(argument) || 'null'; } return String(argument); } else { // it’s an object result = []; options.wrap = true; oldIndent = options.__indent__; indent += oldIndent; options.__indent__ = indent; forOwn(argument, function (key, value) { isEmpty = false; result.push((compact ? '' : indent) + jsesc(key, options) + ':' + (compact ? '' : ' ') + jsesc(value, options)); }); if (isEmpty) { return '{}'; } return '{' + newLine + result.join(',' + newLine) + newLine + (compact ? '' : oldIndent) + '}'; } } var string = argument; // Loop over each code unit in the string and escape it var index = -1; var length = string.length; var first; var second; var codePoint; result = ''; while (++index < length) { var character = string.charAt(index); if (options.es6) { first = string.charCodeAt(index); if ( // check if it’s the start of a surrogate pair first >= 0xD800 && first <= 0xDBFF && // high surrogate length > index + 1 // there is a next code unit ) { second = string.charCodeAt(index + 1); if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; var hexadecimal = codePoint.toString(16); if (!lowercaseHex) { hexadecimal = hexadecimal.toUpperCase(); } result += '\\u{' + hexadecimal + '}'; index++; continue; } } } if (!options.escapeEverything) { if (regexWhitelist.test(character)) { // It’s a printable ASCII character that is not `"`, `'` or `\`, // so don’t escape it. result += character; continue; } if (character == '"') { result += quote == character ? '\\"' : character; continue; } if (character == '\'') { result += quote == character ? '\\\'' : character; continue; } } if (character == '\0' && !json && !regexDigit.test(string.charAt(index + 1))) { result += '\\0'; continue; } if (regexSingleEscape.test(character)) { // no need for a `hasOwnProperty` check here result += singleEscapes[character]; continue; } var charCode = character.charCodeAt(0); var hexadecimal = charCode.toString(16); if (!lowercaseHex) { hexadecimal = hexadecimal.toUpperCase(); } var longhand = hexadecimal.length > 2 || json; var escaped = '\\' + (longhand ? 'u' : 'x') + ('0000' + hexadecimal).slice(longhand ? -4 : -2); result += escaped; continue; } if (options.wrap) { result = quote + result + quote; } if (options.escapeEtago) { // https://mathiasbynens.be/notes/etago return result.replace(/<\/(script|style)/gi, '<\\/$1'); } return result; }; jsesc.version = '1.3.0'; /*--------------------------------------------------------------------------*/ // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if (typeof undefined == 'function' && typeof define.amd == 'object' && define.amd) { define(function () { return jsesc; }); } else if (freeExports && !freeExports.nodeType) { if (freeModule) { // in Node.js or RingoJS v0.8.0+ freeModule.exports = jsesc; } else { // in Narwhal or RingoJS v0.7.0- freeExports.jsesc = jsesc; } } else { // in Rhino or a web browser root.jsesc = jsesc; } })(exports); }); $__System.registerDynamic("55", ["11", "56"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.ArrayPattern = exports.ObjectPattern = exports.RestProperty = exports.SpreadProperty = exports.SpreadElement = undefined; exports.Identifier = Identifier; exports.RestElement = RestElement; exports.ObjectExpression = ObjectExpression; exports.ObjectMethod = ObjectMethod; exports.ObjectProperty = ObjectProperty; exports.ArrayExpression = ArrayExpression; exports.RegExpLiteral = RegExpLiteral; exports.BooleanLiteral = BooleanLiteral; exports.NullLiteral = NullLiteral; exports.NumericLiteral = NumericLiteral; exports.StringLiteral = StringLiteral; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); var _jsesc = $__require("56"); var _jsesc2 = _interopRequireDefault(_jsesc); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function Identifier(node) { if (node.variance) { if (node.variance === "plus") { this.token("+"); } else if (node.variance === "minus") { this.token("-"); } } this.word(node.name); } function RestElement(node) { this.token("..."); this.print(node.argument, node); } exports.SpreadElement = RestElement; exports.SpreadProperty = RestElement; exports.RestProperty = RestElement; 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("}"); } exports.ObjectPattern = ObjectExpression; function ObjectMethod(node) { this.printJoin(node.decorators, node); this._method(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("]"); } exports.ArrayPattern = ArrayExpression; 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, parent) { var raw = this.getPossibleRaw(node); if (!this.format.minified && raw != null) { this.token(raw); return; } var opts = { quotes: t.isJSX(parent) ? "double" : this.format.quotes, wrap: true }; if (this.format.jsonCompatibleStrings) { opts.json = true; } var val = (0, _jsesc2.default)(node.value, opts); return this.token(val); } }); $__System.registerDynamic("57", ["55"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.File = File; exports.Program = Program; exports.BlockStatement = BlockStatement; exports.Noop = Noop; exports.Directive = Directive; var _types = $__require("55"); Object.defineProperty(exports, "DirectiveLiteral", { enumerable: true, get: function get() { return _types.StringLiteral; } }); function File(node) { this.print(node.program, node); } function Program(node) { this.printInnerComments(node, false); this.printSequence(node.directives, node); if (node.directives && node.directives.length) this.newline(); this.printSequence(node.body, node); } function BlockStatement(node) { this.token("{"); this.printInnerComments(node); var hasDirectives = node.directives && node.directives.length; if (node.body.length || hasDirectives) { this.newline(); this.printSequence(node.directives, node, { indent: true }); if (hasDirectives) this.newline(); this.printSequence(node.body, node, { indent: true }); this.removeTrailingNewline(); this.source("end", node.loc); if (!this.endsWith("\n")) this.newline(); this.rightBrace(); } else { this.source("end", node.loc); this.token("}"); } } function Noop() {} function Directive(node) { this.print(node.value, node); this.semicolon(); } }); $__System.registerDynamic("58", ["17"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.JSXAttribute = JSXAttribute; exports.JSXIdentifier = JSXIdentifier; exports.JSXNamespacedName = JSXNamespacedName; exports.JSXMemberExpression = JSXMemberExpression; exports.JSXSpreadAttribute = JSXSpreadAttribute; exports.JSXExpressionContainer = JSXExpressionContainer; exports.JSXSpreadChild = JSXSpreadChild; exports.JSXText = JSXText; exports.JSXElement = JSXElement; exports.JSXOpeningElement = JSXOpeningElement; exports.JSXClosingElement = JSXClosingElement; exports.JSXEmptyExpression = JSXEmptyExpression; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function JSXAttribute(node) { this.print(node.name, node); if (node.value) { this.token("="); this.print(node.value, node); } } function JSXIdentifier(node) { this.word(node.name); } function JSXNamespacedName(node) { this.print(node.namespace, node); this.token(":"); this.print(node.name, node); } function JSXMemberExpression(node) { this.print(node.object, node); this.token("."); this.print(node.property, node); } function JSXSpreadAttribute(node) { this.token("{"); this.token("..."); this.print(node.argument, node); this.token("}"); } function JSXExpressionContainer(node) { this.token("{"); this.print(node.expression, node); this.token("}"); } function JSXSpreadChild(node) { this.token("{"); this.token("..."); this.print(node.expression, node); this.token("}"); } function JSXText(node) { this.token(node.value); } function JSXElement(node) { var open = node.openingElement; this.print(open, node); if (open.selfClosing) return; this.indent(); for (var _iterator = node.children, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 child = _ref; this.print(child, node); } this.dedent(); this.print(node.closingElement, node); } function spaceSeparator() { this.space(); } function JSXOpeningElement(node) { this.token("<"); this.print(node.name, node); if (node.attributes.length > 0) { this.space(); this.printJoin(node.attributes, node, { separator: spaceSeparator }); } if (node.selfClosing) { this.space(); this.token("/>"); } else { this.token(">"); } } function JSXClosingElement(node) { this.token(""); } function JSXEmptyExpression() {} }); $__System.registerDynamic("59", ["5a", "17", "5b", "38", "1d", "3d", "42", "43", "5c", "45", "4e", "46", "11", "47", "4f", "50", "51", "52", "53", "55", "54", "57", "58"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _assign = $__require("5a"); var _assign2 = _interopRequireDefault(_assign); var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _stringify = $__require("5b"); var _stringify2 = _interopRequireDefault(_stringify); var _weakSet = $__require("38"); var _weakSet2 = _interopRequireDefault(_weakSet); var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _find = $__require("3d"); var _find2 = _interopRequireDefault(_find); var _findLast = $__require("42"); var _findLast2 = _interopRequireDefault(_findLast); var _isInteger = $__require("43"); var _isInteger2 = _interopRequireDefault(_isInteger); var _repeat = $__require("5c"); var _repeat2 = _interopRequireDefault(_repeat); var _buffer = $__require("45"); var _buffer2 = _interopRequireDefault(_buffer); var _node = $__require("4e"); var n = _interopRequireWildcard(_node); var _whitespace = $__require("46"); var _whitespace2 = _interopRequireDefault(_whitespace); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var SCIENTIFIC_NOTATION = /e/i; var ZERO_DECIMAL_INTEGER = /\.0+$/; var NON_DECIMAL_LITERAL = /^0[box]/; var Printer = function () { function Printer(format, map, tokens) { (0, _classCallCheck3.default)(this, Printer); this.inForStatementInitCounter = 0; this._printStack = []; this._indent = 0; this._insideAux = false; this._printedCommentStarts = {}; this._parenPushNewlineState = null; this._printAuxAfterOnNextUserNode = false; this._printedComments = new _weakSet2.default(); this._endsWithInteger = false; this._endsWithWord = false; this.format = format || {}; this._buf = new _buffer2.default(map); this._whitespace = tokens.length > 0 ? new _whitespace2.default(tokens) : null; } Printer.prototype.generate = function generate(ast) { this.print(ast); this._maybeAddAuxComment(); return this._buf.get(); }; Printer.prototype.indent = function indent() { if (this.format.compact || this.format.concise) return; this._indent++; }; Printer.prototype.dedent = function dedent() { if (this.format.compact || this.format.concise) return; this._indent--; }; Printer.prototype.semicolon = function semicolon() { var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; this._maybeAddAuxComment(); this._append(";", !force); }; Printer.prototype.rightBrace = function rightBrace() { if (this.format.minified) { this._buf.removeLastSemicolon(); } this.token("}"); }; Printer.prototype.space = function space() { var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; if (this.format.compact) return; if (this._buf.hasContent() && !this.endsWith(" ") && !this.endsWith("\n") || force) { this._space(); } }; Printer.prototype.word = function word(str) { if (this._endsWithWord) this._space(); this._maybeAddAuxComment(); this._append(str); this._endsWithWord = true; }; Printer.prototype.number = function number(str) { this.word(str); this._endsWithInteger = (0, _isInteger2.default)(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str[str.length - 1] !== "."; }; Printer.prototype.token = function token(str) { if (str === "--" && this.endsWith("!") || str[0] === "+" && this.endsWith("+") || str[0] === "-" && this.endsWith("-") || str[0] === "." && this._endsWithInteger) { this._space(); } this._maybeAddAuxComment(); this._append(str); }; Printer.prototype.newline = function newline(i) { if (this.format.retainLines || this.format.compact) return; if (this.format.concise) { this.space(); return; } if (this.endsWith("\n\n")) return; if (typeof i !== "number") i = 1; i = Math.min(2, i); if (this.endsWith("{\n") || this.endsWith(":\n")) i--; if (i <= 0) return; for (var j = 0; j < i; j++) { this._newline(); } }; Printer.prototype.endsWith = function endsWith(str) { return this._buf.endsWith(str); }; Printer.prototype.removeTrailingNewline = function removeTrailingNewline() { this._buf.removeTrailingNewline(); }; Printer.prototype.source = function source(prop, loc) { this._catchUp(prop, loc); this._buf.source(prop, loc); }; Printer.prototype.withSource = function withSource(prop, loc, cb) { this._catchUp(prop, loc); this._buf.withSource(prop, loc, cb); }; Printer.prototype._space = function _space() { this._append(" ", true); }; Printer.prototype._newline = function _newline() { this._append("\n", true); }; Printer.prototype._append = function _append(str) { var queue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; this._maybeAddParen(str); this._maybeIndent(str); if (queue) this._buf.queue(str);else this._buf.append(str); this._endsWithWord = false; this._endsWithInteger = false; }; Printer.prototype._maybeIndent = function _maybeIndent(str) { if (this._indent && this.endsWith("\n") && str[0] !== "\n") { this._buf.queue(this._getIndent()); } }; Printer.prototype._maybeAddParen = function _maybeAddParen(str) { var parenPushNewlineState = this._parenPushNewlineState; if (!parenPushNewlineState) return; this._parenPushNewlineState = null; var i = void 0; for (i = 0; i < str.length && str[i] === " "; i++) { continue; }if (i === str.length) return; var cha = str[i]; if (cha === "\n" || cha === "/") { this.token("("); this.indent(); parenPushNewlineState.printed = true; } }; Printer.prototype._catchUp = function _catchUp(prop, loc) { if (!this.format.retainLines) return; var pos = loc ? loc[prop] : null; if (pos && pos.line !== null) { var count = pos.line - this._buf.getCurrentLine(); for (var i = 0; i < count; i++) { this._newline(); } } }; Printer.prototype._getIndent = function _getIndent() { return (0, _repeat2.default)(this.format.indent.style, this._indent); }; Printer.prototype.startTerminatorless = function startTerminatorless() { return this._parenPushNewlineState = { printed: false }; }; Printer.prototype.endTerminatorless = function endTerminatorless(state) { if (state.printed) { this.dedent(); this.newline(); this.token(")"); } }; Printer.prototype.print = function print(node, parent) { var _this = this; if (!node) return; var oldConcise = this.format.concise; if (node._compact) { this.format.concise = true; } var printMethod = this[node.type]; if (!printMethod) { throw new ReferenceError("unknown node of type " + (0, _stringify2.default)(node.type) + " with constructor " + (0, _stringify2.default)(node && node.constructor.name)); } this._printStack.push(node); var oldInAux = this._insideAux; this._insideAux = !node.loc; this._maybeAddAuxComment(this._insideAux && !oldInAux); var needsParens = n.needsParens(node, parent, this._printStack); if (this.format.retainFunctionParens && node.type === "FunctionExpression" && node.extra && node.extra.parenthesized) { needsParens = true; } if (needsParens) this.token("("); this._printLeadingComments(node, parent); var loc = t.isProgram(node) || t.isFile(node) ? null : node.loc; this.withSource("start", loc, function () { _this[node.type](node, parent); }); this._printTrailingComments(node, parent); if (needsParens) this.token(")"); this._printStack.pop(); this.format.concise = oldConcise; this._insideAux = oldInAux; }; Printer.prototype._maybeAddAuxComment = function _maybeAddAuxComment(enteredPositionlessNode) { if (enteredPositionlessNode) this._printAuxBeforeComment(); if (!this._insideAux) this._printAuxAfterComment(); }; Printer.prototype._printAuxBeforeComment = function _printAuxBeforeComment() { if (this._printAuxAfterOnNextUserNode) return; this._printAuxAfterOnNextUserNode = true; var comment = this.format.auxiliaryCommentBefore; if (comment) { this._printComment({ type: "CommentBlock", value: comment }); } }; Printer.prototype._printAuxAfterComment = function _printAuxAfterComment() { if (!this._printAuxAfterOnNextUserNode) return; this._printAuxAfterOnNextUserNode = false; var comment = this.format.auxiliaryCommentAfter; if (comment) { this._printComment({ type: "CommentBlock", value: comment }); } }; Printer.prototype.getPossibleRaw = function getPossibleRaw(node) { var extra = node.extra; if (extra && extra.raw != null && extra.rawValue != null && node.value === extra.rawValue) { return extra.raw; } }; Printer.prototype.printJoin = function printJoin(nodes, parent) { var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; if (!nodes || !nodes.length) return; if (opts.indent) this.indent(); var newlineOpts = { addNewlines: opts.addNewlines }; for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; if (!node) continue; if (opts.statement) this._printNewline(true, node, parent, newlineOpts); this.print(node, parent); if (opts.iterator) { opts.iterator(node, i); } if (opts.separator && i < nodes.length - 1) { opts.separator.call(this); } if (opts.statement) this._printNewline(false, node, parent, newlineOpts); } if (opts.indent) this.dedent(); }; Printer.prototype.printAndIndentOnComments = function printAndIndentOnComments(node, parent) { var indent = !!node.leadingComments; if (indent) this.indent(); this.print(node, parent); if (indent) this.dedent(); }; Printer.prototype.printBlock = function printBlock(parent) { var node = parent.body; if (!t.isEmptyStatement(node)) { this.space(); } this.print(node, parent); }; Printer.prototype._printTrailingComments = function _printTrailingComments(node, parent) { this._printComments(this._getComments(false, node, parent)); }; Printer.prototype._printLeadingComments = function _printLeadingComments(node, parent) { this._printComments(this._getComments(true, node, parent)); }; Printer.prototype.printInnerComments = function printInnerComments(node) { var indent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; if (!node.innerComments) return; if (indent) this.indent(); this._printComments(node.innerComments); if (indent) this.dedent(); }; Printer.prototype.printSequence = function printSequence(nodes, parent) { var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; opts.statement = true; return this.printJoin(nodes, parent, opts); }; Printer.prototype.printList = function printList(items, parent) { var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; if (opts.separator == null) { opts.separator = commaSeparator; } return this.printJoin(items, parent, opts); }; Printer.prototype._printNewline = function _printNewline(leading, node, parent, opts) { var _this2 = this; if (this.format.retainLines || this.format.compact) return; if (this.format.concise) { this.space(); return; } var lines = 0; if (node.start != null && !node._ignoreUserWhitespace && this._whitespace) { if (leading) { var _comments = node.leadingComments; var _comment = _comments && (0, _find2.default)(_comments, function (comment) { return !!comment.loc && _this2.format.shouldPrintComment(comment.value); }); lines = this._whitespace.getNewlinesBefore(_comment || node); } else { var _comments2 = node.trailingComments; var _comment2 = _comments2 && (0, _findLast2.default)(_comments2, function (comment) { return !!comment.loc && _this2.format.shouldPrintComment(comment.value); }); lines = this._whitespace.getNewlinesAfter(_comment2 || node); } } else { if (!leading) lines++; if (opts.addNewlines) lines += opts.addNewlines(leading, node) || 0; var needs = n.needsWhitespaceAfter; if (leading) needs = n.needsWhitespaceBefore; if (needs(node, parent)) lines++; if (!this._buf.hasContent()) lines = 0; } this.newline(lines); }; Printer.prototype._getComments = function _getComments(leading, node) { return node && (leading ? node.leadingComments : node.trailingComments) || []; }; Printer.prototype._printComment = function _printComment(comment) { var _this3 = this; if (!this.format.shouldPrintComment(comment.value)) return; if (comment.ignore) return; if (this._printedComments.has(comment)) return; this._printedComments.add(comment); if (comment.start != null) { if (this._printedCommentStarts[comment.start]) return; this._printedCommentStarts[comment.start] = true; } this.newline(this._whitespace ? this._whitespace.getNewlinesBefore(comment) : 0); if (!this.endsWith("[") && !this.endsWith("{")) this.space(); var val = comment.type === "CommentLine" ? "//" + comment.value + "\n" : "/*" + comment.value + "*/"; if (comment.type === "CommentBlock" && this.format.indent.adjustMultilineComment) { var offset = comment.loc && comment.loc.start.column; if (offset) { var newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g"); val = val.replace(newlineRegex, "\n"); } var indentSize = Math.max(this._getIndent().length, this._buf.getCurrentColumn()); val = val.replace(/\n(?!$)/g, "\n" + (0, _repeat2.default)(" ", indentSize)); } this.withSource("start", comment.loc, function () { _this3._append(val); }); this.newline((this._whitespace ? this._whitespace.getNewlinesAfter(comment) : 0) + (comment.type === "CommentLine" ? -1 : 0)); }; Printer.prototype._printComments = function _printComments(comments) { if (!comments || !comments.length) return; for (var _iterator = comments, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 _comment3 = _ref; this._printComment(_comment3); } }; return Printer; }(); exports.default = Printer; function commaSeparator() { this.token(","); this.space(); } var _arr = [$__require("47"), $__require("4f"), $__require("50"), $__require("51"), $__require("52"), $__require("53"), $__require("55"), $__require("54"), $__require("57"), $__require("58")]; for (var _i2 = 0; _i2 < _arr.length; _i2++) { var generator = _arr[_i2]; (0, _assign2.default)(Printer.prototype, generator); } module.exports = exports["default"]; }); $__System.registerDynamic("e", ["1d", "1e", "1f", "23", "2f", "f", "59"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.CodeGenerator = undefined; var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _possibleConstructorReturn2 = $__require("1e"); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = $__require("1f"); var _inherits3 = _interopRequireDefault(_inherits2); exports.default = function (ast, opts, code) { var gen = new Generator(ast, opts, code); return gen.generate(); }; var _detectIndent = $__require("23"); var _detectIndent2 = _interopRequireDefault(_detectIndent); var _sourceMap = $__require("2f"); var _sourceMap2 = _interopRequireDefault(_sourceMap); var _babelMessages = $__require("f"); var messages = _interopRequireWildcard(_babelMessages); var _printer = $__require("59"); var _printer2 = _interopRequireDefault(_printer); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Generator = function (_Printer) { (0, _inherits3.default)(Generator, _Printer); function Generator(ast) { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var code = arguments[2]; (0, _classCallCheck3.default)(this, Generator); var tokens = ast.tokens || []; var format = normalizeOptions(code, opts, tokens); var map = opts.sourceMaps ? new _sourceMap2.default(opts, code) : null; var _this = (0, _possibleConstructorReturn3.default)(this, _Printer.call(this, format, map, tokens)); _this.ast = ast; return _this; } Generator.prototype.generate = function generate() { return _Printer.prototype.generate.call(this, this.ast); }; return Generator; }(_printer2.default); function normalizeOptions(code, opts, tokens) { var style = " "; if (code && typeof code === "string") { var indent = (0, _detectIndent2.default)(code).indent; if (indent && indent !== " ") style = indent; } 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, quotes: opts.quotes || findCommonStringDelimiter(code, tokens), jsonCompatibleStrings: opts.jsonCompatibleStrings, indent: { adjustMultilineComment: true, style: style, base: 0 }, flowCommaSeparator: opts.flowCommaSeparator }; 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] " + messages.get("codeGeneratorDeopt", opts.filename, "500KB")); } } if (format.compact) { format.indent.adjustMultilineComment = false; } return format; } function findCommonStringDelimiter(code, tokens) { var DEFAULT_STRING_DELIMITER = "double"; if (!code) { return DEFAULT_STRING_DELIMITER; } var occurrences = { single: 0, double: 0 }; var checked = 0; for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; if (token.type.label !== "string") continue; var raw = code.slice(token.start, token.end); if (raw[0] === "'") { occurrences.single++; } else { occurrences.double++; } checked++; if (checked >= 3) break; } if (occurrences.single > occurrences.double) { return "single"; } else { return "double"; } } var CodeGenerator = exports.CodeGenerator = function () { function CodeGenerator(ast, opts, code) { (0, _classCallCheck3.default)(this, CodeGenerator); this._generator = new Generator(ast, opts, code); } CodeGenerator.prototype.generate = function generate() { return this._generator.generate(); }; return CodeGenerator; }(); }); $__System.registerDynamic('5d', ['5e'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; module.exports = $__require('5e'); }); $__System.registerDynamic("5f", ["1d", "5d", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _node = $__require("5d"); var _node2 = _interopRequireDefault(_node); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var verboseDebug = (0, _node2.default)("babel:verbose"); var generalDebug = (0, _node2.default)("babel"); var seenDeprecatedMessages = []; var Logger = function () { function Logger(file, filename) { (0, _classCallCheck3.default)(this, Logger); this.filename = filename; this.file = file; } Logger.prototype._buildMessage = function _buildMessage(msg) { var parts = "[BABEL] " + this.filename; if (msg) parts += ": " + msg; return parts; }; Logger.prototype.warn = function warn(msg) { console.warn(this._buildMessage(msg)); }; Logger.prototype.error = function error(msg) { var Constructor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Error; throw new Constructor(this._buildMessage(msg)); }; Logger.prototype.deprecate = function deprecate(msg) { if (this.file.opts && this.file.opts.suppressDeprecationMessages) return; msg = this._buildMessage(msg); if (seenDeprecatedMessages.indexOf(msg) >= 0) return; seenDeprecatedMessages.push(msg); console.error(msg); }; Logger.prototype.verbose = function verbose(msg) { if (verboseDebug.enabled) verboseDebug(this._buildMessage(msg)); }; Logger.prototype.debug = function debug(msg) { if (generalDebug.enabled) generalDebug(this._buildMessage(msg)); }; Logger.prototype.deopt = function deopt(node, msg) { this.debug(msg); }; return Logger; }(); exports.default = Logger; module.exports = exports["default"]; }); $__System.registerDynamic('60', ['61', '62', '4b'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var Symbol = $__require('61'), isArguments = $__require('62'), isArray = $__require('4b'); /** Built-in value references. */ var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; /** * Checks if `value` is a flattenable `arguments` object or array. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } module.exports = isFlattenable; }); $__System.registerDynamic('63', ['64', '60'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var arrayPush = $__require('64'), isFlattenable = $__require('60'); /** * The base implementation of `_.flatten` with support for restricting flattening. * * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; predicate || (predicate = isFlattenable); result || (result = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } } else if (!isStrict) { result[result.length] = value; } } return result; } module.exports = baseFlatten; }); $__System.registerDynamic('65', ['66', '67'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var Stack = $__require('66'), baseIsEqual = $__require('67'); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** * The base implementation of `_.isMatch` without support for iteratee shorthands. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Array} matchData The property names, values, and compare flags to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = Object(object); while (index--) { var data = matchData[index]; if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { return false; } } else { var stack = new Stack(); if (customizer) { var result = customizer(objValue, srcValue, key, object, source, stack); } if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) { return false; } } } return true; } module.exports = baseIsMatch; }); $__System.registerDynamic('68', ['69', '40'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var isStrictComparable = $__require('69'), keys = $__require('40'); /** * Gets the property names, values, and compare flags of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the match data of `object`. */ function getMatchData(object) { var result = keys(object), length = result.length; while (length--) { var key = result[length], value = object[key]; result[length] = [key, value, isStrictComparable(value)]; } return result; } module.exports = getMatchData; }); $__System.registerDynamic('6a', ['65', '68', '6b'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseIsMatch = $__require('65'), getMatchData = $__require('68'), matchesStrictComparable = $__require('6b'); /** * The base implementation of `_.matches` which doesn't clone `source`. * * @private * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function (object) { return object === source || baseIsMatch(object, source, matchData); }; } module.exports = baseMatches; }); $__System.registerDynamic("6c", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } module.exports = arraySome; }); $__System.registerDynamic('6d', ['6e', '6c', '6f'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var SetCache = $__require('6e'), arraySome = $__require('6c'), cacheHas = $__require('6f'); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** * A specialized version of `baseIsEqualDeep` for arrays with support for * partial deep comparisons. * * @private * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } // Assume cyclic values are equal. var stacked = stack.get(array); if (stacked && stack.get(other)) { return stacked == other; } var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined; stack.set(array, other); stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], othValue = other[index]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } if (compared !== undefined) { if (compared) { continue; } result = false; break; } // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!arraySome(other, function (othValue, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result = false; break; } } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { result = false; break; } } stack['delete'](array); stack['delete'](other); return result; } module.exports = equalArrays; }); $__System.registerDynamic('70', ['61', '71', '72', '6d', '73', '74'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var Symbol = $__require('61'), Uint8Array = $__require('71'), eq = $__require('72'), equalArrays = $__require('6d'), mapToArray = $__require('73'), setToArray = $__require('74'); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** `Object#toString` result references. */ var boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', mapTag = '[object Map]', numberTag = '[object Number]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]'; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; /** * A specialized version of `baseIsEqualDeep` for comparing objects of * the same `toStringTag`. * * **Note:** This function only supports comparing values with tags of * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag: if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: // Coerce booleans to `1` or `0` and dates to milliseconds. // Invalid dates are coerced to `NaN`. return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. return object == other + ''; case mapTag: var convert = mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG; convert || (convert = setToArray); if (object.size != other.size && !isPartial) { return false; } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG; // Recursively compare objects (susceptible to call stack limits). stack.set(object, other); var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); stack['delete'](object); return result; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object) == symbolValueOf.call(other); } } return false; } module.exports = equalByTag; }); $__System.registerDynamic('75', ['76'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var getAllKeys = $__require('76'); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * A specialized version of `baseIsEqualDeep` for objects with support for * partial deep comparisons. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked && stack.get(other)) { return stacked == other; } var result = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } // Recursively compare objects (susceptible to call stack limits). if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { result = false; break; } skipCtor || (skipCtor = key == 'constructor'); } if (result && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal. if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { result = false; } } stack['delete'](object); stack['delete'](other); return result; } module.exports = equalObjects; }); $__System.registerDynamic('77', ['66', '6d', '70', '75', '78', '4b', '79', '7a'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var Stack = $__require('66'), equalArrays = $__require('6d'), equalByTag = $__require('70'), equalObjects = $__require('75'), getTag = $__require('78'), isArray = $__require('4b'), isBuffer = $__require('79'), isTypedArray = $__require('7a'); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', objectTag = '[object Object]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * A specialized version of `baseIsEqual` for arrays and objects which performs * deep comparisons and tracks traversed objects enabling objects with circular * references to be compared. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack()); return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack()); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack()); return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } module.exports = baseIsEqualDeep; }); $__System.registerDynamic('67', ['77', '7b'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseIsEqualDeep = $__require('77'), isObjectLike = $__require('7b'); /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {boolean} bitmask The bitmask flags. * 1 - Unordered comparison * 2 - Partial comparison * @param {Function} [customizer] The function to customize comparisons. * @param {Object} [stack] Tracks traversed `value` and `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } module.exports = baseIsEqual; }); $__System.registerDynamic('7c', ['7d'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseGet = $__require('7d'); /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } module.exports = get; }); $__System.registerDynamic("7e", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * The base implementation of `_.hasIn` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHasIn(object, key) { return object != null && key in Object(object); } module.exports = baseHasIn; }); $__System.registerDynamic('7f', ['7e', '80'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseHasIn = $__require('7e'), hasPath = $__require('80'); /** * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * * _.hasIn(object, 'a.b'); * // => true * * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */ function hasIn(object, path) { return object != null && hasPath(object, path, baseHasIn); } module.exports = hasIn; }); $__System.registerDynamic('69', ['81'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var isObject = $__require('81'); /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` if suitable for strict * equality comparisons, else `false`. */ function isStrictComparable(value) { return value === value && !isObject(value); } module.exports = isStrictComparable; }); $__System.registerDynamic("6b", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * A specialized version of `matchesProperty` for source values suitable * for strict equality comparisons, i.e. `===`. * * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { return function (object) { if (object == null) { return false; } return object[key] === srcValue && (srcValue !== undefined || key in Object(object)); }; } module.exports = matchesStrictComparable; }); $__System.registerDynamic('82', ['67', '7c', '7f', '83', '69', '6b', '84'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseIsEqual = $__require('67'), get = $__require('7c'), hasIn = $__require('7f'), isKey = $__require('83'), isStrictComparable = $__require('69'), matchesStrictComparable = $__require('6b'), toKey = $__require('84'); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function baseMatchesProperty(path, srcValue) { if (isKey(path) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path), srcValue); } return function (object) { var objValue = get(object, path); return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } module.exports = baseMatchesProperty; }); $__System.registerDynamic("85", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function (object) { return object == null ? undefined : object[key]; }; } module.exports = baseProperty; }); $__System.registerDynamic('7d', ['86', '84'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var castPath = $__require('86'), toKey = $__require('84'); /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return index && index == length ? object : undefined; } module.exports = baseGet; }); $__System.registerDynamic('87', ['7d'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseGet = $__require('7d'); /** * A specialized version of `baseProperty` which supports deep paths. * * @private * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { return function (object) { return baseGet(object, path); }; } module.exports = basePropertyDeep; }); $__System.registerDynamic('88', ['85', '87', '83', '84'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseProperty = $__require('85'), basePropertyDeep = $__require('87'), isKey = $__require('83'), toKey = $__require('84'); /** * Creates a function that returns the value at `path` of a given object. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. * @example * * var objects = [ * { 'a': { 'b': 2 } }, * { 'a': { 'b': 1 } } * ]; * * _.map(objects, _.property('a.b')); * // => [2, 1] * * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); * // => [1, 2] */ function property(path) { return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); } module.exports = property; }); $__System.registerDynamic('3b', ['6a', '82', '89', '4b', '88'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseMatches = $__require('6a'), baseMatchesProperty = $__require('82'), identity = $__require('89'), isArray = $__require('4b'), property = $__require('88'); /** * The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. if (typeof value == 'function') { return value; } if (value == null) { return identity; } if (typeof value == 'object') { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } module.exports = baseIteratee; }); $__System.registerDynamic('8a', ['8b', '40'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseFor = $__require('8b'), keys = $__require('40'); /** * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { return object && baseFor(object, iteratee, keys); } module.exports = baseForOwn; }); $__System.registerDynamic('8c', ['3f'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var isArrayLike = $__require('3f'); /** * Creates a `baseEach` or `baseEachRight` function. * * @private * @param {Function} eachFunc The function to iterate over a collection. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { return function (collection, iteratee) { if (collection == null) { return collection; } if (!isArrayLike(collection)) { return eachFunc(collection, iteratee); } var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); while (fromRight ? index-- : ++index < length) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } module.exports = createBaseEach; }); $__System.registerDynamic('8d', ['8a', '8c'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseForOwn = $__require('8a'), createBaseEach = $__require('8c'); /** * The base implementation of `_.forEach` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEach = createBaseEach(baseForOwn); module.exports = baseEach; }); $__System.registerDynamic('4a', ['8d', '3f'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseEach = $__require('8d'), isArrayLike = $__require('3f'); /** * The base implementation of `_.map` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { var index = -1, result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function (value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; } module.exports = baseMap; }); $__System.registerDynamic("8e", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * The base implementation of `_.sortBy` which uses `comparer` to define the * sort order of `array` and replaces criteria objects with their corresponding * values. * * @private * @param {Array} array The array to sort. * @param {Function} comparer The function to define sort order. * @returns {Array} Returns `array`. */ function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } module.exports = baseSortBy; }); $__System.registerDynamic('8f', ['90'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var isSymbol = $__require('90'); /** * Compares values to sort them in ascending order. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {number} Returns the sort order indicator for `value`. */ function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) { return 1; } if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { return -1; } } return 0; } module.exports = compareAscending; }); $__System.registerDynamic('91', ['8f'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var compareAscending = $__require('8f'); /** * Used by `_.orderBy` to compare multiple properties of a value to another * and stable sort them. * * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, * specify an order of "desc" for descending or "asc" for ascending sort order * of corresponding values. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {boolean[]|string[]} orders The order to sort by for each property. * @returns {number} Returns the sort order indicator for `object`. */ function compareMultiple(object, other, orders) { var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index < length) { var result = compareAscending(objCriteria[index], othCriteria[index]); if (result) { if (index >= ordersLength) { return result; } var order = orders[index]; return result * (order == 'desc' ? -1 : 1); } } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications // that causes it, under certain circumstances, to provide the same value for // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 // for more details. // // This also ensures a stable sort in V8 and other engines. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. return object.index - other.index; } module.exports = compareMultiple; }); $__System.registerDynamic('92', ['49', '3b', '4a', '8e', '93', '91', '89'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var arrayMap = $__require('49'), baseIteratee = $__require('3b'), baseMap = $__require('4a'), baseSortBy = $__require('8e'), baseUnary = $__require('93'), compareMultiple = $__require('91'), identity = $__require('89'); /** * The base implementation of `_.orderBy` without param guards. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. * @param {string[]} orders The sort orders of `iteratees`. * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { var index = -1; iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee)); var result = baseMap(collection, function (value, key, collection) { var criteria = arrayMap(iteratees, function (iteratee) { return iteratee(value); }); return { 'criteria': criteria, 'index': ++index, 'value': value }; }); return baseSortBy(result, function (object, other) { return compareMultiple(object, other, orders); }); } module.exports = baseOrderBy; }); $__System.registerDynamic('94', ['63', '92', '95', '96'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseFlatten = $__require('63'), baseOrderBy = $__require('92'), baseRest = $__require('95'), isIterateeCall = $__require('96'); /** * Creates an array of elements, sorted in ascending order by the results of * running each element in a collection thru each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {...(Function|Function[])} [iteratees=[_.identity]] * The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, [function(o) { return o.user; }]); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] * * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] */ var sortBy = baseRest(function (collection, iteratees) { if (collection == null) { return []; } var length = iteratees.length; if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); module.exports = sortBy; }); $__System.registerDynamic("97", ["98", "94", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _plugin = $__require("98"); var _plugin2 = _interopRequireDefault(_plugin); var _sortBy = $__require("94"); var _sortBy2 = _interopRequireDefault(_sortBy); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = new _plugin2.default({ name: "internal.blockHoist", visitor: { Block: { exit: function exit(_ref) { var node = _ref.node; var hasChange = false; for (var i = 0; i < node.body.length; i++) { var bodyNode = node.body[i]; if (bodyNode && bodyNode._blockHoist != null) { hasChange = true; break; } } if (!hasChange) return; node.body = (0, _sortBy2.default)(node.body, function (bodyNode) { var priority = bodyNode && bodyNode._blockHoist; if (priority == null) priority = 1; if (priority === true) priority = 2; return -1 * priority; }); } } } }); module.exports = exports["default"]; }); $__System.registerDynamic("99", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }; }); $__System.registerDynamic('9a', ['9b'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var toString = $__require('9b'); /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); /** * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escapeRegExp('[lodash](https://lodash.com/)'); * // => '\[lodash\]\(https://lodash\.com/\)' */ function escapeRegExp(string) { string = toString(string); return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, '\\$&') : string; } module.exports = escapeRegExp; }); $__System.registerDynamic("9c", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * The base implementation of `_.clamp` which doesn't coerce arguments. * * @private * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. */ function baseClamp(number, lower, upper) { if (number === number) { if (upper !== undefined) { number = number <= upper ? number : upper; } if (lower !== undefined) { number = number >= lower ? number : lower; } } return number; } module.exports = baseClamp; }); $__System.registerDynamic('9d', ['9c', '9e', '3c', '9b'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseClamp = $__require('9c'), baseToString = $__require('9e'), toInteger = $__require('3c'), toString = $__require('9b'); /** * Checks if `string` starts with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. * @returns {boolean} Returns `true` if `string` starts with `target`, * else `false`. * @example * * _.startsWith('abc', 'a'); * // => true * * _.startsWith('abc', 'b'); * // => false * * _.startsWith('abc', 'b', 1); * // => true */ function startsWith(string, target, position) { string = toString(string); position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); target = baseToString(target); return string.slice(position, position + target.length) == target; } module.exports = startsWith; }); $__System.registerDynamic('9f', [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; module.exports = function (xs, fn) { var res = []; for (var i = 0; i < xs.length; i++) { var x = fn(xs[i], i); if (isArray(x)) res.push.apply(res, x);else res.push(x); } return res; }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; }); $__System.registerDynamic('a0', [], true, function ($__require, exports, module) { 'use strict'; var global = this || self, GLOBAL = global; module.exports = balanced; function balanced(a, b, str) { if (a instanceof RegExp) a = maybeMatch(a, str); if (b instanceof RegExp) b = maybeMatch(b, str); var r = range(a, b, str); return r && { start: r[0], end: r[1], pre: str.slice(0, r[0]), body: str.slice(r[0] + a.length, r[1]), post: str.slice(r[1] + b.length) }; } function maybeMatch(reg, str) { var m = str.match(reg); return m ? m[0] : null; } balanced.range = range; function range(a, b, str) { var begs, beg, left, right, result; var ai = str.indexOf(a); var bi = str.indexOf(b, ai + 1); var i = ai; if (ai >= 0 && bi > 0) { begs = []; left = str.length; while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); } else if (begs.length == 1) { result = [begs.pop(), bi]; } else { beg = begs.pop(); if (beg < left) { left = beg; right = bi; } bi = str.indexOf(b, i + 1); } i = ai < bi && ai >= 0 ? ai : bi; } if (begs.length) { result = [left, right]; } } return result; } }); $__System.registerDynamic('a1', ['9f', 'a0'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var concatMap = $__require('9f'); var balanced = $__require('a0'); module.exports = expandTop; var escSlash = '\0SLASH' + Math.random() + '\0'; var escOpen = '\0OPEN' + Math.random() + '\0'; var escClose = '\0CLOSE' + Math.random() + '\0'; var escComma = '\0COMMA' + Math.random() + '\0'; var escPeriod = '\0PERIOD' + Math.random() + '\0'; function numeric(str) { return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); } function escapeBraces(str) { return str.split('\\\\').join(escSlash).split('\\{').join(escOpen).split('\\}').join(escClose).split('\\,').join(escComma).split('\\.').join(escPeriod); } function unescapeBraces(str) { return str.split(escSlash).join('\\').split(escOpen).join('{').split(escClose).join('}').split(escComma).join(',').split(escPeriod).join('.'); } // Basically just str.split(","), but handling cases // where we have nested braced sections, which should be // treated as individual members, like {a,{b,c},d} function parseCommaParts(str) { if (!str) return ['']; var parts = []; var m = balanced('{', '}', str); if (!m) return str.split(','); var pre = m.pre; var body = m.body; var post = m.post; var p = pre.split(','); p[p.length - 1] += '{' + body + '}'; var postParts = parseCommaParts(post); if (post.length) { p[p.length - 1] += postParts.shift(); p.push.apply(p, postParts); } parts.push.apply(parts, p); return parts; } function expandTop(str) { if (!str) return []; // I don't know why Bash 4.3 does this, but it does. // Anything starting with {} will have the first two bytes preserved // but *only* at the top level, so {},a}b will not expand to anything, // but a{},b}c will be expanded to [a}c,abc]. // One could argue that this is a bug in Bash, but since the goal of // this module is to match Bash's rules, we escape a leading {} if (str.substr(0, 2) === '{}') { str = '\\{\\}' + str.substr(2); } return expand(escapeBraces(str), true).map(unescapeBraces); } function identity(e) { return e; } function embrace(str) { return '{' + str + '}'; } function isPadded(el) { return (/^-?0\d/.test(el) ); } function lte(i, y) { return i <= y; } function gte(i, y) { return i >= y; } function expand(str, isTop) { var expansions = []; var m = balanced('{', '}', str); if (!m || /\$$/.test(m.pre)) return [str]; var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); var isSequence = isNumericSequence || isAlphaSequence; var isOptions = m.body.indexOf(',') >= 0; if (!isSequence && !isOptions) { // {a},b} if (m.post.match(/,.*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; return expand(str); } return [str]; } var n; if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); if (n.length === 1) { // x{{a,b}}y ==> x{a}y x{b}y n = expand(n[0], false).map(embrace); if (n.length === 1) { var post = m.post.length ? expand(m.post, false) : ['']; return post.map(function (p) { return m.pre + n[0] + p; }); } } } // at this point, n is the parts, and we know it's not a comma set // with a single entry. // no need to expand pre, since it is guaranteed to be free of brace-sets var pre = m.pre; var post = m.post.length ? expand(m.post, false) : ['']; var N; if (isSequence) { var x = numeric(n[0]); var y = numeric(n[1]); var width = Math.max(n[0].length, n[1].length); var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; var test = lte; var reverse = y < x; if (reverse) { incr *= -1; test = gte; } var pad = n.some(isPadded); N = []; for (var i = x; test(i, y); i += incr) { var c; if (isAlphaSequence) { c = String.fromCharCode(i); if (c === '\\') c = ''; } else { c = String(i); if (pad) { var need = width - c.length; if (need > 0) { var z = new Array(need + 1).join('0'); if (i < 0) c = '-' + z + c.slice(1);else c = z + c; } } } N.push(c); } } else { N = concatMap(n, function (el) { return expand(el, false); }); } for (var j = 0; j < N.length; j++) { for (var k = 0; k < post.length; k++) { var expansion = pre + N[j] + post[k]; if (!isTop || isSequence || expansion) expansions.push(expansion); } } return expansions; } }); $__System.registerDynamic('a2', ['@node/path', 'a1'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; module.exports = minimatch; minimatch.Minimatch = Minimatch; var path = { sep: '/' }; try { path = $__require('@node/path'); } catch (er) {} var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; var expand = $__require('a1'); var plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)' }, '?': { open: '(?:', close: ')?' }, '+': { open: '(?:', close: ')+' }, '*': { open: '(?:', close: ')*' }, '@': { open: '(?:', close: ')' } }; // any single thing other than / // don't need to escape / when using new RegExp() var qmark = '[^/]'; // * => any number of characters var star = qmark + '*?'; // ** when dots are allowed. Anything goes, except .. and . // not (^ or / followed by one or two dots followed by $ or /), // followed by anything, any number of times. var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'; // not a ^ or / followed by a dot, // followed by anything, any number of times. var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'; // characters that need to be escaped in RegExp. var reSpecials = charSet('().*{}+?[]^$\\!'); // "abc" -> { a:true, b:true, c:true } function charSet(s) { return s.split('').reduce(function (set, c) { set[c] = true; return set; }, {}); } // normalizes slashes. var slashSplit = /\/+/; minimatch.filter = filter; function filter(pattern, options) { options = options || {}; return function (p, i, list) { return minimatch(p, pattern, options); }; } function ext(a, b) { a = a || {}; b = b || {}; var t = {}; Object.keys(b).forEach(function (k) { t[k] = b[k]; }); Object.keys(a).forEach(function (k) { t[k] = a[k]; }); return t; } minimatch.defaults = function (def) { if (!def || !Object.keys(def).length) return minimatch; var orig = minimatch; var m = function minimatch(p, pattern, options) { return orig.minimatch(p, pattern, ext(def, options)); }; m.Minimatch = function Minimatch(pattern, options) { return new orig.Minimatch(pattern, ext(def, options)); }; return m; }; Minimatch.defaults = function (def) { if (!def || !Object.keys(def).length) return Minimatch; return minimatch.defaults(def).Minimatch; }; function minimatch(p, pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('glob pattern string required'); } if (!options) options = {}; // shortcut: comments match nothing. if (!options.nocomment && pattern.charAt(0) === '#') { return false; } // "" only matches "" if (pattern.trim() === '') return p === ''; return new Minimatch(pattern, options).match(p); } function Minimatch(pattern, options) { if (!(this instanceof Minimatch)) { return new Minimatch(pattern, options); } if (typeof pattern !== 'string') { throw new TypeError('glob pattern string required'); } if (!options) options = {}; pattern = pattern.trim(); // windows support: need to use /, not \ if (path.sep !== '/') { pattern = pattern.split(path.sep).join('/'); } this.options = options; this.set = []; this.pattern = pattern; this.regexp = null; this.negate = false; this.comment = false; this.empty = false; // make the set of regexps etc. this.make(); } Minimatch.prototype.debug = function () {}; Minimatch.prototype.make = make; function make() { // don't do it more than once. if (this._made) return; var pattern = this.pattern; var options = this.options; // empty patterns and comments match nothing. if (!options.nocomment && pattern.charAt(0) === '#') { this.comment = true; return; } if (!pattern) { this.empty = true; return; } // step 1: figure out negation, etc. this.parseNegate(); // step 2: expand braces var set = this.globSet = this.braceExpand(); if (options.debug) this.debug = console.error; this.debug(this.pattern, set); // step 3: now we have a set, so turn each one into a series of path-portion // matching patterns. // These will be regexps, except in the case of "**", which is // set to the GLOBSTAR object for globstar behavior, // and will not contain any / characters set = this.globParts = set.map(function (s) { return s.split(slashSplit); }); this.debug(this.pattern, set); // glob --> regexps set = set.map(function (s, si, set) { return s.map(this.parse, this); }, this); this.debug(this.pattern, set); // filter out everything that didn't compile properly. set = set.filter(function (s) { return s.indexOf(false) === -1; }); this.debug(this.pattern, set); this.set = set; } Minimatch.prototype.parseNegate = parseNegate; function parseNegate() { var pattern = this.pattern; var negate = false; var options = this.options; var negateOffset = 0; if (options.nonegate) return; for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === '!'; i++) { negate = !negate; negateOffset++; } if (negateOffset) this.pattern = pattern.substr(negateOffset); this.negate = negate; } // Brace expansion: // a{b,c}d -> abd acd // a{b,}c -> abc ac // a{0..3}d -> a0d a1d a2d a3d // a{b,c{d,e}f}g -> abg acdfg acefg // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg // // Invalid sets are not expanded. // a{2..}b -> a{2..}b // a{b}c -> a{b}c minimatch.braceExpand = function (pattern, options) { return braceExpand(pattern, options); }; Minimatch.prototype.braceExpand = braceExpand; function braceExpand(pattern, options) { if (!options) { if (this instanceof Minimatch) { options = this.options; } else { options = {}; } } pattern = typeof pattern === 'undefined' ? this.pattern : pattern; if (typeof pattern === 'undefined') { throw new TypeError('undefined pattern'); } if (options.nobrace || !pattern.match(/\{.*\}/)) { // shortcut. no need to expand. return [pattern]; } return expand(pattern); } // parse a component of the expanded set. // At this point, no pattern may contain "/" in it // so we're going to return a 2d array, where each entry is the full // pattern, split on '/', and then turned into a regular expression. // A regexp is made at the end which joins each array with an // escaped /, and another full one which joins each regexp with |. // // Following the lead of Bash 4.1, note that "**" only has special meaning // when it is the *only* thing in a path portion. Otherwise, any series // of * is equivalent to a single *. Globstar behavior is enabled by // default, and can be disabled by setting options.noglobstar. Minimatch.prototype.parse = parse; var SUBPARSE = {}; function parse(pattern, isSub) { if (pattern.length > 1024 * 64) { throw new TypeError('pattern is too long'); } var options = this.options; // shortcuts if (!options.noglobstar && pattern === '**') return GLOBSTAR; if (pattern === '') return ''; var re = ''; var hasMagic = !!options.nocase; var escaping = false; // ? => one single character var patternListStack = []; var negativeLists = []; var stateChar; var inClass = false; var reClassStart = -1; var classStart = -1; // . and .. never match anything that doesn't start with ., // even when options.dot is set. var patternStart = pattern.charAt(0) === '.' ? '' // anything // not (start or / followed by . or .. followed by / or end) : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' : '(?!\\.)'; var self = this; function clearStateChar() { if (stateChar) { // we had some state-tracking character // that wasn't consumed by this pass. switch (stateChar) { case '*': re += star; hasMagic = true; break; case '?': re += qmark; hasMagic = true; break; default: re += '\\' + stateChar; break; } self.debug('clearStateChar %j %j', stateChar, re); stateChar = false; } } for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) { this.debug('%s\t%s %s %j', pattern, i, re, c); // skip over any that are escaped. if (escaping && reSpecials[c]) { re += '\\' + c; escaping = false; continue; } switch (c) { case '/': // completely not allowed, even escaped. // Should already be path-split by now. return false; case '\\': clearStateChar(); escaping = true; continue; // the various stateChar values // for the "extglob" stuff. case '?': case '*': case '+': case '@': case '!': this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c); // all of those are literals inside a class, except that // the glob [!a] means [^a] in regexp if (inClass) { this.debug(' in class'); if (c === '!' && i === classStart + 1) c = '^'; re += c; continue; } // if we already have a stateChar, then it means // that there was something like ** or +? in there. // Handle the stateChar, then proceed with this one. self.debug('call clearStateChar %j', stateChar); clearStateChar(); stateChar = c; // if extglob is disabled, then +(asdf|foo) isn't a thing. // just clear the statechar *now*, rather than even diving into // the patternList stuff. if (options.noext) clearStateChar(); continue; case '(': if (inClass) { re += '('; continue; } if (!stateChar) { re += '\\('; continue; } patternListStack.push({ type: stateChar, start: i - 1, reStart: re.length, open: plTypes[stateChar].open, close: plTypes[stateChar].close }); // negation is (?:(?!js)[^/]*) re += stateChar === '!' ? '(?:(?!(?:' : '(?:'; this.debug('plType %j %j', stateChar, re); stateChar = false; continue; case ')': if (inClass || !patternListStack.length) { re += '\\)'; continue; } clearStateChar(); hasMagic = true; var pl = patternListStack.pop(); // negation is (?:(?!js)[^/]*) // The others are (?:) re += pl.close; if (pl.type === '!') { negativeLists.push(pl); } pl.reEnd = re.length; continue; case '|': if (inClass || !patternListStack.length || escaping) { re += '\\|'; escaping = false; continue; } clearStateChar(); re += '|'; continue; // these are mostly the same in regexp and glob case '[': // swallow any state-tracking char before the [ clearStateChar(); if (inClass) { re += '\\' + c; continue; } inClass = true; classStart = i; reClassStart = re.length; re += c; continue; case ']': // a right bracket shall lose its special // meaning and represent itself in // a bracket expression if it occurs // first in the list. -- POSIX.2 2.8.3.2 if (i === classStart + 1 || !inClass) { re += '\\' + c; escaping = false; continue; } // handle the case where we left a class open. // "[z-a]" is valid, equivalent to "\[z-a\]" if (inClass) { // split where the last [ was, make sure we don't have // an invalid re. if so, re-walk the contents of the // would-be class to re-translate any characters that // were passed through as-is // TODO: It would probably be faster to determine this // without a try/catch and a new RegExp, but it's tricky // to do safely. For now, this is safe and works. var cs = pattern.substring(classStart + 1, i); try { RegExp('[' + cs + ']'); } catch (er) { // not a valid class! var sp = this.parse(cs, SUBPARSE); re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'; hasMagic = hasMagic || sp[1]; inClass = false; continue; } } // finish up the class. hasMagic = true; inClass = false; re += c; continue; default: // swallow any state char that wasn't consumed clearStateChar(); if (escaping) { // no need escaping = false; } else if (reSpecials[c] && !(c === '^' && inClass)) { re += '\\'; } re += c; } // switch } // for // handle the case where we left a class open. // "[abc" is valid, equivalent to "\[abc" if (inClass) { // split where the last [ was, and escape it // this is a huge pita. We now have to re-walk // the contents of the would-be class to re-translate // any characters that were passed through as-is cs = pattern.substr(classStart + 1); sp = this.parse(cs, SUBPARSE); re = re.substr(0, reClassStart) + '\\[' + sp[0]; hasMagic = hasMagic || sp[1]; } // handle the case where we had a +( thing at the *end* // of the pattern. // each pattern list stack adds 3 chars, and we need to go through // and escape any | chars that were passed through as-is for the regexp. // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { var tail = re.slice(pl.reStart + pl.open.length); this.debug('setting tail', re, pl); // maybe some even number of \, then maybe 1 \, followed by a | tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. $2 = '\\'; } // need to escape all those slashes *again*, without escaping the // one that we need for escaping the | character. As it works out, // escaping an even number of slashes can be done by simply repeating // it exactly after itself. That's why this trick works. // // I am sorry that you have to see this. return $1 + $1 + $2 + '|'; }); this.debug('tail=%j\n %s', tail, tail, pl, re); var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type; hasMagic = true; re = re.slice(0, pl.reStart) + t + '\\(' + tail; } // handle trailing things that only matter at the very end. clearStateChar(); if (escaping) { // trailing \\ re += '\\\\'; } // only need to apply the nodot start if the re starts with // something that could conceivably capture a dot var addPatternStart = false; switch (re.charAt(0)) { case '.': case '[': case '(': addPatternStart = true; } // Hack to work around lack of negative lookbehind in JS // A pattern like: *.!(x).!(y|z) needs to ensure that a name // like 'a.xyz.yz' doesn't match. So, the first negative // lookahead, has to look ALL the way ahead, to the end of // the pattern. for (var n = negativeLists.length - 1; n > -1; n--) { var nl = negativeLists[n]; var nlBefore = re.slice(0, nl.reStart); var nlFirst = re.slice(nl.reStart, nl.reEnd - 8); var nlLast = re.slice(nl.reEnd - 8, nl.reEnd); var nlAfter = re.slice(nl.reEnd); nlLast += nlAfter; // Handle nested stuff like *(*.js|!(*.json)), where open parens // mean that we should *not* include the ) in the bit that is considered // "after" the negated section. var openParensBefore = nlBefore.split('(').length - 1; var cleanAfter = nlAfter; for (i = 0; i < openParensBefore; i++) { cleanAfter = cleanAfter.replace(/\)[+*?]?/, ''); } nlAfter = cleanAfter; var dollar = ''; if (nlAfter === '' && isSub !== SUBPARSE) { dollar = '$'; } var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; re = newRe; } // if the re is not "" at this point, then we need to make sure // it doesn't match against an empty path part. // Otherwise a/* will match a/, which it should not. if (re !== '' && hasMagic) { re = '(?=.)' + re; } if (addPatternStart) { re = patternStart + re; } // parsing just a piece of a larger pattern. if (isSub === SUBPARSE) { return [re, hasMagic]; } // skip the regexp for non-magical patterns // unescape anything in it, though, so that it'll be // an exact match against a file etc. if (!hasMagic) { return globUnescape(pattern); } var flags = options.nocase ? 'i' : ''; try { var regExp = new RegExp('^' + re + '$', flags); } catch (er) { // If it was an invalid regular expression, then it can't match // anything. This trick looks for a character after the end of // the string, which is of course impossible, except in multi-line // mode, but it's not a /m regex. return new RegExp('$.'); } regExp._glob = pattern; regExp._src = re; return regExp; } minimatch.makeRe = function (pattern, options) { return new Minimatch(pattern, options || {}).makeRe(); }; Minimatch.prototype.makeRe = makeRe; function makeRe() { if (this.regexp || this.regexp === false) return this.regexp; // at this point, this.set is a 2d array of partial // pattern strings, or "**". // // It's better to use .match(). This function shouldn't // be used, really, but it's pretty convenient sometimes, // when you just want to work with a regex. var set = this.set; if (!set.length) { this.regexp = false; return this.regexp; } var options = this.options; var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; var flags = options.nocase ? 'i' : ''; var re = set.map(function (pattern) { return pattern.map(function (p) { return p === GLOBSTAR ? twoStar : typeof p === 'string' ? regExpEscape(p) : p._src; }).join('\\\/'); }).join('|'); // must match entire pattern // ending in a * or ** will make it less strict. re = '^(?:' + re + ')$'; // can match anything, as long as it's not this. if (this.negate) re = '^(?!' + re + ').*$'; try { this.regexp = new RegExp(re, flags); } catch (ex) { this.regexp = false; } return this.regexp; } minimatch.match = function (list, pattern, options) { options = options || {}; var mm = new Minimatch(pattern, options); list = list.filter(function (f) { return mm.match(f); }); if (mm.options.nonull && !list.length) { list.push(pattern); } return list; }; Minimatch.prototype.match = match; function match(f, partial) { this.debug('match', f, this.pattern); // short-circuit in the case of busted things. // comments, etc. if (this.comment) return false; if (this.empty) return f === ''; if (f === '/' && partial) return true; var options = this.options; // windows: need to use /, not \ if (path.sep !== '/') { f = f.split(path.sep).join('/'); } // treat the test path as a set of pathparts. f = f.split(slashSplit); this.debug(this.pattern, 'split', f); // just ONE of the pattern sets in this.set needs to match // in order for it to be valid. If negating, then just one // match means that we have failed. // Either way, return on the first hit. var set = this.set; this.debug(this.pattern, 'set', set); // Find the basename of the path by looking for the last non-empty segment var filename; var i; for (i = f.length - 1; i >= 0; i--) { filename = f[i]; if (filename) break; } for (i = 0; i < set.length; i++) { var pattern = set[i]; var file = f; if (options.matchBase && pattern.length === 1) { file = [filename]; } var hit = this.matchOne(file, pattern, partial); if (hit) { if (options.flipNegate) return true; return !this.negate; } } // didn't get any hits. this is success if it's a negative // pattern, failure otherwise. if (options.flipNegate) return false; return this.negate; } // set partial to true to test if, for example, // "/a/b" matches the start of "/*/b/*/d" // Partial means, if you run out of file before you run // out of pattern, then that's fine, as long as all // the parts match. Minimatch.prototype.matchOne = function (file, pattern, partial) { var options = this.options; this.debug('matchOne', { 'this': this, file: file, pattern: pattern }); this.debug('matchOne', file.length, pattern.length); for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) { this.debug('matchOne loop'); var p = pattern[pi]; var f = file[fi]; this.debug(pattern, p, f); // should be impossible. // some invalid regexp stuff in the set. if (p === false) return false; if (p === GLOBSTAR) { this.debug('GLOBSTAR', [pattern, p, f]); // "**" // a/**/b/**/c would match the following: // a/b/x/y/z/c // a/x/y/z/b/c // a/b/x/b/x/c // a/b/c // To do this, take the rest of the pattern after // the **, and see if it would match the file remainder. // If so, return success. // If not, the ** "swallows" a segment, and try again. // This is recursively awful. // // a/**/b/**/c matching a/b/x/y/z/c // - a matches a // - doublestar // - matchOne(b/x/y/z/c, b/**/c) // - b matches b // - doublestar // - matchOne(x/y/z/c, c) -> no // - matchOne(y/z/c, c) -> no // - matchOne(z/c, c) -> no // - matchOne(c, c) yes, hit var fr = fi; var pr = pi + 1; if (pr === pl) { this.debug('** at the end'); // a ** at the end will just swallow the rest. // We have found a match. // however, it will not swallow /.x, unless // options.dot is set. // . and .. are *never* matched by **, for explosively // exponential reasons. for (; fi < fl; fi++) { if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false; } return true; } // ok, let's see if we can swallow whatever we can. while (fr < fl) { var swallowee = file[fr]; this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { this.debug('globstar found match!', fr, fl, swallowee); // found a match. return true; } else { // can't swallow "." or ".." ever. // can only swallow ".foo" when explicitly asked. if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') { this.debug('dot detected!', file, fr, pattern, pr); break; } // ** swallows a segment, and continue. this.debug('globstar swallow a segment, and continue'); fr++; } } // no match was found. // However, in partial mode, we can't say this is necessarily over. // If there's more *pattern* left, then if (partial) { // ran out of file this.debug('\n>>> no match, partial?', file, fr, pattern, pr); if (fr === fl) return true; } return false; } // something other than ** // non-magic patterns just have to match exactly // patterns with magic have been turned into regexps. var hit; if (typeof p === 'string') { if (options.nocase) { hit = f.toLowerCase() === p.toLowerCase(); } else { hit = f === p; } this.debug('string match', p, f, hit); } else { hit = f.match(p); this.debug('pattern match', p, f, hit); } if (!hit) return false; } // Note: ending in / means that we'll get a final "" // at the end of the pattern. This can only match a // corresponding "" at the end of the file. // If the file ends in /, then it can only match a // a pattern that ends in /, unless the pattern just // doesn't have any more for it. But, a/b/ should *not* // match "a/b/*", even though "" matches against the // [^/]*? pattern, except in partial mode, where it might // simply not be reached yet. // However, a/b/ should still satisfy a/* // now either we fell off the end of the pattern, or we're done. if (fi === fl && pi === pl) { // ran out of pattern and filename at the same time. // an exact hit! return true; } else if (fi === fl) { // ran out of file, but still had pattern left. // this is ok if we're doing the match as part of // a glob fs traversal. return partial; } else if (pi === pl) { // ran out of pattern, still have file left. // this is only acceptable if we're on the very last // empty segment of a file with a trailing slash. // a/* should match a/b/ var emptyFileEnd = fi === fl - 1 && file[fi] === ''; return emptyFileEnd; } // should be unreachable. throw new Error('wtf?'); }; // replace stuff like \* with * function globUnescape(s) { return s.replace(/\\(.)/g, '$1'); } function regExpEscape(s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); } }); $__System.registerDynamic('a3', [], true, function ($__require, exports, module) { 'use strict'; var global = this || self, GLOBAL = global; module.exports = function (str) { var isExtendedLengthPath = /^\\\\\?\\/.test(str); var hasNonAscii = /[^\x00-\x80]+/.test(str); if (isExtendedLengthPath || hasNonAscii) { return str; } return str.replace(/\\/g, '/'); }; }); $__System.registerDynamic("a4", ["17", "@node/util", "9a", "9d", "a2", "a5", "a6", "@node/path", "a3", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.inspect = exports.inherits = undefined; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _util = $__require("@node/util"); Object.defineProperty(exports, "inherits", { enumerable: true, get: function get() { return _util.inherits; } }); Object.defineProperty(exports, "inspect", { enumerable: true, get: function get() { return _util.inspect; } }); exports.canCompile = canCompile; exports.list = list; exports.regexify = regexify; exports.arrayify = arrayify; exports.booleanify = booleanify; exports.shouldIgnore = shouldIgnore; var _escapeRegExp = $__require("9a"); var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp); var _startsWith = $__require("9d"); var _startsWith2 = _interopRequireDefault(_startsWith); var _minimatch = $__require("a2"); var _minimatch2 = _interopRequireDefault(_minimatch); var _includes = $__require("a5"); var _includes2 = _interopRequireDefault(_includes); var _isRegExp = $__require("a6"); var _isRegExp2 = _interopRequireDefault(_isRegExp); var _path = $__require("@node/path"); var _path2 = _interopRequireDefault(_path); var _slash = $__require("a3"); var _slash2 = _interopRequireDefault(_slash); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function canCompile(filename, altExts) { var exts = altExts || canCompile.EXTENSIONS; var ext = _path2.default.extname(filename); return (0, _includes2.default)(exts, ext); } canCompile.EXTENSIONS = [".js", ".jsx", ".es6", ".es"]; function list(val) { if (!val) { return []; } else if (Array.isArray(val)) { return val; } else if (typeof val === "string") { return val.split(","); } else { return [val]; } } function regexify(val) { if (!val) { return new RegExp(/.^/); } if (Array.isArray(val)) { val = new RegExp(val.map(_escapeRegExp2.default).join("|"), "i"); } if (typeof val === "string") { val = (0, _slash2.default)(val); if ((0, _startsWith2.default)(val, "./") || (0, _startsWith2.default)(val, "*/")) val = val.slice(2); if ((0, _startsWith2.default)(val, "**/")) val = val.slice(3); var regex = _minimatch2.default.makeRe(val, { nocase: true }); return new RegExp(regex.source.slice(1, -1), "i"); } if ((0, _isRegExp2.default)(val)) { return val; } throw new TypeError("illegal type for regexify"); } function arrayify(val, mapFn) { if (!val) return []; if (typeof val === "boolean") return arrayify([val], mapFn); if (typeof val === "string") return arrayify(list(val), mapFn); if (Array.isArray(val)) { if (mapFn) val = val.map(mapFn); return val; } return [val]; } function booleanify(val) { if (val === "true" || val == 1) { return true; } if (val === "false" || val == 0 || !val) { return false; } return val; } function shouldIgnore(filename) { var ignore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var only = arguments[2]; filename = filename.replace(/\\/g, "/"); if (only) { for (var _iterator = only, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 pattern = _ref; if (_shouldIgnore(pattern, filename)) return false; } return true; } else if (ignore.length) { for (var _iterator2 = ignore, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _pattern = _ref2; if (_shouldIgnore(_pattern, filename)) return true; } } return false; } function _shouldIgnore(pattern, filename) { if (typeof pattern === "function") { return pattern(filename); } else { return pattern.test(filename); } } }); $__System.registerDynamic("a7", ["a3", "a4", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.filename = undefined; exports.boolean = boolean; exports.booleanString = booleanString; exports.list = list; var _slash = $__require("a3"); var _slash2 = _interopRequireDefault(_slash); var _util = $__require("a4"); var util = _interopRequireWildcard(_util); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var filename = exports.filename = _slash2.default; function boolean(val) { return !!val; } function booleanString(val) { return util.booleanify(val); } function list(val) { return util.list(val); } }); $__System.registerDynamic("a8", ["a7", "a9", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.config = undefined; exports.normaliseOptions = normaliseOptions; var _parsers = $__require("a7"); var parsers = _interopRequireWildcard(_parsers); var _config = $__require("a9"); var _config2 = _interopRequireDefault(_config); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } exports.config = _config2.default; function normaliseOptions() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; for (var key in options) { var val = options[key]; if (val == null) continue; var opt = _config2.default[key]; if (opt && opt.alias) opt = _config2.default[opt.alias]; if (!opt) continue; var parser = parsers[opt.type]; if (parser) val = parser(val); options[key] = val; } return options; } }); $__System.registerDynamic("aa", ["c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = getPossiblePluginNames; function getPossiblePluginNames(pluginName) { return ["babel-plugin-" + pluginName, pluginName]; } module.exports = exports["default"]; }); $__System.registerDynamic("ab", ["ac", "aa", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = resolvePlugin; var _resolveFromPossibleNames = $__require("ac"); var _resolveFromPossibleNames2 = _interopRequireDefault(_resolveFromPossibleNames); var _getPossiblePluginNames = $__require("aa"); var _getPossiblePluginNames2 = _interopRequireDefault(_getPossiblePluginNames); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function resolvePlugin(pluginName) { var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd(); return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePluginNames2.default)(pluginName), dirname); } module.exports = exports["default"]; }); $__System.registerDynamic("ac", ["ad", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = resolveFromPossibleNames; var _resolve = $__require("ad"); var _resolve2 = _interopRequireDefault(_resolve); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function resolveFromPossibleNames(possibleNames, dirname) { return possibleNames.reduce(function (accum, curr) { return accum || (0, _resolve2.default)(curr, dirname); }, null); } module.exports = exports["default"]; }); $__System.registerDynamic("ae", ["c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = getPossiblePresetNames; function getPossiblePresetNames(presetName) { var possibleNames = ["babel-preset-" + presetName, presetName]; var matches = presetName.match(/^(@[^/]+)\/(.+)$/); if (matches) { var orgName = matches[1], presetPath = matches[2]; possibleNames.push(orgName + "/babel-preset-" + presetPath); } return possibleNames; } module.exports = exports["default"]; }); $__System.registerDynamic("af", ["ac", "ae", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = resolvePreset; var _resolveFromPossibleNames = $__require("ac"); var _resolveFromPossibleNames2 = _interopRequireDefault(_resolveFromPossibleNames); var _getPossiblePresetNames = $__require("ae"); var _getPossiblePresetNames2 = _interopRequireDefault(_getPossiblePresetNames); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function resolvePreset(presetName) { var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd(); return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePresetNames2.default)(presetName), dirname); } module.exports = exports["default"]; }); $__System.registerDynamic('b0', ['b1'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseClone = $__require('b1'); /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4; /** * This method is like `_.cloneWith` except that it recursively clones `value`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to recursively clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the deep cloned value. * @see _.cloneWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(true); * } * } * * var el = _.cloneDeepWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 20 */ function cloneDeepWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); } module.exports = cloneDeepWith; }); $__System.registerDynamic("b2", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function (object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } module.exports = createBaseFor; }); $__System.registerDynamic('8b', ['b2'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var createBaseFor = $__require('b2'); /** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = createBaseFor(); module.exports = baseFor; }); $__System.registerDynamic('b3', ['b4', '72'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseAssignValue = $__require('b4'), eq = $__require('72'); /** * This function is like `assignValue` except that it doesn't assign * `undefined` values. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { if (value !== undefined && !eq(object[key], value) || value === undefined && !(key in object)) { baseAssignValue(object, key, value); } } module.exports = assignMergeValue; }); $__System.registerDynamic('b5', ['3f', '7b'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var isArrayLike = $__require('3f'), isObjectLike = $__require('7b'); /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } module.exports = isArrayLikeObject; }); $__System.registerDynamic('b6', ['b7', 'b8'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var copyObject = $__require('b7'), keysIn = $__require('b8'); /** * Converts `value` to a plain object flattening inherited enumerable string * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. * @example * * function Foo() { * this.b = 2; * } * * Foo.prototype.c = 3; * * _.assign({ 'a': 1 }, new Foo); * // => { 'a': 1, 'b': 2 } * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } */ function toPlainObject(value) { return copyObject(value, keysIn(value)); } module.exports = toPlainObject; }); $__System.registerDynamic('b9', ['b3', 'ba', 'bb', 'bc', 'bd', '62', '4b', 'b5', '79', 'be', '81', 'bf', '7a', 'b6'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var assignMergeValue = $__require('b3'), cloneBuffer = $__require('ba'), cloneTypedArray = $__require('bb'), copyArray = $__require('bc'), initCloneObject = $__require('bd'), isArguments = $__require('62'), isArray = $__require('4b'), isArrayLikeObject = $__require('b5'), isBuffer = $__require('79'), isFunction = $__require('be'), isObject = $__require('81'), isPlainObject = $__require('bf'), isTypedArray = $__require('7a'), toPlainObject = $__require('b6'); /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = object[key], srcValue = source[key], stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, key + '', object, source, stack) : undefined; var isCommon = newValue === undefined; if (isCommon) { var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || srcIndex && isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack['delete'](srcValue); } assignMergeValue(object, key, newValue); } module.exports = baseMergeDeep; }); $__System.registerDynamic('c0', ['66', 'b3', '8b', 'b9', '81', 'b8'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var Stack = $__require('66'), assignMergeValue = $__require('b3'), baseFor = $__require('8b'), baseMergeDeep = $__require('b9'), isObject = $__require('81'), keysIn = $__require('b8'); /** * The base implementation of `_.merge` without support for multiple sources. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function (srcValue, key) { if (isObject(srcValue)) { stack || (stack = new Stack()); baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(object[key], srcValue, key + '', object, source, stack) : undefined; if (newValue === undefined) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } module.exports = baseMerge; }); $__System.registerDynamic('c1', ['c0', 'c2'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseMerge = $__require('c0'), createAssigner = $__require('c2'); /** * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source * properties. If `customizer` returns `undefined`, merging is handled by the * method instead. The `customizer` is invoked with six arguments: * (objValue, srcValue, key, object, source, stack). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} customizer The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * function customizer(objValue, srcValue) { * if (_.isArray(objValue)) { * return objValue.concat(srcValue); * } * } * * var object = { 'a': [1], 'b': [2] }; * var other = { 'a': [3], 'b': [4] }; * * _.mergeWith(object, other, customizer); * // => { 'a': [1, 3], 'b': [2, 4] } */ var mergeWith = createAssigner(function (object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); }); module.exports = mergeWith; }); $__System.registerDynamic("c3", ["17", "c1", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (dest, src) { if (!dest || !src) return; return (0, _mergeWith2.default)(dest, src, function (a, b) { if (b && Array.isArray(a)) { var newArray = b.slice(0); for (var _iterator = a, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 item = _ref; if (newArray.indexOf(item) < 0) { newArray.push(item); } } return newArray; } }); }; var _mergeWith = $__require("c1"); var _mergeWith2 = _interopRequireDefault(_mergeWith); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("a9", ["c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; module.exports = { filename: { type: "filename", description: "filename to use when reading from stdin - this will be used in source-maps, errors etc", default: "unknown", shorthand: "f" }, filenameRelative: { hidden: true, type: "string" }, inputSourceMap: { hidden: true }, env: { hidden: true, default: {} }, mode: { description: "", hidden: true }, retainLines: { type: "boolean", default: false, description: "retain line numbers - will result in really ugly code" }, highlightCode: { description: "enable/disable ANSI syntax highlighting of code frames (on by default)", type: "boolean", default: true }, suppressDeprecationMessages: { type: "boolean", default: false, hidden: true }, presets: { type: "list", description: "", default: [] }, plugins: { type: "list", default: [], description: "" }, ignore: { type: "list", description: "list of glob paths to **not** compile", default: [] }, only: { type: "list", description: "list of glob paths to **only** compile" }, code: { hidden: true, default: true, type: "boolean" }, metadata: { hidden: true, default: true, type: "boolean" }, ast: { hidden: true, default: true, type: "boolean" }, extends: { type: "string", hidden: true }, comments: { type: "boolean", default: true, description: "write comments to generated output (true by default)" }, shouldPrintComment: { hidden: true, description: "optional callback to control whether a comment should be inserted, when this is used the comments option is ignored" }, wrapPluginVisitorMethod: { hidden: true, description: "optional callback to wrap all visitor methods" }, compact: { type: "booleanString", default: "auto", description: "do not include superfluous whitespace characters and line terminators [true|false|auto]" }, minified: { type: "boolean", default: false, description: "save as much bytes when printing [true|false]" }, sourceMap: { alias: "sourceMaps", hidden: true }, sourceMaps: { type: "booleanString", description: "[true|false|inline]", default: false, shorthand: "s" }, sourceMapTarget: { type: "string", description: "set `file` on returned source map" }, sourceFileName: { type: "string", description: "set `sources[0]` on returned source map" }, sourceRoot: { type: "filename", description: "the root from which all sources are relative" }, babelrc: { description: "Whether or not to look up .babelrc and .babelignore files", type: "boolean", default: true }, sourceType: { description: "", default: "module" }, auxiliaryCommentBefore: { type: "string", description: "print a comment before any injected non-user code" }, auxiliaryCommentAfter: { type: "string", description: "print a comment after any injected non-user code" }, resolveModuleSource: { hidden: true }, getModuleId: { hidden: true }, moduleRoot: { type: "filename", description: "optional prefix for the AMD module formatter that will be prepend to the filename on module definitions" }, moduleIds: { type: "boolean", default: false, shorthand: "M", description: "insert an explicit id for modules" }, moduleId: { description: "specify a custom name for module ids", type: "string" }, passPerPreset: { description: "Whether to spawn a traversal pass per a preset. By default all presets are merged.", type: "boolean", default: false, hidden: true }, parserOpts: { description: "Options to pass into the parser, or to change parsers (parserOpts.parser)", default: false }, generatorOpts: { description: "Options to pass into the generator, or to change generators (generatorOpts.generator)", default: false } }; }); $__System.registerDynamic("c4", ["c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; module.exports = { "auxiliaryComment": { "message": "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`" }, "blacklist": { "message": "Put the specific transforms you want in the `plugins` option" }, "breakConfig": { "message": "This is not a necessary option in Babel 6" }, "experimental": { "message": "Put the specific transforms you want in the `plugins` option" }, "externalHelpers": { "message": "Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/" }, "extra": { "message": "" }, "jsxPragma": { "message": "use the `pragma` option in the `react-jsx` plugin . Check out http://babeljs.io/docs/plugins/transform-react-jsx/" }, "loose": { "message": "Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option." }, "metadataUsedHelpers": { "message": "Not required anymore as this is enabled by default" }, "modules": { "message": "Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules" }, "nonStandard": { "message": "Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. Also check out the react preset http://babeljs.io/docs/plugins/preset-react/" }, "optional": { "message": "Put the specific transforms you want in the `plugins` option" }, "sourceMapName": { "message": "Use the `sourceMapTarget` option" }, "stage": { "message": "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets" }, "whitelist": { "message": "Put the specific transforms you want in the `plugins` option" } }; }); $__System.registerDynamic('c5', ['c6', 'c7', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; // 19.1.3.1 Object.assign(target, source) var $export = $__require('c6'); $export($export.S + $export.F, 'Object', { assign: $__require('c7') }); }); $__System.registerDynamic('c8', ['c5', '37', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; $__require('c5'); module.exports = $__require('37').Object.assign; }); $__System.registerDynamic("5a", ["c8"], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; module.exports = { "default": $__require("c8"), __esModule: true }; }); $__System.registerDynamic("ad", ["30", "@node/module", "@node/path", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _typeof2 = $__require("30"); var _typeof3 = _interopRequireDefault(_typeof2); exports.default = function (loc) { var relative = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd(); if ((typeof _module2.default === "undefined" ? "undefined" : (0, _typeof3.default)(_module2.default)) === "object") return null; var relativeMod = relativeModules[relative]; if (!relativeMod) { relativeMod = new _module2.default(); var filename = _path2.default.join(relative, ".babelrc"); relativeMod.id = filename; relativeMod.filename = filename; relativeMod.paths = _module2.default._nodeModulePaths(relative); relativeModules[relative] = relativeMod; } try { return _module2.default._resolveFilename(loc, relativeMod); } catch (err) { return null; } }; var _module = $__require("@node/module"); var _module2 = _interopRequireDefault(_module); var _path = $__require("@node/path"); var _path2 = _interopRequireDefault(_path); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var relativeModules = {}; module.exports = exports["default"]; }); $__System.registerDynamic("c9", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; // json5.js // Modern JSON. See README.md for details. // // This file is based directly off of Douglas Crockford's json_parse.js: // https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js var JSON5 = typeof exports === 'object' ? exports : {}; JSON5.parse = function () { "use strict"; // This is a function that can parse a JSON5 text, producing a JavaScript // data structure. It is a simple, recursive descent parser. It does not use // eval or regular expressions, so it can be used as a model for implementing // a JSON5 parser in other languages. // We are defining the function inside of another function to avoid creating // global variables. var at, // The index of the current character lineNumber, // The current line number columnNumber, // The current column number ch, // The current character escapee = { "'": "'", '"': '"', '\\': '\\', '/': '/', '\n': '', // Replace escaped newlines in strings w/ empty string b: '\b', f: '\f', n: '\n', r: '\r', t: '\t' }, ws = [' ', '\t', '\r', '\n', '\v', '\f', '\xA0', '\uFEFF'], text, renderChar = function (chr) { return chr === '' ? 'EOF' : "'" + chr + "'"; }, error = function (m) { // Call error when something is wrong. var error = new SyntaxError(); // beginning of message suffix to agree with that provided by Gecko - see https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse error.message = m + " at line " + lineNumber + " column " + columnNumber + " of the JSON5 data. Still to read: " + JSON.stringify(text.substring(at - 1, at + 19)); error.at = at; // These two property names have been chosen to agree with the ones in Gecko, the only popular // environment which seems to supply this info on JSON.parse error.lineNumber = lineNumber; error.columnNumber = columnNumber; throw error; }, next = function (c) { // If a c parameter is provided, verify that it matches the current character. if (c && c !== ch) { error("Expected " + renderChar(c) + " instead of " + renderChar(ch)); } // Get the next character. When there are no more characters, // return the empty string. ch = text.charAt(at); at++; columnNumber++; if (ch === '\n' || ch === '\r' && peek() !== '\n') { lineNumber++; columnNumber = 0; } return ch; }, peek = function () { // Get the next character without consuming it or // assigning it to the ch varaible. return text.charAt(at); }, identifier = function () { // Parse an identifier. Normally, reserved words are disallowed here, but we // only use this for unquoted object keys, where reserved words are allowed, // so we don't check for those here. References: // - http://es5.github.com/#x7.6 // - https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Core_Language_Features#Variables // - http://docstore.mik.ua/orelly/webprog/jscript/ch02_07.htm // TODO Identifiers can have Unicode "letters" in them; add support for those. var key = ch; // Identifiers must start with a letter, _ or $. if (ch !== '_' && ch !== '$' && (ch < 'a' || ch > 'z') && (ch < 'A' || ch > 'Z')) { error("Bad identifier as unquoted key"); } // Subsequent characters can contain digits. while (next() && (ch === '_' || ch === '$' || ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z' || ch >= '0' && ch <= '9')) { key += ch; } return key; }, number = function () { // Parse a number value. var number, sign = '', string = '', base = 10; if (ch === '-' || ch === '+') { sign = ch; next(ch); } // support for Infinity (could tweak to allow other words): if (ch === 'I') { number = word(); if (typeof number !== 'number' || isNaN(number)) { error('Unexpected word for number'); } return sign === '-' ? -number : number; } // support for NaN if (ch === 'N') { number = word(); if (!isNaN(number)) { error('expected word to be NaN'); } // ignore sign as -NaN also is NaN return number; } if (ch === '0') { string += ch; next(); if (ch === 'x' || ch === 'X') { string += ch; next(); base = 16; } else if (ch >= '0' && ch <= '9') { error('Octal literal'); } } switch (base) { case 10: while (ch >= '0' && ch <= '9') { string += ch; next(); } if (ch === '.') { string += '.'; while (next() && ch >= '0' && ch <= '9') { string += ch; } } if (ch === 'e' || ch === 'E') { string += ch; next(); if (ch === '-' || ch === '+') { string += ch; next(); } while (ch >= '0' && ch <= '9') { string += ch; next(); } } break; case 16: while (ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'F' || ch >= 'a' && ch <= 'f') { string += ch; next(); } break; } if (sign === '-') { number = -string; } else { number = +string; } if (!isFinite(number)) { error("Bad number"); } else { return number; } }, string = function () { // Parse a string value. var hex, i, string = '', delim, // double quote or single quote uffff; // When parsing for string values, we must look for ' or " and \ characters. if (ch === '"' || ch === "'") { delim = ch; while (next()) { if (ch === delim) { next(); return string; } else if (ch === '\\') { next(); if (ch === 'u') { uffff = 0; for (i = 0; i < 4; i += 1) { hex = parseInt(next(), 16); if (!isFinite(hex)) { break; } uffff = uffff * 16 + hex; } string += String.fromCharCode(uffff); } else if (ch === '\r') { if (peek() === '\n') { next(); } } else if (typeof escapee[ch] === 'string') { string += escapee[ch]; } else { break; } } else if (ch === '\n') { // unescaped newlines are invalid; see: // https://github.com/aseemk/json5/issues/24 // TODO this feels special-cased; are there other // invalid unescaped chars? break; } else { string += ch; } } } error("Bad string"); }, inlineComment = function () { // Skip an inline comment, assuming this is one. The current character should // be the second / character in the // pair that begins this inline comment. // To finish the inline comment, we look for a newline or the end of the text. if (ch !== '/') { error("Not an inline comment"); } do { next(); if (ch === '\n' || ch === '\r') { next(); return; } } while (ch); }, blockComment = function () { // Skip a block comment, assuming this is one. The current character should be // the * character in the /* pair that begins this block comment. // To finish the block comment, we look for an ending */ pair of characters, // but we also watch for the end of text before the comment is terminated. if (ch !== '*') { error("Not a block comment"); } do { next(); while (ch === '*') { next('*'); if (ch === '/') { next('/'); return; } } } while (ch); error("Unterminated block comment"); }, comment = function () { // Skip a comment, whether inline or block-level, assuming this is one. // Comments always begin with a / character. if (ch !== '/') { error("Not a comment"); } next('/'); if (ch === '/') { inlineComment(); } else if (ch === '*') { blockComment(); } else { error("Unrecognized comment"); } }, white = function () { // Skip whitespace and comments. // Note that we're detecting comments by only a single / character. // This works since regular expressions are not valid JSON(5), but this will // break if there are other valid values that begin with a / character! while (ch) { if (ch === '/') { comment(); } else if (ws.indexOf(ch) >= 0) { next(); } else { return; } } }, word = function () { // true, false, or null. switch (ch) { case 't': next('t'); next('r'); next('u'); next('e'); return true; case 'f': next('f'); next('a'); next('l'); next('s'); next('e'); return false; case 'n': next('n'); next('u'); next('l'); next('l'); return null; case 'I': next('I'); next('n'); next('f'); next('i'); next('n'); next('i'); next('t'); next('y'); return Infinity; case 'N': next('N'); next('a'); next('N'); return NaN; } error("Unexpected " + renderChar(ch)); }, value, // Place holder for the value function. array = function () { // Parse an array value. var array = []; if (ch === '[') { next('['); white(); while (ch) { if (ch === ']') { next(']'); return array; // Potentially empty array } // ES5 allows omitting elements in arrays, e.g. [,] and // [,null]. We don't allow this in JSON5. if (ch === ',') { error("Missing array element"); } else { array.push(value()); } white(); // If there's no comma after this value, this needs to // be the end of the array. if (ch !== ',') { next(']'); return array; } next(','); white(); } } error("Bad array"); }, object = function () { // Parse an object value. var key, object = {}; if (ch === '{') { next('{'); white(); while (ch) { if (ch === '}') { next('}'); return object; // Potentially empty object } // Keys can be unquoted. If they are, they need to be // valid JS identifiers. if (ch === '"' || ch === "'") { key = string(); } else { key = identifier(); } white(); next(':'); object[key] = value(); white(); // If there's no comma after this pair, this needs to be // the end of the object. if (ch !== ',') { next('}'); return object; } next(','); white(); } } error("Bad object"); }; value = function () { // Parse a JSON value. It could be an object, an array, a string, a number, // or a word. white(); switch (ch) { case '{': return object(); case '[': return array(); case '"': case "'": return string(); case '-': case '+': case '.': return number(); default: return ch >= '0' && ch <= '9' ? number() : word(); } }; // Return the json_parse function. It will have access to all of the above // functions and variables. return function (source, reviver) { var result; text = String(source); at = 0; lineNumber = 1; columnNumber = 1; ch = ' '; result = value(); white(); if (ch) { error("Syntax error"); } // If there is a reviver function, we recursively walk the new structure, // passing each name/value pair to the reviver function for possible // transformation, starting with a temporary root object that holds the result // in an empty key. If there is not a reviver function, we simply return the // result. return typeof reviver === 'function' ? function walk(holder, key) { var k, v, value = holder[key]; if (value && typeof value === 'object') { for (k in value) { if (Object.prototype.hasOwnProperty.call(value, k)) { v = walk(value, k); if (v !== undefined) { value[k] = v; } else { delete value[k]; } } } } return reviver.call(holder, key, value); }({ '': result }, '') : result; }; }(); // JSON5 stringify will not quote keys where appropriate JSON5.stringify = function (obj, replacer, space) { if (replacer && typeof replacer !== "function" && !isArray(replacer)) { throw new Error('Replacer must be a function or an array'); } var getReplacedValueOrUndefined = function (holder, key, isTopLevel) { var value = holder[key]; // Replace the value with its toJSON value first, if possible if (value && value.toJSON && typeof value.toJSON === "function") { value = value.toJSON(); } // If the user-supplied replacer if a function, call it. If it's an array, check objects' string keys for // presence in the array (removing the key/value pair from the resulting JSON if the key is missing). if (typeof replacer === "function") { return replacer.call(holder, key, value); } else if (replacer) { if (isTopLevel || isArray(holder) || replacer.indexOf(key) >= 0) { return value; } else { return undefined; } } else { return value; } }; function isWordChar(c) { return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || c === '_' || c === '$'; } function isWordStart(c) { return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c === '_' || c === '$'; } function isWord(key) { if (typeof key !== 'string') { return false; } if (!isWordStart(key[0])) { return false; } var i = 1, length = key.length; while (i < length) { if (!isWordChar(key[i])) { return false; } i++; } return true; } // export for use in tests JSON5.isWord = isWord; // polyfills function isArray(obj) { if (Array.isArray) { return Array.isArray(obj); } else { return Object.prototype.toString.call(obj) === '[object Array]'; } } function isDate(obj) { return Object.prototype.toString.call(obj) === '[object Date]'; } var objStack = []; function checkForCircular(obj) { for (var i = 0; i < objStack.length; i++) { if (objStack[i] === obj) { throw new TypeError("Converting circular structure to JSON"); } } } function makeIndent(str, num, noNewLine) { if (!str) { return ""; } // indentation no more than 10 chars if (str.length > 10) { str = str.substring(0, 10); } var indent = noNewLine ? "" : "\n"; for (var i = 0; i < num; i++) { indent += str; } return indent; } var indentStr; if (space) { if (typeof space === "string") { indentStr = space; } else if (typeof space === "number" && space >= 0) { indentStr = makeIndent(" ", space, true); } else { // ignore space parameter } } // Copied from Crokford's implementation of JSON // See https://github.com/douglascrockford/JSON-js/blob/e39db4b7e6249f04a195e7dd0840e610cc9e941e/json2.js#L195 // Begin var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, meta = { // table of character substitutions '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"': '\\"', '\\': '\\\\' }; function escapeString(string) { // If the string contains no control characters, no quote characters, and no // backslash characters, then we can safely slap some quotes around it. // Otherwise we must also replace the offending characters with safe escape // sequences. escapable.lastIndex = 0; return escapable.test(string) ? '"' + string.replace(escapable, function (a) { var c = meta[a]; return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }) + '"' : '"' + string + '"'; } // End function internalStringify(holder, key, isTopLevel) { var buffer, res; // Replace the value, if necessary var obj_part = getReplacedValueOrUndefined(holder, key, isTopLevel); if (obj_part && !isDate(obj_part)) { // unbox objects // don't unbox dates, since will turn it into number obj_part = obj_part.valueOf(); } switch (typeof obj_part) { case "boolean": return obj_part.toString(); case "number": if (isNaN(obj_part) || !isFinite(obj_part)) { return "null"; } return obj_part.toString(); case "string": return escapeString(obj_part.toString()); case "object": if (obj_part === null) { return "null"; } else if (isArray(obj_part)) { checkForCircular(obj_part); buffer = "["; objStack.push(obj_part); for (var i = 0; i < obj_part.length; i++) { res = internalStringify(obj_part, i, false); buffer += makeIndent(indentStr, objStack.length); if (res === null || typeof res === "undefined") { buffer += "null"; } else { buffer += res; } if (i < obj_part.length - 1) { buffer += ","; } else if (indentStr) { buffer += "\n"; } } objStack.pop(); if (obj_part.length) { buffer += makeIndent(indentStr, objStack.length, true); } buffer += "]"; } else { checkForCircular(obj_part); buffer = "{"; var nonEmpty = false; objStack.push(obj_part); for (var prop in obj_part) { if (obj_part.hasOwnProperty(prop)) { var value = internalStringify(obj_part, prop, false); isTopLevel = false; if (typeof value !== "undefined" && value !== null) { buffer += makeIndent(indentStr, objStack.length); nonEmpty = true; key = isWord(prop) ? prop : escapeString(prop); buffer += key + ":" + (indentStr ? ' ' : '') + value + ","; } } } objStack.pop(); if (nonEmpty) { buffer = buffer.substring(0, buffer.length - 1) + makeIndent(indentStr, objStack.length) + "}"; } else { buffer = '{}'; } } return buffer; default: // functions and undefined should be ignored return undefined; } } // special case...when undefined is used inside of // a compound object/array, return null. // but when top-level, return undefined var topLevelHolder = { "": obj }; if (obj === undefined) { return getReplacedValueOrUndefined(topLevelHolder, '', true); } return internalStringify(topLevelHolder, '', true); }; }); $__System.registerDynamic('ca', ['c'], true, function ($__require, exports, module) { 'use strict'; var process = $__require('c'); var global = this || self, GLOBAL = global; function posix(path) { return path.charAt(0) === '/'; } function win32(path) { // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; var result = splitDeviceRe.exec(path); var device = result[1] || ''; var isUnc = Boolean(device && device.charAt(1) !== ':'); // UNC paths are always absolute return Boolean(result[2] || isUnc); } module.exports = process.platform === 'win32' ? win32 : posix; module.exports.posix = posix; module.exports.win32 = win32; }); $__System.registerDynamic("cb", ["5a", "1d", "ad", "c9", "ca", "@node/path", "@node/fs", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _assign = $__require("5a"); var _assign2 = _interopRequireDefault(_assign); var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); exports.default = buildConfigChain; var _resolve = $__require("ad"); var _resolve2 = _interopRequireDefault(_resolve); var _json = $__require("c9"); var _json2 = _interopRequireDefault(_json); var _pathIsAbsolute = $__require("ca"); var _pathIsAbsolute2 = _interopRequireDefault(_pathIsAbsolute); var _path = $__require("@node/path"); var _path2 = _interopRequireDefault(_path); var _fs = $__require("@node/fs"); var _fs2 = _interopRequireDefault(_fs); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var existsCache = {}; var jsonCache = {}; var BABELIGNORE_FILENAME = ".babelignore"; var BABELRC_FILENAME = ".babelrc"; var PACKAGE_FILENAME = "package.json"; function exists(filename) { var cached = existsCache[filename]; if (cached == null) { return existsCache[filename] = _fs2.default.existsSync(filename); } else { return cached; } } function buildConfigChain() { var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var log = arguments[1]; var filename = opts.filename; var builder = new ConfigChainBuilder(log); if (opts.babelrc !== false) { builder.findConfigs(filename); } builder.mergeConfig({ options: opts, alias: "base", dirname: filename && _path2.default.dirname(filename) }); return builder.configs; } var ConfigChainBuilder = function () { function ConfigChainBuilder(log) { (0, _classCallCheck3.default)(this, ConfigChainBuilder); this.resolvedConfigs = []; this.configs = []; this.log = log; } ConfigChainBuilder.prototype.findConfigs = function findConfigs(loc) { if (!loc) return; if (!(0, _pathIsAbsolute2.default)(loc)) { loc = _path2.default.join(process.cwd(), loc); } var foundConfig = false; var foundIgnore = false; while (loc !== (loc = _path2.default.dirname(loc))) { if (!foundConfig) { var configLoc = _path2.default.join(loc, BABELRC_FILENAME); if (exists(configLoc)) { this.addConfig(configLoc); foundConfig = true; } var pkgLoc = _path2.default.join(loc, PACKAGE_FILENAME); if (!foundConfig && exists(pkgLoc)) { foundConfig = this.addConfig(pkgLoc, "babel", JSON); } } if (!foundIgnore) { var ignoreLoc = _path2.default.join(loc, BABELIGNORE_FILENAME); if (exists(ignoreLoc)) { this.addIgnoreConfig(ignoreLoc); foundIgnore = true; } } if (foundIgnore && foundConfig) return; } }; ConfigChainBuilder.prototype.addIgnoreConfig = function addIgnoreConfig(loc) { var file = _fs2.default.readFileSync(loc, "utf8"); var lines = file.split("\n"); lines = lines.map(function (line) { return line.replace(/#(.*?)$/, "").trim(); }).filter(function (line) { return !!line; }); if (lines.length) { this.mergeConfig({ options: { ignore: lines }, alias: loc, dirname: _path2.default.dirname(loc) }); } }; ConfigChainBuilder.prototype.addConfig = function addConfig(loc, key) { var json = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _json2.default; if (this.resolvedConfigs.indexOf(loc) >= 0) { return false; } this.resolvedConfigs.push(loc); var content = _fs2.default.readFileSync(loc, "utf8"); var options = void 0; try { options = jsonCache[content] = jsonCache[content] || json.parse(content); if (key) options = options[key]; } catch (err) { err.message = loc + ": Error while parsing JSON - " + err.message; throw err; } this.mergeConfig({ options: options, alias: loc, dirname: _path2.default.dirname(loc) }); return !!options; }; ConfigChainBuilder.prototype.mergeConfig = function mergeConfig(_ref) { var options = _ref.options, alias = _ref.alias, loc = _ref.loc, dirname = _ref.dirname; if (!options) { return false; } options = (0, _assign2.default)({}, options); dirname = dirname || process.cwd(); loc = loc || alias; if (options.extends) { var extendsLoc = (0, _resolve2.default)(options.extends, dirname); if (extendsLoc) { this.addConfig(extendsLoc); } else { if (this.log) this.log.error("Couldn't resolve extends clause of " + options.extends + " in " + alias); } delete options.extends; } this.configs.push({ options: options, alias: alias, loc: loc, dirname: dirname }); var envOpts = void 0; var envKey = process.env.BABEL_ENV || "production" || "development"; if (options.env) { envOpts = options.env[envKey]; delete options.env; } this.mergeConfig({ options: envOpts, alias: alias + ".env." + envKey, dirname: dirname }); }; return ConfigChainBuilder; }(); module.exports = exports["default"]; }); $__System.registerDynamic("cc", ["99", "5b", "5a", "17", "30", "1d", "cd", "98", "f", "a8", "ab", "af", "b0", "ce", "c3", "a9", "c4", "cb", "@node/path", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _objectWithoutProperties2 = $__require("99"); var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); var _stringify = $__require("5b"); var _stringify2 = _interopRequireDefault(_stringify); var _assign = $__require("5a"); var _assign2 = _interopRequireDefault(_assign); var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _typeof2 = $__require("30"); var _typeof3 = _interopRequireDefault(_typeof2); var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _node = $__require("cd"); var context = _interopRequireWildcard(_node); var _plugin2 = $__require("98"); var _plugin3 = _interopRequireDefault(_plugin2); var _babelMessages = $__require("f"); var messages = _interopRequireWildcard(_babelMessages); var _index = $__require("a8"); var _resolvePlugin = $__require("ab"); var _resolvePlugin2 = _interopRequireDefault(_resolvePlugin); var _resolvePreset = $__require("af"); var _resolvePreset2 = _interopRequireDefault(_resolvePreset); var _cloneDeepWith = $__require("b0"); var _cloneDeepWith2 = _interopRequireDefault(_cloneDeepWith); var _clone = $__require("ce"); var _clone2 = _interopRequireDefault(_clone); var _merge = $__require("c3"); var _merge2 = _interopRequireDefault(_merge); var _config2 = $__require("a9"); var _config3 = _interopRequireDefault(_config2); var _removed = $__require("c4"); var _removed2 = _interopRequireDefault(_removed); var _buildConfigChain = $__require("cb"); var _buildConfigChain2 = _interopRequireDefault(_buildConfigChain); var _path = $__require("@node/path"); var _path2 = _interopRequireDefault(_path); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var OptionManager = function () { function OptionManager(log) { (0, _classCallCheck3.default)(this, OptionManager); this.resolvedConfigs = []; this.options = OptionManager.createBareOptions(); this.log = log; } OptionManager.memoisePluginContainer = function memoisePluginContainer(fn, loc, i, alias) { for (var _iterator = OptionManager.memoisedPlugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 cache = _ref; if (cache.container === fn) return cache.plugin; } var obj = void 0; if (typeof fn === "function") { obj = fn(context); } else { obj = fn; } if ((typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) === "object") { var _plugin = new _plugin3.default(obj, alias); OptionManager.memoisedPlugins.push({ container: fn, plugin: _plugin }); return _plugin; } else { throw new TypeError(messages.get("pluginNotObject", loc, i, typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) + loc + i); } }; OptionManager.createBareOptions = function createBareOptions() { var opts = {}; for (var _key in _config3.default) { var opt = _config3.default[_key]; opts[_key] = (0, _clone2.default)(opt.default); } return opts; }; OptionManager.normalisePlugin = function normalisePlugin(plugin, loc, i, alias) { plugin = plugin.__esModule ? plugin.default : plugin; if (!(plugin instanceof _plugin3.default)) { if (typeof plugin === "function" || (typeof plugin === "undefined" ? "undefined" : (0, _typeof3.default)(plugin)) === "object") { plugin = OptionManager.memoisePluginContainer(plugin, loc, i, alias); } else { throw new TypeError(messages.get("pluginNotFunction", loc, i, typeof plugin === "undefined" ? "undefined" : (0, _typeof3.default)(plugin))); } } plugin.init(loc, i); return plugin; }; OptionManager.normalisePlugins = function normalisePlugins(loc, dirname, plugins) { return plugins.map(function (val, i) { var plugin = void 0, options = void 0; if (!val) { throw new TypeError("Falsy value found in plugins"); } if (Array.isArray(val)) { plugin = val[0]; options = val[1]; } else { plugin = val; } var alias = typeof plugin === "string" ? plugin : loc + "$" + i; if (typeof plugin === "string") { var pluginLoc = (0, _resolvePlugin2.default)(plugin, dirname); if (pluginLoc) { plugin = $__require(pluginLoc); } else { throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i, dirname)); } } plugin = OptionManager.normalisePlugin(plugin, loc, i, alias); return [plugin, options]; }); }; OptionManager.prototype.mergeOptions = function mergeOptions(_ref2) { var _this = this; var rawOpts = _ref2.options, extendingOpts = _ref2.extending, alias = _ref2.alias, loc = _ref2.loc, dirname = _ref2.dirname; alias = alias || "foreign"; if (!rawOpts) return; if ((typeof rawOpts === "undefined" ? "undefined" : (0, _typeof3.default)(rawOpts)) !== "object" || Array.isArray(rawOpts)) { this.log.error("Invalid options type for " + alias, TypeError); } var opts = (0, _cloneDeepWith2.default)(rawOpts, function (val) { if (val instanceof _plugin3.default) { return val; } }); dirname = dirname || process.cwd(); loc = loc || alias; for (var _key2 in opts) { var option = _config3.default[_key2]; if (!option && this.log) { if (_removed2.default[_key2]) { this.log.error("Using removed Babel 5 option: " + alias + "." + _key2 + " - " + _removed2.default[_key2].message, ReferenceError); } else { var unknownOptErr = "Unknown option: " + alias + "." + _key2 + ". Check out http://babeljs.io/docs/usage/options/ for more information about options."; var presetConfigErr = "A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:\n\nInvalid:\n `{ presets: [{option: value}] }`\nValid:\n `{ presets: [['presetName', {option: value}]] }`\n\nFor more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options."; this.log.error(unknownOptErr + "\n\n" + presetConfigErr, ReferenceError); } } } (0, _index.normaliseOptions)(opts); if (opts.plugins) { opts.plugins = OptionManager.normalisePlugins(loc, dirname, opts.plugins); } if (opts.presets) { if (opts.passPerPreset) { opts.presets = this.resolvePresets(opts.presets, dirname, function (preset, presetLoc) { _this.mergeOptions({ options: preset, extending: preset, alias: presetLoc, loc: presetLoc, dirname: dirname }); }); } else { this.mergePresets(opts.presets, dirname); delete opts.presets; } } if (rawOpts === extendingOpts) { (0, _assign2.default)(extendingOpts, opts); } else { (0, _merge2.default)(extendingOpts || this.options, opts); } }; OptionManager.prototype.mergePresets = function mergePresets(presets, dirname) { var _this2 = this; this.resolvePresets(presets, dirname, function (presetOpts, presetLoc) { _this2.mergeOptions({ options: presetOpts, alias: presetLoc, loc: presetLoc, dirname: _path2.default.dirname(presetLoc || "") }); }); }; OptionManager.prototype.resolvePresets = function resolvePresets(presets, dirname, onResolve) { return presets.map(function (val) { var options = void 0; if (Array.isArray(val)) { if (val.length > 2) { throw new Error("Unexpected extra options " + (0, _stringify2.default)(val.slice(2)) + " passed to preset."); } var _val = val; val = _val[0]; options = _val[1]; } var presetLoc = void 0; try { if (typeof val === "string") { presetLoc = (0, _resolvePreset2.default)(val, dirname); if (!presetLoc) { throw new Error("Couldn't find preset " + (0, _stringify2.default)(val) + " relative to directory " + (0, _stringify2.default)(dirname)); } val = $__require(presetLoc); } if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object" && val.__esModule) { if (val.default) { val = val.default; } else { var _val2 = val, __esModule = _val2.__esModule, rest = (0, _objectWithoutProperties3.default)(_val2, ["__esModule"]); val = rest; } } if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object" && val.buildPreset) val = val.buildPreset; if (typeof val !== "function" && options !== undefined) { throw new Error("Options " + (0, _stringify2.default)(options) + " passed to " + (presetLoc || "a preset") + " which does not accept options."); } if (typeof val === "function") val = val(context, options, { dirname: dirname }); if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) !== "object") { throw new Error("Unsupported preset format: " + val + "."); } onResolve && onResolve(val, presetLoc); } catch (e) { if (presetLoc) { e.message += " (While processing preset: " + (0, _stringify2.default)(presetLoc) + ")"; } throw e; } return val; }); }; OptionManager.prototype.normaliseOptions = function normaliseOptions() { var opts = this.options; for (var _key3 in _config3.default) { var option = _config3.default[_key3]; var val = opts[_key3]; if (!val && option.optional) continue; if (option.alias) { opts[option.alias] = opts[option.alias] || val; } else { opts[_key3] = val; } } }; OptionManager.prototype.init = function init() { var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; for (var _iterator2 = (0, _buildConfigChain2.default)(opts, this.log), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref3; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref3 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref3 = _i2.value; } var _config = _ref3; this.mergeOptions(_config); } this.normaliseOptions(opts); return this.options; }; return OptionManager; }(); exports.default = OptionManager; OptionManager.memoisedPlugins = []; module.exports = exports["default"]; }); $__System.registerDynamic("1b", ["cf", "1d", "1e", "1f", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _map = $__require("cf"); var _map2 = _interopRequireDefault(_map); var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _possibleConstructorReturn2 = $__require("1e"); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = $__require("1f"); var _inherits3 = _interopRequireDefault(_inherits2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Store = function (_Map) { (0, _inherits3.default)(Store, _Map); function Store() { (0, _classCallCheck3.default)(this, Store); var _this = (0, _possibleConstructorReturn3.default)(this, _Map.call(this)); _this.dynamicData = {}; return _this; } Store.prototype.setDynamic = function setDynamic(key, fn) { this.dynamicData[key] = fn; }; Store.prototype.get = function get(key) { if (this.has(key)) { return _Map.prototype.get.call(this, key); } else { if (Object.prototype.hasOwnProperty.call(this.dynamicData, key)) { var val = this.dynamicData[key](); this.set(key, val); return val; } } }; return Store; }(_map2.default); exports.default = Store; module.exports = exports["default"]; }); $__System.registerDynamic("98", ["17", "1d", "1e", "1f", "cc", "f", "1b", "d0", "d1", "ce", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _possibleConstructorReturn2 = $__require("1e"); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = $__require("1f"); var _inherits3 = _interopRequireDefault(_inherits2); var _optionManager = $__require("cc"); var _optionManager2 = _interopRequireDefault(_optionManager); var _babelMessages = $__require("f"); var messages = _interopRequireWildcard(_babelMessages); var _store = $__require("1b"); var _store2 = _interopRequireDefault(_store); var _babelTraverse = $__require("d0"); var _babelTraverse2 = _interopRequireDefault(_babelTraverse); var _assign = $__require("d1"); var _assign2 = _interopRequireDefault(_assign); var _clone = $__require("ce"); var _clone2 = _interopRequireDefault(_clone); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var GLOBAL_VISITOR_PROPS = ["enter", "exit"]; var Plugin = function (_Store) { (0, _inherits3.default)(Plugin, _Store); function Plugin(plugin, key) { (0, _classCallCheck3.default)(this, Plugin); var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); _this.initialized = false; _this.raw = (0, _assign2.default)({}, plugin); _this.key = _this.take("name") || key; _this.manipulateOptions = _this.take("manipulateOptions"); _this.post = _this.take("post"); _this.pre = _this.take("pre"); _this.visitor = _this.normaliseVisitor((0, _clone2.default)(_this.take("visitor")) || {}); return _this; } Plugin.prototype.take = function take(key) { var val = this.raw[key]; delete this.raw[key]; return val; }; Plugin.prototype.chain = function chain(target, key) { if (!target[key]) return this[key]; if (!this[key]) return target[key]; var fns = [target[key], this[key]]; return function () { var val = void 0; for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } for (var _iterator = fns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 fn = _ref; if (fn) { var ret = fn.apply(this, args); if (ret != null) val = ret; } } return val; }; }; Plugin.prototype.maybeInherit = function maybeInherit(loc) { var inherits = this.take("inherits"); if (!inherits) return; inherits = _optionManager2.default.normalisePlugin(inherits, loc, "inherits"); this.manipulateOptions = this.chain(inherits, "manipulateOptions"); this.post = this.chain(inherits, "post"); this.pre = this.chain(inherits, "pre"); this.visitor = _babelTraverse2.default.visitors.merge([inherits.visitor, this.visitor]); }; Plugin.prototype.init = function init(loc, i) { if (this.initialized) return; this.initialized = true; this.maybeInherit(loc); for (var key in this.raw) { throw new Error(messages.get("pluginInvalidProperty", loc, i, key)); } }; Plugin.prototype.normaliseVisitor = function normaliseVisitor(visitor) { for (var _iterator2 = GLOBAL_VISITOR_PROPS, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var key = _ref2; if (visitor[key]) { throw new Error("Plugins aren't allowed to specify catch-all enter/exit handlers. " + "Please target individual nodes."); } } _babelTraverse2.default.explode(visitor); return visitor; }; return Plugin; }(_store2.default); exports.default = Plugin; module.exports = exports["default"]; }); $__System.registerDynamic("d2", ["d3", "98", "11", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _symbol = $__require("d3"); var _symbol2 = _interopRequireDefault(_symbol); var _plugin = $__require("98"); var _plugin2 = _interopRequireDefault(_plugin); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var SUPER_THIS_BOUND = (0, _symbol2.default)("super this bound"); var superVisitor = { CallExpression: function CallExpression(path) { if (!path.get("callee").isSuper()) return; var node = path.node; if (node[SUPER_THIS_BOUND]) return; node[SUPER_THIS_BOUND] = true; path.replaceWith(t.assignmentExpression("=", this.id, node)); } }; exports.default = new _plugin2.default({ name: "internal.shadowFunctions", visitor: { ThisExpression: function ThisExpression(path) { remap(path, "this"); }, ReferencedIdentifier: function ReferencedIdentifier(path) { if (path.node.name === "arguments") { remap(path, "arguments"); } } } }); function shouldShadow(path, shadowPath) { if (path.is("_forceShadow")) { return true; } else { return shadowPath; } } function remap(path, key) { var shadowPath = path.inShadow(key); if (!shouldShadow(path, shadowPath)) return; var shadowFunction = path.node._shadowedFunctionLiteral; var currentFunction = void 0; var passedShadowFunction = false; var fnPath = path.find(function (innerPath) { if (innerPath.parentPath && innerPath.parentPath.isClassProperty() && innerPath.key === "value") { return true; } if (path === innerPath) return false; if (innerPath.isProgram() || innerPath.isFunction()) { currentFunction = currentFunction || innerPath; } if (innerPath.isProgram()) { passedShadowFunction = true; return true; } else if (innerPath.isFunction() && !innerPath.isArrowFunctionExpression()) { if (shadowFunction) { if (innerPath === shadowFunction || innerPath.node === shadowFunction.node) return true; } else { if (!innerPath.is("shadow")) return true; } passedShadowFunction = true; return false; } return false; }); if (shadowFunction && fnPath.isProgram() && !shadowFunction.isProgram()) { fnPath = path.findParent(function (p) { return p.isProgram() || p.isFunction(); }); } if (fnPath === currentFunction) return; if (!passedShadowFunction) return; var cached = fnPath.getData(key); if (cached) return path.replaceWith(cached); var id = path.scope.generateUidIdentifier(key); fnPath.setData(key, id); var classPath = fnPath.findParent(function (p) { return p.isClass(); }); var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass); if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) { fnPath.scope.push({ id: id }); fnPath.traverse(superVisitor, { id: id }); } else { var init = key === "this" ? t.thisExpression() : t.identifier(key); if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction; fnPath.scope.push({ id: id, init: init }); } return path.replaceWith(id); } module.exports = exports["default"]; }); $__System.registerDynamic("1c", ["17", "d4", "5a", "1d", "1e", "1f", "d", "16", "18", "cc", "1a", "d0", "2e", "e", "d5", "d6", "5f", "1b", "d7", "a4", "@node/path", "11", "ad", "97", "d2", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.File = undefined; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _create = $__require("d4"); var _create2 = _interopRequireDefault(_create); var _assign = $__require("5a"); var _assign2 = _interopRequireDefault(_assign); var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _possibleConstructorReturn2 = $__require("1e"); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = $__require("1f"); var _inherits3 = _interopRequireDefault(_inherits2); var _babelHelpers = $__require("d"); var _babelHelpers2 = _interopRequireDefault(_babelHelpers); var _metadata = $__require("16"); var metadataVisitor = _interopRequireWildcard(_metadata); var _convertSourceMap = $__require("18"); var _convertSourceMap2 = _interopRequireDefault(_convertSourceMap); var _optionManager = $__require("cc"); var _optionManager2 = _interopRequireDefault(_optionManager); var _pluginPass = $__require("1a"); var _pluginPass2 = _interopRequireDefault(_pluginPass); var _babelTraverse = $__require("d0"); var _babelTraverse2 = _interopRequireDefault(_babelTraverse); var _sourceMap = $__require("2e"); var _sourceMap2 = _interopRequireDefault(_sourceMap); var _babelGenerator = $__require("e"); var _babelGenerator2 = _interopRequireDefault(_babelGenerator); var _babelCodeFrame = $__require("d5"); var _babelCodeFrame2 = _interopRequireDefault(_babelCodeFrame); var _defaults = $__require("d6"); var _defaults2 = _interopRequireDefault(_defaults); var _logger = $__require("5f"); var _logger2 = _interopRequireDefault(_logger); var _store = $__require("1b"); var _store2 = _interopRequireDefault(_store); var _babylon = $__require("d7"); var _util = $__require("a4"); var util = _interopRequireWildcard(_util); var _path = $__require("@node/path"); var _path2 = _interopRequireDefault(_path); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); var _resolve = $__require("ad"); var _resolve2 = _interopRequireDefault(_resolve); var _blockHoist = $__require("97"); var _blockHoist2 = _interopRequireDefault(_blockHoist); var _shadowFunctions = $__require("d2"); var _shadowFunctions2 = _interopRequireDefault(_shadowFunctions); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var shebangRegex = /^#!.*/; var INTERNAL_PLUGINS = [[_blockHoist2.default], [_shadowFunctions2.default]]; var errorVisitor = { enter: function enter(path, state) { var loc = path.node.loc; if (loc) { state.loc = loc; path.stop(); } } }; var File = function (_Store) { (0, _inherits3.default)(File, _Store); function File() { var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var pipeline = arguments[1]; (0, _classCallCheck3.default)(this, File); var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this)); _this.pipeline = pipeline; _this.log = new _logger2.default(_this, opts.filename || "unknown"); _this.opts = _this.initOptions(opts); _this.parserOpts = { sourceType: _this.opts.sourceType, sourceFileName: _this.opts.filename, plugins: [] }; _this.pluginVisitors = []; _this.pluginPasses = []; _this.buildPluginsForOptions(_this.opts); if (_this.opts.passPerPreset) { _this.perPresetOpts = []; _this.opts.presets.forEach(function (presetOpts) { var perPresetOpts = (0, _assign2.default)((0, _create2.default)(_this.opts), presetOpts); _this.perPresetOpts.push(perPresetOpts); _this.buildPluginsForOptions(perPresetOpts); }); } _this.metadata = { usedHelpers: [], marked: [], modules: { imports: [], exports: { exported: [], specifiers: [] } } }; _this.dynamicImportTypes = {}; _this.dynamicImportIds = {}; _this.dynamicImports = []; _this.declarations = {}; _this.usedHelpers = {}; _this.path = null; _this.ast = {}; _this.code = ""; _this.shebang = ""; _this.hub = new _babelTraverse.Hub(_this); return _this; } File.prototype.getMetadata = function getMetadata() { var has = false; for (var _iterator = this.ast.program.body, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 node = _ref; if (t.isModuleDeclaration(node)) { has = true; break; } } if (has) { this.path.traverse(metadataVisitor, this); } }; File.prototype.initOptions = function initOptions(opts) { opts = new _optionManager2.default(this.log, this.pipeline).init(opts); if (opts.inputSourceMap) { opts.sourceMaps = true; } if (opts.moduleId) { opts.moduleIds = true; } opts.basename = _path2.default.basename(opts.filename, _path2.default.extname(opts.filename)); opts.ignore = util.arrayify(opts.ignore, util.regexify); if (opts.only) opts.only = util.arrayify(opts.only, util.regexify); (0, _defaults2.default)(opts, { moduleRoot: opts.sourceRoot }); (0, _defaults2.default)(opts, { sourceRoot: opts.moduleRoot }); (0, _defaults2.default)(opts, { filenameRelative: opts.filename }); var basenameRelative = _path2.default.basename(opts.filenameRelative); (0, _defaults2.default)(opts, { sourceFileName: basenameRelative, sourceMapTarget: basenameRelative }); return opts; }; File.prototype.buildPluginsForOptions = function buildPluginsForOptions(opts) { if (!Array.isArray(opts.plugins)) { return; } var plugins = opts.plugins.concat(INTERNAL_PLUGINS); var currentPluginVisitors = []; var currentPluginPasses = []; for (var _iterator2 = plugins, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var ref = _ref2; var plugin = ref[0], pluginOpts = ref[1]; currentPluginVisitors.push(plugin.visitor); currentPluginPasses.push(new _pluginPass2.default(this, plugin, pluginOpts)); if (plugin.manipulateOptions) { plugin.manipulateOptions(opts, this.parserOpts, this); } } this.pluginVisitors.push(currentPluginVisitors); this.pluginPasses.push(currentPluginPasses); }; File.prototype.getModuleName = function getModuleName() { var opts = this.opts; if (!opts.moduleIds) { return null; } if (opts.moduleId != null && !opts.getModuleId) { return opts.moduleId; } var filenameRelative = opts.filenameRelative; var moduleName = ""; if (opts.moduleRoot != null) { moduleName = opts.moduleRoot + "/"; } if (!opts.filenameRelative) { return moduleName + opts.filename.replace(/^\//, ""); } if (opts.sourceRoot != null) { var sourceRootRegEx = new RegExp("^" + opts.sourceRoot + "\/?"); filenameRelative = filenameRelative.replace(sourceRootRegEx, ""); } filenameRelative = filenameRelative.replace(/\.(\w*?)$/, ""); moduleName += filenameRelative; moduleName = moduleName.replace(/\\/g, "/"); if (opts.getModuleId) { return opts.getModuleId(moduleName) || moduleName; } else { return moduleName; } }; File.prototype.resolveModuleSource = function resolveModuleSource(source) { var resolveModuleSource = this.opts.resolveModuleSource; if (resolveModuleSource) source = resolveModuleSource(source, this.opts.filename); return source; }; File.prototype.addImport = function addImport(source, imported) { var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : imported; var alias = source + ":" + imported; var id = this.dynamicImportIds[alias]; if (!id) { source = this.resolveModuleSource(source); id = this.dynamicImportIds[alias] = this.scope.generateUidIdentifier(name); var specifiers = []; if (imported === "*") { specifiers.push(t.importNamespaceSpecifier(id)); } else if (imported === "default") { specifiers.push(t.importDefaultSpecifier(id)); } else { specifiers.push(t.importSpecifier(id, t.identifier(imported))); } var declar = t.importDeclaration(specifiers, t.stringLiteral(source)); declar._blockHoist = 3; this.path.unshiftContainer("body", declar); } return id; }; File.prototype.addHelper = function addHelper(name) { var declar = this.declarations[name]; if (declar) return declar; if (!this.usedHelpers[name]) { this.metadata.usedHelpers.push(name); this.usedHelpers[name] = true; } 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(runtime, t.identifier(name)); } var ref = (0, _babelHelpers2.default)(name); var uid = this.declarations[name] = this.scope.generateUidIdentifier(name); if (t.isFunctionExpression(ref) && !ref.id) { ref.body._compact = true; ref._generated = true; ref.id = uid; ref.type = "FunctionDeclaration"; this.path.unshiftContainer("body", ref); } else { ref._compact = true; this.scope.push({ id: uid, init: ref, unique: true }); } return uid; }; File.prototype.addTemplateObject = function addTemplateObject(helperName, strings, raw) { var stringIds = raw.elements.map(function (string) { return string.value; }); var name = helperName + "_" + raw.elements.length + "_" + stringIds.join(","); var declar = this.declarations[name]; if (declar) return declar; var uid = this.declarations[name] = this.scope.generateUidIdentifier("templateObject"); var helperId = this.addHelper(helperName); var init = t.callExpression(helperId, [strings, raw]); init._compact = true; this.scope.push({ id: uid, init: init, _blockHoist: 1.9 }); return uid; }; File.prototype.buildCodeFrameError = function buildCodeFrameError(node, msg) { var Error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : SyntaxError; var loc = node && (node.loc || node._loc); var err = new Error(msg); if (loc) { err.loc = loc.start; } else { (0, _babelTraverse2.default)(node, errorVisitor, this.scope, err); err.message += " (This is an error on an internal node. Probably an internal error"; if (err.loc) { err.message += ". Location has been estimated."; } err.message += ")"; } return err; }; File.prototype.mergeSourceMap = function mergeSourceMap(map) { var inputMap = this.opts.inputSourceMap; if (inputMap) { var inputMapConsumer = new _sourceMap2.default.SourceMapConsumer(inputMap); var outputMapConsumer = new _sourceMap2.default.SourceMapConsumer(map); var mergedGenerator = new _sourceMap2.default.SourceMapGenerator({ file: inputMapConsumer.file, sourceRoot: inputMapConsumer.sourceRoot }); var source = outputMapConsumer.sources[0]; inputMapConsumer.eachMapping(function (mapping) { var generatedPosition = outputMapConsumer.generatedPositionFor({ line: mapping.generatedLine, column: mapping.generatedColumn, source: source }); if (generatedPosition.column != null) { mergedGenerator.addMapping({ source: mapping.source, original: mapping.source == null ? null : { line: mapping.originalLine, column: mapping.originalColumn }, generated: generatedPosition }); } }); var mergedMap = mergedGenerator.toJSON(); inputMap.mappings = mergedMap.mappings; return inputMap; } else { return map; } }; File.prototype.parse = function parse(code) { var parseCode = _babylon.parse; var parserOpts = this.opts.parserOpts; if (parserOpts) { parserOpts = (0, _assign2.default)({}, this.parserOpts, parserOpts); if (parserOpts.parser) { if (typeof parserOpts.parser === "string") { var dirname = _path2.default.dirname(this.opts.filename) || process.cwd(); var parser = (0, _resolve2.default)(parserOpts.parser, dirname); if (parser) { parseCode = $__require(parser).parse; } else { throw new Error("Couldn't find parser " + parserOpts.parser + " with \"parse\" method " + ("relative to directory " + dirname)); } } else { parseCode = parserOpts.parser; } parserOpts.parser = { parse: function parse(source) { return (0, _babylon.parse)(source, parserOpts); } }; } } this.log.debug("Parse start"); var ast = parseCode(code, parserOpts || this.parserOpts); this.log.debug("Parse stop"); return ast; }; File.prototype._addAst = function _addAst(ast) { this.path = _babelTraverse.NodePath.get({ hub: this.hub, parentPath: null, parent: ast, container: ast, key: "program" }).setContext(); this.scope = this.path.scope; this.ast = ast; this.getMetadata(); }; File.prototype.addAst = function addAst(ast) { this.log.debug("Start set AST"); this._addAst(ast); this.log.debug("End set AST"); }; File.prototype.transform = function transform() { for (var i = 0; i < this.pluginPasses.length; i++) { var pluginPasses = this.pluginPasses[i]; this.call("pre", pluginPasses); this.log.debug("Start transform traverse"); var visitor = _babelTraverse2.default.visitors.merge(this.pluginVisitors[i], pluginPasses, this.opts.wrapPluginVisitorMethod); (0, _babelTraverse2.default)(this.ast, visitor, this.scope); this.log.debug("End transform traverse"); this.call("post", pluginPasses); } return this.generate(); }; File.prototype.wrap = function wrap(code, callback) { code = code + ""; try { if (this.shouldIgnore()) { return this.makeResult({ code: code, ignored: true }); } else { return callback(); } } catch (err) { if (err._babel) { throw err; } else { err._babel = true; } var message = err.message = this.opts.filename + ": " + err.message; var loc = err.loc; if (loc) { err.codeFrame = (0, _babelCodeFrame2.default)(code, loc.line, loc.column + 1, this.opts); message += "\n" + err.codeFrame; } if (process.browser) { err.message = message; } if (err.stack) { var newStack = err.stack.replace(err.message, message); err.stack = newStack; } throw err; } }; File.prototype.addCode = function addCode(code) { code = (code || "") + ""; code = this.parseInputSourceMap(code); this.code = code; }; File.prototype.parseCode = function parseCode() { this.parseShebang(); var ast = this.parse(this.code); this.addAst(ast); }; File.prototype.shouldIgnore = function shouldIgnore() { var opts = this.opts; return util.shouldIgnore(opts.filename, opts.ignore, opts.only); }; File.prototype.call = function call(key, pluginPasses) { for (var _iterator3 = pluginPasses, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var pass = _ref3; var plugin = pass.plugin; var fn = plugin[key]; if (fn) fn.call(pass, this); } }; File.prototype.parseInputSourceMap = function parseInputSourceMap(code) { var opts = this.opts; if (opts.inputSourceMap !== false) { var inputMap = _convertSourceMap2.default.fromSource(code); if (inputMap) { opts.inputSourceMap = inputMap.toObject(); code = _convertSourceMap2.default.removeComments(code); } } return code; }; File.prototype.parseShebang = function parseShebang() { var shebangMatch = shebangRegex.exec(this.code); if (shebangMatch) { this.shebang = shebangMatch[0]; this.code = this.code.replace(shebangRegex, ""); } }; File.prototype.makeResult = function makeResult(_ref4) { var code = _ref4.code, map = _ref4.map, ast = _ref4.ast, ignored = _ref4.ignored; var result = { metadata: null, options: this.opts, ignored: !!ignored, code: null, ast: null, map: map || null }; if (this.opts.code) { result.code = code; } if (this.opts.ast) { result.ast = ast; } if (this.opts.metadata) { result.metadata = this.metadata; } return result; }; File.prototype.generate = function generate() { var opts = this.opts; var ast = this.ast; var result = { ast: ast }; if (!opts.code) return this.makeResult(result); var gen = _babelGenerator2.default; if (opts.generatorOpts.generator) { gen = opts.generatorOpts.generator; if (typeof gen === "string") { var dirname = _path2.default.dirname(this.opts.filename) || process.cwd(); var generator = (0, _resolve2.default)(gen, dirname); if (generator) { gen = $__require(generator).print; } else { throw new Error("Couldn't find generator " + gen + " with \"print\" method relative " + ("to directory " + dirname)); } } } this.log.debug("Generation start"); var _result = gen(ast, opts.generatorOpts ? (0, _assign2.default)(opts, opts.generatorOpts) : opts, this.code); result.code = _result.code; result.map = _result.map; this.log.debug("Generation end"); if (this.shebang) { result.code = this.shebang + "\n" + result.code; } if (result.map) { result.map = this.mergeSourceMap(result.map); } if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") { result.code += "\n" + _convertSourceMap2.default.fromObject(result.map).toComment(); } if (opts.sourceMaps === "inline") { result.map = null; } return this.makeResult(result); }; return File; }(_store2.default); exports.default = File; exports.File = File; }); $__System.registerDynamic("d8", ["1d", "13", "98", "1c", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _normalizeAst = $__require("13"); var _normalizeAst2 = _interopRequireDefault(_normalizeAst); var _plugin = $__require("98"); var _plugin2 = _interopRequireDefault(_plugin); var _file = $__require("1c"); var _file2 = _interopRequireDefault(_file); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Pipeline = function () { function Pipeline() { (0, _classCallCheck3.default)(this, Pipeline); } Pipeline.prototype.lint = function lint(code) { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; opts.code = false; opts.mode = "lint"; return this.transform(code, opts); }; Pipeline.prototype.pretransform = function pretransform(code, opts) { var file = new _file2.default(opts, this); return file.wrap(code, function () { file.addCode(code); file.parseCode(code); return file; }); }; Pipeline.prototype.transform = function transform(code, opts) { var file = new _file2.default(opts, this); return file.wrap(code, function () { file.addCode(code); file.parseCode(code); return file.transform(); }); }; Pipeline.prototype.analyse = function analyse(code) { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var visitor = arguments[2]; opts.code = false; if (visitor) { opts.plugins = opts.plugins || []; opts.plugins.push(new _plugin2.default({ visitor: visitor })); } return this.transform(code, opts).metadata; }; Pipeline.prototype.transformFromAst = function transformFromAst(ast, code, opts) { ast = (0, _normalizeAst2.default)(ast); var file = new _file2.default(opts, this); return file.wrap(code, function () { file.addCode(code); file.addAst(ast); return file.transform(); }); }; return Pipeline; }(); exports.default = Pipeline; module.exports = exports["default"]; }); $__System.registerDynamic("cd", ["1c", "a9", "b", "10", "ab", "af", "12", "@node/fs", "a4", "f", "11", "d0", "cc", "d8", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.transformFromAst = exports.transform = exports.analyse = exports.Pipeline = exports.OptionManager = exports.traverse = exports.types = exports.messages = exports.util = exports.version = exports.resolvePreset = exports.resolvePlugin = exports.template = exports.buildExternalHelpers = exports.options = exports.File = undefined; var _file = $__require("1c"); Object.defineProperty(exports, "File", { enumerable: true, get: function get() { return _interopRequireDefault(_file).default; } }); var _config = $__require("a9"); Object.defineProperty(exports, "options", { enumerable: true, get: function get() { return _interopRequireDefault(_config).default; } }); var _buildExternalHelpers = $__require("b"); Object.defineProperty(exports, "buildExternalHelpers", { enumerable: true, get: function get() { return _interopRequireDefault(_buildExternalHelpers).default; } }); var _babelTemplate = $__require("10"); Object.defineProperty(exports, "template", { enumerable: true, get: function get() { return _interopRequireDefault(_babelTemplate).default; } }); var _resolvePlugin = $__require("ab"); Object.defineProperty(exports, "resolvePlugin", { enumerable: true, get: function get() { return _interopRequireDefault(_resolvePlugin).default; } }); var _resolvePreset = $__require("af"); Object.defineProperty(exports, "resolvePreset", { enumerable: true, get: function get() { return _interopRequireDefault(_resolvePreset).default; } }); var _package = $__require("12"); Object.defineProperty(exports, "version", { enumerable: true, get: function get() { return _package.version; } }); exports.Plugin = Plugin; exports.transformFile = transformFile; exports.transformFileSync = transformFileSync; var _fs = $__require("@node/fs"); var _fs2 = _interopRequireDefault(_fs); var _util = $__require("a4"); var util = _interopRequireWildcard(_util); var _babelMessages = $__require("f"); var messages = _interopRequireWildcard(_babelMessages); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); var _babelTraverse = $__require("d0"); var _babelTraverse2 = _interopRequireDefault(_babelTraverse); var _optionManager = $__require("cc"); var _optionManager2 = _interopRequireDefault(_optionManager); var _pipeline = $__require("d8"); var _pipeline2 = _interopRequireDefault(_pipeline); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.util = util; exports.messages = messages; exports.types = t; exports.traverse = _babelTraverse2.default; exports.OptionManager = _optionManager2.default; function Plugin(alias) { throw new Error("The (" + alias + ") Babel 5 plugin is being run with Babel 6."); } exports.Pipeline = _pipeline2.default; var pipeline = new _pipeline2.default(); var analyse = exports.analyse = pipeline.analyse.bind(pipeline); var transform = exports.transform = pipeline.transform.bind(pipeline); var transformFromAst = exports.transformFromAst = pipeline.transformFromAst.bind(pipeline); function transformFile(filename, opts, callback) { if (typeof opts === "function") { callback = opts; opts = {}; } opts.filename = filename; _fs2.default.readFile(filename, function (err, code) { var result = void 0; if (!err) { try { result = transform(code, opts); } catch (_err) { err = _err; } } if (err) { callback(err); } else { callback(null, result); } }); } function transformFileSync(filename) { var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; opts.filename = filename; return transform(_fs2.default.readFileSync(filename, "utf8"), opts); } }); $__System.registerDynamic("d9", ["cd", "c"], true, function ($__require, exports, module) { var process = $__require("c"); var global = this || self, GLOBAL = global; module.exports = $__require("cd"); }); $__System.registerDynamic("da", ["d4", "17", "d3", "db", "10"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _create = $__require("d4"); var _create2 = _interopRequireDefault(_create); var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _symbol = $__require("d3"); var _symbol2 = _interopRequireDefault(_symbol); exports.default = function (_ref) { var t = _ref.types; var IGNORE_REASSIGNMENT_SYMBOL = (0, _symbol2.default)(); var reassignmentVisitor = { "AssignmentExpression|UpdateExpression": function AssignmentExpressionUpdateExpression(path) { if (path.node[IGNORE_REASSIGNMENT_SYMBOL]) return; path.node[IGNORE_REASSIGNMENT_SYMBOL] = true; var arg = path.get(path.isAssignmentExpression() ? "left" : "argument"); if (!arg.isIdentifier()) return; var name = arg.node.name; if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return; var exportedNames = this.exports[name]; if (!exportedNames) return; var node = path.node; var isPostUpdateExpression = path.isUpdateExpression() && !node.prefix; if (isPostUpdateExpression) { if (node.operator === "++") node = t.binaryExpression("+", node.argument, t.numericLiteral(1));else if (node.operator === "--") node = t.binaryExpression("-", node.argument, t.numericLiteral(1));else isPostUpdateExpression = false; } for (var _iterator = exportedNames, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 exportedName = _ref2; node = this.buildCall(exportedName, node).expression; } if (isPostUpdateExpression) node = t.sequenceExpression([node, path.node]); path.replaceWith(node); } }; return { visitor: { CallExpression: function CallExpression(path, state) { if (path.node.callee.type === TYPE_IMPORT) { var contextIdent = state.contextIdent; path.replaceWith(t.callExpression(t.memberExpression(contextIdent, t.identifier("import")), path.node.arguments)); } }, ReferencedIdentifier: function ReferencedIdentifier(path, state) { if (path.node.name == "__moduleName" && !path.scope.hasBinding("__moduleName")) { path.replaceWith(t.memberExpression(state.contextIdent, t.identifier("id"))); } }, Program: { enter: function enter(path, state) { state.contextIdent = path.scope.generateUidIdentifier("context"); }, exit: function exit(path, state) { var exportIdent = path.scope.generateUidIdentifier("export"); var contextIdent = state.contextIdent; var exportNames = (0, _create2.default)(null); var modules = []; var beforeBody = []; var setters = []; var sources = []; var variableIds = []; var removedPaths = []; function addExportName(key, val) { exportNames[key] = exportNames[key] || []; exportNames[key].push(val); } function pushModule(source, key, specifiers) { var module = void 0; modules.forEach(function (m) { if (m.key === source) { module = m; } }); if (!module) { modules.push(module = { key: source, imports: [], exports: [] }); } module[key] = module[key].concat(specifiers); } function buildExportCall(name, val) { return t.expressionStatement(t.callExpression(exportIdent, [t.stringLiteral(name), val])); } var body = path.get("body"); var canHoist = true; for (var _iterator2 = body, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref3; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref3 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref3 = _i2.value; } var _path = _ref3; if (_path.isExportDeclaration()) _path = _path.get("declaration"); if (_path.isVariableDeclaration() && _path.node.kind !== "var") { canHoist = false; break; } } for (var _iterator3 = body, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref4; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref4 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref4 = _i3.value; } var _path2 = _ref4; if (canHoist && _path2.isFunctionDeclaration()) { beforeBody.push(_path2.node); removedPaths.push(_path2); } else if (_path2.isImportDeclaration()) { var source = _path2.node.source.value; pushModule(source, "imports", _path2.node.specifiers); for (var name in _path2.getBindingIdentifiers()) { _path2.scope.removeBinding(name); variableIds.push(t.identifier(name)); } _path2.remove(); } else if (_path2.isExportAllDeclaration()) { pushModule(_path2.node.source.value, "exports", _path2.node); _path2.remove(); } else if (_path2.isExportDefaultDeclaration()) { var declar = _path2.get("declaration"); if (declar.isClassDeclaration() || declar.isFunctionDeclaration()) { var id = declar.node.id; var nodes = []; if (id) { nodes.push(declar.node); nodes.push(buildExportCall("default", id)); addExportName(id.name, "default"); } else { nodes.push(buildExportCall("default", t.toExpression(declar.node))); } if (!canHoist || declar.isClassDeclaration()) { _path2.replaceWithMultiple(nodes); } else { beforeBody = beforeBody.concat(nodes); removedPaths.push(_path2); } } else { _path2.replaceWith(buildExportCall("default", declar.node)); } } else if (_path2.isExportNamedDeclaration()) { var _declar = _path2.get("declaration"); if (_declar.node) { _path2.replaceWith(_declar); var _nodes = []; var bindingIdentifiers = void 0; if (_path2.isFunction()) { var node = _declar.node; var _name = node.id.name; if (canHoist) { addExportName(_name, _name); beforeBody.push(node); beforeBody.push(buildExportCall(_name, node.id)); removedPaths.push(_path2); } else { var _bindingIdentifiers; bindingIdentifiers = (_bindingIdentifiers = {}, _bindingIdentifiers[_name] = node.id, _bindingIdentifiers); } } else { bindingIdentifiers = _declar.getBindingIdentifiers(); } for (var _name2 in bindingIdentifiers) { addExportName(_name2, _name2); _nodes.push(buildExportCall(_name2, t.identifier(_name2))); } _path2.insertAfter(_nodes); } else { var specifiers = _path2.node.specifiers; if (specifiers && specifiers.length) { if (_path2.node.source) { pushModule(_path2.node.source.value, "exports", specifiers); _path2.remove(); } else { var _nodes2 = []; for (var _iterator7 = specifiers, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) { var _ref8; if (_isArray7) { if (_i7 >= _iterator7.length) break; _ref8 = _iterator7[_i7++]; } else { _i7 = _iterator7.next(); if (_i7.done) break; _ref8 = _i7.value; } var specifier = _ref8; _nodes2.push(buildExportCall(specifier.exported.name, specifier.local)); addExportName(specifier.local.name, specifier.exported.name); } _path2.replaceWithMultiple(_nodes2); } } } } } modules.forEach(function (specifiers) { var setterBody = []; var target = path.scope.generateUidIdentifier(specifiers.key); for (var _iterator4 = specifiers.imports, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { var _ref5; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref5 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref5 = _i4.value; } var specifier = _ref5; if (t.isImportNamespaceSpecifier(specifier)) { setterBody.push(t.expressionStatement(t.assignmentExpression("=", specifier.local, target))); } else if (t.isImportDefaultSpecifier(specifier)) { specifier = t.importSpecifier(specifier.local, t.identifier("default")); } if (t.isImportSpecifier(specifier)) { setterBody.push(t.expressionStatement(t.assignmentExpression("=", specifier.local, t.memberExpression(target, specifier.imported)))); } } if (specifiers.exports.length) { var exportObjRef = path.scope.generateUidIdentifier("exportObj"); setterBody.push(t.variableDeclaration("var", [t.variableDeclarator(exportObjRef, t.objectExpression([]))])); for (var _iterator5 = specifiers.exports, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { var _ref6; if (_isArray5) { if (_i5 >= _iterator5.length) break; _ref6 = _iterator5[_i5++]; } else { _i5 = _iterator5.next(); if (_i5.done) break; _ref6 = _i5.value; } var node = _ref6; if (t.isExportAllDeclaration(node)) { setterBody.push(buildExportAll({ KEY: path.scope.generateUidIdentifier("key"), EXPORT_OBJ: exportObjRef, TARGET: target })); } else if (t.isExportSpecifier(node)) { setterBody.push(t.expressionStatement(t.assignmentExpression("=", t.memberExpression(exportObjRef, node.exported), t.memberExpression(target, node.local)))); } else {} } setterBody.push(t.expressionStatement(t.callExpression(exportIdent, [exportObjRef]))); } sources.push(t.stringLiteral(specifiers.key)); setters.push(t.functionExpression(null, [target], t.blockStatement(setterBody))); }); var moduleName = this.getModuleName(); if (moduleName) moduleName = t.stringLiteral(moduleName); if (canHoist) { (0, _babelHelperHoistVariables2.default)(path, function (id) { return variableIds.push(id); }); } if (variableIds.length) { beforeBody.unshift(t.variableDeclaration("var", variableIds.map(function (id) { return t.variableDeclarator(id); }))); } path.traverse(reassignmentVisitor, { exports: exportNames, buildCall: buildExportCall, scope: path.scope }); for (var _iterator6 = removedPaths, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) { var _ref7; if (_isArray6) { if (_i6 >= _iterator6.length) break; _ref7 = _iterator6[_i6++]; } else { _i6 = _iterator6.next(); if (_i6.done) break; _ref7 = _i6.value; } var _path3 = _ref7; _path3.remove(); } path.node.body = [buildTemplate({ SYSTEM_REGISTER: t.memberExpression(t.identifier(state.opts.systemGlobal || "System"), t.identifier("register")), BEFORE_BODY: beforeBody, MODULE_NAME: moduleName, SETTERS: setters, SOURCES: sources, BODY: path.node.body, EXPORT_IDENTIFIER: exportIdent, CONTEXT_IDENTIFIER: contextIdent })]; } } } }; }; var _babelHelperHoistVariables = $__require("db"); var _babelHelperHoistVariables2 = _interopRequireDefault(_babelHelperHoistVariables); var _babelTemplate = $__require("10"); var _babelTemplate2 = _interopRequireDefault(_babelTemplate); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var buildTemplate = (0, _babelTemplate2.default)("\n SYSTEM_REGISTER(MODULE_NAME, [SOURCES], function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) {\n \"use strict\";\n BEFORE_BODY;\n return {\n setters: [SETTERS],\n execute: function () {\n BODY;\n }\n };\n });\n"); var buildExportAll = (0, _babelTemplate2.default)("\n for (var KEY in TARGET) {\n if (KEY !== \"default\" && KEY !== \"__esModule\") EXPORT_OBJ[KEY] = TARGET[KEY];\n }\n"); var TYPE_IMPORT = "Import"; module.exports = exports["default"]; }); $__System.registerDynamic("dc", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (_ref) { var t = _ref.types; return { pre: function pre(file) { file.set("helpersNamespace", t.identifier("babelHelpers")); } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("dd", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; module.exports = { builtins: { Symbol: "symbol", Promise: "promise", Map: "map", WeakMap: "weak-map", Set: "set", WeakSet: "weak-set", Observable: "observable", setImmediate: "set-immediate", clearImmediate: "clear-immediate", asap: "asap" }, methods: { Array: { concat: "array/concat", copyWithin: "array/copy-within", entries: "array/entries", every: "array/every", fill: "array/fill", filter: "array/filter", findIndex: "array/find-index", find: "array/find", forEach: "array/for-each", from: "array/from", includes: "array/includes", indexOf: "array/index-of", join: "array/join", keys: "array/keys", lastIndexOf: "array/last-index-of", map: "array/map", of: "array/of", pop: "array/pop", push: "array/push", reduceRight: "array/reduce-right", reduce: "array/reduce", reverse: "array/reverse", shift: "array/shift", slice: "array/slice", some: "array/some", sort: "array/sort", splice: "array/splice", unshift: "array/unshift", values: "array/values" }, JSON: { stringify: "json/stringify" }, Object: { assign: "object/assign", create: "object/create", defineProperties: "object/define-properties", defineProperty: "object/define-property", entries: "object/entries", freeze: "object/freeze", getOwnPropertyDescriptor: "object/get-own-property-descriptor", getOwnPropertyDescriptors: "object/get-own-property-descriptors", getOwnPropertyNames: "object/get-own-property-names", getOwnPropertySymbols: "object/get-own-property-symbols", getPrototypeOf: "object/get-prototype-of", isExtensible: "object/is-extensible", isFrozen: "object/is-frozen", isSealed: "object/is-sealed", is: "object/is", keys: "object/keys", preventExtensions: "object/prevent-extensions", seal: "object/seal", setPrototypeOf: "object/set-prototype-of", values: "object/values" }, RegExp: { escape: "regexp/escape" }, Math: { acosh: "math/acosh", asinh: "math/asinh", atanh: "math/atanh", cbrt: "math/cbrt", clz32: "math/clz32", cosh: "math/cosh", expm1: "math/expm1", fround: "math/fround", hypot: "math/hypot", imul: "math/imul", log10: "math/log10", log1p: "math/log1p", log2: "math/log2", sign: "math/sign", sinh: "math/sinh", tanh: "math/tanh", trunc: "math/trunc", iaddh: "math/iaddh", isubh: "math/isubh", imulh: "math/imulh", umulh: "math/umulh" }, Symbol: { for: "symbol/for", hasInstance: "symbol/has-instance", isConcatSpreadable: "symbol/is-concat-spreadable", iterator: "symbol/iterator", keyFor: "symbol/key-for", match: "symbol/match", replace: "symbol/replace", search: "symbol/search", species: "symbol/species", split: "symbol/split", toPrimitive: "symbol/to-primitive", toStringTag: "symbol/to-string-tag", unscopables: "symbol/unscopables" }, String: { at: "string/at", codePointAt: "string/code-point-at", endsWith: "string/ends-with", fromCodePoint: "string/from-code-point", includes: "string/includes", matchAll: "string/match-all", padLeft: "string/pad-left", padRight: "string/pad-right", padStart: "string/pad-start", padEnd: "string/pad-end", raw: "string/raw", repeat: "string/repeat", startsWith: "string/starts-with", trim: "string/trim", trimLeft: "string/trim-left", trimRight: "string/trim-right", trimStart: "string/trim-start", trimEnd: "string/trim-end" }, Number: { EPSILON: "number/epsilon", isFinite: "number/is-finite", isInteger: "number/is-integer", isNaN: "number/is-nan", isSafeInteger: "number/is-safe-integer", MAX_SAFE_INTEGER: "number/max-safe-integer", MIN_SAFE_INTEGER: "number/min-safe-integer", parseFloat: "number/parse-float", parseInt: "number/parse-int" }, Reflect: { apply: "reflect/apply", construct: "reflect/construct", defineProperty: "reflect/define-property", deleteProperty: "reflect/delete-property", enumerate: "reflect/enumerate", getOwnPropertyDescriptor: "reflect/get-own-property-descriptor", getPrototypeOf: "reflect/get-prototype-of", get: "reflect/get", has: "reflect/has", isExtensible: "reflect/is-extensible", ownKeys: "reflect/own-keys", preventExtensions: "reflect/prevent-extensions", setPrototypeOf: "reflect/set-prototype-of", set: "reflect/set", defineMetadata: "reflect/define-metadata", deleteMetadata: "reflect/delete-metadata", getMetadata: "reflect/get-metadata", getMetadataKeys: "reflect/get-metadata-keys", getOwnMetadata: "reflect/get-own-metadata", getOwnMetadataKeys: "reflect/get-own-metadata-keys", hasMetadata: "reflect/has-metadata", hasOwnMetadata: "reflect/has-own-metadata", metadata: "reflect/metadata" }, System: { global: "system/global" }, Error: { isError: "error/is-error" }, Date: {}, Function: {} } }; }); $__System.registerDynamic("de", ["dd"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.definitions = undefined; exports.default = function (_ref) { var t = _ref.types; function getRuntimeModuleName(opts) { return opts.moduleName || "babel-runtime"; } function has(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key); } var HELPER_BLACKLIST = ["interopRequireWildcard", "interopRequireDefault"]; return { pre: function pre(file) { var moduleName = getRuntimeModuleName(this.opts); if (this.opts.helpers !== false) { file.set("helperGenerator", function (name) { if (HELPER_BLACKLIST.indexOf(name) < 0) { return file.addImport(moduleName + "/helpers/" + name, "default", name); } }); } this.setDynamic("regeneratorIdentifier", function () { return file.addImport(moduleName + "/regenerator", "default", "regeneratorRuntime"); }); }, visitor: { ReferencedIdentifier: function ReferencedIdentifier(path, state) { var node = path.node, parent = path.parent, scope = path.scope; if (node.name === "regeneratorRuntime" && state.opts.regenerator !== false) { path.replaceWith(state.get("regeneratorIdentifier")); return; } if (state.opts.polyfill === false) return; if (t.isMemberExpression(parent)) return; if (!has(_definitions2.default.builtins, node.name)) return; if (scope.getBindingIdentifier(node.name)) return; var moduleName = getRuntimeModuleName(state.opts); path.replaceWith(state.addImport(moduleName + "/core-js/" + _definitions2.default.builtins[node.name], "default", node.name)); }, CallExpression: function CallExpression(path, state) { if (state.opts.polyfill === false) return; if (path.node.arguments.length) return; var callee = path.node.callee; if (!t.isMemberExpression(callee)) return; if (!callee.computed) return; if (!path.get("callee.property").matchesPattern("Symbol.iterator")) return; var moduleName = getRuntimeModuleName(state.opts); path.replaceWith(t.callExpression(state.addImport(moduleName + "/core-js/get-iterator", "default", "getIterator"), [callee.object])); }, BinaryExpression: function BinaryExpression(path, state) { if (state.opts.polyfill === false) return; if (path.node.operator !== "in") return; if (!path.get("left").matchesPattern("Symbol.iterator")) return; var moduleName = getRuntimeModuleName(state.opts); path.replaceWith(t.callExpression(state.addImport(moduleName + "/core-js/is-iterable", "default", "isIterable"), [path.node.right])); }, MemberExpression: { enter: function enter(path, state) { if (state.opts.polyfill === false) return; if (!path.isReferenced()) return; var node = path.node; var obj = node.object; var prop = node.property; if (!t.isReferenced(obj, node)) return; if (node.computed) return; if (!has(_definitions2.default.methods, obj.name)) return; var methods = _definitions2.default.methods[obj.name]; if (!has(methods, prop.name)) return; if (path.scope.getBindingIdentifier(obj.name)) return; if (obj.name === "Object" && prop.name === "defineProperty" && path.parentPath.isCallExpression()) { var call = path.parentPath.node; if (call.arguments.length === 3 && t.isLiteral(call.arguments[1])) return; } var moduleName = getRuntimeModuleName(state.opts); path.replaceWith(state.addImport(moduleName + "/core-js/" + methods[prop.name], "default", obj.name + "$" + prop.name)); }, exit: function exit(path, state) { if (state.opts.polyfill === false) return; if (!path.isReferenced()) return; var node = path.node; var obj = node.object; if (!has(_definitions2.default.builtins, obj.name)) return; if (path.scope.getBindingIdentifier(obj.name)) return; var moduleName = getRuntimeModuleName(state.opts); path.replaceWith(t.memberExpression(state.addImport(moduleName + "/core-js/" + _definitions2.default.builtins[obj.name], "default", obj.name), node.property, node.computed)); } } } }; }; var _definitions = $__require("dd"); var _definitions2 = _interopRequireDefault(_definitions); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.definitions = _definitions2.default; }); $__System.registerDynamic("df", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { manipulateOptions: function manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("classConstructorCall"); } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("e0", ["17", "d3", "df", "10"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _symbol = $__require("d3"); var _symbol2 = _interopRequireDefault(_symbol); exports.default = function (_ref) { var t = _ref.types; var ALREADY_VISITED = (0, _symbol2.default)(); function findConstructorCall(path) { var methods = path.get("body.body"); for (var _iterator = methods, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 method = _ref2; if (method.node.kind === "constructorCall") { return method; } } return null; } function handleClassWithCall(constructorCall, classPath) { var _classPath = classPath, node = _classPath.node; var ref = node.id || classPath.scope.generateUidIdentifier("class"); if (classPath.parentPath.isExportDefaultDeclaration()) { classPath = classPath.parentPath; classPath.insertAfter(t.exportDefaultDeclaration(ref)); } classPath.replaceWithMultiple(buildWrapper({ CLASS_REF: classPath.scope.generateUidIdentifier(ref.name), CALL_REF: classPath.scope.generateUidIdentifier(ref.name + "Call"), CALL: t.functionExpression(null, constructorCall.node.params, constructorCall.node.body), CLASS: t.toExpression(node), WRAPPER_REF: ref })); constructorCall.remove(); } return { inherits: $__require("df"), visitor: { Class: function Class(path) { if (path.node[ALREADY_VISITED]) return; path.node[ALREADY_VISITED] = true; var constructorCall = findConstructorCall(path); if (constructorCall) { handleClassWithCall(constructorCall, path); } else { return; } } } }; }; var _babelTemplate = $__require("10"); var _babelTemplate2 = _interopRequireDefault(_babelTemplate); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var buildWrapper = (0, _babelTemplate2.default)("\n let CLASS_REF = CLASS;\n var CALL_REF = CALL;\n var WRAPPER_REF = function (...args) {\n if (this instanceof WRAPPER_REF) {\n return Reflect.construct(CLASS_REF, args);\n } else {\n return CALL_REF.apply(this, args);\n }\n };\n WRAPPER_REF.__proto__ = CLASS_REF;\n WRAPPER_REF;\n"); module.exports = exports["default"]; }); $__System.registerDynamic("e1", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { manipulateOptions: function manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("exportExtensions"); } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("e2", ["e1"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (_ref) { var t = _ref.types; function build(node, nodes, scope) { var first = node.specifiers[0]; if (!t.isExportNamespaceSpecifier(first) && !t.isExportDefaultSpecifier(first)) return; var specifier = node.specifiers.shift(); var uid = scope.generateUidIdentifier(specifier.exported.name); var newSpecifier = void 0; if (t.isExportNamespaceSpecifier(specifier)) { newSpecifier = t.importNamespaceSpecifier(uid); } else { newSpecifier = t.importDefaultSpecifier(uid); } nodes.push(t.importDeclaration([newSpecifier], node.source)); nodes.push(t.exportNamedDeclaration(null, [t.exportSpecifier(uid, specifier.exported)])); build(node, nodes, scope); } return { inherits: $__require("e1"), visitor: { ExportNamedDeclaration: function ExportNamedDeclaration(path) { var node = path.node, scope = path.scope; var nodes = []; build(node, nodes, scope); if (!nodes.length) return; if (node.specifiers.length >= 1) { nodes.push(node); } path.replaceWithMultiple(nodes); } } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("e3", ["e4", "e0", "e2"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _babelPresetStage = $__require("e4"); var _babelPresetStage2 = _interopRequireDefault(_babelPresetStage); var _babelPluginTransformClassConstructorCall = $__require("e0"); var _babelPluginTransformClassConstructorCall2 = _interopRequireDefault(_babelPluginTransformClassConstructorCall); var _babelPluginTransformExportExtensions = $__require("e2"); var _babelPluginTransformExportExtensions2 = _interopRequireDefault(_babelPluginTransformExportExtensions); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = { presets: [_babelPresetStage2.default], plugins: [_babelPluginTransformClassConstructorCall2.default, _babelPluginTransformExportExtensions2.default] }; module.exports = exports["default"]; }); $__System.registerDynamic("e5", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { manipulateOptions: function manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("classProperties"); } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("e6", ["17", "e5", "e7", "10"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (_ref) { var t = _ref.types; var findBareSupers = { Super: function Super(path) { if (path.parentPath.isCallExpression({ callee: path.node })) { this.push(path.parentPath); } } }; var referenceVisitor = { ReferencedIdentifier: function ReferencedIdentifier(path) { if (this.scope.hasOwnBinding(path.node.name)) { this.collision = true; path.skip(); } } }; var buildObjectDefineProperty = (0, _babelTemplate2.default)("\n Object.defineProperty(REF, KEY, {\n // configurable is false by default\n enumerable: true,\n writable: true,\n value: VALUE\n });\n "); var buildClassPropertySpec = function buildClassPropertySpec(ref, _ref2) { var key = _ref2.key, value = _ref2.value, computed = _ref2.computed; return buildObjectDefineProperty({ REF: ref, KEY: t.isIdentifier(key) && !computed ? t.stringLiteral(key.name) : key, VALUE: value ? value : t.identifier("undefined") }); }; var buildClassPropertyNonSpec = function buildClassPropertyNonSpec(ref, _ref3) { var key = _ref3.key, value = _ref3.value, computed = _ref3.computed; return t.expressionStatement(t.assignmentExpression("=", t.memberExpression(ref, key, computed || t.isLiteral(key)), value)); }; return { inherits: $__require("e5"), visitor: { Class: function Class(path, state) { var buildClassProperty = state.opts.spec ? buildClassPropertySpec : buildClassPropertyNonSpec; var isDerived = !!path.node.superClass; var constructor = void 0; var props = []; var body = path.get("body"); for (var _iterator = body.get("body"), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { var _ref4; if (_isArray) { if (_i >= _iterator.length) break; _ref4 = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref4 = _i.value; } var _path = _ref4; if (_path.isClassProperty()) { props.push(_path); } else if (_path.isClassMethod({ kind: "constructor" })) { constructor = _path; } } if (!props.length) return; var nodes = []; var ref = void 0; if (path.isClassExpression() || !path.node.id) { (0, _babelHelperFunctionName2.default)(path); ref = path.scope.generateUidIdentifier("class"); } else { ref = path.node.id; } var instanceBody = []; for (var _iterator2 = props, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref5; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref5 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref5 = _i2.value; } var _prop = _ref5; var propNode = _prop.node; if (propNode.decorators && propNode.decorators.length > 0) continue; if (!state.opts.spec && !propNode.value) continue; var isStatic = propNode.static; if (isStatic) { nodes.push(buildClassProperty(ref, propNode)); } else { if (!propNode.value) continue; instanceBody.push(buildClassProperty(t.thisExpression(), propNode)); } } if (instanceBody.length) { if (!constructor) { var newConstructor = t.classMethod("constructor", t.identifier("constructor"), [], t.blockStatement([])); if (isDerived) { newConstructor.params = [t.restElement(t.identifier("args"))]; newConstructor.body.body.push(t.returnStatement(t.callExpression(t.super(), [t.spreadElement(t.identifier("args"))]))); } var _body$unshiftContaine = body.unshiftContainer("body", newConstructor); constructor = _body$unshiftContaine[0]; } var collisionState = { collision: false, scope: constructor.scope }; for (var _iterator3 = props, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref6; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref6 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref6 = _i3.value; } var prop = _ref6; prop.traverse(referenceVisitor, collisionState); if (collisionState.collision) break; } if (collisionState.collision) { var initialisePropsRef = path.scope.generateUidIdentifier("initialiseProps"); nodes.push(t.variableDeclaration("var", [t.variableDeclarator(initialisePropsRef, t.functionExpression(null, [], t.blockStatement(instanceBody)))])); instanceBody = [t.expressionStatement(t.callExpression(t.memberExpression(initialisePropsRef, t.identifier("call")), [t.thisExpression()]))]; } if (isDerived) { var bareSupers = []; constructor.traverse(findBareSupers, bareSupers); for (var _iterator4 = bareSupers, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { var _ref7; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref7 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref7 = _i4.value; } var bareSuper = _ref7; bareSuper.insertAfter(instanceBody); } } else { constructor.get("body").unshiftContainer("body", instanceBody); } } for (var _iterator5 = props, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { var _ref8; if (_isArray5) { if (_i5 >= _iterator5.length) break; _ref8 = _iterator5[_i5++]; } else { _i5 = _iterator5.next(); if (_i5.done) break; _ref8 = _i5.value; } var _prop2 = _ref8; _prop2.remove(); } if (!nodes.length) return; if (path.isClassExpression()) { path.scope.push({ id: ref }); path.replaceWith(t.assignmentExpression("=", ref, path.node)); } else { if (!path.node.id) { path.node.id = ref; } if (path.parentPath.isExportDeclaration()) { path = path.parentPath; } } path.insertAfter(nodes); }, ArrowFunctionExpression: function ArrowFunctionExpression(path) { var classExp = path.get("body"); if (!classExp.isClassExpression()) return; var body = classExp.get("body"); var members = body.get("body"); if (members.some(function (member) { return member.isClassProperty(); })) { path.ensureBlock(); } } } }; }; var _babelHelperFunctionName = $__require("e7"); var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName); var _babelTemplate = $__require("10"); var _babelTemplate2 = _interopRequireDefault(_babelTemplate); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("e8", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { manipulateOptions: function manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("decorators"); } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("e9", ["17", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = bindifyDecorators; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function bindifyDecorators(decorators) { for (var _iterator = decorators, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 decoratorPath = _ref; var decorator = decoratorPath.node; var expression = decorator.expression; if (!t.isMemberExpression(expression)) continue; var temp = decoratorPath.scope.maybeGenerateMemoised(expression.object); var ref = void 0; var nodes = []; if (temp) { ref = temp; nodes.push(t.assignmentExpression("=", temp, expression.object)); } else { ref = expression.object; } nodes.push(t.callExpression(t.memberExpression(t.memberExpression(ref, expression.property, expression.computed), t.identifier("bind")), [ref])); if (nodes.length === 1) { decorator.expression = nodes[0]; } else { decorator.expression = t.sequenceExpression(nodes); } } } module.exports = exports["default"]; }); $__System.registerDynamic("ea", ["17", "e9", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (classPath) { classPath.assertClass(); var memoisedExpressions = []; function maybeMemoise(path) { if (!path.node || path.isPure()) return; var uid = classPath.scope.generateDeclaredUidIdentifier(); memoisedExpressions.push(t.assignmentExpression("=", uid, path.node)); path.replaceWith(uid); } function memoiseDecorators(paths) { if (!Array.isArray(paths) || !paths.length) return; paths = paths.reverse(); (0, _babelHelperBindifyDecorators2.default)(paths); for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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; maybeMemoise(path); } } maybeMemoise(classPath.get("superClass")); memoiseDecorators(classPath.get("decorators"), true); var methods = classPath.get("body.body"); for (var _iterator2 = methods, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var methodPath = _ref2; if (methodPath.is("computed")) { maybeMemoise(methodPath.get("key")); } if (methodPath.has("decorators")) { memoiseDecorators(classPath.get("decorators")); } } if (memoisedExpressions) { classPath.insertBefore(memoisedExpressions.map(function (expr) { return t.expressionStatement(expr); })); } }; var _babelHelperBindifyDecorators = $__require("e9"); var _babelHelperBindifyDecorators2 = _interopRequireDefault(_babelHelperBindifyDecorators); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("eb", ["d4", "17", "e8", "10", "ea"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _create = $__require("d4"); var _create2 = _interopRequireDefault(_create); var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (_ref) { var t = _ref.types; function cleanDecorators(decorators) { return decorators.reverse().map(function (dec) { return dec.expression; }); } function transformClass(path, ref, state) { var nodes = []; state; var classDecorators = path.node.decorators; if (classDecorators) { path.node.decorators = null; classDecorators = cleanDecorators(classDecorators); for (var _iterator = classDecorators, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 decorator = _ref2; nodes.push(buildClassDecorator({ CLASS_REF: ref, DECORATOR: decorator })); } } var map = (0, _create2.default)(null); for (var _iterator2 = path.get("body.body"), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref3; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref3 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref3 = _i2.value; } var method = _ref3; var decorators = method.node.decorators; if (!decorators) continue; var _alias = t.toKeyAlias(method.node); map[_alias] = map[_alias] || []; map[_alias].push(method.node); method.remove(); } for (var alias in map) { var items = map[alias]; items; } return nodes; } function hasDecorators(path) { if (path.isClass()) { if (path.node.decorators) return true; for (var _iterator3 = path.node.body.body, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref4; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref4 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref4 = _i3.value; } var method = _ref4; if (method.decorators) { return true; } } } else if (path.isObjectExpression()) { for (var _iterator4 = path.node.properties, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { var _ref5; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref5 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref5 = _i4.value; } var prop = _ref5; if (prop.decorators) { return true; } } } return false; } function doError(path) { throw path.buildCodeFrameError("Decorators are not officially supported yet in 6.x pending a proposal update.\nHowever, if you need to use them you can install the legacy decorators transform with:\n\nnpm install babel-plugin-transform-decorators-legacy --save-dev\n\nand add the following line to your .babelrc file:\n\n{\n \"plugins\": [\"transform-decorators-legacy\"]\n}\n\nThe repo url is: https://github.com/loganfsmyth/babel-plugin-transform-decorators-legacy.\n "); } return { inherits: $__require("e8"), visitor: { ClassExpression: function ClassExpression(path) { if (!hasDecorators(path)) return; doError(path); (0, _babelHelperExplodeClass2.default)(path); var ref = path.scope.generateDeclaredUidIdentifier("ref"); var nodes = []; nodes.push(t.assignmentExpression("=", ref, path.node)); nodes = nodes.concat(transformClass(path, ref, this)); nodes.push(ref); path.replaceWith(t.sequenceExpression(nodes)); }, ClassDeclaration: function ClassDeclaration(path) { if (!hasDecorators(path)) return; doError(path); (0, _babelHelperExplodeClass2.default)(path); var ref = path.node.id; var nodes = []; nodes = nodes.concat(transformClass(path, ref, this).map(function (expr) { return t.expressionStatement(expr); })); nodes.push(t.expressionStatement(ref)); path.insertAfter(nodes); }, ObjectExpression: function ObjectExpression(path) { if (!hasDecorators(path)) return; doError(path); } } }; }; var _babelTemplate = $__require("10"); var _babelTemplate2 = _interopRequireDefault(_babelTemplate); var _babelHelperExplodeClass = $__require("ea"); var _babelHelperExplodeClass2 = _interopRequireDefault(_babelHelperExplodeClass); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var buildClassDecorator = (0, _babelTemplate2.default)("\n CLASS_REF = DECORATOR(CLASS_REF) || CLASS_REF;\n"); module.exports = exports["default"]; }); $__System.registerDynamic("ec", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { manipulateOptions: function manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("dynamicImport"); } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("e4", ["ed", "e6", "eb", "ec"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _babelPresetStage = $__require("ed"); var _babelPresetStage2 = _interopRequireDefault(_babelPresetStage); var _babelPluginTransformClassProperties = $__require("e6"); var _babelPluginTransformClassProperties2 = _interopRequireDefault(_babelPluginTransformClassProperties); var _babelPluginTransformDecorators = $__require("eb"); var _babelPluginTransformDecorators2 = _interopRequireDefault(_babelPluginTransformDecorators); var _babelPluginSyntaxDynamicImport = $__require("ec"); var _babelPluginSyntaxDynamicImport2 = _interopRequireDefault(_babelPluginSyntaxDynamicImport); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = { presets: [_babelPresetStage2.default], plugins: [_babelPluginSyntaxDynamicImport2.default, _babelPluginTransformClassProperties2.default, _babelPluginTransformDecorators2.default] }; module.exports = exports["default"]; }); $__System.registerDynamic("ee", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { manipulateOptions: function manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("trailingFunctionCommas"); } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("ef", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { manipulateOptions: function manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("asyncFunctions"); } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("f0", ["ef", "f1"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { inherits: $__require("ef"), visitor: { Function: function Function(path, state) { if (!path.node.async || path.node.generator) return; (0, _babelHelperRemapAsyncToGenerator2.default)(path, state.file, { wrapAsync: state.addHelper("asyncToGenerator") }); } } }; }; var _babelHelperRemapAsyncToGenerator = $__require("f1"); var _babelHelperRemapAsyncToGenerator2 = _interopRequireDefault(_babelHelperRemapAsyncToGenerator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("f2", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { manipulateOptions: function manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("exponentiationOperator"); } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("f3", ["11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (node, nodes, file, scope, allowedSingleIdent) { var obj = void 0; if (t.isIdentifier(node) && allowedSingleIdent) { obj = node; } else { obj = getObjRef(node, nodes, file, scope); } var ref = void 0, uid = void 0; if (t.isIdentifier(node)) { ref = node; uid = obj; } else { var prop = getPropRef(node, nodes, file, scope); var computed = node.computed || t.isLiteral(prop); uid = ref = t.memberExpression(obj, prop, computed); } return { uid: uid, ref: ref }; }; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function getObjRef(node, nodes, file, scope) { var ref = void 0; if (t.isSuper(node)) { return node; } else if (t.isIdentifier(node)) { if (scope.hasBinding(node.name)) { return node; } else { ref = node; } } else if (t.isMemberExpression(node)) { ref = node.object; if (t.isSuper(ref) || t.isIdentifier(ref) && scope.hasBinding(ref.name)) { return ref; } } else { throw new Error("We can't explode this node type " + node.type); } var temp = scope.generateUidIdentifierBasedOnNode(ref); nodes.push(t.variableDeclaration("var", [t.variableDeclarator(temp, ref)])); return temp; } function getPropRef(node, nodes, file, scope) { var prop = node.property; var key = t.toComputedKey(node, prop); if (t.isLiteral(key) && t.isPureish(key)) return key; var temp = scope.generateUidIdentifierBasedOnNode(prop); nodes.push(t.variableDeclaration("var", [t.variableDeclarator(temp, prop)])); return temp; } module.exports = exports["default"]; }); $__System.registerDynamic("f4", ["f3", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (opts) { var visitor = {}; function isAssignment(node) { return node && node.operator === opts.operator + "="; } function buildAssignment(left, right) { return t.assignmentExpression("=", left, right); } visitor.ExpressionStatement = function (path, file) { if (path.isCompletionRecord()) return; var expr = path.node.expression; if (!isAssignment(expr)) return; var nodes = []; var exploded = (0, _babelHelperExplodeAssignableExpression2.default)(expr.left, nodes, file, path.scope, true); nodes.push(t.expressionStatement(buildAssignment(exploded.ref, opts.build(exploded.uid, expr.right)))); path.replaceWithMultiple(nodes); }; visitor.AssignmentExpression = function (path, file) { var node = path.node, scope = path.scope; if (!isAssignment(node)) return; var nodes = []; var exploded = (0, _babelHelperExplodeAssignableExpression2.default)(node.left, nodes, file, scope); nodes.push(buildAssignment(exploded.ref, opts.build(exploded.uid, node.right))); path.replaceWithMultiple(nodes); }; visitor.BinaryExpression = function (path) { var node = path.node; if (node.operator === opts.operator) { path.replaceWith(opts.build(node.left, node.right)); } }; return visitor; }; var _babelHelperExplodeAssignableExpression = $__require("f3"); var _babelHelperExplodeAssignableExpression2 = _interopRequireDefault(_babelHelperExplodeAssignableExpression); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("f5", ["f2", "f4"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (_ref) { var t = _ref.types; return { inherits: $__require("f2"), visitor: (0, _babelHelperBuilderBinaryAssignmentOperatorVisitor2.default)({ operator: "**", build: function build(left, right) { return t.callExpression(t.memberExpression(t.identifier("Math"), t.identifier("pow")), [left, right]); } }) }; }; var _babelHelperBuilderBinaryAssignmentOperatorVisitor = $__require("f4"); var _babelHelperBuilderBinaryAssignmentOperatorVisitor2 = _interopRequireDefault(_babelHelperBuilderBinaryAssignmentOperatorVisitor); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("f6", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { manipulateOptions: function manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("objectRestSpread"); } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("f7", ["17", "f6"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (_ref) { var t = _ref.types; function hasRestProperty(path) { var foundRestProperty = false; path.traverse({ RestProperty: function RestProperty() { foundRestProperty = true; path.stop(); } }); return foundRestProperty; } function hasSpread(node) { for (var _iterator = node.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 prop = _ref2; if (t.isSpreadProperty(prop)) { return true; } } return false; } function createObjectSpread(file, props, objRef) { var restProperty = props.pop(); var keys = []; for (var _iterator2 = props, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref3; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref3 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref3 = _i2.value; } var prop = _ref3; var key = prop.key; if (t.isIdentifier(key) && !prop.computed) { key = t.stringLiteral(prop.key.name); } keys.push(key); } return [restProperty.argument, t.callExpression(file.addHelper("objectWithoutProperties"), [objRef, t.arrayExpression(keys)])]; } function replaceRestProperty(parentPath, paramPath, i, numParams) { if (paramPath.isAssignmentPattern()) { replaceRestProperty(parentPath, paramPath.get("left"), i, numParams); return; } if (paramPath.isObjectPattern() && hasRestProperty(paramPath)) { var uid = parentPath.scope.generateUidIdentifier("ref"); var declar = t.variableDeclaration("let", [t.variableDeclarator(paramPath.node, uid)]); declar._blockHoist = i ? numParams - i : 1; parentPath.ensureBlock(); parentPath.get("body").unshiftContainer("body", declar); paramPath.replaceWith(uid); } } return { inherits: $__require("f6"), visitor: { Function: function Function(path) { var params = path.get("params"); for (var i = 0; i < params.length; i++) { replaceRestProperty(params[i].parentPath, params[i], i, params.length); } }, VariableDeclarator: function VariableDeclarator(path, file) { if (!path.get("id").isObjectPattern()) { return; } var insertionPath = path; path.get("id").traverse({ RestProperty: function RestProperty(path) { if (this.originalPath.node.id.properties.length > 1 && !t.isIdentifier(this.originalPath.node.init)) { var initRef = path.scope.generateUidIdentifierBasedOnNode(this.originalPath.node.init, "ref"); this.originalPath.insertBefore(t.variableDeclarator(initRef, this.originalPath.node.init)); this.originalPath.replaceWith(t.variableDeclarator(this.originalPath.node.id, initRef)); return; } var ref = this.originalPath.node.init; path.findParent(function (path) { if (path.isObjectProperty()) { ref = t.memberExpression(ref, t.identifier(path.node.key.name)); } else if (path.isVariableDeclarator()) { return true; } }); var _createObjectSpread = createObjectSpread(file, path.parentPath.node.properties, ref), argument = _createObjectSpread[0], callExpression = _createObjectSpread[1]; insertionPath.insertAfter(t.variableDeclarator(argument, callExpression)); insertionPath = insertionPath.getSibling(insertionPath.key + 1); if (path.parentPath.node.properties.length === 0) { path.findParent(function (path) { return path.isObjectProperty() || path.isVariableDeclarator(); }).remove(); } } }, { originalPath: path }); }, ExportNamedDeclaration: function ExportNamedDeclaration(path) { var declaration = path.get("declaration"); if (!declaration.isVariableDeclaration()) return; if (!hasRestProperty(declaration)) return; var specifiers = []; for (var name in path.getOuterBindingIdentifiers(path)) { var id = t.identifier(name); specifiers.push(t.exportSpecifier(id, id)); } path.replaceWith(declaration.node); path.insertAfter(t.exportNamedDeclaration(null, specifiers)); }, CatchClause: function CatchClause(path) { var paramPath = path.get("param"); replaceRestProperty(paramPath.parentPath, paramPath); }, AssignmentExpression: function AssignmentExpression(path, file) { var leftPath = path.get("left"); if (leftPath.isObjectPattern() && hasRestProperty(leftPath)) { var nodes = []; var ref = void 0; if (path.isCompletionRecord() || path.parentPath.isExpressionStatement()) { ref = path.scope.generateUidIdentifierBasedOnNode(path.node.right, "ref"); nodes.push(t.variableDeclaration("var", [t.variableDeclarator(ref, path.node.right)])); } var _createObjectSpread2 = createObjectSpread(file, path.node.left.properties, ref), argument = _createObjectSpread2[0], callExpression = _createObjectSpread2[1]; var nodeWithoutSpread = t.clone(path.node); nodeWithoutSpread.right = ref; nodes.push(t.expressionStatement(nodeWithoutSpread)); nodes.push(t.toStatement(t.assignmentExpression("=", argument, callExpression))); if (ref) { nodes.push(t.expressionStatement(ref)); } path.replaceWithMultiple(nodes); } }, ForXStatement: function ForXStatement(path) { var node = path.node, scope = path.scope; var leftPath = path.get("left"); var left = node.left; if (t.isObjectPattern(left) && hasRestProperty(leftPath)) { var temp = scope.generateUidIdentifier("ref"); node.left = t.variableDeclaration("var", [t.variableDeclarator(temp)]); path.ensureBlock(); node.body.body.unshift(t.variableDeclaration("var", [t.variableDeclarator(left, temp)])); return; } if (!t.isVariableDeclaration(left)) return; var pattern = left.declarations[0].id; if (!t.isObjectPattern(pattern)) return; var key = scope.generateUidIdentifier("ref"); node.left = t.variableDeclaration(left.kind, [t.variableDeclarator(key, null)]); path.ensureBlock(); node.body.body.unshift(t.variableDeclaration(node.left.kind, [t.variableDeclarator(pattern, key)])); }, ObjectExpression: function ObjectExpression(path, file) { if (!hasSpread(path.node)) return; var useBuiltIns = file.opts.useBuiltIns || false; if (typeof useBuiltIns !== "boolean") { throw new Error("transform-object-rest-spread currently only accepts a boolean " + "option for useBuiltIns (defaults to false)"); } var args = []; var props = []; function push() { if (!props.length) return; args.push(t.objectExpression(props)); props = []; } for (var _iterator3 = path.node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref4; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref4 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref4 = _i3.value; } var prop = _ref4; if (t.isSpreadProperty(prop)) { push(); args.push(prop.argument); } else { props.push(prop); } } push(); if (!t.isObjectExpression(args[0])) { args.unshift(t.objectExpression([])); } var helper = useBuiltIns ? t.memberExpression(t.identifier("Object"), t.identifier("assign")) : file.addHelper("extends"); path.replaceWith(t.callExpression(helper, args)); } } }; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("f8", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { manipulateOptions: function manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("asyncGenerators"); } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("f9", ["11", "10", "d0"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (path, helpers) { var node = path.node, scope = path.scope, parent = path.parent; var stepKey = scope.generateUidIdentifier("step"); var stepValue = scope.generateUidIdentifier("value"); var left = node.left; var declar = void 0; if (t.isIdentifier(left) || t.isPattern(left) || t.isMemberExpression(left)) { declar = t.expressionStatement(t.assignmentExpression("=", left, stepValue)); } else if (t.isVariableDeclaration(left)) { declar = t.variableDeclaration(left.kind, [t.variableDeclarator(left.declarations[0].id, stepValue)]); } var template = buildForAwait(); (0, _babelTraverse2.default)(template, forAwaitVisitor, null, { ITERATOR_HAD_ERROR_KEY: scope.generateUidIdentifier("didIteratorError"), ITERATOR_COMPLETION: scope.generateUidIdentifier("iteratorNormalCompletion"), ITERATOR_ERROR_KEY: scope.generateUidIdentifier("iteratorError"), ITERATOR_KEY: scope.generateUidIdentifier("iterator"), GET_ITERATOR: helpers.getAsyncIterator, OBJECT: node.right, STEP_VALUE: stepValue, STEP_KEY: stepKey, AWAIT: helpers.wrapAwait }); template = template.body.body; var isLabeledParent = t.isLabeledStatement(parent); var tryBody = template[3].block.body; var loop = tryBody[0]; if (isLabeledParent) { tryBody[0] = t.labeledStatement(parent.label, loop); } return { replaceParent: isLabeledParent, node: template, declar: declar, loop: loop }; }; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); var _babelTemplate = $__require("10"); var _babelTemplate2 = _interopRequireDefault(_babelTemplate); var _babelTraverse = $__require("d0"); var _babelTraverse2 = _interopRequireDefault(_babelTraverse); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } var buildForAwait = (0, _babelTemplate2.default)("\n function* wrapper() {\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (\n var ITERATOR_KEY = GET_ITERATOR(OBJECT), STEP_KEY, STEP_VALUE;\n (\n STEP_KEY = yield AWAIT(ITERATOR_KEY.next()),\n ITERATOR_COMPLETION = STEP_KEY.done,\n STEP_VALUE = yield AWAIT(STEP_KEY.value),\n !ITERATOR_COMPLETION\n );\n ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return) {\n yield AWAIT(ITERATOR_KEY.return());\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n }\n"); var forAwaitVisitor = { noScope: true, Identifier: function Identifier(path, replacements) { if (path.node.name in replacements) { path.replaceInline(replacements[path.node.name]); } }, CallExpression: function CallExpression(path, replacements) { var callee = path.node.callee; if (t.isIdentifier(callee) && callee.name === "AWAIT" && !replacements.AWAIT) { path.replaceWith(path.node.arguments[0]); } } }; module.exports = exports["default"]; }); $__System.registerDynamic("f1", ["e7", "10", "11", "f9"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (path, file, helpers) { if (!helpers) { helpers = { wrapAsync: file }; file = null; } path.traverse(awaitVisitor, { file: file, wrapAwait: helpers.wrapAwait }); if (path.isClassMethod() || path.isObjectMethod()) { classOrObjectMethod(path, helpers.wrapAsync); } else { plainFunction(path, helpers.wrapAsync); } }; var _babelHelperFunctionName = $__require("e7"); var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName); var _babelTemplate = $__require("10"); var _babelTemplate2 = _interopRequireDefault(_babelTemplate); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); var _forAwait = $__require("f9"); var _forAwait2 = _interopRequireDefault(_forAwait); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var buildWrapper = (0, _babelTemplate2.default)("\n (() => {\n var REF = FUNCTION;\n return function NAME(PARAMS) {\n return REF.apply(this, arguments);\n };\n })\n"); var namedBuildWrapper = (0, _babelTemplate2.default)("\n (() => {\n var REF = FUNCTION;\n function NAME(PARAMS) {\n return REF.apply(this, arguments);\n }\n return NAME;\n })\n"); var awaitVisitor = { Function: function Function(path) { if (path.isArrowFunctionExpression() && !path.node.async) { path.arrowFunctionToShadowed(); return; } path.skip(); }, AwaitExpression: function AwaitExpression(_ref, _ref2) { var node = _ref.node; var wrapAwait = _ref2.wrapAwait; node.type = "YieldExpression"; if (wrapAwait) { node.argument = t.callExpression(wrapAwait, [node.argument]); } }, ForAwaitStatement: function ForAwaitStatement(path, _ref3) { var file = _ref3.file, wrapAwait = _ref3.wrapAwait; var node = path.node; var build = (0, _forAwait2.default)(path, { getAsyncIterator: file.addHelper("asyncIterator"), wrapAwait: wrapAwait }); var declar = build.declar, loop = build.loop; var block = loop.body; path.ensureBlock(); if (declar) { block.body.push(declar); } block.body = block.body.concat(node.body.body); t.inherits(loop, node); t.inherits(loop.body, node.body); if (build.replaceParent) { path.parentPath.replaceWithMultiple(build.node); path.remove(); } else { path.replaceWithMultiple(build.node); } } }; function classOrObjectMethod(path, callId) { var node = path.node; var body = node.body; node.async = false; var container = t.functionExpression(null, [], t.blockStatement(body.body), true); container.shadow = true; body.body = [t.returnStatement(t.callExpression(t.callExpression(callId, [container]), []))]; node.generator = false; } function plainFunction(path, callId) { var node = path.node; var isDeclaration = path.isFunctionDeclaration(); var asyncFnId = node.id; var wrapper = buildWrapper; if (path.isArrowFunctionExpression()) { path.arrowFunctionToShadowed(); } else if (!isDeclaration && asyncFnId) { wrapper = namedBuildWrapper; } node.async = false; node.generator = true; node.id = null; if (isDeclaration) { node.type = "FunctionExpression"; } var built = t.callExpression(callId, [node]); var container = wrapper({ NAME: asyncFnId, REF: path.scope.generateUidIdentifier("ref"), FUNCTION: built, PARAMS: node.params.reduce(function (acc, param) { acc.done = acc.done || t.isAssignmentPattern(param) || t.isRestElement(param); if (!acc.done) { acc.params.push(path.scope.generateUidIdentifier("x")); } return acc; }, { params: [], done: false }).params }).expression; if (isDeclaration) { var declar = t.variableDeclaration("let", [t.variableDeclarator(t.identifier(asyncFnId.name), t.callExpression(container, []))]); declar._blockHoist = true; path.replaceWith(declar); } else { var retFunction = container.body.body[1].argument; if (!asyncFnId) { (0, _babelHelperFunctionName2.default)({ node: retFunction, parent: path.parent, scope: path.scope }); } if (!retFunction || retFunction.id || node.params.length) { path.replaceWith(t.callExpression(container, [])); } else { path.replaceWith(built); } } } module.exports = exports["default"]; }); $__System.registerDynamic("fa", ["f8", "f1"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (_ref) { var t = _ref.types; var yieldStarVisitor = { Function: function Function(path) { path.skip(); }, YieldExpression: function YieldExpression(_ref2, state) { var node = _ref2.node; if (!node.delegate) return; var callee = state.addHelper("asyncGeneratorDelegate"); node.argument = t.callExpression(callee, [t.callExpression(state.addHelper("asyncIterator"), [node.argument]), t.memberExpression(state.addHelper("asyncGenerator"), t.identifier("await"))]); } }; return { inherits: $__require("f8"), visitor: { Function: function Function(path, state) { if (!path.node.async || !path.node.generator) return; path.traverse(yieldStarVisitor, state); (0, _babelHelperRemapAsyncToGenerator2.default)(path, state.file, { wrapAsync: t.memberExpression(state.addHelper("asyncGenerator"), t.identifier("wrap")), wrapAwait: t.memberExpression(state.addHelper("asyncGenerator"), t.identifier("await")) }); } } }; }; var _babelHelperRemapAsyncToGenerator = $__require("f1"); var _babelHelperRemapAsyncToGenerator2 = _interopRequireDefault(_babelHelperRemapAsyncToGenerator); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("ed", ["ee", "f0", "f5", "f7", "fa"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _babelPluginSyntaxTrailingFunctionCommas = $__require("ee"); var _babelPluginSyntaxTrailingFunctionCommas2 = _interopRequireDefault(_babelPluginSyntaxTrailingFunctionCommas); var _babelPluginTransformAsyncToGenerator = $__require("f0"); var _babelPluginTransformAsyncToGenerator2 = _interopRequireDefault(_babelPluginTransformAsyncToGenerator); var _babelPluginTransformExponentiationOperator = $__require("f5"); var _babelPluginTransformExponentiationOperator2 = _interopRequireDefault(_babelPluginTransformExponentiationOperator); var _babelPluginTransformObjectRestSpread = $__require("f7"); var _babelPluginTransformObjectRestSpread2 = _interopRequireDefault(_babelPluginTransformObjectRestSpread); var _babelPluginTransformAsyncGeneratorFunctions = $__require("fa"); var _babelPluginTransformAsyncGeneratorFunctions2 = _interopRequireDefault(_babelPluginTransformAsyncGeneratorFunctions); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = { plugins: [_babelPluginSyntaxTrailingFunctionCommas2.default, _babelPluginTransformAsyncToGenerator2.default, _babelPluginTransformExponentiationOperator2.default, _babelPluginTransformAsyncGeneratorFunctions2.default, _babelPluginTransformObjectRestSpread2.default] }; module.exports = exports["default"]; }); $__System.registerDynamic("fb", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { manipulateOptions: function manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("flow"); } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("fc", ["17", "fb"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (_ref) { var t = _ref.types; var FLOW_DIRECTIVE = "@flow"; return { inherits: $__require("fb"), visitor: { Program: function Program(path, _ref2) { var comments = _ref2.file.ast.comments; for (var _iterator = comments, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { var _ref3; if (_isArray) { if (_i >= _iterator.length) break; _ref3 = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref3 = _i.value; } var comment = _ref3; if (comment.value.indexOf(FLOW_DIRECTIVE) >= 0) { comment.value = comment.value.replace(FLOW_DIRECTIVE, ""); if (!comment.value.replace(/\*/g, "").trim()) comment.ignore = true; } } }, Flow: function Flow(path) { path.remove(); }, ClassProperty: function ClassProperty(path) { path.node.variance = null; path.node.typeAnnotation = null; if (!path.node.value) path.remove(); }, Class: function Class(path) { path.node.implements = null; path.get("body.body").forEach(function (child) { if (child.isClassProperty()) { child.node.typeAnnotation = null; if (!child.node.value) child.remove(); } }); }, AssignmentPattern: function AssignmentPattern(_ref4) { var node = _ref4.node; node.left.optional = false; }, Function: function Function(_ref5) { var node = _ref5.node; for (var i = 0; i < node.params.length; i++) { var param = node.params[i]; param.optional = false; } }, TypeCastExpression: function TypeCastExpression(path) { var node = path.node; do { node = node.expression; } while (t.isTypeCastExpression(node)); path.replaceWith(node); } } }; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("fd", ["fc"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _babelPluginTransformFlowStripTypes = $__require("fc"); var _babelPluginTransformFlowStripTypes2 = _interopRequireDefault(_babelPluginTransformFlowStripTypes); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = { plugins: [_babelPluginTransformFlowStripTypes2.default] }; module.exports = exports["default"]; }); $__System.registerDynamic("fe", ["ff", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (opts) { var visitor = {}; visitor.JSXNamespacedName = function (path) { throw path.buildCodeFrameError("Namespace tags are not supported. ReactJSX is not XML."); }; visitor.JSXElement = { exit: function exit(path, file) { var callExpr = buildElementCall(path.get("openingElement"), file); callExpr.arguments = callExpr.arguments.concat(path.node.children); if (callExpr.arguments.length >= 3) { callExpr._prettyCall = true; } 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 (_esutils2.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)); } 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 (t.isValidIdentifier(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) { path.parent.children = t.react.buildChildren(path.parent); var tagExpr = convertJSXIdentifier(path.node.name, path.node); var args = []; var tagName = void 0; 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 = path.node.attributes; if (attribs.length) { attribs = buildOpeningElementAttributes(attribs, file); } else { attribs = t.nullLiteral(); } args.push(attribs); if (opts.post) { opts.post(state, file); } return state.call || t.callExpression(state.callee, args); } 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)"); } function pushProps() { if (!_props.length) return; objs.push(t.objectExpression(_props)); _props = []; } while (attribs.length) { var prop = attribs.shift(); if (t.isJSXSpreadAttribute(prop)) { pushProps(); objs.push(prop.argument); } else { _props.push(convertAttribute(prop)); } } pushProps(); 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; } }; var _esutils = $__require("ff"); var _esutils2 = _interopRequireDefault(_esutils); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("100", ["17", "101", "fe"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (_ref) { var t = _ref.types; var JSX_ANNOTATION_REGEX = /\*?\s*@jsx\s+([^\s]+)/; var visitor = (0, _babelHelperBuilderReactJsx2.default)({ pre: function pre(state) { var tagName = state.tagName; var args = state.args; if (t.react.isCompatTag(tagName)) { args.push(t.stringLiteral(tagName)); } else { args.push(state.tagExpr); } }, post: function post(state, pass) { state.callee = pass.get("jsxIdentifier")(); } }); visitor.Program = function (path, state) { var file = state.file; var id = state.opts.pragma || "React.createElement"; for (var _iterator = file.ast.comments, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 comment = _ref2; var matches = JSX_ANNOTATION_REGEX.exec(comment.value); if (matches) { id = matches[1]; if (id === "React.DOM") { throw file.buildCodeFrameError(comment, "The @jsx React.DOM pragma has been deprecated as of React 0.12"); } else { break; } } } state.set("jsxIdentifier", function () { return id.split(".").map(function (name) { return t.identifier(name); }).reduce(function (object, property) { return t.memberExpression(object, property); }); }); }; return { inherits: _babelPluginSyntaxJsx2.default, visitor: visitor }; }; var _babelPluginSyntaxJsx = $__require("101"); var _babelPluginSyntaxJsx2 = _interopRequireDefault(_babelPluginSyntaxJsx); var _babelHelperBuilderReactJsx = $__require("fe"); var _babelHelperBuilderReactJsx2 = _interopRequireDefault(_babelHelperBuilderReactJsx); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("101", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { manipulateOptions: function manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("jsx"); } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("102", ["@node/path"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (_ref) { var t = _ref.types; function addDisplayName(id, call) { var props = call.arguments[0].properties; var safe = true; for (var i = 0; i < props.length; i++) { var prop = props[i]; var key = t.toComputedKey(prop); if (t.isLiteral(key, { value: "displayName" })) { safe = false; break; } } if (safe) { props.unshift(t.objectProperty(t.identifier("displayName"), t.stringLiteral(id))); } } var isCreateClassCallExpression = t.buildMatchMemberExpression("React.createClass"); var isCreateClassAddon = function isCreateClassAddon(callee) { return callee.name === "createReactClass"; }; function isCreateClass(node) { if (!node || !t.isCallExpression(node)) return false; if (!isCreateClassCallExpression(node.callee) && !isCreateClassAddon(node.callee)) return false; var args = node.arguments; if (args.length !== 1) return false; var first = args[0]; if (!t.isObjectExpression(first)) return false; return true; } return { visitor: { ExportDefaultDeclaration: function ExportDefaultDeclaration(_ref2, state) { var node = _ref2.node; if (isCreateClass(node.declaration)) { var displayName = state.file.opts.basename; if (displayName === "index") { displayName = _path2.default.basename(_path2.default.dirname(state.file.opts.filename)); } addDisplayName(displayName, node.declaration); } }, CallExpression: function CallExpression(path) { var node = path.node; if (!isCreateClass(node)) return; var id = void 0; path.find(function (path) { if (path.isAssignmentExpression()) { id = path.node.left; } else if (path.isObjectProperty()) { id = path.node.key; } else if (path.isVariableDeclarator()) { id = path.node.id; } else if (path.isStatement()) { return true; } if (id) return true; }); if (!id) return; if (t.isMemberExpression(id)) { id = id.property; } if (t.isIdentifier(id)) { addDisplayName(id.name, node); } } } }; }; var _path = $__require("@node/path"); var _path2 = _interopRequireDefault(_path); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("103", ["fd", "100", "101", "102"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _babelPresetFlow = $__require("fd"); var _babelPresetFlow2 = _interopRequireDefault(_babelPresetFlow); var _babelPluginTransformReactJsx = $__require("100"); var _babelPluginTransformReactJsx2 = _interopRequireDefault(_babelPluginTransformReactJsx); var _babelPluginSyntaxJsx = $__require("101"); var _babelPluginSyntaxJsx2 = _interopRequireDefault(_babelPluginSyntaxJsx); var _babelPluginTransformReactDisplayName = $__require("102"); var _babelPluginTransformReactDisplayName2 = _interopRequireDefault(_babelPluginTransformReactDisplayName); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = { presets: [_babelPresetFlow2.default], plugins: [_babelPluginTransformReactJsx2.default, _babelPluginSyntaxJsx2.default, _babelPluginTransformReactDisplayName2.default], env: { development: { plugins: [] } } }; module.exports = exports["default"]; }); $__System.registerDynamic("104", ["17"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (_ref) { var t = _ref.types; function isString(node) { return t.isLiteral(node) && typeof node.value === "string"; } function buildBinaryExpression(left, right) { return t.binaryExpression("+", left, right); } return { visitor: { TaggedTemplateExpression: function TaggedTemplateExpression(path, state) { var node = path.node; var quasi = node.quasi; var args = []; var strings = []; var raw = []; for (var _iterator = quasi.quasis, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 elem = _ref2; strings.push(t.stringLiteral(elem.value.cooked)); raw.push(t.stringLiteral(elem.value.raw)); } strings = t.arrayExpression(strings); raw = t.arrayExpression(raw); var templateName = "taggedTemplateLiteral"; if (state.opts.loose) templateName += "Loose"; var templateObject = state.file.addTemplateObject(templateName, strings, raw); args.push(templateObject); args = args.concat(quasi.expressions); path.replaceWith(t.callExpression(node.tag, args)); }, TemplateLiteral: function TemplateLiteral(path, state) { var nodes = []; var expressions = path.get("expressions"); for (var _iterator2 = path.node.quasis, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref3; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref3 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref3 = _i2.value; } var elem = _ref3; nodes.push(t.stringLiteral(elem.value.cooked)); var expr = expressions.shift(); if (expr) { if (state.opts.spec && !expr.isBaseType("string") && !expr.isBaseType("number")) { nodes.push(t.callExpression(t.identifier("String"), [expr.node])); } else { nodes.push(expr.node); } } } nodes = nodes.filter(function (n) { return !t.isLiteral(n, { value: "" }); }); if (!isString(nodes[0]) && !isString(nodes[1])) { nodes.unshift(t.stringLiteral("")); } if (nodes.length > 1) { var root = buildBinaryExpression(nodes.shift(), nodes.shift()); for (var _iterator3 = nodes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref4; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref4 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref4 = _i3.value; } var node = _ref4; root = buildBinaryExpression(root, node); } path.replaceWith(root); } else { path.replaceWith(nodes[0]); } } } }; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("105", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { visitor: { NumericLiteral: function NumericLiteral(_ref) { var node = _ref.node; if (node.extra && /^0[ob]/i.test(node.extra.raw)) { node.extra = undefined; } }, StringLiteral: function StringLiteral(_ref2) { var node = _ref2.node; if (node.extra && /\\[u]/gi.test(node.extra.raw)) { node.extra = undefined; } } } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("106", ["e7"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { visitor: { FunctionExpression: { exit: function exit(path) { if (path.key !== "value" && !path.parentPath.isObjectProperty()) { var replacement = (0, _babelHelperFunctionName2.default)(path); if (replacement) path.replaceWith(replacement); } } }, ObjectProperty: function ObjectProperty(path) { var value = path.get("value"); if (value.isFunction()) { var newNode = (0, _babelHelperFunctionName2.default)(value); if (newNode) value.replaceWith(newNode); } } } }; }; var _babelHelperFunctionName = $__require("e7"); var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("107", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (_ref) { var t = _ref.types; return { visitor: { ArrowFunctionExpression: function ArrowFunctionExpression(path, state) { if (state.opts.spec) { var node = path.node; if (node.shadow) return; node.shadow = { this: false }; node.type = "FunctionExpression"; var boundThis = t.thisExpression(); boundThis._forceShadow = path; path.ensureBlock(); path.get("body").unshiftContainer("body", t.expressionStatement(t.callExpression(state.addHelper("newArrowCheck"), [t.thisExpression(), boundThis]))); path.replaceWith(t.callExpression(t.memberExpression(node, t.identifier("bind")), [t.thisExpression()])); } else { path.arrowFunctionToShadowed(); } } } }; }; module.exports = exports["default"]; }); $__System.registerDynamic("108", ["17"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (_ref) { var t = _ref.types; function statementList(key, path) { var paths = path.get(key); for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 _path = _ref2; var func = _path.node; if (!_path.isFunctionDeclaration()) continue; var declar = t.variableDeclaration("let", [t.variableDeclarator(func.id, t.toExpression(func))]); declar._blockHoist = 2; func.id = null; _path.replaceWith(declar); } } return { visitor: { BlockStatement: function BlockStatement(path) { var node = path.node, parent = path.parent; if (t.isFunction(parent, { body: node }) || t.isExportDeclaration(parent)) { return; } statementList("body", path); }, SwitchCase: function SwitchCase(path) { statementList("consequent", path); } } }; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("1e", ["30"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _typeof2 = $__require("30"); var _typeof3 = _interopRequireDefault(_typeof2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; }; }); $__System.registerDynamic('109', ['10a', '10b', '10c', '10d', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var isObject = $__require('10a'), anObject = $__require('10b'); var check = function (O, proto) { anObject(O); if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); }; module.exports = { set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line function (test, buggy, set) { try { set = $__require('10c')(Function.call, $__require('10d').f(Object.prototype, '__proto__').set, 2); set(test, []); buggy = !(test instanceof Array); } catch (e) { buggy = true; } return function setPrototypeOf(O, proto) { check(O, proto); if (buggy) O.__proto__ = proto;else set(O, proto); return O; }; }({}, false) : undefined), check: check }; }); $__System.registerDynamic('10e', ['c6', '109', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; // 19.1.3.19 Object.setPrototypeOf(O, proto) var $export = $__require('c6'); $export($export.S, 'Object', { setPrototypeOf: $__require('109').set }); }); $__System.registerDynamic('10f', ['10e', '37', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; $__require('10e'); module.exports = $__require('37').Object.setPrototypeOf; }); $__System.registerDynamic("110", ["10f"], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; module.exports = { "default": $__require("10f"), __esModule: true }; }); $__System.registerDynamic("1f", ["110", "d4", "30"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _setPrototypeOf = $__require("110"); var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); var _create = $__require("d4"); var _create2 = _interopRequireDefault(_create); var _typeof2 = $__require("30"); var _typeof3 = _interopRequireDefault(_typeof2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); } subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; }; }); $__System.registerDynamic("111", ["1d", "1e", "1f", "e7", "112", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _possibleConstructorReturn2 = $__require("1e"); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = $__require("1f"); var _inherits3 = _interopRequireDefault(_inherits2); var _babelHelperFunctionName = $__require("e7"); var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName); var _vanilla = $__require("112"); var _vanilla2 = _interopRequireDefault(_vanilla); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var LooseClassTransformer = function (_VanillaTransformer) { (0, _inherits3.default)(LooseClassTransformer, _VanillaTransformer); function LooseClassTransformer() { (0, _classCallCheck3.default)(this, LooseClassTransformer); var _this = (0, _possibleConstructorReturn3.default)(this, _VanillaTransformer.apply(this, arguments)); _this.isLoose = true; return _this; } LooseClassTransformer.prototype._processMethod = function _processMethod(node, scope) { if (!node.decorators) { var classRef = this.classRef; if (!node.static) classRef = t.memberExpression(classRef, t.identifier("prototype")); var methodName = t.memberExpression(classRef, node.key, node.computed || t.isLiteral(node.key)); var func = t.functionExpression(null, node.params, node.body, node.generator, node.async); func.returnType = node.returnType; var key = t.toComputedKey(node, node.key); if (t.isStringLiteral(key)) { func = (0, _babelHelperFunctionName2.default)({ node: func, id: key, scope: scope }); } var expr = t.expressionStatement(t.assignmentExpression("=", methodName, func)); t.inheritsComments(expr, node); this.body.push(expr); return true; } }; return LooseClassTransformer; }(_vanilla2.default); exports.default = LooseClassTransformer; module.exports = exports["default"]; }); $__System.registerDynamic("113", ["15", "e7", "114", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _keys = $__require("15"); var _keys2 = _interopRequireDefault(_keys); exports.push = push; exports.hasComputed = hasComputed; exports.toComputedObjectFromClass = toComputedObjectFromClass; exports.toClassObject = toClassObject; exports.toDefineObject = toDefineObject; var _babelHelperFunctionName = $__require("e7"); var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName); var _has = $__require("114"); var _has2 = _interopRequireDefault(_has); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function toKind(node) { if (t.isClassMethod(node) || t.isObjectMethod(node)) { if (node.kind === "get" || node.kind === "set") { return node.kind; } } return "value"; } function push(mutatorMap, node, kind, file, scope) { var alias = t.toKeyAlias(node); var map = {}; if ((0, _has2.default)(mutatorMap, alias)) map = mutatorMap[alias]; mutatorMap[alias] = map; map._inherits = map._inherits || []; map._inherits.push(node); map._key = node.key; if (node.computed) { map._computed = true; } if (node.decorators) { var decorators = map.decorators = map.decorators || t.arrayExpression([]); decorators.elements = decorators.elements.concat(node.decorators.map(function (dec) { return dec.expression; }).reverse()); } if (map.value || map.initializer) { throw file.buildCodeFrameError(node, "Key conflict with sibling node"); } var key = void 0, value = void 0; if (t.isObjectProperty(node) || t.isObjectMethod(node) || t.isClassMethod(node)) { key = t.toComputedKey(node, node.key); } if (t.isObjectProperty(node) || t.isClassProperty(node)) { value = node.value; } else if (t.isObjectMethod(node) || t.isClassMethod(node)) { value = t.functionExpression(null, node.params, node.body, node.generator, node.async); value.returnType = node.returnType; } var inheritedKind = toKind(node); if (!kind || inheritedKind !== "value") { kind = inheritedKind; } if (scope && t.isStringLiteral(key) && (kind === "value" || kind === "initializer") && t.isFunctionExpression(value)) { value = (0, _babelHelperFunctionName2.default)({ id: key, node: value, scope: scope }); } if (value) { t.inheritsComments(value, node); map[kind] = value; } return map; } function hasComputed(mutatorMap) { for (var key in mutatorMap) { if (mutatorMap[key]._computed) { return true; } } return false; } function toComputedObjectFromClass(obj) { var objExpr = t.arrayExpression([]); for (var i = 0; i < obj.properties.length; i++) { var prop = obj.properties[i]; var val = prop.value; val.properties.unshift(t.objectProperty(t.identifier("key"), t.toComputedKey(prop))); objExpr.elements.push(val); } return objExpr; } function toClassObject(mutatorMap) { var objExpr = t.objectExpression([]); (0, _keys2.default)(mutatorMap).forEach(function (mutatorMapKey) { var map = mutatorMap[mutatorMapKey]; var mapNode = t.objectExpression([]); var propNode = t.objectProperty(map._key, mapNode, map._computed); (0, _keys2.default)(map).forEach(function (key) { var node = map[key]; if (key[0] === "_") return; var inheritNode = node; if (t.isClassMethod(node) || t.isClassProperty(node)) node = node.value; var prop = t.objectProperty(t.identifier(key), node); t.inheritsComments(prop, inheritNode); t.removeComments(inheritNode); mapNode.properties.push(prop); }); objExpr.properties.push(propNode); }); return objExpr; } function toDefineObject(mutatorMap) { (0, _keys2.default)(mutatorMap).forEach(function (key) { var map = mutatorMap[key]; if (map.value) map.writable = t.booleanLiteral(true); map.configurable = t.booleanLiteral(true); map.enumerable = t.booleanLiteral(true); }); return toClassObject(mutatorMap); } }); $__System.registerDynamic("112", ["17", "1d", "d0", "115", "116", "113", "10", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _babelTraverse = $__require("d0"); var _babelHelperReplaceSupers = $__require("115"); var _babelHelperReplaceSupers2 = _interopRequireDefault(_babelHelperReplaceSupers); var _babelHelperOptimiseCallExpression = $__require("116"); var _babelHelperOptimiseCallExpression2 = _interopRequireDefault(_babelHelperOptimiseCallExpression); var _babelHelperDefineMap = $__require("113"); var defineMap = _interopRequireWildcard(_babelHelperDefineMap); var _babelTemplate = $__require("10"); var _babelTemplate2 = _interopRequireDefault(_babelTemplate); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var buildDerivedConstructor = (0, _babelTemplate2.default)("\n (function () {\n super(...arguments);\n })\n"); var noMethodVisitor = { "FunctionExpression|FunctionDeclaration": function FunctionExpressionFunctionDeclaration(path) { if (!path.is("shadow")) { path.skip(); } }, Method: function Method(path) { path.skip(); } }; var verifyConstructorVisitor = _babelTraverse.visitors.merge([noMethodVisitor, { Super: function Super(path) { if (this.isDerived && !this.hasBareSuper && !path.parentPath.isCallExpression({ callee: path.node })) { throw path.buildCodeFrameError("'super.*' is not allowed before super()"); } }, CallExpression: { exit: function exit(path) { if (path.get("callee").isSuper()) { this.hasBareSuper = true; if (!this.isDerived) { throw path.buildCodeFrameError("super() is only allowed in a derived constructor"); } } } }, ThisExpression: function ThisExpression(path) { if (this.isDerived && !this.hasBareSuper) { if (!path.inShadow("this")) { throw path.buildCodeFrameError("'this' is not allowed before super()"); } } } }]); var findThisesVisitor = _babelTraverse.visitors.merge([noMethodVisitor, { ThisExpression: function ThisExpression(path) { this.superThises.push(path); } }]); var ClassTransformer = function () { function ClassTransformer(path, file) { (0, _classCallCheck3.default)(this, ClassTransformer); this.parent = path.parent; this.scope = path.scope; this.node = path.node; this.path = path; this.file = file; this.clearDescriptors(); this.instancePropBody = []; this.instancePropRefs = {}; this.staticPropBody = []; this.body = []; this.bareSuperAfter = []; this.bareSupers = []; this.pushedConstructor = false; this.pushedInherits = false; this.isLoose = false; this.superThises = []; this.classId = this.node.id; this.classRef = this.node.id ? t.identifier(this.node.id.name) : this.scope.generateUidIdentifier("class"); this.superName = this.node.superClass || t.identifier("Function"); this.isDerived = !!this.node.superClass; } ClassTransformer.prototype.run = function run() { var _this = this; var superName = this.superName; var file = this.file; var body = this.body; var constructorBody = this.constructorBody = t.blockStatement([]); this.constructor = this.buildConstructor(); var closureParams = []; var closureArgs = []; if (this.isDerived) { closureArgs.push(superName); superName = this.scope.generateUidIdentifierBasedOnNode(superName); closureParams.push(superName); this.superName = superName; } this.buildBody(); constructorBody.body.unshift(t.expressionStatement(t.callExpression(file.addHelper("classCallCheck"), [t.thisExpression(), this.classRef]))); body = body.concat(this.staticPropBody.map(function (fn) { return fn(_this.classRef); })); if (this.classId) { if (body.length === 1) return t.toExpression(body[0]); } body.push(t.returnStatement(this.classRef)); var container = t.functionExpression(null, closureParams, t.blockStatement(body)); container.shadow = true; return t.callExpression(container, closureArgs); }; ClassTransformer.prototype.buildConstructor = function buildConstructor() { var func = t.functionDeclaration(this.classRef, [], this.constructorBody); t.inherits(func, this.node); return func; }; ClassTransformer.prototype.pushToMap = function pushToMap(node, enumerable) { var kind = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "value"; var scope = arguments[3]; var mutatorMap = void 0; if (node.static) { this.hasStaticDescriptors = true; mutatorMap = this.staticMutatorMap; } else { this.hasInstanceDescriptors = true; mutatorMap = this.instanceMutatorMap; } var map = defineMap.push(mutatorMap, node, kind, this.file, scope); if (enumerable) { map.enumerable = t.booleanLiteral(true); } return map; }; ClassTransformer.prototype.constructorMeMaybe = function constructorMeMaybe() { var hasConstructor = false; var paths = this.path.get("body.body"); for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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; hasConstructor = path.equals("kind", "constructor"); if (hasConstructor) break; } if (hasConstructor) return; var params = void 0, body = void 0; if (this.isDerived) { var _constructor = buildDerivedConstructor().expression; params = _constructor.params; body = _constructor.body; } else { params = []; body = t.blockStatement([]); } this.path.get("body").unshiftContainer("body", t.classMethod("constructor", t.identifier("constructor"), params, body)); }; ClassTransformer.prototype.buildBody = function buildBody() { this.constructorMeMaybe(); this.pushBody(); this.verifyConstructor(); if (this.userConstructor) { var constructorBody = this.constructorBody; constructorBody.body = constructorBody.body.concat(this.userConstructor.body.body); t.inherits(this.constructor, this.userConstructor); t.inherits(constructorBody, this.userConstructor.body); } this.pushDescriptors(); }; ClassTransformer.prototype.pushBody = function pushBody() { var classBodyPaths = this.path.get("body.body"); for (var _iterator2 = classBodyPaths, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var path = _ref2; var node = path.node; if (path.isClassProperty()) { throw path.buildCodeFrameError("Missing class properties transform."); } if (node.decorators) { throw path.buildCodeFrameError("Method has decorators, put the decorator plugin before the classes one."); } if (t.isClassMethod(node)) { var isConstructor = node.kind === "constructor"; if (isConstructor) { path.traverse(verifyConstructorVisitor, this); if (!this.hasBareSuper && this.isDerived) { throw path.buildCodeFrameError("missing super() call in constructor"); } } var replaceSupers = new _babelHelperReplaceSupers2.default({ forceSuperMemoisation: isConstructor, methodPath: path, methodNode: node, objectRef: this.classRef, superRef: this.superName, isStatic: node.static, isLoose: this.isLoose, scope: this.scope, file: this.file }, true); replaceSupers.replace(); if (isConstructor) { this.pushConstructor(replaceSupers, node, path); } else { this.pushMethod(node, path); } } } }; ClassTransformer.prototype.clearDescriptors = function clearDescriptors() { this.hasInstanceDescriptors = false; this.hasStaticDescriptors = false; this.instanceMutatorMap = {}; this.staticMutatorMap = {}; }; ClassTransformer.prototype.pushDescriptors = function pushDescriptors() { this.pushInherits(); var body = this.body; var instanceProps = void 0; var staticProps = void 0; if (this.hasInstanceDescriptors) { instanceProps = defineMap.toClassObject(this.instanceMutatorMap); } if (this.hasStaticDescriptors) { staticProps = defineMap.toClassObject(this.staticMutatorMap); } if (instanceProps || staticProps) { if (instanceProps) instanceProps = defineMap.toComputedObjectFromClass(instanceProps); if (staticProps) staticProps = defineMap.toComputedObjectFromClass(staticProps); var nullNode = t.nullLiteral(); var args = [this.classRef, nullNode, nullNode, nullNode, nullNode]; if (instanceProps) args[1] = instanceProps; if (staticProps) args[2] = staticProps; if (this.instanceInitializersId) { args[3] = this.instanceInitializersId; body.unshift(this.buildObjectAssignment(this.instanceInitializersId)); } if (this.staticInitializersId) { args[4] = this.staticInitializersId; body.unshift(this.buildObjectAssignment(this.staticInitializersId)); } var lastNonNullIndex = 0; for (var i = 0; i < args.length; i++) { if (args[i] !== nullNode) lastNonNullIndex = i; } args = args.slice(0, lastNonNullIndex + 1); body.push(t.expressionStatement(t.callExpression(this.file.addHelper("createClass"), args))); } this.clearDescriptors(); }; ClassTransformer.prototype.buildObjectAssignment = function buildObjectAssignment(id) { return t.variableDeclaration("var", [t.variableDeclarator(id, t.objectExpression([]))]); }; ClassTransformer.prototype.wrapSuperCall = function wrapSuperCall(bareSuper, superRef, thisRef, body) { var bareSuperNode = bareSuper.node; if (this.isLoose) { bareSuperNode.arguments.unshift(t.thisExpression()); if (bareSuperNode.arguments.length === 2 && t.isSpreadElement(bareSuperNode.arguments[1]) && t.isIdentifier(bareSuperNode.arguments[1].argument, { name: "arguments" })) { bareSuperNode.arguments[1] = bareSuperNode.arguments[1].argument; bareSuperNode.callee = t.memberExpression(superRef, t.identifier("apply")); } else { bareSuperNode.callee = t.memberExpression(superRef, t.identifier("call")); } } else { bareSuperNode = (0, _babelHelperOptimiseCallExpression2.default)(t.logicalExpression("||", t.memberExpression(this.classRef, t.identifier("__proto__")), t.callExpression(t.memberExpression(t.identifier("Object"), t.identifier("getPrototypeOf")), [this.classRef])), t.thisExpression(), bareSuperNode.arguments); } var call = t.callExpression(this.file.addHelper("possibleConstructorReturn"), [t.thisExpression(), bareSuperNode]); var bareSuperAfter = this.bareSuperAfter.map(function (fn) { return fn(thisRef); }); if (bareSuper.parentPath.isExpressionStatement() && bareSuper.parentPath.container === body.node.body && body.node.body.length - 1 === bareSuper.parentPath.key) { if (this.superThises.length || bareSuperAfter.length) { bareSuper.scope.push({ id: thisRef }); call = t.assignmentExpression("=", thisRef, call); } if (bareSuperAfter.length) { call = t.toSequenceExpression([call].concat(bareSuperAfter, [thisRef])); } bareSuper.parentPath.replaceWith(t.returnStatement(call)); } else { bareSuper.replaceWithMultiple([t.variableDeclaration("var", [t.variableDeclarator(thisRef, call)])].concat(bareSuperAfter, [t.expressionStatement(thisRef)])); } }; ClassTransformer.prototype.verifyConstructor = function verifyConstructor() { var _this2 = this; if (!this.isDerived) return; var path = this.userConstructorPath; var body = path.get("body"); path.traverse(findThisesVisitor, this); var guaranteedSuperBeforeFinish = !!this.bareSupers.length; var superRef = this.superName || t.identifier("Function"); var thisRef = path.scope.generateUidIdentifier("this"); for (var _iterator3 = this.bareSupers, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var bareSuper = _ref3; this.wrapSuperCall(bareSuper, superRef, thisRef, body); if (guaranteedSuperBeforeFinish) { bareSuper.find(function (parentPath) { if (parentPath === path) { return true; } if (parentPath.isLoop() || parentPath.isConditional()) { guaranteedSuperBeforeFinish = false; return true; } }); } } for (var _iterator4 = this.superThises, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { var _ref4; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref4 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref4 = _i4.value; } var thisPath = _ref4; thisPath.replaceWith(thisRef); } var wrapReturn = function wrapReturn(returnArg) { return t.callExpression(_this2.file.addHelper("possibleConstructorReturn"), [thisRef].concat(returnArg || [])); }; var bodyPaths = body.get("body"); if (bodyPaths.length && !bodyPaths.pop().isReturnStatement()) { body.pushContainer("body", t.returnStatement(guaranteedSuperBeforeFinish ? thisRef : wrapReturn())); } for (var _iterator5 = this.superReturns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { var _ref5; if (_isArray5) { if (_i5 >= _iterator5.length) break; _ref5 = _iterator5[_i5++]; } else { _i5 = _iterator5.next(); if (_i5.done) break; _ref5 = _i5.value; } var returnPath = _ref5; if (returnPath.node.argument) { var ref = returnPath.scope.generateDeclaredUidIdentifier("ret"); returnPath.get("argument").replaceWithMultiple([t.assignmentExpression("=", ref, returnPath.node.argument), wrapReturn(ref)]); } else { returnPath.get("argument").replaceWith(wrapReturn()); } } }; ClassTransformer.prototype.pushMethod = function pushMethod(node, path) { var scope = path ? path.scope : this.scope; if (node.kind === "method") { if (this._processMethod(node, scope)) return; } this.pushToMap(node, false, null, scope); }; ClassTransformer.prototype._processMethod = function _processMethod() { return false; }; ClassTransformer.prototype.pushConstructor = function pushConstructor(replaceSupers, method, path) { this.bareSupers = replaceSupers.bareSupers; this.superReturns = replaceSupers.returns; if (path.scope.hasOwnBinding(this.classRef.name)) { path.scope.rename(this.classRef.name); } var construct = this.constructor; this.userConstructorPath = path; this.userConstructor = method; this.hasConstructor = true; t.inheritsComments(construct, method); construct._ignoreUserWhitespace = true; construct.params = method.params; t.inherits(construct.body, method.body); construct.body.directives = method.body.directives; this._pushConstructor(); }; ClassTransformer.prototype._pushConstructor = function _pushConstructor() { if (this.pushedConstructor) return; this.pushedConstructor = true; if (this.hasInstanceDescriptors || this.hasStaticDescriptors) { this.pushDescriptors(); } this.body.push(this.constructor); this.pushInherits(); }; ClassTransformer.prototype.pushInherits = function pushInherits() { if (!this.isDerived || this.pushedInherits) return; this.pushedInherits = true; this.body.unshift(t.expressionStatement(t.callExpression(this.file.addHelper("inherits"), [this.classRef, this.superName]))); }; return ClassTransformer; }(); exports.default = ClassTransformer; module.exports = exports["default"]; }); $__System.registerDynamic("e7", ["117", "10", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (_ref) { var node = _ref.node, parent = _ref.parent, scope = _ref.scope, id = _ref.id; 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)) { var binding = scope.parent.getBinding(id.name); if (binding && binding.constant && scope.getBinding(id.name) === binding) { node.id = id; node.id[t.NOT_LOCAL_BINDING] = true; return; } } } else if (t.isAssignmentExpression(parent)) { id = parent.left; } else if (!id) { return; } var name = void 0; if (id && t.isLiteral(id)) { name = id.value; } else if (id && t.isIdentifier(id)) { name = id.name; } else { 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; }; var _babelHelperGetFunctionArity = $__require("117"); var _babelHelperGetFunctionArity2 = _interopRequireDefault(_babelHelperGetFunctionArity); var _babelTemplate = $__require("10"); var _babelTemplate2 = _interopRequireDefault(_babelTemplate); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var buildPropertyMethodAssignmentWrapper = (0, _babelTemplate2.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, _babelTemplate2.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 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; _template.callee._skipModulesRemap = true; var params = _template.callee.body.body[0].params; for (var i = 0, len = (0, _babelHelperGetFunctionArity2.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; } module.exports = exports["default"]; }); $__System.registerDynamic("118", ["d3", "111", "112", "e7"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _symbol = $__require("d3"); var _symbol2 = _interopRequireDefault(_symbol); exports.default = function (_ref) { var t = _ref.types; var VISITED = (0, _symbol2.default)(); return { visitor: { ExportDefaultDeclaration: function ExportDefaultDeclaration(path) { if (!path.get("declaration").isClassDeclaration()) return; var node = path.node; var ref = node.declaration.id || path.scope.generateUidIdentifier("class"); node.declaration.id = ref; path.replaceWith(node.declaration); path.insertAfter(t.exportDefaultDeclaration(ref)); }, ClassDeclaration: function ClassDeclaration(path) { var node = path.node; var ref = node.id || path.scope.generateUidIdentifier("class"); path.replaceWith(t.variableDeclaration("let", [t.variableDeclarator(ref, t.toExpression(node))])); }, ClassExpression: function ClassExpression(path, state) { var node = path.node; if (node[VISITED]) return; var inferred = (0, _babelHelperFunctionName2.default)(path); if (inferred && inferred !== node) return path.replaceWith(inferred); node[VISITED] = true; var Constructor = _vanilla2.default; if (state.opts.loose) Constructor = _loose2.default; path.replaceWith(new Constructor(path, state.file).run()); } } }; }; var _loose = $__require("111"); var _loose2 = _interopRequireDefault(_loose); var _vanilla = $__require("112"); var _vanilla2 = _interopRequireDefault(_vanilla); var _babelHelperFunctionName = $__require("e7"); var _babelHelperFunctionName2 = _interopRequireDefault(_babelHelperFunctionName); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("116", ["11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (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)); } }; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } module.exports = exports["default"]; }); $__System.registerDynamic("115", ["1d", "d3", "116", "f", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _symbol = $__require("d3"); var _symbol2 = _interopRequireDefault(_symbol); var _babelHelperOptimiseCallExpression = $__require("116"); var _babelHelperOptimiseCallExpression2 = _interopRequireDefault(_babelHelperOptimiseCallExpression); var _babelMessages = $__require("f"); var messages = _interopRequireWildcard(_babelMessages); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var HARDCORE_THIS_REF = (0, _symbol2.default)(); function isIllegalBareSuper(node, parent) { if (!t.isSuper(node)) return false; if (t.isMemberExpression(parent, { computed: false })) return false; if (t.isCallExpression(parent, { callee: node })) return false; return true; } function isMemberExpressionSuper(node) { return t.isMemberExpression(node) && t.isSuper(node.object); } function getPrototypeOfExpression(objectRef, isStatic) { var targetRef = isStatic ? objectRef : t.memberExpression(objectRef, t.identifier("prototype")); return t.logicalExpression("||", t.memberExpression(targetRef, t.identifier("__proto__")), t.callExpression(t.memberExpression(t.identifier("Object"), t.identifier("getPrototypeOf")), [targetRef])); } var visitor = { Function: function Function(path) { if (!path.inShadow("this")) { path.skip(); } }, ReturnStatement: function ReturnStatement(path, state) { if (!path.inShadow("this")) { state.returns.push(path); } }, ThisExpression: function ThisExpression(path, state) { if (!path.node[HARDCORE_THIS_REF]) { state.thises.push(path); } }, enter: function enter(path, state) { var callback = state.specHandle; if (state.isLoose) callback = state.looseHandle; var isBareSuper = path.isCallExpression() && path.get("callee").isSuper(); var result = callback.call(state, path); if (result) { state.hasSuper = true; } if (isBareSuper) { state.bareSupers.push(path); } if (result === true) { path.requeue(); } if (result !== true && result) { if (Array.isArray(result)) { path.replaceWithMultiple(result); } else { path.replaceWith(result); } } } }; var ReplaceSupers = function () { function ReplaceSupers(opts) { var inClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; (0, _classCallCheck3.default)(this, ReplaceSupers); this.forceSuperMemoisation = opts.forceSuperMemoisation; this.methodPath = opts.methodPath; this.methodNode = opts.methodNode; this.superRef = opts.superRef; this.isStatic = opts.isStatic; this.hasSuper = false; this.inClass = inClass; this.isLoose = opts.isLoose; this.scope = this.methodPath.scope; this.file = opts.file; this.opts = opts; this.bareSupers = []; this.returns = []; this.thises = []; } ReplaceSupers.prototype.getObjectRef = function getObjectRef() { return this.opts.objectRef || this.opts.getObjectRef(); }; ReplaceSupers.prototype.setSuperProperty = function setSuperProperty(property, value, isComputed) { return t.callExpression(this.file.addHelper("set"), [getPrototypeOfExpression(this.getObjectRef(), this.isStatic), isComputed ? property : t.stringLiteral(property.name), value, t.thisExpression()]); }; ReplaceSupers.prototype.getSuperProperty = function getSuperProperty(property, isComputed) { return t.callExpression(this.file.addHelper("get"), [getPrototypeOfExpression(this.getObjectRef(), this.isStatic), isComputed ? property : t.stringLiteral(property.name), t.thisExpression()]); }; ReplaceSupers.prototype.replace = function replace() { this.methodPath.traverse(visitor, this); }; ReplaceSupers.prototype.getLooseSuperProperty = function getLooseSuperProperty(id, parent) { var methodNode = this.methodNode; var superRef = this.superRef || t.identifier("Function"); if (parent.property === id) { return; } else if (t.isCallExpression(parent, { callee: id })) { return; } else if (t.isMemberExpression(parent) && !methodNode.static) { return t.memberExpression(superRef, t.identifier("prototype")); } else { return superRef; } }; ReplaceSupers.prototype.looseHandle = function looseHandle(path) { var node = path.node; if (path.isSuper()) { return this.getLooseSuperProperty(node, path.parent); } else if (path.isCallExpression()) { var callee = node.callee; if (!t.isMemberExpression(callee)) return; if (!t.isSuper(callee.object)) return; t.appendToMemberExpression(callee, t.identifier("call")); node.arguments.unshift(t.thisExpression()); return true; } }; ReplaceSupers.prototype.specHandleAssignmentExpression = function specHandleAssignmentExpression(ref, path, node) { if (node.operator === "=") { return this.setSuperProperty(node.left.property, node.right, node.left.computed); } else { ref = ref || path.scope.generateUidIdentifier("ref"); return [t.variableDeclaration("var", [t.variableDeclarator(ref, node.left)]), t.expressionStatement(t.assignmentExpression("=", node.left, t.binaryExpression(node.operator[0], ref, node.right)))]; } }; ReplaceSupers.prototype.specHandle = function specHandle(path) { var property = void 0; var computed = void 0; var args = void 0; var parent = path.parent; var node = path.node; if (isIllegalBareSuper(node, parent)) { throw path.buildCodeFrameError(messages.get("classesIllegalBareSuper")); } if (t.isCallExpression(node)) { var callee = node.callee; if (t.isSuper(callee)) { return; } else if (isMemberExpressionSuper(callee)) { property = callee.property; computed = callee.computed; args = node.arguments; } } else if (t.isMemberExpression(node) && t.isSuper(node.object)) { property = node.property; computed = node.computed; } else if (t.isUpdateExpression(node) && isMemberExpressionSuper(node.argument)) { var binary = t.binaryExpression(node.operator[0], node.argument, t.numericLiteral(1)); if (node.prefix) { return this.specHandleAssignmentExpression(null, path, binary); } else { var ref = path.scope.generateUidIdentifier("ref"); return this.specHandleAssignmentExpression(ref, path, binary).concat(t.expressionStatement(ref)); } } else if (t.isAssignmentExpression(node) && isMemberExpressionSuper(node.left)) { return this.specHandleAssignmentExpression(null, path, node); } if (!property) return; var superProperty = this.getSuperProperty(property, computed); if (args) { return this.optimiseCall(superProperty, args); } else { return superProperty; } }; ReplaceSupers.prototype.optimiseCall = function optimiseCall(callee, args) { var thisNode = t.thisExpression(); thisNode[HARDCORE_THIS_REF] = true; return (0, _babelHelperOptimiseCallExpression2.default)(callee, thisNode, args); }; return ReplaceSupers; }(); exports.default = ReplaceSupers; module.exports = exports["default"]; }); $__System.registerDynamic("119", ["17", "d3", "115"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _symbol = $__require("d3"); var _symbol2 = _interopRequireDefault(_symbol); exports.default = function (_ref) { var t = _ref.types; function Property(path, node, scope, getObjectRef, file) { var replaceSupers = new _babelHelperReplaceSupers2.default({ getObjectRef: getObjectRef, methodNode: node, methodPath: path, isStatic: true, scope: scope, file: file }); replaceSupers.replace(); } var CONTAINS_SUPER = (0, _symbol2.default)(); return { visitor: { Super: function Super(path) { var parentObj = path.findParent(function (path) { return path.isObjectExpression(); }); if (parentObj) parentObj.node[CONTAINS_SUPER] = true; }, ObjectExpression: { exit: function exit(path, file) { if (!path.node[CONTAINS_SUPER]) return; var objectRef = void 0; var getObjectRef = function getObjectRef() { return objectRef = objectRef || path.scope.generateUidIdentifier("obj"); }; var propPaths = path.get("properties"); for (var _iterator = propPaths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 propPath = _ref2; if (propPath.isObjectProperty()) propPath = propPath.get("value"); Property(propPath, propPath.node, path.scope, getObjectRef, file); } if (objectRef) { path.scope.push({ id: objectRef }); path.replaceWith(t.assignmentExpression("=", objectRef, path.node)); } } } } }; }; var _babelHelperReplaceSupers = $__require("115"); var _babelHelperReplaceSupers2 = _interopRequireDefault(_babelHelperReplaceSupers); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("11a", ["11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { visitor: { ObjectMethod: function ObjectMethod(path) { var node = path.node; if (node.kind === "method") { var func = t.functionExpression(null, node.params, node.body, node.generator, node.async); func.returnType = node.returnType; path.replaceWith(t.objectProperty(node.key, func, node.computed)); } }, ObjectProperty: function ObjectProperty(_ref) { var node = _ref.node; if (node.shorthand) { node.shorthand = false; } } } }; }; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } module.exports = exports["default"]; }); $__System.registerDynamic("11b", ["17"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (_ref) { var t = _ref.types, template = _ref.template; var buildMutatorMapAssign = template("\n MUTATOR_MAP_REF[KEY] = MUTATOR_MAP_REF[KEY] || {};\n MUTATOR_MAP_REF[KEY].KIND = VALUE;\n "); function getValue(prop) { if (t.isObjectProperty(prop)) { return prop.value; } else if (t.isObjectMethod(prop)) { return t.functionExpression(null, prop.params, prop.body, prop.generator, prop.async); } } function pushAssign(objId, prop, body) { if (prop.kind === "get" && prop.kind === "set") { pushMutatorDefine(objId, prop, body); } else { body.push(t.expressionStatement(t.assignmentExpression("=", t.memberExpression(objId, prop.key, prop.computed || t.isLiteral(prop.key)), getValue(prop)))); } } function pushMutatorDefine(_ref2, prop) { var objId = _ref2.objId, body = _ref2.body, getMutatorId = _ref2.getMutatorId, scope = _ref2.scope; var key = !prop.computed && t.isIdentifier(prop.key) ? t.stringLiteral(prop.key.name) : prop.key; var maybeMemoise = scope.maybeGenerateMemoised(key); if (maybeMemoise) { body.push(t.expressionStatement(t.assignmentExpression("=", maybeMemoise, key))); key = maybeMemoise; } body.push.apply(body, buildMutatorMapAssign({ MUTATOR_MAP_REF: getMutatorId(), KEY: key, VALUE: getValue(prop), KIND: t.identifier(prop.kind) })); } function loose(info) { for (var _iterator = info.computedProps, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { var _ref3; if (_isArray) { if (_i >= _iterator.length) break; _ref3 = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref3 = _i.value; } var prop = _ref3; if (prop.kind === "get" || prop.kind === "set") { pushMutatorDefine(info, prop); } else { pushAssign(info.objId, prop, info.body); } } } function spec(info) { var objId = info.objId, body = info.body, computedProps = info.computedProps, state = info.state; for (var _iterator2 = computedProps, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref4; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref4 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref4 = _i2.value; } var prop = _ref4; var key = t.toComputedKey(prop); if (prop.kind === "get" || prop.kind === "set") { pushMutatorDefine(info, prop); } else if (t.isStringLiteral(key, { value: "__proto__" })) { pushAssign(objId, prop, body); } else { if (computedProps.length === 1) { return t.callExpression(state.addHelper("defineProperty"), [info.initPropExpression, key, getValue(prop)]); } else { body.push(t.expressionStatement(t.callExpression(state.addHelper("defineProperty"), [objId, key, getValue(prop)]))); } } } } return { visitor: { ObjectExpression: { exit: function exit(path, state) { var node = path.node, parent = path.parent, scope = path.scope; var hasComputed = false; for (var _iterator3 = node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref5; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref5 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref5 = _i3.value; } var prop = _ref5; hasComputed = prop.computed === true; if (hasComputed) break; } if (!hasComputed) return; var initProps = []; var computedProps = []; var foundComputed = false; for (var _iterator4 = node.properties, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { var _ref6; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref6 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref6 = _i4.value; } var _prop = _ref6; if (_prop.computed) { foundComputed = true; } if (foundComputed) { computedProps.push(_prop); } else { initProps.push(_prop); } } var objId = scope.generateUidIdentifierBasedOnNode(parent); var initPropExpression = t.objectExpression(initProps); var body = []; body.push(t.variableDeclaration("var", [t.variableDeclarator(objId, initPropExpression)])); var callback = spec; if (state.opts.loose) callback = loose; var mutatorRef = void 0; var getMutatorId = function getMutatorId() { if (!mutatorRef) { mutatorRef = scope.generateUidIdentifier("mutatorMap"); body.push(t.variableDeclaration("var", [t.variableDeclarator(mutatorRef, t.objectExpression([]))])); } return mutatorRef; }; var single = callback({ scope: scope, objId: objId, body: body, computedProps: computedProps, initPropExpression: initPropExpression, getMutatorId: getMutatorId, state: state }); if (mutatorRef) { body.push(t.expressionStatement(t.callExpression(state.addHelper("defineEnumerableProperties"), [objId, mutatorRef]))); } if (single) { path.replaceWith(single); } else { body.push(t.expressionStatement(objId)); path.replaceWithMultiple(body); } } } } }; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("11c", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (_ref) { var messages = _ref.messages, template = _ref.template, t = _ref.types; var buildForOfArray = template("\n for (var KEY = 0; KEY < ARR.length; KEY++) BODY;\n "); var buildForOfLoose = template("\n for (var LOOP_OBJECT = OBJECT,\n IS_ARRAY = Array.isArray(LOOP_OBJECT),\n INDEX = 0,\n LOOP_OBJECT = IS_ARRAY ? LOOP_OBJECT : LOOP_OBJECT[Symbol.iterator]();;) {\n var ID;\n if (IS_ARRAY) {\n if (INDEX >= LOOP_OBJECT.length) break;\n ID = LOOP_OBJECT[INDEX++];\n } else {\n INDEX = LOOP_OBJECT.next();\n if (INDEX.done) break;\n ID = INDEX.value;\n }\n }\n "); var buildForOf = template("\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (var ITERATOR_KEY = OBJECT[Symbol.iterator](), STEP_KEY; !(ITERATOR_COMPLETION = (STEP_KEY = ITERATOR_KEY.next()).done); ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return) {\n ITERATOR_KEY.return();\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n "); function _ForOfStatementArray(path) { var node = path.node, scope = path.scope; var nodes = []; var right = node.right; if (!t.isIdentifier(right) || !scope.hasBinding(right.name)) { var uid = scope.generateUidIdentifier("arr"); nodes.push(t.variableDeclaration("var", [t.variableDeclarator(uid, right)])); right = uid; } var iterationKey = scope.generateUidIdentifier("i"); var loop = buildForOfArray({ BODY: node.body, KEY: iterationKey, ARR: right }); t.inherits(loop, node); t.ensureBlock(loop); var iterationValue = t.memberExpression(right, iterationKey, true); var left = node.left; if (t.isVariableDeclaration(left)) { left.declarations[0].init = iterationValue; loop.body.body.unshift(left); } else { loop.body.body.unshift(t.expressionStatement(t.assignmentExpression("=", left, iterationValue))); } if (path.parentPath.isLabeledStatement()) { loop = t.labeledStatement(path.parentPath.node.label, loop); } nodes.push(loop); return nodes; } return { visitor: { ForOfStatement: function ForOfStatement(path, state) { if (path.get("right").isArrayExpression()) { if (path.parentPath.isLabeledStatement()) { return path.parentPath.replaceWithMultiple(_ForOfStatementArray(path)); } else { return path.replaceWithMultiple(_ForOfStatementArray(path)); } } var callback = spec; if (state.opts.loose) callback = loose; var node = path.node; var build = callback(path, state); var declar = build.declar; var loop = build.loop; var block = loop.body; path.ensureBlock(); if (declar) { block.body.push(declar); } block.body = block.body.concat(node.body.body); t.inherits(loop, node); t.inherits(loop.body, node.body); if (build.replaceParent) { path.parentPath.replaceWithMultiple(build.node); path.remove(); } else { path.replaceWithMultiple(build.node); } } } }; function loose(path, file) { var node = path.node, scope = path.scope, parent = path.parent; var left = node.left; var declar = void 0, id = void 0; if (t.isIdentifier(left) || t.isPattern(left) || t.isMemberExpression(left)) { id = left; } else if (t.isVariableDeclaration(left)) { id = scope.generateUidIdentifier("ref"); declar = t.variableDeclaration(left.kind, [t.variableDeclarator(left.declarations[0].id, id)]); } else { throw file.buildCodeFrameError(left, messages.get("unknownForHead", left.type)); } var iteratorKey = scope.generateUidIdentifier("iterator"); var isArrayKey = scope.generateUidIdentifier("isArray"); var loop = buildForOfLoose({ LOOP_OBJECT: iteratorKey, IS_ARRAY: isArrayKey, OBJECT: node.right, INDEX: scope.generateUidIdentifier("i"), ID: id }); if (!declar) { loop.body.body.shift(); } var isLabeledParent = t.isLabeledStatement(parent); var labeled = void 0; if (isLabeledParent) { labeled = t.labeledStatement(parent.label, loop); } return { replaceParent: isLabeledParent, declar: declar, node: labeled || loop, loop: loop }; } function spec(path, file) { var node = path.node, scope = path.scope, parent = path.parent; var left = node.left; var declar = void 0; var stepKey = scope.generateUidIdentifier("step"); var stepValue = t.memberExpression(stepKey, t.identifier("value")); if (t.isIdentifier(left) || t.isPattern(left) || t.isMemberExpression(left)) { declar = t.expressionStatement(t.assignmentExpression("=", left, stepValue)); } else if (t.isVariableDeclaration(left)) { declar = t.variableDeclaration(left.kind, [t.variableDeclarator(left.declarations[0].id, stepValue)]); } else { throw file.buildCodeFrameError(left, messages.get("unknownForHead", left.type)); } var iteratorKey = scope.generateUidIdentifier("iterator"); var template = buildForOf({ ITERATOR_HAD_ERROR_KEY: scope.generateUidIdentifier("didIteratorError"), ITERATOR_COMPLETION: scope.generateUidIdentifier("iteratorNormalCompletion"), ITERATOR_ERROR_KEY: scope.generateUidIdentifier("iteratorError"), ITERATOR_KEY: iteratorKey, STEP_KEY: stepKey, OBJECT: node.right, BODY: null }); var isLabeledParent = t.isLabeledStatement(parent); var tryBody = template[3].block.body; var loop = tryBody[0]; if (isLabeledParent) { tryBody[0] = t.labeledStatement(parent.label, loop); } return { replaceParent: isLabeledParent, declar: declar, loop: loop, node: template }; } }; module.exports = exports["default"]; }); $__System.registerDynamic("11d", ["11e", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { visitor: { RegExpLiteral: function RegExpLiteral(path) { var node = path.node; if (!regex.is(node, "y")) return; path.replaceWith(t.newExpression(t.identifier("RegExp"), [t.stringLiteral(node.pattern), t.stringLiteral(node.flags)])); } } }; }; var _babelHelperRegex = $__require("11e"); var regex = _interopRequireWildcard(_babelHelperRegex); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } module.exports = exports["default"]; }); /*! * RegJSGen * Copyright 2014 Benjamin Tan * Available under MIT license */ ;(function () { 'use strict'; /** Used to determine if values are of the language type `Object` */ var objectTypes = { 'function': true, 'object': true }; /** Used as a reference to the global object */ var root = objectTypes[typeof window] && window || this; /** Backup possible global object */ var oldRoot = root; /** Detect free variable `exports` */ var freeExports = objectTypes[typeof exports] && exports; /** Detect free variable `module` */ var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; /** Detect free variable `global` from Node.js or Browserified code and use it as `root` */ var freeGlobal = freeExports && freeModule && typeof global == 'object' && global; if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) { root = freeGlobal; } /*--------------------------------------------------------------------------*/ /*! Based on https://mths.be/fromcodepoint v0.2.0 by @mathias */ var stringFromCharCode = String.fromCharCode; var floor = Math.floor; function fromCodePoint() { var MAX_SIZE = 0x4000; var codeUnits = []; var highSurrogate; var lowSurrogate; var index = -1; var length = arguments.length; if (!length) { return ''; } var result = ''; while (++index < length) { var codePoint = Number(arguments[index]); if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity` codePoint < 0 || // not a valid Unicode code point codePoint > 0x10FFFF || // not a valid Unicode code point floor(codePoint) != codePoint // not an integer ) { throw RangeError('Invalid code point: ' + codePoint); } if (codePoint <= 0xFFFF) { // BMP code point codeUnits.push(codePoint); } else { // Astral code point; split in surrogate halves // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae codePoint -= 0x10000; highSurrogate = (codePoint >> 10) + 0xD800; lowSurrogate = codePoint % 0x400 + 0xDC00; codeUnits.push(highSurrogate, lowSurrogate); } if (index + 1 == length || codeUnits.length > MAX_SIZE) { result += stringFromCharCode.apply(null, codeUnits); codeUnits.length = 0; } } return result; } function assertType(type, expected) { if (expected.indexOf('|') == -1) { if (type == expected) { return; } throw Error('Invalid node type: ' + type); } expected = assertType.hasOwnProperty(expected) ? assertType[expected] : assertType[expected] = RegExp('^(?:' + expected + ')$'); if (expected.test(type)) { return; } throw Error('Invalid node type: ' + type); } /*--------------------------------------------------------------------------*/ function generate(node) { var type = node.type; if (generate.hasOwnProperty(type) && typeof generate[type] == 'function') { return generate[type](node); } throw Error('Invalid node type: ' + type); } /*--------------------------------------------------------------------------*/ function generateAlternative(node) { assertType(node.type, 'alternative'); var terms = node.body, length = terms ? terms.length : 0; if (length == 1) { return generateTerm(terms[0]); } else { var i = -1, result = ''; while (++i < length) { result += generateTerm(terms[i]); } return result; } } function generateAnchor(node) { assertType(node.type, 'anchor'); switch (node.kind) { case 'start': return '^'; case 'end': return '$'; case 'boundary': return '\\b'; case 'not-boundary': return '\\B'; default: throw Error('Invalid assertion'); } } function generateAtom(node) { assertType(node.type, 'anchor|characterClass|characterClassEscape|dot|group|reference|value'); return generate(node); } function generateCharacterClass(node) { assertType(node.type, 'characterClass'); var classRanges = node.body, length = classRanges ? classRanges.length : 0; var i = -1, result = '['; if (node.negative) { result += '^'; } while (++i < length) { result += generateClassAtom(classRanges[i]); } result += ']'; return result; } function generateCharacterClassEscape(node) { assertType(node.type, 'characterClassEscape'); return '\\' + node.value; } function generateCharacterClassRange(node) { assertType(node.type, 'characterClassRange'); var min = node.min, max = node.max; if (min.type == 'characterClassRange' || max.type == 'characterClassRange') { throw Error('Invalid character class range'); } return generateClassAtom(min) + '-' + generateClassAtom(max); } function generateClassAtom(node) { assertType(node.type, 'anchor|characterClassEscape|characterClassRange|dot|value'); return generate(node); } function generateDisjunction(node) { assertType(node.type, 'disjunction'); var body = node.body, length = body ? body.length : 0; if (length == 0) { throw Error('No body'); } else if (length == 1) { return generate(body[0]); } else { var i = -1, result = ''; while (++i < length) { if (i != 0) { result += '|'; } result += generate(body[i]); } return result; } } function generateDot(node) { assertType(node.type, 'dot'); return '.'; } function generateGroup(node) { assertType(node.type, 'group'); var result = '('; switch (node.behavior) { case 'normal': break; case 'ignore': result += '?:'; break; case 'lookahead': result += '?='; break; case 'negativeLookahead': result += '?!'; break; default: throw Error('Invalid behaviour: ' + node.behaviour); } var body = node.body, length = body ? body.length : 0; if (length == 1) { result += generate(body[0]); } else { var i = -1; while (++i < length) { result += generate(body[i]); } } result += ')'; return result; } function generateQuantifier(node) { assertType(node.type, 'quantifier'); var quantifier = '', min = node.min, max = node.max; switch (max) { case undefined: case null: switch (min) { case 0: quantifier = '*'; break; case 1: quantifier = '+'; break; default: quantifier = '{' + min + ',}'; break; } break; default: if (min == max) { quantifier = '{' + min + '}'; } else if (min == 0 && max == 1) { quantifier = '?'; } else { quantifier = '{' + min + ',' + max + '}'; } break; } if (!node.greedy) { quantifier += '?'; } return generateAtom(node.body[0]) + quantifier; } function generateReference(node) { assertType(node.type, 'reference'); return '\\' + node.matchIndex; } function generateTerm(node) { assertType(node.type, 'anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value'); return generate(node); } function generateValue(node) { assertType(node.type, 'value'); var kind = node.kind, codePoint = node.codePoint; switch (kind) { case 'controlLetter': return '\\c' + fromCodePoint(codePoint + 64); case 'hexadecimalEscape': return '\\x' + ('00' + codePoint.toString(16).toUpperCase()).slice(-2); case 'identifier': return '\\' + fromCodePoint(codePoint); case 'null': return '\\' + codePoint; case 'octal': return '\\' + codePoint.toString(8); case 'singleEscape': switch (codePoint) { case 0x0008: return '\\b'; case 0x009: return '\\t'; case 0x00A: return '\\n'; case 0x00B: return '\\v'; case 0x00C: return '\\f'; case 0x00D: return '\\r'; default: throw Error('Invalid codepoint: ' + codePoint); } case 'symbol': return fromCodePoint(codePoint); case 'unicodeEscape': return '\\u' + ('0000' + codePoint.toString(16).toUpperCase()).slice(-4); case 'unicodeCodePointEscape': return '\\u{' + codePoint.toString(16).toUpperCase() + '}'; default: throw Error('Unsupported node kind: ' + kind); } } /*--------------------------------------------------------------------------*/ generate.alternative = generateAlternative; generate.anchor = generateAnchor; generate.characterClass = generateCharacterClass; generate.characterClassEscape = generateCharacterClassEscape; generate.characterClassRange = generateCharacterClassRange; generate.disjunction = generateDisjunction; generate.dot = generateDot; generate.group = generateGroup; generate.quantifier = generateQuantifier; generate.reference = generateReference; generate.value = generateValue; /*--------------------------------------------------------------------------*/ // export regjsgen // some AMD build optimizers, like r.js, check for condition patterns like the following: if ('function' == 'function' && 'object' == 'object' && true) { // define as an anonymous module so, through path mapping, it can be aliased $__System.registerDynamic('11f', [], false, function ($__require, $__exports, $__module) { return (function () { return { 'generate': generate }; }).call(this); }); } // check for `exports` after `define` in case a build optimizer adds an `exports` object else if (freeExports && freeModule) { // in Narwhal, Node.js, Rhino -require, or RingoJS freeExports.generate = generate; } // in a browser or Rhino else { root.regjsgen = { 'generate': generate }; } }).call(this); $__System.registerDynamic('120', [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; // regjsparser // // ================================================================== // // See ECMA-262 Standard: 15.10.1 // // NOTE: The ECMA-262 standard uses the term "Assertion" for /^/. Here the // term "Anchor" is used. // // Pattern :: // Disjunction // // Disjunction :: // Alternative // Alternative | Disjunction // // Alternative :: // [empty] // Alternative Term // // Term :: // Anchor // Atom // Atom Quantifier // // Anchor :: // ^ // $ // \ b // \ B // ( ? = Disjunction ) // ( ? ! Disjunction ) // // Quantifier :: // QuantifierPrefix // QuantifierPrefix ? // // QuantifierPrefix :: // * // + // ? // { DecimalDigits } // { DecimalDigits , } // { DecimalDigits , DecimalDigits } // // Atom :: // PatternCharacter // . // \ AtomEscape // CharacterClass // ( Disjunction ) // ( ? : Disjunction ) // // PatternCharacter :: // SourceCharacter but not any of: ^ $ \ . * + ? ( ) [ ] { } | // // AtomEscape :: // DecimalEscape // CharacterEscape // CharacterClassEscape // // CharacterEscape[U] :: // ControlEscape // c ControlLetter // HexEscapeSequence // RegExpUnicodeEscapeSequence[?U] (ES6) // IdentityEscape[?U] // // ControlEscape :: // one of f n r t v // ControlLetter :: // one of // a b c d e f g h i j k l m n o p q r s t u v w x y z // A B C D E F G H I J K L M N O P Q R S T U V W X Y Z // // IdentityEscape :: // SourceCharacter but not IdentifierPart // // // // DecimalEscape :: // DecimalIntegerLiteral [lookahead ∉ DecimalDigit] // // CharacterClassEscape :: // one of d D s S w W // // CharacterClass :: // [ [lookahead ∉ {^}] ClassRanges ] // [ ^ ClassRanges ] // // ClassRanges :: // [empty] // NonemptyClassRanges // // NonemptyClassRanges :: // ClassAtom // ClassAtom NonemptyClassRangesNoDash // ClassAtom - ClassAtom ClassRanges // // NonemptyClassRangesNoDash :: // ClassAtom // ClassAtomNoDash NonemptyClassRangesNoDash // ClassAtomNoDash - ClassAtom ClassRanges // // ClassAtom :: // - // ClassAtomNoDash // // ClassAtomNoDash :: // SourceCharacter but not one of \ or ] or - // \ ClassEscape // // ClassEscape :: // DecimalEscape // b // CharacterEscape // CharacterClassEscape (function () { function parse(str, flags) { function addRaw(node) { node.raw = str.substring(node.range[0], node.range[1]); return node; } function updateRawStart(node, start) { node.range[0] = start; return addRaw(node); } function createAnchor(kind, rawLength) { return addRaw({ type: 'anchor', kind: kind, range: [pos - rawLength, pos] }); } function createValue(kind, codePoint, from, to) { return addRaw({ type: 'value', kind: kind, codePoint: codePoint, range: [from, to] }); } function createEscaped(kind, codePoint, value, fromOffset) { fromOffset = fromOffset || 0; return createValue(kind, codePoint, pos - (value.length + fromOffset), pos); } function createCharacter(matches) { var _char = matches[0]; var first = _char.charCodeAt(0); if (hasUnicodeFlag) { var second; if (_char.length === 1 && first >= 0xD800 && first <= 0xDBFF) { second = lookahead().charCodeAt(0); if (second >= 0xDC00 && second <= 0xDFFF) { // Unicode surrogate pair pos++; return createValue('symbol', (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000, pos - 2, pos); } } } return createValue('symbol', first, pos - 1, pos); } function createDisjunction(alternatives, from, to) { return addRaw({ type: 'disjunction', body: alternatives, range: [from, to] }); } function createDot() { return addRaw({ type: 'dot', range: [pos - 1, pos] }); } function createCharacterClassEscape(value) { return addRaw({ type: 'characterClassEscape', value: value, range: [pos - 2, pos] }); } function createReference(matchIndex) { return addRaw({ type: 'reference', matchIndex: parseInt(matchIndex, 10), range: [pos - 1 - matchIndex.length, pos] }); } function createGroup(behavior, disjunction, from, to) { return addRaw({ type: 'group', behavior: behavior, body: disjunction, range: [from, to] }); } function createQuantifier(min, max, from, to) { if (to == null) { from = pos - 1; to = pos; } return addRaw({ type: 'quantifier', min: min, max: max, greedy: true, body: null, // set later on range: [from, to] }); } function createAlternative(terms, from, to) { return addRaw({ type: 'alternative', body: terms, range: [from, to] }); } function createCharacterClass(classRanges, negative, from, to) { return addRaw({ type: 'characterClass', body: classRanges, negative: negative, range: [from, to] }); } function createClassRange(min, max, from, to) { // See 15.10.2.15: if (min.codePoint > max.codePoint) { bail('invalid range in character class', min.raw + '-' + max.raw, from, to); } return addRaw({ type: 'characterClassRange', min: min, max: max, range: [from, to] }); } function flattenBody(body) { if (body.type === 'alternative') { return body.body; } else { return [body]; } } function isEmpty(obj) { return obj.type === 'empty'; } function incr(amount) { amount = amount || 1; var res = str.substring(pos, pos + amount); pos += amount || 1; return res; } function skip(value) { if (!match(value)) { bail('character', value); } } function match(value) { if (str.indexOf(value, pos) === pos) { return incr(value.length); } } function lookahead() { return str[pos]; } function current(value) { return str.indexOf(value, pos) === pos; } function next(value) { return str[pos + 1] === value; } function matchReg(regExp) { var subStr = str.substring(pos); var res = subStr.match(regExp); if (res) { res.range = []; res.range[0] = pos; incr(res[0].length); res.range[1] = pos; } return res; } function parseDisjunction() { // Disjunction :: // Alternative // Alternative | Disjunction var res = [], from = pos; res.push(parseAlternative()); while (match('|')) { res.push(parseAlternative()); } if (res.length === 1) { return res[0]; } return createDisjunction(res, from, pos); } function parseAlternative() { var res = [], from = pos; var term; // Alternative :: // [empty] // Alternative Term while (term = parseTerm()) { res.push(term); } if (res.length === 1) { return res[0]; } return createAlternative(res, from, pos); } function parseTerm() { // Term :: // Anchor // Atom // Atom Quantifier if (pos >= str.length || current('|') || current(')')) { return null; /* Means: The term is empty */ } var anchor = parseAnchor(); if (anchor) { return anchor; } var atom = parseAtom(); if (!atom) { bail('Expected atom'); } var quantifier = parseQuantifier() || false; if (quantifier) { quantifier.body = flattenBody(atom); // The quantifier contains the atom. Therefore, the beginning of the // quantifier range is given by the beginning of the atom. updateRawStart(quantifier, atom.range[0]); return quantifier; } return atom; } function parseGroup(matchA, typeA, matchB, typeB) { var type = null, from = pos; if (match(matchA)) { type = typeA; } else if (match(matchB)) { type = typeB; } else { return false; } var body = parseDisjunction(); if (!body) { bail('Expected disjunction'); } skip(')'); var group = createGroup(type, flattenBody(body), from, pos); if (type == 'normal') { // Keep track of the number of closed groups. This is required for // parseDecimalEscape(). In case the string is parsed a second time the // value already holds the total count and no incrementation is required. if (firstIteration) { closedCaptureCounter++; } } return group; } function parseAnchor() { // Anchor :: // ^ // $ // \ b // \ B // ( ? = Disjunction ) // ( ? ! Disjunction ) var res, from = pos; if (match('^')) { return createAnchor('start', 1 /* rawLength */); } else if (match('$')) { return createAnchor('end', 1 /* rawLength */); } else if (match('\\b')) { return createAnchor('boundary', 2 /* rawLength */); } else if (match('\\B')) { return createAnchor('not-boundary', 2 /* rawLength */); } else { return parseGroup('(?=', 'lookahead', '(?!', 'negativeLookahead'); } } function parseQuantifier() { // Quantifier :: // QuantifierPrefix // QuantifierPrefix ? // // QuantifierPrefix :: // * // + // ? // { DecimalDigits } // { DecimalDigits , } // { DecimalDigits , DecimalDigits } var res, from = pos; var quantifier; var min, max; if (match('*')) { quantifier = createQuantifier(0); } else if (match('+')) { quantifier = createQuantifier(1); } else if (match('?')) { quantifier = createQuantifier(0, 1); } else if (res = matchReg(/^\{([0-9]+)\}/)) { min = parseInt(res[1], 10); quantifier = createQuantifier(min, min, res.range[0], res.range[1]); } else if (res = matchReg(/^\{([0-9]+),\}/)) { min = parseInt(res[1], 10); quantifier = createQuantifier(min, undefined, res.range[0], res.range[1]); } else if (res = matchReg(/^\{([0-9]+),([0-9]+)\}/)) { min = parseInt(res[1], 10); max = parseInt(res[2], 10); if (min > max) { bail('numbers out of order in {} quantifier', '', from, pos); } quantifier = createQuantifier(min, max, res.range[0], res.range[1]); } if (quantifier) { if (match('?')) { quantifier.greedy = false; quantifier.range[1] += 1; } } return quantifier; } function parseAtom() { // Atom :: // PatternCharacter // . // \ AtomEscape // CharacterClass // ( Disjunction ) // ( ? : Disjunction ) var res; // jviereck: allow ']', '}' here as well to be compatible with browser's // implementations: ']'.match(/]/); // if (res = matchReg(/^[^^$\\.*+?()[\]{}|]/)) { if (res = matchReg(/^[^^$\\.*+?(){[|]/)) { // PatternCharacter return createCharacter(res); } else if (match('.')) { // . return createDot(); } else if (match('\\')) { // \ AtomEscape res = parseAtomEscape(); if (!res) { bail('atomEscape'); } return res; } else if (res = parseCharacterClass()) { return res; } else { // ( Disjunction ) // ( ? : Disjunction ) return parseGroup('(?:', 'ignore', '(', 'normal'); } } function parseUnicodeSurrogatePairEscape(firstEscape) { if (hasUnicodeFlag) { var first, second; if (firstEscape.kind == 'unicodeEscape' && (first = firstEscape.codePoint) >= 0xD800 && first <= 0xDBFF && current('\\') && next('u')) { var prevPos = pos; pos++; var secondEscape = parseClassEscape(); if (secondEscape.kind == 'unicodeEscape' && (second = secondEscape.codePoint) >= 0xDC00 && second <= 0xDFFF) { // Unicode surrogate pair firstEscape.range[1] = secondEscape.range[1]; firstEscape.codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; firstEscape.type = 'value'; firstEscape.kind = 'unicodeCodePointEscape'; addRaw(firstEscape); } else { pos = prevPos; } } } return firstEscape; } function parseClassEscape() { return parseAtomEscape(true); } function parseAtomEscape(insideCharacterClass) { // AtomEscape :: // DecimalEscape // CharacterEscape // CharacterClassEscape var res, from = pos; res = parseDecimalEscape(); if (res) { return res; } // For ClassEscape if (insideCharacterClass) { if (match('b')) { // 15.10.2.19 // The production ClassEscape :: b evaluates by returning the // CharSet containing the one character (Unicode value 0008). return createEscaped('singleEscape', 0x0008, '\\b'); } else if (match('B')) { bail('\\B not possible inside of CharacterClass', '', from); } } res = parseCharacterEscape(); return res; } function parseDecimalEscape() { // DecimalEscape :: // DecimalIntegerLiteral [lookahead ∉ DecimalDigit] // CharacterClassEscape :: one of d D s S w W var res, match; if (res = matchReg(/^(?!0)\d+/)) { match = res[0]; var refIdx = parseInt(res[0], 10); if (refIdx <= closedCaptureCounter) { // If the number is smaller than the normal-groups found so // far, then it is a reference... return createReference(res[0]); } else { // ... otherwise it needs to be interpreted as a octal (if the // number is in an octal format). If it is NOT octal format, // then the slash is ignored and the number is matched later // as normal characters. // Recall the negative decision to decide if the input must be parsed // a second time with the total normal-groups. backrefDenied.push(refIdx); // Reset the position again, as maybe only parts of the previous // matched numbers are actual octal numbers. E.g. in '019' only // the '01' should be matched. incr(-res[0].length); if (res = matchReg(/^[0-7]{1,3}/)) { return createEscaped('octal', parseInt(res[0], 8), res[0], 1); } else { // If we end up here, we have a case like /\91/. Then the // first slash is to be ignored and the 9 & 1 to be treated // like ordinary characters. Create a character for the // first number only here - other number-characters // (if available) will be matched later. res = createCharacter(matchReg(/^[89]/)); return updateRawStart(res, res.range[0] - 1); } } } // Only allow octal numbers in the following. All matched numbers start // with a zero (if the do not, the previous if-branch is executed). // If the number is not octal format and starts with zero (e.g. `091`) // then only the zeros `0` is treated here and the `91` are ordinary // characters. // Example: // /\091/.exec('\091')[0].length === 3 else if (res = matchReg(/^[0-7]{1,3}/)) { match = res[0]; if (/^0{1,3}$/.test(match)) { // If they are all zeros, then only take the first one. return createEscaped('null', 0x0000, '0', match.length + 1); } else { return createEscaped('octal', parseInt(match, 8), match, 1); } } else if (res = matchReg(/^[dDsSwW]/)) { return createCharacterClassEscape(res[0]); } return false; } function parseCharacterEscape() { // CharacterEscape :: // ControlEscape // c ControlLetter // HexEscapeSequence // UnicodeEscapeSequence // IdentityEscape var res; if (res = matchReg(/^[fnrtv]/)) { // ControlEscape var codePoint = 0; switch (res[0]) { case 't': codePoint = 0x009;break; case 'n': codePoint = 0x00A;break; case 'v': codePoint = 0x00B;break; case 'f': codePoint = 0x00C;break; case 'r': codePoint = 0x00D;break; } return createEscaped('singleEscape', codePoint, '\\' + res[0]); } else if (res = matchReg(/^c([a-zA-Z])/)) { // c ControlLetter return createEscaped('controlLetter', res[1].charCodeAt(0) % 32, res[1], 2); } else if (res = matchReg(/^x([0-9a-fA-F]{2})/)) { // HexEscapeSequence return createEscaped('hexadecimalEscape', parseInt(res[1], 16), res[1], 2); } else if (res = matchReg(/^u([0-9a-fA-F]{4})/)) { // UnicodeEscapeSequence return parseUnicodeSurrogatePairEscape(createEscaped('unicodeEscape', parseInt(res[1], 16), res[1], 2)); } else if (hasUnicodeFlag && (res = matchReg(/^u\{([0-9a-fA-F]+)\}/))) { // RegExpUnicodeEscapeSequence (ES6 Unicode code point escape) return createEscaped('unicodeCodePointEscape', parseInt(res[1], 16), res[1], 4); } else { // IdentityEscape return parseIdentityEscape(); } } // Taken from the Esprima parser. function isIdentifierPart(ch) { // Generated by `tools/generate-identifier-regex.js`. var NonAsciiIdentifierPart = new RegExp('[\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]'); return ch === 36 || ch === 95 || // $ (dollar) and _ (underscore) ch >= 65 && ch <= 90 || // A..Z ch >= 97 && ch <= 122 || // a..z ch >= 48 && ch <= 57 || // 0..9 ch === 92 || // \ (backslash) ch >= 0x80 && NonAsciiIdentifierPart.test(String.fromCharCode(ch)); } function parseIdentityEscape() { // IdentityEscape :: // SourceCharacter but not IdentifierPart // // var ZWJ = '\u200C'; var ZWNJ = '\u200D'; var tmp; if (!isIdentifierPart(lookahead())) { tmp = incr(); return createEscaped('identifier', tmp.charCodeAt(0), tmp, 1); } if (match(ZWJ)) { // return createEscaped('identifier', 0x200C, ZWJ); } else if (match(ZWNJ)) { // return createEscaped('identifier', 0x200D, ZWNJ); } return null; } function parseCharacterClass() { // CharacterClass :: // [ [lookahead ∉ {^}] ClassRanges ] // [ ^ ClassRanges ] var res, from = pos; if (res = matchReg(/^\[\^/)) { res = parseClassRanges(); skip(']'); return createCharacterClass(res, true, from, pos); } else if (match('[')) { res = parseClassRanges(); skip(']'); return createCharacterClass(res, false, from, pos); } return null; } function parseClassRanges() { // ClassRanges :: // [empty] // NonemptyClassRanges var res; if (current(']')) { // Empty array means nothing insinde of the ClassRange. return []; } else { res = parseNonemptyClassRanges(); if (!res) { bail('nonEmptyClassRanges'); } return res; } } function parseHelperClassRanges(atom) { var from, to, res; if (current('-') && !next(']')) { // ClassAtom - ClassAtom ClassRanges skip('-'); res = parseClassAtom(); if (!res) { bail('classAtom'); } to = pos; var classRanges = parseClassRanges(); if (!classRanges) { bail('classRanges'); } from = atom.range[0]; if (classRanges.type === 'empty') { return [createClassRange(atom, res, from, to)]; } return [createClassRange(atom, res, from, to)].concat(classRanges); } res = parseNonemptyClassRangesNoDash(); if (!res) { bail('nonEmptyClassRangesNoDash'); } return [atom].concat(res); } function parseNonemptyClassRanges() { // NonemptyClassRanges :: // ClassAtom // ClassAtom NonemptyClassRangesNoDash // ClassAtom - ClassAtom ClassRanges var atom = parseClassAtom(); if (!atom) { bail('classAtom'); } if (current(']')) { // ClassAtom return [atom]; } // ClassAtom NonemptyClassRangesNoDash // ClassAtom - ClassAtom ClassRanges return parseHelperClassRanges(atom); } function parseNonemptyClassRangesNoDash() { // NonemptyClassRangesNoDash :: // ClassAtom // ClassAtomNoDash NonemptyClassRangesNoDash // ClassAtomNoDash - ClassAtom ClassRanges var res = parseClassAtom(); if (!res) { bail('classAtom'); } if (current(']')) { // ClassAtom return res; } // ClassAtomNoDash NonemptyClassRangesNoDash // ClassAtomNoDash - ClassAtom ClassRanges return parseHelperClassRanges(res); } function parseClassAtom() { // ClassAtom :: // - // ClassAtomNoDash if (match('-')) { return createCharacter('-'); } else { return parseClassAtomNoDash(); } } function parseClassAtomNoDash() { // ClassAtomNoDash :: // SourceCharacter but not one of \ or ] or - // \ ClassEscape var res; if (res = matchReg(/^[^\\\]-]/)) { return createCharacter(res[0]); } else if (match('\\')) { res = parseClassEscape(); if (!res) { bail('classEscape'); } return parseUnicodeSurrogatePairEscape(res); } } function bail(message, details, from, to) { from = from == null ? pos : from; to = to == null ? from : to; var contextStart = Math.max(0, from - 10); var contextEnd = Math.min(to + 10, str.length); // Output a bit of context and a line pointing to where our error is. // // We are assuming that there are no actual newlines in the content as this is a regular expression. var context = ' ' + str.substring(contextStart, contextEnd); var pointer = ' ' + new Array(from - contextStart + 1).join(' ') + '^'; throw SyntaxError(message + ' at position ' + from + (details ? ': ' + details : '') + '\n' + context + '\n' + pointer); } var backrefDenied = []; var closedCaptureCounter = 0; var firstIteration = true; var hasUnicodeFlag = (flags || "").indexOf("u") !== -1; var pos = 0; // Convert the input to a string and treat the empty string special. str = String(str); if (str === '') { str = '(?:)'; } var result = parseDisjunction(); if (result.range[1] !== str.length) { bail('Could not parse entire input - got stuck', '', result.range[1]); } // The spec requires to interpret the `\2` in `/\2()()/` as backreference. // As the parser collects the number of capture groups as the string is // parsed it is impossible to make these decisions at the point when the // `\2` is handled. In case the local decision turns out to be wrong after // the parsing has finished, the input string is parsed a second time with // the total number of capture groups set. // // SEE: https://github.com/jviereck/regjsparser/issues/70 for (var i = 0; i < backrefDenied.length; i++) { if (backrefDenied[i] <= closedCaptureCounter) { // Parse the input a second time. pos = 0; firstIteration = false; return parseDisjunction(); } } return result; } var regjsparser = { parse: parse }; if (typeof module !== 'undefined' && module.exports) { module.exports = regjsparser; } else { window.regjsparser = regjsparser; } })(); }); $__System.registerDynamic("121", [], true, function() { return { "75": 8490, "83": 383, "107": 8490, "115": 383, "181": 924, "197": 8491, "383": 83, "452": 453, "453": 452, "455": 456, "456": 455, "458": 459, "459": 458, "497": 498, "498": 497, "837": 8126, "914": 976, "917": 1013, "920": 1012, "921": 8126, "922": 1008, "924": 181, "928": 982, "929": 1009, "931": 962, "934": 981, "937": 8486, "962": 931, "976": 914, "977": 1012, "981": 934, "982": 928, "1008": 922, "1009": 929, "1012": [ 920, 977 ], "1013": 917, "7776": 7835, "7835": 7776, "8126": [ 837, 921 ], "8486": 937, "8490": 75, "8491": 197, "66560": 66600, "66561": 66601, "66562": 66602, "66563": 66603, "66564": 66604, "66565": 66605, "66566": 66606, "66567": 66607, "66568": 66608, "66569": 66609, "66570": 66610, "66571": 66611, "66572": 66612, "66573": 66613, "66574": 66614, "66575": 66615, "66576": 66616, "66577": 66617, "66578": 66618, "66579": 66619, "66580": 66620, "66581": 66621, "66582": 66622, "66583": 66623, "66584": 66624, "66585": 66625, "66586": 66626, "66587": 66627, "66588": 66628, "66589": 66629, "66590": 66630, "66591": 66631, "66592": 66632, "66593": 66633, "66594": 66634, "66595": 66635, "66596": 66636, "66597": 66637, "66598": 66638, "66599": 66639, "66600": 66560, "66601": 66561, "66602": 66562, "66603": 66563, "66604": 66564, "66605": 66565, "66606": 66566, "66607": 66567, "66608": 66568, "66609": 66569, "66610": 66570, "66611": 66571, "66612": 66572, "66613": 66573, "66614": 66574, "66615": 66575, "66616": 66576, "66617": 66577, "66618": 66578, "66619": 66579, "66620": 66580, "66621": 66581, "66622": 66582, "66623": 66583, "66624": 66584, "66625": 66585, "66626": 66586, "66627": 66587, "66628": 66588, "66629": 66589, "66630": 66590, "66631": 66591, "66632": 66592, "66633": 66593, "66634": 66594, "66635": 66595, "66636": 66596, "66637": 66597, "66638": 66598, "66639": 66599, "68736": 68800, "68737": 68801, "68738": 68802, "68739": 68803, "68740": 68804, "68741": 68805, "68742": 68806, "68743": 68807, "68744": 68808, "68745": 68809, "68746": 68810, "68747": 68811, "68748": 68812, "68749": 68813, "68750": 68814, "68751": 68815, "68752": 68816, "68753": 68817, "68754": 68818, "68755": 68819, "68756": 68820, "68757": 68821, "68758": 68822, "68759": 68823, "68760": 68824, "68761": 68825, "68762": 68826, "68763": 68827, "68764": 68828, "68765": 68829, "68766": 68830, "68767": 68831, "68768": 68832, "68769": 68833, "68770": 68834, "68771": 68835, "68772": 68836, "68773": 68837, "68774": 68838, "68775": 68839, "68776": 68840, "68777": 68841, "68778": 68842, "68779": 68843, "68780": 68844, "68781": 68845, "68782": 68846, "68783": 68847, "68784": 68848, "68785": 68849, "68786": 68850, "68800": 68736, "68801": 68737, "68802": 68738, "68803": 68739, "68804": 68740, "68805": 68741, "68806": 68742, "68807": 68743, "68808": 68744, "68809": 68745, "68810": 68746, "68811": 68747, "68812": 68748, "68813": 68749, "68814": 68750, "68815": 68751, "68816": 68752, "68817": 68753, "68818": 68754, "68819": 68755, "68820": 68756, "68821": 68757, "68822": 68758, "68823": 68759, "68824": 68760, "68825": 68761, "68826": 68762, "68827": 68763, "68828": 68764, "68829": 68765, "68830": 68766, "68831": 68767, "68832": 68768, "68833": 68769, "68834": 68770, "68835": 68771, "68836": 68772, "68837": 68773, "68838": 68774, "68839": 68775, "68840": 68776, "68841": 68777, "68842": 68778, "68843": 68779, "68844": 68780, "68845": 68781, "68846": 68782, "68847": 68783, "68848": 68784, "68849": 68785, "68850": 68786, "71840": 71872, "71841": 71873, "71842": 71874, "71843": 71875, "71844": 71876, "71845": 71877, "71846": 71878, "71847": 71879, "71848": 71880, "71849": 71881, "71850": 71882, "71851": 71883, "71852": 71884, "71853": 71885, "71854": 71886, "71855": 71887, "71856": 71888, "71857": 71889, "71858": 71890, "71859": 71891, "71860": 71892, "71861": 71893, "71862": 71894, "71863": 71895, "71864": 71896, "71865": 71897, "71866": 71898, "71867": 71899, "71868": 71900, "71869": 71901, "71870": 71902, "71871": 71903, "71872": 71840, "71873": 71841, "71874": 71842, "71875": 71843, "71876": 71844, "71877": 71845, "71878": 71846, "71879": 71847, "71880": 71848, "71881": 71849, "71882": 71850, "71883": 71851, "71884": 71852, "71885": 71853, "71886": 71854, "71887": 71855, "71888": 71856, "71889": 71857, "71890": 71858, "71891": 71859, "71892": 71860, "71893": 71861, "71894": 71862, "71895": 71863, "71896": 71864, "71897": 71865, "71898": 71866, "71899": 71867, "71900": 71868, "71901": 71869, "71902": 71870, "71903": 71871 }; }); $__System.registerDynamic('122', [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /*! https://mths.be/regenerate v1.3.2 by @mathias | MIT license */ ;(function (root) { // Detect free variables `exports`. var freeExports = typeof exports == 'object' && exports; // Detect free variable `module`. var freeModule = typeof module == 'object' && module && module.exports == freeExports && module; // Detect free variable `global`, from Node.js/io.js or Browserified code, // and use it as `root`. 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.' }; // https://mathiasbynens.be/notes/javascript-encoding#surrogate-pairs var HIGH_SURROGATE_MIN = 0xD800; var HIGH_SURROGATE_MAX = 0xDBFF; var LOW_SURROGATE_MIN = 0xDC00; var LOW_SURROGATE_MAX = 0xDFFF; // In Regenerate output, `\0` is never preceded by `\` because we sort by // code point value, so let’s keep this regular expression simple. var regexNull = /\\x00([^0123456789]|$)/g; var object = {}; var hasOwnProperty = object.hasOwnProperty; var extend = function (destination, source) { var key; for (key in source) { if (hasOwnProperty.call(source, key)) { destination[key] = source[key]; } } return destination; }; var forEach = function (array, callback) { var index = -1; var length = array.length; while (++index < length) { callback(array[index], index); } }; var toString = object.toString; var isArray = function (value) { return toString.call(value) == '[object Array]'; }; var isNumber = function (value) { return typeof value == 'number' || toString.call(value) == '[object Number]'; }; // This assumes that `number` is a positive integer that `toString()`s nicely // (which is the case for all code point values). var zeroes = '0000'; var pad = function (number, totalCharacters) { var string = String(number); return string.length < totalCharacters ? (zeroes + string).slice(-totalCharacters) : string; }; var hex = function (number) { return Number(number).toString(16).toUpperCase(); }; var slice = [].slice; /*--------------------------------------------------------------------------*/ var dataFromCodePoints = function (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 { // End the previous range and start a new one. result.push(previous + 1, tmp); previous = tmp; } } } if (!isStart) { result.push(tmp + 1); } return result; }; var dataRemove = function (data, codePoint) { // Iterate over the data per `(start, end)` pair. 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) { // Modify this pair. if (codePoint == start) { if (end == start + 1) { // Just remove `start` and `end`. data.splice(index, 2); return data; } else { // Just replace `start` with a new value. data[index] = codePoint + 1; return data; } } else if (codePoint == end - 1) { // Just replace `end` with a new value. data[index + 1] = codePoint; return data; } else { // Replace `[start, end]` with `[startA, endA, startB, endB]`. data.splice(index, 2, start, codePoint, codePoint + 1, end); return data; } } index += 2; } return data; }; var dataRemoveRange = function (data, rangeStart, rangeEnd) { if (rangeEnd < rangeStart) { throw Error(ERRORS.rangeOrder); } // Iterate over the data per `(start, end)` pair. var index = 0; var start; var end; while (index < data.length) { start = data[index]; end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive. // Exit as soon as no more matching pairs can be found. if (start > rangeEnd) { return data; } // Check if this range pair is equal to, or forms a subset of, the range // to be removed. // E.g. we have `[0, 11, 40, 51]` and want to remove 0-10 → `[40, 51]`. // E.g. we have `[40, 51]` and want to remove 0-100 → `[]`. if (rangeStart <= start && rangeEnd >= end) { // Remove this pair. data.splice(index, 2); continue; } // Check if both `rangeStart` and `rangeEnd` are within the bounds of // this pair. // E.g. we have `[0, 11]` and want to remove 4-6 → `[0, 4, 7, 11]`. if (rangeStart >= start && rangeEnd < end) { if (rangeStart == start) { // Replace `[start, end]` with `[startB, endB]`. data[index] = rangeEnd + 1; data[index + 1] = end + 1; return data; } // Replace `[start, end]` with `[startA, endA, startB, endB]`. data.splice(index, 2, start, rangeStart, rangeEnd + 1, end + 1); return data; } // Check if only `rangeStart` is within the bounds of this pair. // E.g. we have `[0, 11]` and want to remove 4-20 → `[0, 4]`. if (rangeStart >= start && rangeStart <= end) { // Replace `end` with `rangeStart`. data[index + 1] = rangeStart; // Note: we cannot `return` just yet, in case any following pairs still // contain matching code points. // E.g. we have `[0, 11, 14, 31]` and want to remove 4-20 // → `[0, 4, 21, 31]`. } // Check if only `rangeEnd` is within the bounds of this pair. // E.g. we have `[14, 31]` and want to remove 4-20 → `[21, 31]`. else if (rangeEnd >= start && rangeEnd <= end) { // Just replace `start`. data[index] = rangeEnd + 1; return data; } index += 2; } return data; }; var dataAdd = function (data, codePoint) { // Iterate over the data per `(start, end)` pair. 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]; // Check if the code point is already in the set. if (codePoint >= start && codePoint < end) { return data; } if (codePoint == start - 1) { // Just replace `start` with a new value. data[index] = codePoint; return data; } // At this point, if `start` is `greater` than `codePoint`, insert a new // `[start, end]` pair before the current pair, or after the current pair // if there is a known `lastIndex`. if (start > codePoint) { data.splice(lastIndex != null ? lastIndex + 2 : 0, 0, codePoint, codePoint + 1); return data; } if (codePoint == end) { // Check if adding this code point causes two separate ranges to become // a single range, e.g. `dataAdd([0, 4, 5, 10], 4)` → `[0, 10]`. if (codePoint + 1 == data[index + 2]) { data.splice(index, 4, start, data[index + 3]); return data; } // Else, just replace `end` with a new value. data[index + 1] = codePoint + 1; return data; } lastIndex = index; index += 2; } // The loop has finished; add the new pair to the end of the data set. data.push(codePoint, codePoint + 1); return data; }; var dataAddData = function (dataA, dataB) { // Iterate over the data per `(start, end)` pair. 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 (dataA, dataB) { // Iterate over the data per `(start, end)` pair. 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 (data, rangeStart, rangeEnd) { if (rangeEnd < rangeStart) { throw Error(ERRORS.rangeOrder); } if (rangeStart < 0x0 || rangeStart > 0x10FFFF || rangeEnd < 0x0 || rangeEnd > 0x10FFFF) { throw RangeError(ERRORS.codePointRange); } // Iterate over the data per `(start, end)` pair. 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) { // The range has already been added to the set; at this point, we just // need to get rid of the following ranges in case they overlap. // Check if this range can be combined with the previous range. if (start == rangeEnd + 1) { data.splice(index - 1, 2); return data; } // Exit as soon as no more possibly overlapping pairs can be found. if (start > rangeEnd) { return data; } // E.g. `[0, 11, 12, 16]` and we’ve added 5-15, so we now have // `[0, 16, 12, 16]`. Remove the `12,16` part, as it lies within the // `0,16` range that was previously added. if (start >= rangeStart && start <= rangeEnd) { // `start` lies within the range that was previously added. if (end > rangeStart && end - 1 <= rangeEnd) { // `end` lies within the range that was previously added as well, // so remove this pair. data.splice(index, 2); index -= 2; // Note: we cannot `return` just yet, as there may still be other // overlapping pairs. } else { // `start` lies within the range that was previously added, but // `end` doesn’t. E.g. `[0, 11, 12, 31]` and we’ve added 5-15, so // now we have `[0, 16, 12, 31]`. This must be written as `[0, 31]`. // Remove the previously added `end` and the current `start`. data.splice(index - 1, 2); index -= 2; } // Note: we cannot return yet. } } else if (start == rangeEnd + 1) { data[index] = rangeStart; return data; } // Check if a new pair must be inserted *before* the current one. else if (start > rangeEnd) { data.splice(index, 0, rangeStart, rangeEnd + 1); return data; } else if (rangeStart >= start && rangeStart < end && rangeEnd + 1 <= end) { // The new range lies entirely within an existing range pair. No action // needed. return data; } else if ( // E.g. `[0, 11]` and you add 5-15 → `[0, 16]`. rangeStart >= start && rangeStart < end || // E.g. `[0, 3]` and you add 3-6 → `[0, 7]`. end == rangeStart) { // Replace `end` with the new value. data[index + 1] = rangeEnd + 1; // Make sure the next range pair doesn’t overlap, e.g. `[0, 11, 12, 14]` // and you add 5-15 → `[0, 16]`, i.e. remove the `12,14` part. added = true; // Note: we cannot `return` just yet. } else if (rangeStart <= start && rangeEnd + 1 >= end) { // The new range is a superset of the old range. data[index] = rangeStart; data[index + 1] = rangeEnd + 1; added = true; } index += 2; } // The loop has finished without doing anything; add the new pair to the end // of the data set. if (!added) { data.push(rangeStart, rangeEnd + 1); } return data; }; var dataContains = function (data, codePoint) { var index = 0; var length = data.length; // Exit early if `codePoint` is not within `data`’s overall range. var start = data[index]; var end = data[length - 1]; if (length >= 2) { if (codePoint < start || codePoint > end) { return false; } } // Iterate over the data per `(start, end)` pair. while (index < length) { start = data[index]; end = data[index + 1]; if (codePoint >= start && codePoint < end) { return true; } index += 2; } return false; }; var dataIntersection = function (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 (data) { return !data.length; }; var dataIsSingleton = function (data) { // Check if the set only represents a single code point. return data.length == 2 && data[0] + 1 == data[1]; }; var dataToArray = function (data) { // Iterate over the data per `(start, end)` pair. 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; }; /*--------------------------------------------------------------------------*/ // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae var floor = Math.floor; var highSurrogate = function (codePoint) { return parseInt(floor((codePoint - 0x10000) / 0x400) + HIGH_SURROGATE_MIN, 10); }; var lowSurrogate = function (codePoint) { return parseInt((codePoint - 0x10000) % 0x400 + LOW_SURROGATE_MIN, 10); }; var stringFromCharCode = String.fromCharCode; var codePointToString = function (codePoint) { var string; // https://mathiasbynens.be/notes/javascript-escapes#single // Note: the `\b` escape sequence for U+0008 BACKSPACE in strings has a // different meaning in regular expressions (word boundary), so it cannot // be used here. if (codePoint == 0x09) { string = '\\t'; } // Note: IE < 9 treats `'\v'` as `'v'`, so avoid using it. // else if (codePoint == 0x0B) { // string = '\\v'; // } 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 == 0x2E || codePoint == 0x3F || codePoint >= 0x5B && codePoint <= 0x5E || codePoint >= 0x7B && codePoint <= 0x7D) { // The code point maps to an unsafe printable ASCII character; // backslash-escape it. Here’s the list of those symbols: // // $()*+-.?[\]^{|} // // See #7 for more info. string = '\\' + stringFromCharCode(codePoint); } else if (codePoint >= 0x20 && codePoint <= 0x7E) { // The code point maps to one of these printable ASCII symbols // (including the space character): // // !"#%&',/0123456789:;<=>@ABCDEFGHIJKLMNO // PQRSTUVWXYZ_`abcdefghijklmnopqrstuvwxyz~ // // These can safely be used directly. string = stringFromCharCode(codePoint); } else if (codePoint <= 0xFF) { // https://mathiasbynens.be/notes/javascript-escapes#hexadecimal string = '\\x' + pad(hex(codePoint), 2); } else { // `codePoint <= 0xFFFF` holds true. // https://mathiasbynens.be/notes/javascript-escapes#unicode string = '\\u' + pad(hex(codePoint), 4); } // There’s no need to account for astral symbols / surrogate pairs here, // since `codePointToString` is private and only used for BMP code points. // But if that’s what you need, just add an `else` block with this code: // // string = '\\u' + pad(hex(highSurrogate(codePoint)), 4) // + '\\u' + pad(hex(lowSurrogate(codePoint)), 4); return string; }; var codePointToStringUnicode = function (codePoint) { if (codePoint <= 0xFFFF) { return codePointToString(codePoint); } return '\\u{' + codePoint.toString(16).toUpperCase() + '}'; }; var symbolToCodePoint = function (symbol) { var length = symbol.length; var first = symbol.charCodeAt(0); var second; if (first >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX && length > 1 // There is a next code unit. ) { // `first` is a high surrogate, and there is a next character. Assume // it’s a low surrogate (else it’s invalid usage of Regenerate anyway). second = symbol.charCodeAt(1); // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae return (first - HIGH_SURROGATE_MIN) * 0x400 + second - LOW_SURROGATE_MIN + 0x10000; } return first; }; var createBMPCharacterClasses = function (data) { // Iterate over the data per `(start, end)` pair. 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; // Note: the `- 1` makes `end` inclusive. 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 (data) { // Iterate over the data per `(start, end)` pair. 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; // Note: the `- 1` makes `end` inclusive. 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 (data) { // Iterate over the data per `(start, end)` pair. 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; // Note: the `- 1` makes `end` inclusive. if (start < HIGH_SURROGATE_MIN) { // The range starts and ends before the high surrogate range. // E.g. (0, 0x10). if (end < HIGH_SURROGATE_MIN) { bmp.push(start, end + 1); } // The range starts before the high surrogate range and ends within it. // E.g. (0, 0xD855). if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) { bmp.push(start, HIGH_SURROGATE_MIN); loneHighSurrogates.push(HIGH_SURROGATE_MIN, end + 1); } // The range starts before the high surrogate range and ends in the low // surrogate range. E.g. (0, 0xDCFF). 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); } // The range starts before the high surrogate range and ends after the // low surrogate range. E.g. (0, 0x10FFFF). 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) { // The range starts and ends in the high surrogate range. // E.g. (0xD855, 0xD866). if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) { loneHighSurrogates.push(start, end + 1); } // The range starts in the high surrogate range and ends in the low // surrogate range. E.g. (0xD855, 0xDCFF). if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) { loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1); loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1); } // The range starts in the high surrogate range and ends after the low // surrogate range. E.g. (0xD855, 0x10FFFF). 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) { // The range starts and ends in the low surrogate range. // E.g. (0xDCFF, 0xDDFF). if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) { loneLowSurrogates.push(start, end + 1); } // The range starts in the low surrogate range and ends after the low // surrogate range. E.g. (0xDCFF, 0x10FFFF). 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) { // The range starts and ends after the low surrogate range. // E.g. (0xFFAA, 0x10FFFF). if (end <= 0xFFFF) { bmp.push(start, end + 1); } else { bmp.push(start, 0xFFFF + 1); astral.push(0xFFFF + 1, end + 1); } } else { // The range starts and ends in the astral range. astral.push(start, end + 1); } index += 2; } return { 'loneHighSurrogates': loneHighSurrogates, 'loneLowSurrogates': loneLowSurrogates, 'bmp': bmp, 'astral': astral }; }; var optimizeSurrogateMappings = function (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]; // Check for identical high surrogate ranges. tmpLow = lowSurrogates; while (nextHighSurrogates && highSurrogates[0] == nextHighSurrogates[0] && highSurrogates[1] == nextHighSurrogates[1]) { // Merge with the next item. 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 (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; // Note: the loop starts at the next 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) { // Add the code points in the other item to this one. 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); } // Remove the other, now redundant, item. surrogateMappings.splice(innerIndex, 1); --innerIndex; } } } return surrogateMappings; }; var surrogateSet = function (data) { // Exit early if `data` is an empty set. if (!data.length) { return []; } // Iterate over the data per `(start, end)` pair. 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; // Append the previous high-surrogate-to-low-surrogate mappings. // Step 1: `(startHigh, startLow)` to `(startHigh, LOW_SURROGATE_MAX)`. 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]]); } // Step 2: `(startHigh + 1, LOW_SURROGATE_MIN)` to // `(endHigh - 1, LOW_SURROGATE_MAX)`. if (!complete && startHigh + 1 < endHigh) { if (endsWithHighestLowSurrogate) { // Combine step 2 and step 3. 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]]); } } // Step 3. `(endHigh, LOW_SURROGATE_MIN)` to `(endHigh, endLow)`. if (!complete) { surrogateMappings.push([[endHigh, endHigh + 1], [LOW_SURROGATE_MIN, endLow + 1]]); } index += 2; } // The format of `surrogateMappings` is as follows: // // [ surrogateMapping1, surrogateMapping2 ] // // i.e.: // // [ // [ highSurrogates1, lowSurrogates1 ], // [ highSurrogates2, lowSurrogates2 ] // ] return optimizeSurrogateMappings(surrogateMappings); }; var createSurrogateCharacterClasses = function (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 (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)) { // The data set contains BMP code points that are not high surrogates // needed for astral code points in the set. result.push(createBMPCharacterClasses(bmp)); } if (surrogateMappings.length) { // The data set contains astral code points; append character classes // based on their surrogate pairs. result.push(createSurrogateCharacterClasses(surrogateMappings)); } // https://gist.github.com/mathiasbynens/bbe7f870208abcfec860 if (hasLoneHighSurrogates) { result.push(createBMPCharacterClasses(loneHighSurrogates) + // Make sure the high surrogates aren’t part of a surrogate pair. '(?![\\uDC00-\\uDFFF])'); } if (hasLoneLowSurrogates) { result.push( // It is not possible to accurately assert the low surrogates aren’t // part of a surrogate pair, since JavaScript regular expressions do // not support lookbehind. '(?:[^\\uD800-\\uDBFF]|^)' + createBMPCharacterClasses(loneLowSurrogates)); } return result.join('|'); }; /*--------------------------------------------------------------------------*/ // `regenerate` can be used as a constructor (and new methods can be added to // its prototype) but also as a regular function, the latter of which is the // documented and most common usage. For that reason, it’s not capitalized. var regenerate = function (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.2'; var proto = regenerate.prototype; extend(proto, { 'add': function (value) { var $this = this; if (value == null) { return $this; } if (value instanceof regenerate) { // Allow passing other Regenerate instances. $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 (value) { var $this = this; if (value == null) { return $this; } if (value instanceof regenerate) { // Allow passing other Regenerate instances. $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 (start, end) { var $this = this; $this.data = dataAddRange($this.data, isNumber(start) ? start : symbolToCodePoint(start), isNumber(end) ? end : symbolToCodePoint(end)); return $this; }, 'removeRange': function (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 (argument) { var $this = this; // Allow passing other Regenerate instances. // TODO: Optimize this by writing and using `dataIntersectionData()`. var array = argument instanceof regenerate ? dataToArray(argument.data) : argument; $this.data = dataIntersection($this.data, array); return $this; }, 'contains': function (codePoint) { return dataContains(this.data, isNumber(codePoint) ? codePoint : symbolToCodePoint(codePoint)); }, 'clone': function () { var set = new regenerate(); set.data = this.data.slice(0); return set; }, 'toString': function (options) { var result = createCharacterClassesFromData(this.data, options ? options.bmpOnly : false, options ? options.hasUnicodeFlag : false); if (!result) { // For an empty set, return something that can be inserted `/here/` to // form a valid regular expression. Avoid `(?:)` since that matches the // empty string. return '[]'; } // Use `\0` instead of `\x00` where possible. return result.replace(regexNull, '\\0$1'); }, 'toRegExp': function (flags) { var pattern = this.toString(flags && flags.indexOf('u') != -1 ? { 'hasUnicodeFlag': true } : null); return RegExp(pattern, flags || ''); }, 'valueOf': function () { // Note: `valueOf` is aliased as `toArray`. return dataToArray(this.data); } }); proto.toArray = proto.valueOf; // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if (typeof undefined == 'function' && typeof define.amd == 'object' && define.amd) { define(function () { return regenerate; }); } else if (freeExports && !freeExports.nodeType) { if (freeModule) { // in Node.js, io.js, or RingoJS v0.8.0+ freeModule.exports = regenerate; } else { // in Narwhal or RingoJS v0.7.0- freeExports.regenerate = regenerate; } } else { // in Rhino or a web browser root.regenerate = regenerate; } })(exports); }); $__System.registerDynamic('123', ['122'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; // Generated by `/scripts/character-class-escape-sets.js`. Do not edit. var regenerate = $__require('122'); exports.REGULAR = { 'd': regenerate().addRange(0x30, 0x39), 'D': regenerate().addRange(0x0, 0x2F).addRange(0x3A, 0xFFFF), 's': regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF).addRange(0x9, 0xD).addRange(0x2000, 0x200A).addRange(0x2028, 0x2029), 'S': regenerate().addRange(0x0, 0x8).addRange(0xE, 0x1F).addRange(0x21, 0x9F).addRange(0xA1, 0x167F).addRange(0x1681, 0x1FFF).addRange(0x200B, 0x2027).addRange(0x202A, 0x202E).addRange(0x2030, 0x205E).addRange(0x2060, 0x2FFF).addRange(0x3001, 0xFEFE).addRange(0xFF00, 0xFFFF), 'w': regenerate(0x5F).addRange(0x30, 0x39).addRange(0x41, 0x5A).addRange(0x61, 0x7A), 'W': regenerate(0x60).addRange(0x0, 0x2F).addRange(0x3A, 0x40).addRange(0x5B, 0x5E).addRange(0x7B, 0xFFFF) }; exports.UNICODE = { 'd': regenerate().addRange(0x30, 0x39), 'D': regenerate().addRange(0x0, 0x2F).addRange(0x3A, 0x10FFFF), 's': regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF).addRange(0x9, 0xD).addRange(0x2000, 0x200A).addRange(0x2028, 0x2029), 'S': regenerate().addRange(0x0, 0x8).addRange(0xE, 0x1F).addRange(0x21, 0x9F).addRange(0xA1, 0x167F).addRange(0x1681, 0x1FFF).addRange(0x200B, 0x2027).addRange(0x202A, 0x202E).addRange(0x2030, 0x205E).addRange(0x2060, 0x2FFF).addRange(0x3001, 0xFEFE).addRange(0xFF00, 0x10FFFF), 'w': regenerate(0x5F).addRange(0x30, 0x39).addRange(0x41, 0x5A).addRange(0x61, 0x7A), 'W': regenerate(0x60).addRange(0x0, 0x2F).addRange(0x3A, 0x40).addRange(0x5B, 0x5E).addRange(0x7B, 0x10FFFF) }; exports.UNICODE_IGNORE_CASE = { 'd': regenerate().addRange(0x30, 0x39), 'D': regenerate().addRange(0x0, 0x2F).addRange(0x3A, 0x10FFFF), 's': regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF).addRange(0x9, 0xD).addRange(0x2000, 0x200A).addRange(0x2028, 0x2029), 'S': regenerate().addRange(0x0, 0x8).addRange(0xE, 0x1F).addRange(0x21, 0x9F).addRange(0xA1, 0x167F).addRange(0x1681, 0x1FFF).addRange(0x200B, 0x2027).addRange(0x202A, 0x202E).addRange(0x2030, 0x205E).addRange(0x2060, 0x2FFF).addRange(0x3001, 0xFEFE).addRange(0xFF00, 0x10FFFF), 'w': regenerate(0x5F, 0x17F, 0x212A).addRange(0x30, 0x39).addRange(0x41, 0x5A).addRange(0x61, 0x7A), 'W': regenerate(0x4B, 0x53, 0x60).addRange(0x0, 0x2F).addRange(0x3A, 0x40).addRange(0x5B, 0x5E).addRange(0x7B, 0x10FFFF) }; }); $__System.registerDynamic('124', ['11f', '120', '122', '121', '123'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var generate = $__require('11f').generate; var parse = $__require('120').parse; var regenerate = $__require('122'); var iuMappings = $__require('121'); var ESCAPE_SETS = $__require('123'); function getCharacterClassEscapeSet(character) { if (unicode) { if (ignoreCase) { return ESCAPE_SETS.UNICODE_IGNORE_CASE[character]; } return ESCAPE_SETS.UNICODE[character]; } return ESCAPE_SETS.REGULAR[character]; } var object = {}; var hasOwnProperty = object.hasOwnProperty; function has(object, property) { return hasOwnProperty.call(object, property); } // Prepare a Regenerate set containing all code points, used for negative // character classes (if any). var UNICODE_SET = regenerate().addRange(0x0, 0x10FFFF); // Without the `u` flag, the range stops at 0xFFFF. // https://mths.be/es6#sec-pattern-semantics var BMP_SET = regenerate().addRange(0x0, 0xFFFF); // Prepare a Regenerate set containing all code points that are supposed to be // matched by `/./u`. https://mths.be/es6#sec-atom var DOT_SET_UNICODE = UNICODE_SET.clone() // all Unicode code points .remove( // minus `LineTerminator`s (https://mths.be/es6#sec-line-terminators): 0x000A, // Line Feed 0x000D, // Carriage Return 0x2028, // Line Separator 0x2029 // Paragraph Separator ); // Prepare a Regenerate set containing all code points that are supposed to be // matched by `/./` (only BMP code points). var DOT_SET = DOT_SET_UNICODE.clone().intersection(BMP_SET); // Add a range of code points + any case-folded code points in that range to a // set. regenerate.prototype.iuAddRange = function (min, max) { var $this = this; do { var folded = caseFold(min); if (folded) { $this.add(folded); } } while (++min <= max); return $this; }; function assign(target, source) { for (var key in source) { // Note: `hasOwnProperty` is not needed here. target[key] = source[key]; } } function update(item, pattern) { // TODO: Test if memoizing `pattern` here is worth the effort. if (!pattern) { return; } var tree = parse(pattern, ''); switch (tree.type) { case 'characterClass': case 'group': case 'value': // No wrapping needed. break; default: // Wrap the pattern in a non-capturing group. tree = wrap(tree, pattern); } assign(item, tree); } function wrap(tree, pattern) { // Wrap the pattern in a non-capturing group. return { 'type': 'group', 'behavior': 'ignore', 'body': [tree], 'raw': '(?:' + pattern + ')' }; } function caseFold(codePoint) { return has(iuMappings, codePoint) ? iuMappings[codePoint] : false; } var ignoreCase = false; var unicode = false; function processCharacterClass(characterClassItem) { var set = regenerate(); var body = characterClassItem.body.forEach(function (item) { switch (item.type) { case 'value': set.add(item.codePoint); if (ignoreCase && unicode) { var folded = caseFold(item.codePoint); if (folded) { set.add(folded); } } break; case 'characterClassRange': var min = item.min.codePoint; var max = item.max.codePoint; set.addRange(min, max); if (ignoreCase && unicode) { set.iuAddRange(min, max); } break; case 'characterClassEscape': set.add(getCharacterClassEscapeSet(item.value)); break; // The `default` clause is only here as a safeguard; it should never be // reached. Code coverage tools should ignore it. /* istanbul ignore next */ default: throw Error('Unknown term type: ' + item.type); } }); if (characterClassItem.negative) { set = (unicode ? UNICODE_SET : BMP_SET).clone().remove(set); } update(characterClassItem, set.toString()); return characterClassItem; } function processTerm(item) { switch (item.type) { case 'dot': update(item, (unicode ? DOT_SET_UNICODE : DOT_SET).toString()); break; case 'characterClass': item = processCharacterClass(item); break; case 'characterClassEscape': update(item, getCharacterClassEscapeSet(item.value).toString()); break; case 'alternative': case 'disjunction': case 'group': case 'quantifier': item.body = item.body.map(processTerm); break; case 'value': var codePoint = item.codePoint; var set = regenerate(codePoint); if (ignoreCase && unicode) { var folded = caseFold(codePoint); if (folded) { set.add(folded); } } update(item, set.toString()); break; case 'anchor': case 'empty': case 'group': case 'reference': // Nothing to do here. break; // The `default` clause is only here as a safeguard; it should never be // reached. Code coverage tools should ignore it. /* istanbul ignore next */ default: throw Error('Unknown term type: ' + item.type); } return item; }; module.exports = function (pattern, flags) { var tree = parse(pattern, flags); ignoreCase = flags ? flags.indexOf('i') > -1 : false; unicode = flags ? flags.indexOf('u') > -1 : false; assign(tree, processTerm(tree)); return generate(tree); }; }); $__System.registerDynamic("125", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * This function is like `baseIndexOf` except that it accepts a comparator. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @param {Function} comparator The comparator invoked per element. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOfWith(array, value, fromIndex, comparator) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (comparator(array[index], value)) { return index; } } return -1; } module.exports = baseIndexOfWith; }); $__System.registerDynamic('126', ['49', '127', '125', '93', 'bc'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var arrayMap = $__require('49'), baseIndexOf = $__require('127'), baseIndexOfWith = $__require('125'), baseUnary = $__require('93'), copyArray = $__require('bc'); /** Used for built-in method references. */ var arrayProto = Array.prototype; /** Built-in value references. */ var splice = arrayProto.splice; /** * The base implementation of `_.pullAllBy` without support for iteratee * shorthands. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. */ function basePullAll(array, values, iteratee, comparator) { var indexOf = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values.length, seen = array; if (array === values) { values = copyArray(values); } if (iteratee) { seen = arrayMap(array, baseUnary(iteratee)); } while (++index < length) { var fromIndex = 0, value = values[index], computed = iteratee ? iteratee(value) : value; while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { if (seen !== array) { splice.call(seen, fromIndex, 1); } splice.call(array, fromIndex, 1); } } return array; } module.exports = basePullAll; }); $__System.registerDynamic('128', ['126'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var basePullAll = $__require('126'); /** * This method is like `_.pull` except that it accepts an array of values to remove. * * **Note:** Unlike `_.difference`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pullAll(array, ['a', 'c']); * console.log(array); * // => ['b', 'b'] */ function pullAll(array, values) { return array && array.length && values && values.length ? basePullAll(array, values) : array; } module.exports = pullAll; }); $__System.registerDynamic('129', ['95', '128'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseRest = $__require('95'), pullAll = $__require('128'); /** * Removes all given values from `array` using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` * to remove elements from an array by predicate. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {...*} [values] The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pull(array, 'a', 'c'); * console.log(array); * // => ['b', 'b'] */ var pull = baseRest(pullAll); module.exports = pull; }); $__System.registerDynamic("11e", ["129", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.is = is; exports.pullFlag = pullFlag; var _pull = $__require("129"); var _pull2 = _interopRequireDefault(_pull); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function is(node, flag) { return t.isRegExpLiteral(node) && node.flags.indexOf(flag) >= 0; } function pullFlag(node, flag) { var flags = node.flags.split(""); if (node.flags.indexOf(flag) < 0) return; (0, _pull2.default)(flags, flag); node.flags = flags.join(""); } }); $__System.registerDynamic("12a", ["124", "11e"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function () { return { visitor: { RegExpLiteral: function RegExpLiteral(_ref) { var node = _ref.node; if (!regex.is(node, "u")) return; node.pattern = (0, _regexpuCore2.default)(node.pattern, node.flags); regex.pullFlag(node, "u"); } } }; }; var _regexpuCore = $__require("124"); var _regexpuCore2 = _interopRequireDefault(_regexpuCore); var _babelHelperRegex = $__require("11e"); var regex = _interopRequireWildcard(_babelHelperRegex); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("12b", ["17"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (_ref) { var messages = _ref.messages; return { visitor: { Scope: function Scope(_ref2) { var scope = _ref2.scope; for (var name in scope.bindings) { var binding = scope.bindings[name]; if (binding.kind !== "const" && binding.kind !== "module") continue; for (var _iterator = binding.constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { var _ref3; if (_isArray) { if (_i >= _iterator.length) break; _ref3 = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref3 = _i.value; } var violation = _ref3; throw violation.buildCodeFrameError(messages.get("readOnly", name)); } } } } }; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("12c", ["17"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (_ref) { var t = _ref.types; function getSpreadLiteral(spread, scope, state) { if (state.opts.loose && !t.isIdentifier(spread.argument, { name: "arguments" })) { return spread.argument; } else { return scope.toArray(spread.argument, true); } } function hasSpread(nodes) { for (var i = 0; i < nodes.length; i++) { if (t.isSpreadElement(nodes[i])) { return true; } } return false; } function build(props, scope, state) { var nodes = []; var _props = []; function push() { if (!_props.length) return; nodes.push(t.arrayExpression(_props)); _props = []; } for (var _iterator = props, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 prop = _ref2; if (t.isSpreadElement(prop)) { push(); nodes.push(getSpreadLiteral(prop, scope, state)); } else { _props.push(prop); } } push(); return nodes; } return { visitor: { ArrayExpression: function ArrayExpression(path, state) { var node = path.node, scope = path.scope; var elements = node.elements; if (!hasSpread(elements)) return; var nodes = build(elements, scope, state); var first = nodes.shift(); if (!t.isArrayExpression(first)) { nodes.unshift(first); first = t.arrayExpression([]); } path.replaceWith(t.callExpression(t.memberExpression(first, t.identifier("concat")), nodes)); }, CallExpression: function CallExpression(path, state) { var node = path.node, scope = path.scope; var args = node.arguments; if (!hasSpread(args)) return; var calleePath = path.get("callee"); if (calleePath.isSuper()) return; var contextLiteral = t.identifier("undefined"); node.arguments = []; var nodes = void 0; if (args.length === 1 && args[0].argument.name === "arguments") { nodes = [args[0].argument]; } else { nodes = build(args, scope, state); } var first = nodes.shift(); if (nodes.length) { node.arguments.push(t.callExpression(t.memberExpression(first, t.identifier("concat")), nodes)); } else { node.arguments.push(first); } var callee = node.callee; if (calleePath.isMemberExpression()) { var temp = scope.maybeGenerateMemoised(callee.object); if (temp) { callee.object = t.assignmentExpression("=", temp, callee.object); contextLiteral = temp; } else { contextLiteral = callee.object; } t.appendToMemberExpression(callee, t.identifier("apply")); } else { node.callee = t.memberExpression(node.callee, t.identifier("apply")); } if (t.isSuper(contextLiteral)) { contextLiteral = t.thisExpression(); } node.arguments.unshift(contextLiteral); }, NewExpression: function NewExpression(path, state) { var node = path.node, scope = path.scope; var args = node.arguments; if (!hasSpread(args)) return; var nodes = build(args, scope, state); var context = t.arrayExpression([t.nullLiteral()]); args = t.callExpression(t.memberExpression(context, t.identifier("concat")), nodes); path.replaceWith(t.newExpression(t.callExpression(t.memberExpression(t.memberExpression(t.memberExpression(t.identifier("Function"), t.identifier("prototype")), t.identifier("bind")), t.identifier("apply")), [node.callee, args]), [])); } } }; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("12d", ["11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.visitor = undefined; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } var visitor = exports.visitor = { Function: function Function(path) { var params = path.get("params"); var hoistTweak = t.isRestElement(params[params.length - 1]) ? 1 : 0; var outputParamsLength = params.length - hoistTweak; for (var i = 0; i < outputParamsLength; i++) { var param = params[i]; if (param.isArrayPattern() || param.isObjectPattern()) { var uid = path.scope.generateUidIdentifier("ref"); var declar = t.variableDeclaration("let", [t.variableDeclarator(param.node, uid)]); declar._blockHoist = outputParamsLength - i; path.ensureBlock(); path.get("body").unshiftContainer("body", declar); param.replaceWith(uid); } } } }; }); $__System.registerDynamic("117", ["11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (node) { var params = node.params; for (var i = 0; i < params.length; i++) { var param = params[i]; if (t.isAssignmentPattern(param) || t.isRestElement(param)) { return i; } } return params.length; }; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } module.exports = exports["default"]; }); $__System.registerDynamic("db", ["17", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (path, emit) { var kind = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "var"; path.traverse(visitor, { kind: kind, emit: emit }); }; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var visitor = { Scope: function Scope(path, state) { if (state.kind === "let") path.skip(); }, Function: function Function(path) { path.skip(); }, VariableDeclaration: function VariableDeclaration(path, state) { if (state.kind && path.node.kind !== state.kind) return; var nodes = []; var declarations = path.get("declarations"); var firstId = void 0; for (var _iterator = declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 declar = _ref; firstId = declar.node.id; if (declar.node.init) { nodes.push(t.expressionStatement(t.assignmentExpression("=", declar.node.id, declar.node.init))); } for (var name in declar.getBindingIdentifiers()) { state.emit(t.identifier(name), name); } } if (path.parentPath.isFor({ left: path.node })) { path.replaceWith(firstId); } else { path.replaceWithMultiple(nodes); } } }; module.exports = exports["default"]; }); $__System.registerDynamic("12e", ["db", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (path) { var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : path.scope; var node = path.node; var container = t.functionExpression(null, [], node.body, node.generator, node.async); var callee = container; var args = []; (0, _babelHelperHoistVariables2.default)(path, function (id) { return scope.push({ id: id }); }); var state = { foundThis: false, foundArguments: false }; path.traverse(visitor, state); if (state.foundArguments) { callee = t.memberExpression(container, t.identifier("apply")); args = []; if (state.foundThis) { args.push(t.thisExpression()); } if (state.foundArguments) { if (!state.foundThis) args.push(t.nullLiteral()); args.push(t.identifier("arguments")); } } var call = t.callExpression(callee, args); if (node.generator) call = t.yieldExpression(call, true); return t.returnStatement(call); }; var _babelHelperHoistVariables = $__require("db"); var _babelHelperHoistVariables2 = _interopRequireDefault(_babelHelperHoistVariables); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var visitor = { enter: function enter(path, state) { if (path.isThisExpression()) { state.foundThis = true; } if (path.isReferencedIdentifier({ name: "arguments" })) { state.foundArguments = true; } }, Function: function Function(path) { path.skip(); } }; module.exports = exports["default"]; }); $__System.registerDynamic("12f", ["17", "117", "12e", "10", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.visitor = undefined; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _babelHelperGetFunctionArity = $__require("117"); var _babelHelperGetFunctionArity2 = _interopRequireDefault(_babelHelperGetFunctionArity); var _babelHelperCallDelegate = $__require("12e"); var _babelHelperCallDelegate2 = _interopRequireDefault(_babelHelperCallDelegate); var _babelTemplate = $__require("10"); var _babelTemplate2 = _interopRequireDefault(_babelTemplate); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var buildDefaultParam = (0, _babelTemplate2.default)("\n let VARIABLE_NAME =\n ARGUMENTS.length > ARGUMENT_KEY && ARGUMENTS[ARGUMENT_KEY] !== undefined ?\n ARGUMENTS[ARGUMENT_KEY]\n :\n DEFAULT_VALUE;\n"); var buildCutOff = (0, _babelTemplate2.default)("\n let $0 = $1[$2];\n"); function hasDefaults(node) { for (var _iterator = node.params, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 param = _ref; if (!t.isIdentifier(param)) return true; } return false; } function isSafeBinding(scope, node) { if (!scope.hasOwnBinding(node.name)) return true; var _scope$getOwnBinding = scope.getOwnBinding(node.name), kind = _scope$getOwnBinding.kind; return kind === "param" || kind === "local"; } var iifeVisitor = { ReferencedIdentifier: function ReferencedIdentifier(path, state) { var scope = path.scope, node = path.node; if (node.name === "eval" || !isSafeBinding(scope, node)) { state.iife = true; path.stop(); } }, Scope: function Scope(path) { path.skip(); } }; var visitor = exports.visitor = { Function: function Function(path) { var node = path.node, scope = path.scope; if (!hasDefaults(node)) return; path.ensureBlock(); var state = { iife: false, scope: scope }; var body = []; var argsIdentifier = t.identifier("arguments"); argsIdentifier._shadowedFunctionLiteral = path; function pushDefNode(left, right, i) { var defNode = buildDefaultParam({ VARIABLE_NAME: left, DEFAULT_VALUE: right, ARGUMENT_KEY: t.numericLiteral(i), ARGUMENTS: argsIdentifier }); defNode._blockHoist = node.params.length - i; body.push(defNode); } var lastNonDefaultParam = (0, _babelHelperGetFunctionArity2.default)(node); var params = path.get("params"); for (var i = 0; i < params.length; i++) { var param = params[i]; if (!param.isAssignmentPattern()) { if (!state.iife && !param.isIdentifier()) { param.traverse(iifeVisitor, state); } continue; } var left = param.get("left"); var right = param.get("right"); if (i >= lastNonDefaultParam || left.isPattern()) { var placeholder = scope.generateUidIdentifier("x"); placeholder._isDefaultPlaceholder = true; node.params[i] = placeholder; } else { node.params[i] = left.node; } if (!state.iife) { if (right.isIdentifier() && !isSafeBinding(scope, right.node)) { state.iife = true; } else { right.traverse(iifeVisitor, state); } } pushDefNode(left.node, right.node, i); } for (var _i2 = lastNonDefaultParam + 1; _i2 < node.params.length; _i2++) { var _param = node.params[_i2]; if (_param._isDefaultPlaceholder) continue; var declar = buildCutOff(_param, argsIdentifier, t.numericLiteral(_i2)); declar._blockHoist = node.params.length - _i2; body.push(declar); } node.params = node.params.slice(0, lastNonDefaultParam); if (state.iife) { body.push((0, _babelHelperCallDelegate2.default)(path, scope)); path.set("body", t.blockStatement(body)); } else { path.get("body").unshiftContainer("body", body); } } }; }); $__System.registerDynamic("130", ["17", "10", "11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.visitor = undefined; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _babelTemplate = $__require("10"); var _babelTemplate2 = _interopRequireDefault(_babelTemplate); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var buildRest = (0, _babelTemplate2.default)("\n for (var LEN = ARGUMENTS.length,\n ARRAY = Array(ARRAY_LEN),\n KEY = START;\n KEY < LEN;\n KEY++) {\n ARRAY[ARRAY_KEY] = ARGUMENTS[KEY];\n }\n"); var restIndex = (0, _babelTemplate2.default)("\n ARGUMENTS.length <= INDEX ? undefined : ARGUMENTS[INDEX]\n"); var restIndexImpure = (0, _babelTemplate2.default)("\n REF = INDEX, ARGUMENTS.length <= REF ? undefined : ARGUMENTS[REF]\n"); var restLength = (0, _babelTemplate2.default)("\n ARGUMENTS.length <= OFFSET ? 0 : ARGUMENTS.length - OFFSET\n"); var memberExpressionOptimisationVisitor = { Scope: function Scope(path, state) { if (!path.scope.bindingIdentifierEquals(state.name, state.outerBinding)) { path.skip(); } }, Flow: function Flow(path) { if (path.isTypeCastExpression()) return; path.skip(); }, "Function|ClassProperty": function FunctionClassProperty(path, state) { var oldNoOptimise = state.noOptimise; state.noOptimise = true; path.traverse(memberExpressionOptimisationVisitor, state); state.noOptimise = oldNoOptimise; path.skip(); }, ReferencedIdentifier: function ReferencedIdentifier(path, state) { var node = path.node; if (node.name === "arguments") { state.deopted = true; } if (node.name !== state.name) return; if (state.noOptimise) { state.deopted = true; } else { var parentPath = path.parentPath; if (parentPath.listKey === "params" && parentPath.key < state.offset) { return; } if (parentPath.isMemberExpression({ object: node })) { var grandparentPath = parentPath.parentPath; var argsOptEligible = !state.deopted && !(grandparentPath.isAssignmentExpression() && parentPath.node === grandparentPath.node.left || grandparentPath.isLVal() || grandparentPath.isForXStatement() || grandparentPath.isUpdateExpression() || grandparentPath.isUnaryExpression({ operator: "delete" }) || (grandparentPath.isCallExpression() || grandparentPath.isNewExpression()) && parentPath.node === grandparentPath.node.callee); if (argsOptEligible) { if (parentPath.node.computed) { if (parentPath.get("property").isBaseType("number")) { state.candidates.push({ cause: "indexGetter", path: path }); return; } } else if (parentPath.node.property.name === "length") { state.candidates.push({ cause: "lengthGetter", path: path }); return; } } } if (state.offset === 0 && parentPath.isSpreadElement()) { var call = parentPath.parentPath; if (call.isCallExpression() && call.node.arguments.length === 1) { state.candidates.push({ cause: "argSpread", path: path }); return; } } state.references.push(path); } }, BindingIdentifier: function BindingIdentifier(_ref, state) { var node = _ref.node; if (node.name === state.name) { state.deopted = true; } } }; function hasRest(node) { return t.isRestElement(node.params[node.params.length - 1]); } function optimiseIndexGetter(path, argsId, offset) { var index = void 0; if (t.isNumericLiteral(path.parent.property)) { index = t.numericLiteral(path.parent.property.value + offset); } else if (offset === 0) { index = path.parent.property; } else { index = t.binaryExpression("+", path.parent.property, t.numericLiteral(offset)); } var scope = path.scope; if (!scope.isPure(index)) { var temp = scope.generateUidIdentifierBasedOnNode(index); scope.push({ id: temp, kind: "var" }); path.parentPath.replaceWith(restIndexImpure({ ARGUMENTS: argsId, INDEX: index, REF: temp })); } else { path.parentPath.replaceWith(restIndex({ ARGUMENTS: argsId, INDEX: index })); } } function optimiseLengthGetter(path, argsId, offset) { if (offset) { path.parentPath.replaceWith(restLength({ ARGUMENTS: argsId, OFFSET: t.numericLiteral(offset) })); } else { path.replaceWith(argsId); } } var visitor = exports.visitor = { Function: function Function(path) { var node = path.node, scope = path.scope; if (!hasRest(node)) return; var rest = node.params.pop().argument; var argsId = t.identifier("arguments"); argsId._shadowedFunctionLiteral = path; var state = { references: [], offset: node.params.length, argumentsNode: argsId, outerBinding: scope.getBindingIdentifier(rest.name), candidates: [], name: rest.name, deopted: false }; path.traverse(memberExpressionOptimisationVisitor, state); if (!state.deopted && !state.references.length) { for (var _iterator = state.candidates, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) { var _ref3; if (_isArray) { if (_i >= _iterator.length) break; _ref3 = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref3 = _i.value; } var _ref4 = _ref3; var _path = _ref4.path, cause = _ref4.cause; switch (cause) { case "indexGetter": optimiseIndexGetter(_path, argsId, state.offset); break; case "lengthGetter": optimiseLengthGetter(_path, argsId, state.offset); break; default: _path.replaceWith(argsId); } } return; } state.references = state.references.concat(state.candidates.map(function (_ref5) { var path = _ref5.path; return path; })); state.deopted = state.deopted || !!node.shadow; var start = t.numericLiteral(node.params.length); var key = scope.generateUidIdentifier("key"); var len = scope.generateUidIdentifier("len"); var arrKey = key; var arrLen = len; if (node.params.length) { arrKey = t.binaryExpression("-", key, start); arrLen = t.conditionalExpression(t.binaryExpression(">", len, start), t.binaryExpression("-", len, start), t.numericLiteral(0)); } var loop = buildRest({ ARGUMENTS: argsId, ARRAY_KEY: arrKey, ARRAY_LEN: arrLen, START: start, ARRAY: rest, KEY: key, LEN: len }); if (state.deopted) { loop._blockHoist = node.params.length + 1; node.body.body.unshift(loop); } else { loop._blockHoist = 1; var target = path.getEarliestCommonAncestorFrom(state.references).getStatementParent(); target.findParent(function (path) { if (path.isLoop()) { target = path; } else { return path.isFunction(); } }); target.insertBefore(loop); } } }; }); $__System.registerDynamic("131", ["17", "d0", "12d", "12f", "130"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function () { return { visitor: _babelTraverse.visitors.merge([{ ArrowFunctionExpression: function ArrowFunctionExpression(path) { var params = path.get("params"); for (var _iterator = params, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 param = _ref; if (param.isRestElement() || param.isAssignmentPattern()) { path.arrowFunctionToShadowed(); break; } } } }, destructuring.visitor, rest.visitor, def.visitor]) }; }; var _babelTraverse = $__require("d0"); var _destructuring = $__require("12d"); var destructuring = _interopRequireWildcard(_destructuring); var _default = $__require("12f"); var def = _interopRequireWildcard(_default); var _rest = $__require("130"); var rest = _interopRequireWildcard(_rest); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("132", ["1d", "17"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (_ref) { var t = _ref.types; function variableDeclarationHasPattern(node) { for (var _iterator = node.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 declar = _ref2; if (t.isPattern(declar.id)) { return true; } } return false; } function hasRest(pattern) { for (var _iterator2 = pattern.elements, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref3; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref3 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref3 = _i2.value; } var elem = _ref3; if (t.isRestElement(elem)) { return true; } } return false; } var arrayUnpackVisitor = { ReferencedIdentifier: function ReferencedIdentifier(path, state) { if (state.bindings[path.node.name]) { state.deopt = true; path.stop(); } } }; var DestructuringTransformer = function () { function DestructuringTransformer(opts) { (0, _classCallCheck3.default)(this, DestructuringTransformer); this.blockHoist = opts.blockHoist; this.operator = opts.operator; this.arrays = {}; this.nodes = opts.nodes || []; this.scope = opts.scope; this.file = opts.file; this.kind = opts.kind; } DestructuringTransformer.prototype.buildVariableAssignment = function buildVariableAssignment(id, init) { var op = this.operator; if (t.isMemberExpression(id)) op = "="; var node = void 0; if (op) { node = t.expressionStatement(t.assignmentExpression(op, id, init)); } else { node = t.variableDeclaration(this.kind, [t.variableDeclarator(id, init)]); } node._blockHoist = this.blockHoist; return node; }; DestructuringTransformer.prototype.buildVariableDeclaration = function buildVariableDeclaration(id, init) { var declar = t.variableDeclaration("var", [t.variableDeclarator(id, init)]); declar._blockHoist = this.blockHoist; return declar; }; DestructuringTransformer.prototype.push = function push(id, init) { if (t.isObjectPattern(id)) { this.pushObjectPattern(id, init); } else if (t.isArrayPattern(id)) { this.pushArrayPattern(id, init); } else if (t.isAssignmentPattern(id)) { this.pushAssignmentPattern(id, init); } else { this.nodes.push(this.buildVariableAssignment(id, init)); } }; DestructuringTransformer.prototype.toArray = function toArray(node, count) { if (this.file.opts.loose || t.isIdentifier(node) && this.arrays[node.name]) { return node; } else { return this.scope.toArray(node, count); } }; DestructuringTransformer.prototype.pushAssignmentPattern = function pushAssignmentPattern(pattern, valueRef) { var tempValueRef = this.scope.generateUidIdentifierBasedOnNode(valueRef); var declar = t.variableDeclaration("var", [t.variableDeclarator(tempValueRef, valueRef)]); declar._blockHoist = this.blockHoist; this.nodes.push(declar); var tempConditional = t.conditionalExpression(t.binaryExpression("===", tempValueRef, t.identifier("undefined")), pattern.right, tempValueRef); var left = pattern.left; if (t.isPattern(left)) { var tempValueDefault = t.expressionStatement(t.assignmentExpression("=", tempValueRef, tempConditional)); tempValueDefault._blockHoist = this.blockHoist; this.nodes.push(tempValueDefault); this.push(left, tempValueRef); } else { this.nodes.push(this.buildVariableAssignment(left, tempConditional)); } }; DestructuringTransformer.prototype.pushObjectRest = function pushObjectRest(pattern, objRef, spreadProp, spreadPropIndex) { var keys = []; for (var i = 0; i < pattern.properties.length; i++) { var prop = pattern.properties[i]; if (i >= spreadPropIndex) break; if (t.isRestProperty(prop)) continue; var key = prop.key; if (t.isIdentifier(key) && !prop.computed) key = t.stringLiteral(prop.key.name); keys.push(key); } keys = t.arrayExpression(keys); var value = t.callExpression(this.file.addHelper("objectWithoutProperties"), [objRef, keys]); this.nodes.push(this.buildVariableAssignment(spreadProp.argument, value)); }; DestructuringTransformer.prototype.pushObjectProperty = function pushObjectProperty(prop, propRef) { if (t.isLiteral(prop.key)) prop.computed = true; var pattern = prop.value; var objRef = t.memberExpression(propRef, prop.key, prop.computed); if (t.isPattern(pattern)) { this.push(pattern, objRef); } else { this.nodes.push(this.buildVariableAssignment(pattern, objRef)); } }; DestructuringTransformer.prototype.pushObjectPattern = function pushObjectPattern(pattern, objRef) { if (!pattern.properties.length) { this.nodes.push(t.expressionStatement(t.callExpression(this.file.addHelper("objectDestructuringEmpty"), [objRef]))); } if (pattern.properties.length > 1 && !this.scope.isStatic(objRef)) { var temp = this.scope.generateUidIdentifierBasedOnNode(objRef); this.nodes.push(this.buildVariableDeclaration(temp, objRef)); objRef = temp; } for (var i = 0; i < pattern.properties.length; i++) { var prop = pattern.properties[i]; if (t.isRestProperty(prop)) { this.pushObjectRest(pattern, objRef, prop, i); } else { this.pushObjectProperty(prop, objRef); } } }; DestructuringTransformer.prototype.canUnpackArrayPattern = function canUnpackArrayPattern(pattern, arr) { if (!t.isArrayExpression(arr)) return false; if (pattern.elements.length > arr.elements.length) return; if (pattern.elements.length < arr.elements.length && !hasRest(pattern)) return false; for (var _iterator3 = pattern.elements, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref4; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref4 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref4 = _i3.value; } var elem = _ref4; if (!elem) return false; if (t.isMemberExpression(elem)) return false; } for (var _iterator4 = arr.elements, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { var _ref5; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref5 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref5 = _i4.value; } var _elem = _ref5; if (t.isSpreadElement(_elem)) return false; if (t.isCallExpression(_elem)) return false; if (t.isMemberExpression(_elem)) return false; } var bindings = t.getBindingIdentifiers(pattern); var state = { deopt: false, bindings: bindings }; this.scope.traverse(arr, arrayUnpackVisitor, state); return !state.deopt; }; DestructuringTransformer.prototype.pushUnpackedArrayPattern = function pushUnpackedArrayPattern(pattern, arr) { for (var i = 0; i < pattern.elements.length; i++) { var elem = pattern.elements[i]; if (t.isRestElement(elem)) { this.push(elem.argument, t.arrayExpression(arr.elements.slice(i))); } else { this.push(elem, arr.elements[i]); } } }; DestructuringTransformer.prototype.pushArrayPattern = function pushArrayPattern(pattern, arrayRef) { if (!pattern.elements) return; if (this.canUnpackArrayPattern(pattern, arrayRef)) { return this.pushUnpackedArrayPattern(pattern, arrayRef); } var count = !hasRest(pattern) && pattern.elements.length; var toArray = this.toArray(arrayRef, count); if (t.isIdentifier(toArray)) { arrayRef = toArray; } else { arrayRef = this.scope.generateUidIdentifierBasedOnNode(arrayRef); this.arrays[arrayRef.name] = true; this.nodes.push(this.buildVariableDeclaration(arrayRef, toArray)); } for (var i = 0; i < pattern.elements.length; i++) { var elem = pattern.elements[i]; if (!elem) continue; var elemRef = void 0; if (t.isRestElement(elem)) { elemRef = this.toArray(arrayRef); elemRef = t.callExpression(t.memberExpression(elemRef, t.identifier("slice")), [t.numericLiteral(i)]); elem = elem.argument; } else { elemRef = t.memberExpression(arrayRef, t.numericLiteral(i), true); } this.push(elem, elemRef); } }; DestructuringTransformer.prototype.init = function init(pattern, ref) { if (!t.isArrayExpression(ref) && !t.isMemberExpression(ref)) { var memo = this.scope.maybeGenerateMemoised(ref, true); if (memo) { this.nodes.push(this.buildVariableDeclaration(memo, ref)); ref = memo; } } this.push(pattern, ref); return this.nodes; }; return DestructuringTransformer; }(); return { visitor: { ExportNamedDeclaration: function ExportNamedDeclaration(path) { var declaration = path.get("declaration"); if (!declaration.isVariableDeclaration()) return; if (!variableDeclarationHasPattern(declaration.node)) return; var specifiers = []; for (var name in path.getOuterBindingIdentifiers(path)) { var id = t.identifier(name); specifiers.push(t.exportSpecifier(id, id)); } path.replaceWith(declaration.node); path.insertAfter(t.exportNamedDeclaration(null, specifiers)); }, ForXStatement: function ForXStatement(path, file) { var node = path.node, scope = path.scope; var left = node.left; if (t.isPattern(left)) { var temp = scope.generateUidIdentifier("ref"); node.left = t.variableDeclaration("var", [t.variableDeclarator(temp)]); path.ensureBlock(); node.body.body.unshift(t.variableDeclaration("var", [t.variableDeclarator(left, temp)])); return; } if (!t.isVariableDeclaration(left)) return; var pattern = left.declarations[0].id; if (!t.isPattern(pattern)) return; var key = scope.generateUidIdentifier("ref"); node.left = t.variableDeclaration(left.kind, [t.variableDeclarator(key, null)]); var nodes = []; var destructuring = new DestructuringTransformer({ kind: left.kind, file: file, scope: scope, nodes: nodes }); destructuring.init(pattern, key); path.ensureBlock(); var block = node.body; block.body = nodes.concat(block.body); }, CatchClause: function CatchClause(_ref6, file) { var node = _ref6.node, scope = _ref6.scope; var pattern = node.param; if (!t.isPattern(pattern)) return; var ref = scope.generateUidIdentifier("ref"); node.param = ref; var nodes = []; var destructuring = new DestructuringTransformer({ kind: "let", file: file, scope: scope, nodes: nodes }); destructuring.init(pattern, ref); node.body.body = nodes.concat(node.body.body); }, AssignmentExpression: function AssignmentExpression(path, file) { var node = path.node, scope = path.scope; if (!t.isPattern(node.left)) return; var nodes = []; var destructuring = new DestructuringTransformer({ operator: node.operator, file: file, scope: scope, nodes: nodes }); var ref = void 0; if (path.isCompletionRecord() || !path.parentPath.isExpressionStatement()) { ref = scope.generateUidIdentifierBasedOnNode(node.right, "ref"); nodes.push(t.variableDeclaration("var", [t.variableDeclarator(ref, node.right)])); if (t.isArrayExpression(node.right)) { destructuring.arrays[ref.name] = true; } } destructuring.init(node.left, ref || node.right); if (ref) { nodes.push(t.expressionStatement(ref)); } path.replaceWithMultiple(nodes); }, VariableDeclaration: function VariableDeclaration(path, file) { var node = path.node, scope = path.scope, parent = path.parent; if (t.isForXStatement(parent)) return; if (!parent || !path.container) return; if (!variableDeclarationHasPattern(node)) return; var nodes = []; var declar = void 0; for (var i = 0; i < node.declarations.length; i++) { declar = node.declarations[i]; var patternId = declar.init; var pattern = declar.id; var destructuring = new DestructuringTransformer({ blockHoist: node._blockHoist, nodes: nodes, scope: scope, kind: node.kind, file: file }); if (t.isPattern(pattern)) { destructuring.init(pattern, patternId); if (+i !== node.declarations.length - 1) { t.inherits(nodes[nodes.length - 1], declar); } } else { nodes.push(t.inherits(destructuring.buildVariableAssignment(declar.id, declar.init), declar)); } } var nodesOut = []; for (var _iterator5 = nodes, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { var _ref7; if (_isArray5) { if (_i5 >= _iterator5.length) break; _ref7 = _iterator5[_i5++]; } else { _i5 = _iterator5.next(); if (_i5.done) break; _ref7 = _i5.value; } var _node = _ref7; var tail = nodesOut[nodesOut.length - 1]; if (tail && t.isVariableDeclaration(tail) && t.isVariableDeclaration(_node) && tail.kind === _node.kind) { var _tail$declarations; (_tail$declarations = tail.declarations).push.apply(_tail$declarations, _node.declarations); } else { nodesOut.push(_node); } } for (var _iterator6 = nodesOut, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) { var _ref8; if (_isArray6) { if (_i6 >= _iterator6.length) break; _ref8 = _iterator6[_i6++]; } else { _i6 = _iterator6.next(); if (_i6.done) break; _ref8 = _i6.value; } var nodeOut = _ref8; if (!nodeOut.declarations) continue; for (var _iterator7 = nodeOut.declarations, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) { var _ref9; if (_isArray7) { if (_i7 >= _iterator7.length) break; _ref9 = _iterator7[_i7++]; } else { _i7 = _iterator7.next(); if (_i7.done) break; _ref9 = _i7.value; } var declaration = _ref9; var name = declaration.id.name; if (scope.bindings[name]) { scope.bindings[name].kind = nodeOut.kind; } } } if (nodesOut.length === 1) { path.replaceWith(nodesOut[0]); } else { path.replaceWithMultiple(nodesOut); } } } }; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } module.exports = exports["default"]; }); $__System.registerDynamic("133", ["11"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.visitor = undefined; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function getTDZStatus(refPath, bindingPath) { var executionStatus = bindingPath._guessExecutionStatusRelativeTo(refPath); if (executionStatus === "before") { return "inside"; } else if (executionStatus === "after") { return "outside"; } else { return "maybe"; } } function buildTDZAssert(node, file) { return t.callExpression(file.addHelper("temporalRef"), [node, t.stringLiteral(node.name), file.addHelper("temporalUndefined")]); } function isReference(node, scope, state) { var declared = state.letReferences[node.name]; if (!declared) return false; return scope.getBindingIdentifier(node.name) === declared; } var visitor = exports.visitor = { ReferencedIdentifier: function ReferencedIdentifier(path, state) { if (!this.file.opts.tdz) return; var node = path.node, parent = path.parent, scope = path.scope; if (path.parentPath.isFor({ left: node })) return; if (!isReference(node, scope, state)) return; var bindingPath = scope.getBinding(node.name).path; var status = getTDZStatus(path, bindingPath); if (status === "inside") return; if (status === "maybe") { var assert = buildTDZAssert(node, state.file); bindingPath.parent._tdzThis = true; path.skip(); if (path.parentPath.isUpdateExpression()) { if (parent._ignoreBlockScopingTDZ) return; path.parentPath.replaceWith(t.sequenceExpression([assert, parent])); } else { path.replaceWith(assert); } } else if (status === "outside") { path.replaceWith(t.throwStatement(t.inherits(t.newExpression(t.identifier("ReferenceError"), [t.stringLiteral(node.name + " is not defined - temporal dead zone")]), node))); } }, AssignmentExpression: { exit: function exit(path, state) { if (!this.file.opts.tdz) return; var node = path.node; if (node._ignoreBlockScopingTDZ) return; var nodes = []; var ids = path.getBindingIdentifiers(); for (var name in ids) { var id = ids[name]; if (isReference(id, path.scope, state)) { nodes.push(buildTDZAssert(id, state.file)); } } if (nodes.length) { node._ignoreBlockScopingTDZ = true; nodes.push(node); path.replaceWithMultiple(nodes.map(t.expressionStatement)); } } } }; }); $__System.registerDynamic('134', ['b7', 'c2', 'b8'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var copyObject = $__require('b7'), createAssigner = $__require('c2'), keysIn = $__require('b8'); /** * This method is like `_.assign` except that it iterates over own and * inherited source properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extend * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assign * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assignIn({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ var assignIn = createAssigner(function (object, source) { copyObject(source, keysIn(source), object); }); module.exports = assignIn; }); $__System.registerDynamic('135', ['134'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; module.exports = $__require('134'); }); $__System.registerDynamic('136', ['b1'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseClone = $__require('b1'); /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4; /** * This method is like `_.clone` except that it recursively clones `value`. * * @static * @memberOf _ * @since 1.0.0 * @category Lang * @param {*} value The value to recursively clone. * @returns {*} Returns the deep cloned value. * @see _.clone * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var deep = _.cloneDeep(objects); * console.log(deep[0] === objects[0]); * // => false */ function cloneDeep(value) { return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } module.exports = cloneDeep; }); $__System.registerDynamic("137", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * The base implementation of `_.has` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { return object != null && hasOwnProperty.call(object, key); } module.exports = baseHas; }); $__System.registerDynamic('83', ['4b', '90'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var isArray = $__require('4b'), isSymbol = $__require('90'); /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ 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; }); $__System.registerDynamic('138', ['139'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var MapCache = $__require('139'); /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || resolver != null && typeof resolver != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function () { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache)(); return memoized; } // Expose `MapCache`. memoize.Cache = MapCache; module.exports = memoize; }); $__System.registerDynamic('13a', ['138'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var memoize = $__require('138'); /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500; /** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { var result = memoize(func, function (key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } module.exports = memoizeCapped; }); $__System.registerDynamic('13b', ['13a'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var memoizeCapped = $__require('13a'); /** Used to match property names within property paths. */ var reLeadingDot = /^\./, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoizeCapped(function (string) { var result = []; if (reLeadingDot.test(string)) { result.push(''); } string.replace(rePropName, function (match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : number || match); }); return result; }); module.exports = stringToPath; }); $__System.registerDynamic('86', ['4b', '83', '13b', '9b'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var isArray = $__require('4b'), isKey = $__require('83'), stringToPath = $__require('13b'), toString = $__require('9b'); /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array. */ function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } module.exports = castPath; }); $__System.registerDynamic('84', ['90'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var isSymbol = $__require('90'); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ 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; }); $__System.registerDynamic('80', ['86', '62', '4b', '13c', '13d', '84'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var castPath = $__require('86'), isArguments = $__require('62'), isArray = $__require('4b'), isIndex = $__require('13c'), isLength = $__require('13d'), toKey = $__require('84'); /** * Checks if `path` exists on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { path = castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } module.exports = hasPath; }); $__System.registerDynamic('114', ['137', '80'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseHas = $__require('137'), hasPath = $__require('80'); /** * Checks if `path` is a direct property of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = { 'a': { 'b': 2 } }; * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * * _.has(object, 'a.b'); * // => true * * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); * // => false */ function has(object, path) { return object != null && hasPath(object, path, baseHas); } module.exports = has; }); $__System.registerDynamic("13e", ["1d", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Hub = function Hub(file, options) { (0, _classCallCheck3.default)(this, Hub); this.file = file; this.options = options; }; exports.default = Hub; module.exports = exports["default"]; }); $__System.registerDynamic('13f', [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ 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)); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ 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; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ 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'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms'; } /** * Pluralization helper. */ 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'; } }); $__System.registerDynamic('140', ['13f'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; exports.humanize = $__require('13f'); /** * The currently active debug mode names, and names to skip. */ exports.names = []; exports.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ exports.formatters = {}; /** * Previous log timestamp. */ var prevTime; /** * Select a color. * @param {String} namespace * @return {Number} * @api private */ function selectColor(namespace) { var hash = 0, i; for (i in namespace) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return exports.colors[Math.abs(hash) % exports.colors.length]; } /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { function debug() { // disabled? if (!debug.enabled) return; var self = debug; // set `diff` timestamp var curr = +new Date(); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; // turn the `arguments` into a proper Array var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } args[0] = exports.coerce(args[0]); if ('string' !== typeof args[0]) { // anything else let's inspect with %O args.unshift('%O'); } // apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { // if we encounter an escaped % then don't increase the array index if (match === '%%') return match; index++; var formatter = exports.formatters[format]; if ('function' === typeof formatter) { var val = args[index]; match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // apply env-specific formatting (colors, etc.) exports.formatArgs.call(self, args); var logFn = debug.log || exports.log || console.log.bind(console); logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = exports.enabled(namespace); debug.useColors = exports.useColors(); debug.color = selectColor(namespace); // env-specific initialization logic for debug instances if ('function' === typeof exports.init) { exports.init(debug); } return debug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { exports.save(namespaces); exports.names = []; exports.skips = []; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (var i = 0; i < len; i++) { if (!split[i]) continue; // ignore empty strings namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { exports.names.push(new RegExp('^' + namespaces + '$')); } } } /** * Disable debug output. * * @api public */ function disable() { exports.enable(''); } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { var i, len; for (i = 0, len = exports.skips.length; i < len; i++) { if (exports.skips[i].test(name)) { return false; } } for (i = 0, len = exports.names.length; i < len; i++) { if (exports.names[i].test(name)) { return true; } } return false; } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) return val.stack || val.message; return val; } }); $__System.registerDynamic('5e', ['@node/tty', '@node/util', '140', '@node/fs', '@node/net'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * Module dependencies. */ var tty = $__require('@node/tty'); var util = $__require('@node/util'); /** * This is the Node.js implementation of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = $__require('140'); exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(function (key) { return (/^debug_/i.test(key) ); }).reduce(function (obj, key) { // camel-case var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) { return k.toUpperCase(); }); // coerce string value into JS value var val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) val = true;else if (/^(no|off|false|disabled)$/i.test(val)) val = false;else if (val === 'null') val = null;else val = Number(val); obj[prop] = val; return obj; }, {}); /** * The file descriptor to write the `debug()` calls to. * Set the `DEBUG_FD` env variable to override with another value. i.e.: * * $ DEBUG_FD=3 node script.js 3>debug.log */ var fd = parseInt(process.env.DEBUG_FD, 10) || 2; if (1 !== fd && 2 !== fd) { util.deprecate(function () {}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')(); } var stream = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(fd); } /** * Map %o to `util.inspect()`, all on a single line. */ exports.formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts).replace(/\s*\n\s*/g, ' '); }; /** * Map %o to `util.inspect()`, allowing multiple lines if needed. */ exports.formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { var name = this.namespace; var useColors = this.useColors; if (useColors) { var c = this.color; var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); } else { args[0] = new Date().toUTCString() + ' ' + name + ' ' + args[0]; } } /** * Invokes `util.format()` with the specified arguments and writes to `stream`. */ function log() { return stream.write(util.format.apply(util, arguments) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (null == namespaces) { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } else { process.env.DEBUG = namespaces; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Copied from `node/src/node.js`. * * XXX: It's lame that node doesn't expose this API out-of-the-box. It also * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. */ function createWritableStdioStream(fd) { var stream; var tty_wrap = process.binding('tty_wrap'); // Note stream._type is used for test-module-load-list.js switch (tty_wrap.guessHandleType(fd)) { case 'TTY': stream = new tty.WriteStream(fd); stream._type = 'tty'; // Hack to have stream not keep the event loop alive. // See https://github.com/joyent/node/issues/1726 if (stream._handle && stream._handle.unref) { stream._handle.unref(); } break; case 'FILE': var fs = $__require('@node/fs'); stream = new fs.SyncWriteStream(fd, { autoClose: false }); stream._type = 'fs'; break; case 'PIPE': case 'TCP': var net = $__require('@node/net'); stream = new net.Socket({ fd: fd, readable: false, writable: true }); // FIXME Should probably have an option in net.Socket to create a // stream from an existing fd which is writable only. But for now // we'll just add this hack and set the `readable` member to false. // Test: ./node test/fixtures/echo.js < /etc/passwd stream.readable = false; stream.read = null; stream._type = 'pipe'; // FIXME Hack to have stream not keep the event loop alive. // See https://github.com/joyent/node/issues/1726 if (stream._handle && stream._handle.unref) { stream._handle.unref(); } break; default: // Probably an error on in uv_guess_handle() throw new Error('Implement me. Unknown stream file type!'); } // For supporting legacy API we put the FD here. stream.fd = fd; stream._isStdio = true; return stream; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; var keys = Object.keys(exports.inspectOpts); for (var i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } /** * Enable namespaces listed in `process.env.DEBUG` initially. */ exports.enable(load()); }); $__System.registerDynamic('141', ['c'], true, function ($__require, exports, module) { /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ 'use strict'; /** * Use invariant() to assert state which your program assumes to be true. * * Provide sprintf-style format (only %s is supported) and arguments * to provide information about what broke and what you were * expecting. * * The invariant message will be stripped in production, but the invariant * will remain to ensure logic does not differ in production. */ var process = $__require('c'); var global = this || self, GLOBAL = global; var NODE_ENV = 'production'; var invariant = function (condition, format, a, b, c, d, e, f) { if (NODE_ENV !== 'production') { if (format === undefined) { throw new Error('invariant requires an error message argument'); } } if (!condition) { var error; if (format === undefined) { error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error(format.replace(/%s/g, function () { return args[argIndex++]; })); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } }; module.exports = invariant; }); $__System.registerDynamic('d1', ['142', 'b7', 'c2', '3f', '143', '40'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var assignValue = $__require('142'), copyObject = $__require('b7'), createAssigner = $__require('c2'), isArrayLike = $__require('3f'), isPrototype = $__require('143'), keys = $__require('40'); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Assigns own enumerable string keyed properties of source objects to the * destination object. Source objects are applied from left to right. * Subsequent sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object` and is loosely based on * [`Object.assign`](https://mdn.io/Object/assign). * * @static * @memberOf _ * @since 0.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assignIn * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assign({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'c': 3 } */ var assign = createAssigner(function (object, source) { if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; } for (var key in source) { if (hasOwnProperty.call(source, key)) { assignValue(object, key, source[key]); } } }); module.exports = assign; }); $__System.registerDynamic('144', [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeFloor = Math.floor; /** * The base implementation of `_.repeat` which doesn't coerce arguments. * * @private * @param {string} string The string to repeat. * @param {number} n The number of times to repeat the string. * @returns {string} Returns the repeated string. */ function baseRepeat(string, n) { var result = ''; if (!string || n < 1 || n > MAX_SAFE_INTEGER) { return result; } // Leverage the exponentiation by squaring algorithm for a faster repeat. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. do { if (n % 2) { result += string; } n = nativeFloor(n / 2); if (n) { string += string; } } while (n); return result; } module.exports = baseRepeat; }); $__System.registerDynamic('9e', ['61', '49', '4b', '90'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var Symbol = $__require('61'), arrayMap = $__require('49'), isArray = $__require('4b'), isSymbol = $__require('90'); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isArray(value)) { // Recursively convert values (susceptible to call stack limits). return arrayMap(value, baseToString) + ''; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = value + ''; return result == '0' && 1 / value == -INFINITY ? '-0' : result; } module.exports = baseToString; }); $__System.registerDynamic('9b', ['9e'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseToString = $__require('9e'); /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } module.exports = toString; }); $__System.registerDynamic('5c', ['144', '96', '3c', '9b'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseRepeat = $__require('144'), isIterateeCall = $__require('96'), toInteger = $__require('3c'), toString = $__require('9b'); /** * Repeats the given string `n` times. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to repeat. * @param {number} [n=1] The number of times to repeat the string. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the repeated string. * @example * * _.repeat('*', 3); * // => '***' * * _.repeat('abc', 2); * // => 'abcabc' * * _.repeat('abc', 0); * // => '' */ function repeat(string, n, guard) { if (guard ? isIterateeCall(string, n, guard) : n === undefined) { n = 1; } else { n = toInteger(n); } return baseRepeat(toString(string), n); } module.exports = repeat; }); $__System.registerDynamic("145", ["1d", "146", "11", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _binding = $__require("146"); var _binding2 = _interopRequireDefault(_binding); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var renameVisitor = { ReferencedIdentifier: function ReferencedIdentifier(_ref, state) { var node = _ref.node; if (node.name === state.oldName) { node.name = state.newName; } }, Scope: function Scope(path, state) { if (!path.scope.bindingIdentifierEquals(state.oldName, state.binding.identifier)) { path.skip(); } }, "AssignmentExpression|Declaration": function AssignmentExpressionDeclaration(path, state) { var ids = path.getOuterBindingIdentifiers(); for (var name in ids) { if (name === state.oldName) ids[name].name = state.newName; } } }; var Renamer = function () { function Renamer(binding, oldName, newName) { (0, _classCallCheck3.default)(this, Renamer); this.newName = newName; this.oldName = oldName; this.binding = binding; } Renamer.prototype.maybeConvertFromExportDeclaration = function maybeConvertFromExportDeclaration(parentDeclar) { var exportDeclar = parentDeclar.parentPath.isExportDeclaration() && parentDeclar.parentPath; if (!exportDeclar) return; var isDefault = exportDeclar.isExportDefaultDeclaration(); if (isDefault && (parentDeclar.isFunctionDeclaration() || parentDeclar.isClassDeclaration()) && !parentDeclar.node.id) { parentDeclar.node.id = parentDeclar.scope.generateUidIdentifier("default"); } var bindingIdentifiers = parentDeclar.getOuterBindingIdentifiers(); var specifiers = []; for (var name in bindingIdentifiers) { var localName = name === this.oldName ? this.newName : name; var exportedName = isDefault ? "default" : name; specifiers.push(t.exportSpecifier(t.identifier(localName), t.identifier(exportedName))); } if (specifiers.length) { var aliasDeclar = t.exportNamedDeclaration(null, specifiers); if (parentDeclar.isFunctionDeclaration()) { aliasDeclar._blockHoist = 3; } exportDeclar.insertAfter(aliasDeclar); exportDeclar.replaceWith(parentDeclar.node); } }; Renamer.prototype.maybeConvertFromClassFunctionDeclaration = function maybeConvertFromClassFunctionDeclaration(path) { return; if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return; if (this.binding.kind !== "hoisted") return; path.node.id = t.identifier(this.oldName); path.node._blockHoist = 3; path.replaceWith(t.variableDeclaration("let", [t.variableDeclarator(t.identifier(this.newName), t.toExpression(path.node))])); }; Renamer.prototype.maybeConvertFromClassFunctionExpression = function maybeConvertFromClassFunctionExpression(path) { return; if (!path.isFunctionExpression() && !path.isClassExpression()) return; if (this.binding.kind !== "local") return; path.node.id = t.identifier(this.oldName); this.binding.scope.parent.push({ id: t.identifier(this.newName) }); path.replaceWith(t.assignmentExpression("=", t.identifier(this.newName), path.node)); }; Renamer.prototype.rename = function rename(block) { var binding = this.binding, oldName = this.oldName, newName = this.newName; var scope = binding.scope, path = binding.path; var parentDeclar = path.find(function (path) { return path.isDeclaration() || path.isFunctionExpression(); }); if (parentDeclar) { this.maybeConvertFromExportDeclaration(parentDeclar); } scope.traverse(block || scope.block, renameVisitor, this); if (!block) { scope.removeOwnBinding(oldName); scope.bindings[newName] = binding; this.binding.identifier.name = newName; } if (binding.type === "hoisted") {} if (parentDeclar) { this.maybeConvertFromClassFunctionDeclaration(parentDeclar); this.maybeConvertFromClassFunctionExpression(parentDeclar); } }; return Renamer; }(); exports.default = Renamer; module.exports = exports["default"]; }); $__System.registerDynamic('96', ['72', '3f', '13c', '81'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var eq = $__require('72'), isArrayLike = $__require('3f'), isIndex = $__require('13c'), isObject = $__require('81'); /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, * else `false`. */ 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; }); $__System.registerDynamic('c2', ['95', '96'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseRest = $__require('95'), isIterateeCall = $__require('96'); /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return baseRest(function (object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = assigner.length > 3 && typeof customizer == 'function' ? (length--, customizer) : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } module.exports = createAssigner; }); $__System.registerDynamic('147', ['b7', 'c2', 'b8'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var copyObject = $__require('b7'), createAssigner = $__require('c2'), keysIn = $__require('b8'); /** * This method is like `_.assignIn` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extendWith * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignInWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignInWith = createAssigner(function (object, source, srcIndex, customizer) { copyObject(source, keysIn(source), object, customizer); }); module.exports = assignInWith; }); $__System.registerDynamic("148", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } module.exports = apply; }); $__System.registerDynamic('149', ['148'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var apply = $__require('148'); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax(start === undefined ? func.length - 1 : start, 0); return function () { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } module.exports = overRest; }); $__System.registerDynamic("14a", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * Creates a function that returns `value`. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. * @returns {Function} Returns the new constant function. * @example * * var objects = _.times(2, _.constant({ 'a': 1 })); * * console.log(objects); * // => [{ 'a': 1 }, { 'a': 1 }] * * console.log(objects[0] === objects[1]); * // => true */ function constant(value) { return function () { return value; }; } module.exports = constant; }); $__System.registerDynamic("89", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } module.exports = identity; }); $__System.registerDynamic('14b', ['14a', '14c', '89'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var constant = $__require('14a'), defineProperty = $__require('14c'), identity = $__require('89'); /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !defineProperty ? identity : function (func, string) { return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), 'writable': true }); }; module.exports = baseSetToString; }); $__System.registerDynamic("14d", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeNow = Date.now; /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function () { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } module.exports = shortOut; }); $__System.registerDynamic('14e', ['14b', '14d'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseSetToString = $__require('14b'), shortOut = $__require('14d'); /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = shortOut(baseSetToString); module.exports = setToString; }); $__System.registerDynamic('95', ['89', '149', '14e'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var identity = $__require('89'), overRest = $__require('149'), setToString = $__require('14e'); /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ''); } module.exports = baseRest; }); $__System.registerDynamic('14f', ['72'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var eq = $__require('72'); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used by `_.defaults` to customize its `_.assignIn` use to assign properties * of source objects to the destination object for all destination properties * that resolve to `undefined`. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to assign. * @param {Object} object The parent object of `objValue`. * @returns {*} Returns the value to assign. */ function customDefaultsAssignIn(objValue, srcValue, key, object) { if (objValue === undefined || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) { return srcValue; } return objValue; } module.exports = customDefaultsAssignIn; }); $__System.registerDynamic('d6', ['148', '147', '95', '14f'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var apply = $__require('148'), assignInWith = $__require('147'), baseRest = $__require('95'), customDefaultsAssignIn = $__require('14f'); /** * Assigns own and inherited enumerable string keyed properties of source * objects to the destination object for all destination properties that * resolve to `undefined`. Source objects are applied from left to right. * Once a property is set, additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaultsDeep * @example * * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var defaults = baseRest(function (args) { args.push(undefined, customDefaultsAssignIn); return apply(assignInWith, undefined, args); }); module.exports = defaults; }); $__System.registerDynamic("146", ["1d", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Binding = function () { function Binding(_ref) { var existing = _ref.existing, identifier = _ref.identifier, scope = _ref.scope, path = _ref.path, kind = _ref.kind; (0, _classCallCheck3.default)(this, Binding); this.identifier = identifier; this.scope = scope; this.path = path; this.kind = kind; this.constantViolations = []; this.constant = true; this.referencePaths = []; this.referenced = false; this.references = 0; this.clearValue(); if (existing) { this.constantViolations = [].concat(existing.path, existing.constantViolations, this.constantViolations); } } Binding.prototype.deoptValue = function deoptValue() { this.clearValue(); this.hasDeoptedValue = true; }; Binding.prototype.setValue = function setValue(value) { if (this.hasDeoptedValue) return; this.hasValue = true; this.value = value; }; Binding.prototype.clearValue = function clearValue() { this.hasDeoptedValue = false; this.hasValue = false; this.value = null; }; Binding.prototype.reassign = function reassign(path) { this.constant = false; if (this.constantViolations.indexOf(path) !== -1) { return; } this.constantViolations.push(path); }; Binding.prototype.reference = function reference(path) { if (this.referencePaths.indexOf(path) !== -1) { return; } this.referenced = true; this.references++; this.referencePaths.push(path); }; Binding.prototype.dereference = function dereference() { this.references--; this.referenced = !!this.references; }; return Binding; }(); exports.default = Binding; module.exports = exports["default"]; }); $__System.registerDynamic("150", [], true, function() { return { "builtin": { "Array": false, "ArrayBuffer": false, "Boolean": false, "constructor": false, "DataView": false, "Date": false, "decodeURI": false, "decodeURIComponent": false, "encodeURI": false, "encodeURIComponent": false, "Error": false, "escape": false, "eval": false, "EvalError": false, "Float32Array": false, "Float64Array": false, "Function": false, "hasOwnProperty": false, "Infinity": false, "Int16Array": false, "Int32Array": false, "Int8Array": false, "isFinite": false, "isNaN": false, "isPrototypeOf": false, "JSON": false, "Map": false, "Math": false, "NaN": false, "Number": false, "Object": false, "parseFloat": false, "parseInt": false, "Promise": false, "propertyIsEnumerable": false, "Proxy": false, "RangeError": false, "ReferenceError": false, "Reflect": false, "RegExp": false, "Set": false, "String": false, "Symbol": false, "SyntaxError": false, "System": false, "toLocaleString": false, "toString": false, "TypeError": false, "Uint16Array": false, "Uint32Array": false, "Uint8Array": false, "Uint8ClampedArray": false, "undefined": false, "unescape": false, "URIError": false, "valueOf": false, "WeakMap": false, "WeakSet": false }, "es5": { "Array": false, "Boolean": false, "constructor": false, "Date": false, "decodeURI": false, "decodeURIComponent": false, "encodeURI": false, "encodeURIComponent": false, "Error": false, "escape": false, "eval": false, "EvalError": false, "Function": false, "hasOwnProperty": false, "Infinity": false, "isFinite": false, "isNaN": false, "isPrototypeOf": false, "JSON": false, "Math": false, "NaN": false, "Number": false, "Object": false, "parseFloat": false, "parseInt": false, "propertyIsEnumerable": false, "RangeError": false, "ReferenceError": false, "RegExp": false, "String": false, "SyntaxError": false, "toLocaleString": false, "toString": false, "TypeError": false, "undefined": false, "unescape": false, "URIError": false, "valueOf": false }, "es6": { "Array": false, "ArrayBuffer": false, "Boolean": false, "constructor": false, "DataView": false, "Date": false, "decodeURI": false, "decodeURIComponent": false, "encodeURI": false, "encodeURIComponent": false, "Error": false, "escape": false, "eval": false, "EvalError": false, "Float32Array": false, "Float64Array": false, "Function": false, "hasOwnProperty": false, "Infinity": false, "Int16Array": false, "Int32Array": false, "Int8Array": false, "isFinite": false, "isNaN": false, "isPrototypeOf": false, "JSON": false, "Map": false, "Math": false, "NaN": false, "Number": false, "Object": false, "parseFloat": false, "parseInt": false, "Promise": false, "propertyIsEnumerable": false, "Proxy": false, "RangeError": false, "ReferenceError": false, "Reflect": false, "RegExp": false, "Set": false, "String": false, "Symbol": false, "SyntaxError": false, "System": false, "toLocaleString": false, "toString": false, "TypeError": false, "Uint16Array": false, "Uint32Array": false, "Uint8Array": false, "Uint8ClampedArray": false, "undefined": false, "unescape": false, "URIError": false, "valueOf": false, "WeakMap": false, "WeakSet": false }, "browser": { "addEventListener": false, "alert": false, "AnalyserNode": false, "Animation": false, "AnimationEffectReadOnly": false, "AnimationEffectTiming": false, "AnimationEffectTimingReadOnly": false, "AnimationEvent": false, "AnimationPlaybackEvent": false, "AnimationTimeline": false, "applicationCache": false, "ApplicationCache": false, "ApplicationCacheErrorEvent": false, "atob": false, "Attr": false, "Audio": false, "AudioBuffer": false, "AudioBufferSourceNode": false, "AudioContext": false, "AudioDestinationNode": false, "AudioListener": false, "AudioNode": false, "AudioParam": false, "AudioProcessingEvent": false, "AutocompleteErrorEvent": false, "BarProp": false, "BatteryManager": false, "BeforeUnloadEvent": false, "BiquadFilterNode": false, "Blob": false, "blur": false, "btoa": false, "Cache": false, "caches": false, "CacheStorage": false, "cancelAnimationFrame": false, "cancelIdleCallback": false, "CanvasGradient": false, "CanvasPattern": false, "CanvasRenderingContext2D": false, "CDATASection": false, "ChannelMergerNode": false, "ChannelSplitterNode": false, "CharacterData": false, "clearInterval": false, "clearTimeout": false, "clientInformation": false, "ClientRect": false, "ClientRectList": false, "ClipboardEvent": false, "close": false, "closed": false, "CloseEvent": false, "Comment": false, "CompositionEvent": false, "confirm": false, "console": false, "ConvolverNode": false, "createImageBitmap": false, "Credential": false, "CredentialsContainer": false, "crypto": false, "Crypto": false, "CryptoKey": false, "CSS": false, "CSSAnimation": false, "CSSFontFaceRule": false, "CSSImportRule": false, "CSSKeyframeRule": false, "CSSKeyframesRule": false, "CSSMediaRule": false, "CSSPageRule": false, "CSSRule": false, "CSSRuleList": false, "CSSStyleDeclaration": false, "CSSStyleRule": false, "CSSStyleSheet": false, "CSSSupportsRule": false, "CSSTransition": false, "CSSUnknownRule": false, "CSSViewportRule": false, "customElements": false, "CustomEvent": false, "DataTransfer": false, "DataTransferItem": false, "DataTransferItemList": false, "Debug": false, "defaultStatus": false, "defaultstatus": false, "DelayNode": false, "DeviceMotionEvent": false, "DeviceOrientationEvent": false, "devicePixelRatio": false, "dispatchEvent": false, "document": false, "Document": false, "DocumentFragment": false, "DocumentTimeline": false, "DocumentType": false, "DOMError": false, "DOMException": false, "DOMImplementation": false, "DOMParser": false, "DOMSettableTokenList": false, "DOMStringList": false, "DOMStringMap": false, "DOMTokenList": false, "DragEvent": false, "DynamicsCompressorNode": false, "Element": false, "ElementTimeControl": false, "ErrorEvent": false, "event": false, "Event": false, "EventSource": false, "EventTarget": false, "external": false, "FederatedCredential": false, "fetch": false, "File": false, "FileError": false, "FileList": false, "FileReader": false, "find": false, "focus": false, "FocusEvent": false, "FontFace": false, "FormData": false, "frameElement": false, "frames": false, "GainNode": false, "Gamepad": false, "GamepadButton": false, "GamepadEvent": false, "getComputedStyle": false, "getSelection": false, "HashChangeEvent": false, "Headers": false, "history": false, "History": false, "HTMLAllCollection": false, "HTMLAnchorElement": false, "HTMLAppletElement": false, "HTMLAreaElement": false, "HTMLAudioElement": false, "HTMLBaseElement": false, "HTMLBlockquoteElement": false, "HTMLBodyElement": false, "HTMLBRElement": false, "HTMLButtonElement": false, "HTMLCanvasElement": false, "HTMLCollection": false, "HTMLContentElement": false, "HTMLDataListElement": false, "HTMLDetailsElement": false, "HTMLDialogElement": false, "HTMLDirectoryElement": false, "HTMLDivElement": false, "HTMLDListElement": false, "HTMLDocument": false, "HTMLElement": false, "HTMLEmbedElement": false, "HTMLFieldSetElement": false, "HTMLFontElement": false, "HTMLFormControlsCollection": false, "HTMLFormElement": false, "HTMLFrameElement": false, "HTMLFrameSetElement": false, "HTMLHeadElement": false, "HTMLHeadingElement": false, "HTMLHRElement": false, "HTMLHtmlElement": false, "HTMLIFrameElement": false, "HTMLImageElement": false, "HTMLInputElement": false, "HTMLIsIndexElement": false, "HTMLKeygenElement": false, "HTMLLabelElement": false, "HTMLLayerElement": false, "HTMLLegendElement": false, "HTMLLIElement": false, "HTMLLinkElement": false, "HTMLMapElement": false, "HTMLMarqueeElement": false, "HTMLMediaElement": false, "HTMLMenuElement": false, "HTMLMetaElement": false, "HTMLMeterElement": false, "HTMLModElement": false, "HTMLObjectElement": false, "HTMLOListElement": false, "HTMLOptGroupElement": false, "HTMLOptionElement": false, "HTMLOptionsCollection": false, "HTMLOutputElement": false, "HTMLParagraphElement": false, "HTMLParamElement": false, "HTMLPictureElement": false, "HTMLPreElement": false, "HTMLProgressElement": false, "HTMLQuoteElement": false, "HTMLScriptElement": false, "HTMLSelectElement": false, "HTMLShadowElement": false, "HTMLSourceElement": false, "HTMLSpanElement": false, "HTMLStyleElement": false, "HTMLTableCaptionElement": false, "HTMLTableCellElement": false, "HTMLTableColElement": false, "HTMLTableElement": false, "HTMLTableRowElement": false, "HTMLTableSectionElement": false, "HTMLTemplateElement": false, "HTMLTextAreaElement": false, "HTMLTitleElement": false, "HTMLTrackElement": false, "HTMLUListElement": false, "HTMLUnknownElement": false, "HTMLVideoElement": false, "IDBCursor": false, "IDBCursorWithValue": false, "IDBDatabase": false, "IDBEnvironment": false, "IDBFactory": false, "IDBIndex": false, "IDBKeyRange": false, "IDBObjectStore": false, "IDBOpenDBRequest": false, "IDBRequest": false, "IDBTransaction": false, "IDBVersionChangeEvent": false, "Image": false, "ImageBitmap": false, "ImageData": false, "indexedDB": false, "innerHeight": false, "innerWidth": false, "InputEvent": false, "InputMethodContext": false, "IntersectionObserver": false, "IntersectionObserverEntry": false, "Intl": false, "KeyboardEvent": false, "KeyframeEffect": false, "KeyframeEffectReadOnly": false, "length": false, "localStorage": false, "location": false, "Location": false, "locationbar": false, "matchMedia": false, "MediaElementAudioSourceNode": false, "MediaEncryptedEvent": false, "MediaError": false, "MediaKeyError": false, "MediaKeyEvent": false, "MediaKeyMessageEvent": false, "MediaKeys": false, "MediaKeySession": false, "MediaKeyStatusMap": false, "MediaKeySystemAccess": false, "MediaList": false, "MediaQueryList": false, "MediaQueryListEvent": false, "MediaSource": false, "MediaRecorder": false, "MediaStream": false, "MediaStreamAudioDestinationNode": false, "MediaStreamAudioSourceNode": false, "MediaStreamEvent": false, "MediaStreamTrack": false, "menubar": false, "MessageChannel": false, "MessageEvent": false, "MessagePort": false, "MIDIAccess": false, "MIDIConnectionEvent": false, "MIDIInput": false, "MIDIInputMap": false, "MIDIMessageEvent": false, "MIDIOutput": false, "MIDIOutputMap": false, "MIDIPort": false, "MimeType": false, "MimeTypeArray": false, "MouseEvent": false, "moveBy": false, "moveTo": false, "MutationEvent": false, "MutationObserver": false, "MutationRecord": false, "name": false, "NamedNodeMap": false, "navigator": false, "Navigator": false, "Node": false, "NodeFilter": false, "NodeIterator": false, "NodeList": false, "Notification": false, "OfflineAudioCompletionEvent": false, "OfflineAudioContext": false, "offscreenBuffering": false, "onbeforeunload": true, "onblur": true, "onerror": true, "onfocus": true, "onload": true, "onresize": true, "onunload": true, "open": false, "openDatabase": false, "opener": false, "opera": false, "Option": false, "OscillatorNode": false, "outerHeight": false, "outerWidth": false, "PageTransitionEvent": false, "pageXOffset": false, "pageYOffset": false, "parent": false, "PasswordCredential": false, "Path2D": false, "performance": false, "Performance": false, "PerformanceEntry": false, "PerformanceMark": false, "PerformanceMeasure": false, "PerformanceNavigation": false, "PerformanceResourceTiming": false, "PerformanceTiming": false, "PeriodicWave": false, "Permissions": false, "PermissionStatus": false, "personalbar": false, "Plugin": false, "PluginArray": false, "PopStateEvent": false, "postMessage": false, "print": false, "ProcessingInstruction": false, "ProgressEvent": false, "PromiseRejectionEvent": false, "prompt": false, "PushManager": false, "PushSubscription": false, "RadioNodeList": false, "Range": false, "ReadableByteStream": false, "ReadableStream": false, "removeEventListener": false, "Request": false, "requestAnimationFrame": false, "requestIdleCallback": false, "resizeBy": false, "resizeTo": false, "Response": false, "RTCIceCandidate": false, "RTCSessionDescription": false, "RTCPeerConnection": false, "screen": false, "Screen": false, "screenLeft": false, "ScreenOrientation": false, "screenTop": false, "screenX": false, "screenY": false, "ScriptProcessorNode": false, "scroll": false, "scrollbars": false, "scrollBy": false, "scrollTo": false, "scrollX": false, "scrollY": false, "SecurityPolicyViolationEvent": false, "Selection": false, "self": false, "ServiceWorker": false, "ServiceWorkerContainer": false, "ServiceWorkerRegistration": false, "sessionStorage": false, "setInterval": false, "setTimeout": false, "ShadowRoot": false, "SharedKeyframeList": false, "SharedWorker": false, "showModalDialog": false, "SiteBoundCredential": false, "speechSynthesis": false, "SpeechSynthesisEvent": false, "SpeechSynthesisUtterance": false, "status": false, "statusbar": false, "stop": false, "Storage": false, "StorageEvent": false, "styleMedia": false, "StyleSheet": false, "StyleSheetList": false, "SubtleCrypto": false, "SVGAElement": false, "SVGAltGlyphDefElement": false, "SVGAltGlyphElement": false, "SVGAltGlyphItemElement": false, "SVGAngle": false, "SVGAnimateColorElement": false, "SVGAnimatedAngle": false, "SVGAnimatedBoolean": false, "SVGAnimatedEnumeration": false, "SVGAnimatedInteger": false, "SVGAnimatedLength": false, "SVGAnimatedLengthList": false, "SVGAnimatedNumber": false, "SVGAnimatedNumberList": false, "SVGAnimatedPathData": false, "SVGAnimatedPoints": false, "SVGAnimatedPreserveAspectRatio": false, "SVGAnimatedRect": false, "SVGAnimatedString": false, "SVGAnimatedTransformList": false, "SVGAnimateElement": false, "SVGAnimateMotionElement": false, "SVGAnimateTransformElement": false, "SVGAnimationElement": false, "SVGCircleElement": false, "SVGClipPathElement": false, "SVGColor": false, "SVGColorProfileElement": false, "SVGColorProfileRule": false, "SVGComponentTransferFunctionElement": false, "SVGCSSRule": false, "SVGCursorElement": false, "SVGDefsElement": false, "SVGDescElement": false, "SVGDiscardElement": false, "SVGDocument": false, "SVGElement": false, "SVGElementInstance": false, "SVGElementInstanceList": false, "SVGEllipseElement": false, "SVGEvent": false, "SVGExternalResourcesRequired": false, "SVGFEBlendElement": false, "SVGFEColorMatrixElement": false, "SVGFEComponentTransferElement": false, "SVGFECompositeElement": false, "SVGFEConvolveMatrixElement": false, "SVGFEDiffuseLightingElement": false, "SVGFEDisplacementMapElement": false, "SVGFEDistantLightElement": false, "SVGFEDropShadowElement": false, "SVGFEFloodElement": false, "SVGFEFuncAElement": false, "SVGFEFuncBElement": false, "SVGFEFuncGElement": false, "SVGFEFuncRElement": false, "SVGFEGaussianBlurElement": false, "SVGFEImageElement": false, "SVGFEMergeElement": false, "SVGFEMergeNodeElement": false, "SVGFEMorphologyElement": false, "SVGFEOffsetElement": false, "SVGFEPointLightElement": false, "SVGFESpecularLightingElement": false, "SVGFESpotLightElement": false, "SVGFETileElement": false, "SVGFETurbulenceElement": false, "SVGFilterElement": false, "SVGFilterPrimitiveStandardAttributes": false, "SVGFitToViewBox": false, "SVGFontElement": false, "SVGFontFaceElement": false, "SVGFontFaceFormatElement": false, "SVGFontFaceNameElement": false, "SVGFontFaceSrcElement": false, "SVGFontFaceUriElement": false, "SVGForeignObjectElement": false, "SVGGElement": false, "SVGGeometryElement": false, "SVGGlyphElement": false, "SVGGlyphRefElement": false, "SVGGradientElement": false, "SVGGraphicsElement": false, "SVGHKernElement": false, "SVGICCColor": false, "SVGImageElement": false, "SVGLangSpace": false, "SVGLength": false, "SVGLengthList": false, "SVGLinearGradientElement": false, "SVGLineElement": false, "SVGLocatable": false, "SVGMarkerElement": false, "SVGMaskElement": false, "SVGMatrix": false, "SVGMetadataElement": false, "SVGMissingGlyphElement": false, "SVGMPathElement": false, "SVGNumber": false, "SVGNumberList": false, "SVGPaint": false, "SVGPathElement": false, "SVGPathSeg": false, "SVGPathSegArcAbs": false, "SVGPathSegArcRel": false, "SVGPathSegClosePath": false, "SVGPathSegCurvetoCubicAbs": false, "SVGPathSegCurvetoCubicRel": false, "SVGPathSegCurvetoCubicSmoothAbs": false, "SVGPathSegCurvetoCubicSmoothRel": false, "SVGPathSegCurvetoQuadraticAbs": false, "SVGPathSegCurvetoQuadraticRel": false, "SVGPathSegCurvetoQuadraticSmoothAbs": false, "SVGPathSegCurvetoQuadraticSmoothRel": false, "SVGPathSegLinetoAbs": false, "SVGPathSegLinetoHorizontalAbs": false, "SVGPathSegLinetoHorizontalRel": false, "SVGPathSegLinetoRel": false, "SVGPathSegLinetoVerticalAbs": false, "SVGPathSegLinetoVerticalRel": false, "SVGPathSegList": false, "SVGPathSegMovetoAbs": false, "SVGPathSegMovetoRel": false, "SVGPatternElement": false, "SVGPoint": false, "SVGPointList": false, "SVGPolygonElement": false, "SVGPolylineElement": false, "SVGPreserveAspectRatio": false, "SVGRadialGradientElement": false, "SVGRect": false, "SVGRectElement": false, "SVGRenderingIntent": false, "SVGScriptElement": false, "SVGSetElement": false, "SVGStopElement": false, "SVGStringList": false, "SVGStylable": false, "SVGStyleElement": false, "SVGSVGElement": false, "SVGSwitchElement": false, "SVGSymbolElement": false, "SVGTests": false, "SVGTextContentElement": false, "SVGTextElement": false, "SVGTextPathElement": false, "SVGTextPositioningElement": false, "SVGTitleElement": false, "SVGTransform": false, "SVGTransformable": false, "SVGTransformList": false, "SVGTRefElement": false, "SVGTSpanElement": false, "SVGUnitTypes": false, "SVGURIReference": false, "SVGUseElement": false, "SVGViewElement": false, "SVGViewSpec": false, "SVGVKernElement": false, "SVGZoomAndPan": false, "SVGZoomEvent": false, "Text": false, "TextDecoder": false, "TextEncoder": false, "TextEvent": false, "TextMetrics": false, "TextTrack": false, "TextTrackCue": false, "TextTrackCueList": false, "TextTrackList": false, "TimeEvent": false, "TimeRanges": false, "toolbar": false, "top": false, "Touch": false, "TouchEvent": false, "TouchList": false, "TrackEvent": false, "TransitionEvent": false, "TreeWalker": false, "UIEvent": false, "URL": false, "URLSearchParams": false, "ValidityState": false, "VTTCue": false, "WaveShaperNode": false, "WebGLActiveInfo": false, "WebGLBuffer": false, "WebGLContextEvent": false, "WebGLFramebuffer": false, "WebGLProgram": false, "WebGLRenderbuffer": false, "WebGLRenderingContext": false, "WebGLShader": false, "WebGLShaderPrecisionFormat": false, "WebGLTexture": false, "WebGLUniformLocation": false, "WebSocket": false, "WheelEvent": false, "window": false, "Window": false, "Worker": false, "XDomainRequest": false, "XMLDocument": false, "XMLHttpRequest": false, "XMLHttpRequestEventTarget": false, "XMLHttpRequestProgressEvent": false, "XMLHttpRequestUpload": false, "XMLSerializer": false, "XPathEvaluator": false, "XPathException": false, "XPathExpression": false, "XPathNamespace": false, "XPathNSResolver": false, "XPathResult": false, "XSLTProcessor": false }, "worker": { "applicationCache": false, "atob": false, "Blob": false, "BroadcastChannel": false, "btoa": false, "Cache": false, "caches": false, "clearInterval": false, "clearTimeout": false, "close": true, "console": false, "fetch": false, "FileReaderSync": false, "FormData": false, "Headers": false, "IDBCursor": false, "IDBCursorWithValue": false, "IDBDatabase": false, "IDBFactory": false, "IDBIndex": false, "IDBKeyRange": false, "IDBObjectStore": false, "IDBOpenDBRequest": false, "IDBRequest": false, "IDBTransaction": false, "IDBVersionChangeEvent": false, "ImageData": false, "importScripts": true, "indexedDB": false, "location": false, "MessageChannel": false, "MessagePort": false, "name": false, "navigator": false, "Notification": false, "onclose": true, "onconnect": true, "onerror": true, "onlanguagechange": true, "onmessage": true, "onoffline": true, "ononline": true, "onrejectionhandled": true, "onunhandledrejection": true, "performance": false, "Performance": false, "PerformanceEntry": false, "PerformanceMark": false, "PerformanceMeasure": false, "PerformanceNavigation": false, "PerformanceResourceTiming": false, "PerformanceTiming": false, "postMessage": true, "Promise": false, "Request": false, "Response": false, "self": true, "ServiceWorkerRegistration": false, "setInterval": false, "setTimeout": false, "TextDecoder": false, "TextEncoder": false, "URL": false, "URLSearchParams": false, "WebSocket": false, "Worker": false, "XMLHttpRequest": false }, "node": { "__dirname": false, "__filename": false, "arguments": false, "Buffer": false, "clearImmediate": false, "clearInterval": false, "clearTimeout": false, "console": false, "exports": true, "GLOBAL": false, "global": false, "Intl": false, "module": false, "process": false, "require": false, "root": false, "setImmediate": false, "setInterval": false, "setTimeout": false }, "commonjs": { "exports": true, "module": false, "require": false, "global": false }, "amd": { "define": false, "require": false }, "mocha": { "after": false, "afterEach": false, "before": false, "beforeEach": false, "context": false, "describe": false, "it": false, "mocha": false, "run": false, "setup": false, "specify": false, "suite": false, "suiteSetup": false, "suiteTeardown": false, "teardown": false, "test": false, "xcontext": false, "xdescribe": false, "xit": false, "xspecify": false }, "jasmine": { "afterAll": false, "afterEach": false, "beforeAll": false, "beforeEach": false, "describe": false, "expect": false, "fail": false, "fdescribe": false, "fit": false, "it": false, "jasmine": false, "pending": false, "runs": false, "spyOn": false, "spyOnProperty": false, "waits": false, "waitsFor": false, "xdescribe": false, "xit": false }, "jest": { "afterAll": false, "afterEach": false, "beforeAll": false, "beforeEach": false, "check": false, "describe": false, "expect": false, "gen": false, "it": false, "fdescribe": false, "fit": false, "jest": false, "pit": false, "require": false, "test": false, "xdescribe": false, "xit": false, "xtest": false }, "qunit": { "asyncTest": false, "deepEqual": false, "equal": false, "expect": false, "module": false, "notDeepEqual": false, "notEqual": false, "notOk": false, "notPropEqual": false, "notStrictEqual": false, "ok": false, "propEqual": false, "QUnit": false, "raises": false, "start": false, "stop": false, "strictEqual": false, "test": false, "throws": false }, "phantomjs": { "console": true, "exports": true, "phantom": true, "require": true, "WebPage": true }, "couch": { "emit": false, "exports": false, "getRow": false, "log": false, "module": false, "provides": false, "require": false, "respond": false, "send": false, "start": false, "sum": false }, "rhino": { "defineClass": false, "deserialize": false, "gc": false, "help": false, "importClass": false, "importPackage": false, "java": false, "load": false, "loadClass": false, "Packages": false, "print": false, "quit": false, "readFile": false, "readUrl": false, "runCommand": false, "seal": false, "serialize": false, "spawn": false, "sync": false, "toint32": false, "version": false }, "nashorn": { "__DIR__": false, "__FILE__": false, "__LINE__": false, "com": false, "edu": false, "exit": false, "Java": false, "java": false, "javafx": false, "JavaImporter": false, "javax": false, "JSAdapter": false, "load": false, "loadWithNewGlobal": false, "org": false, "Packages": false, "print": false, "quit": false }, "wsh": { "ActiveXObject": true, "Enumerator": true, "GetObject": true, "ScriptEngine": true, "ScriptEngineBuildVersion": true, "ScriptEngineMajorVersion": true, "ScriptEngineMinorVersion": true, "VBArray": true, "WScript": true, "WSH": true, "XDomainRequest": true }, "jquery": { "$": false, "jQuery": false }, "yui": { "Y": false, "YUI": false, "YUI_config": false }, "shelljs": { "cat": false, "cd": false, "chmod": false, "config": false, "cp": false, "dirs": false, "echo": false, "env": false, "error": false, "exec": false, "exit": false, "find": false, "grep": false, "ls": false, "ln": false, "mkdir": false, "mv": false, "popd": false, "pushd": false, "pwd": false, "rm": false, "sed": false, "set": false, "target": false, "tempdir": false, "test": false, "touch": false, "which": false }, "prototypejs": { "$": false, "$$": false, "$A": false, "$break": false, "$continue": false, "$F": false, "$H": false, "$R": false, "$w": false, "Abstract": false, "Ajax": false, "Autocompleter": false, "Builder": false, "Class": false, "Control": false, "Draggable": false, "Draggables": false, "Droppables": false, "Effect": false, "Element": false, "Enumerable": false, "Event": false, "Field": false, "Form": false, "Hash": false, "Insertion": false, "ObjectRange": false, "PeriodicalExecuter": false, "Position": false, "Prototype": false, "Scriptaculous": false, "Selector": false, "Sortable": false, "SortableObserver": false, "Sound": false, "Template": false, "Toggle": false, "Try": false }, "meteor": { "$": false, "_": false, "Accounts": false, "AccountsClient": false, "AccountsServer": false, "AccountsCommon": false, "App": false, "Assets": false, "Blaze": false, "check": false, "Cordova": false, "DDP": false, "DDPServer": false, "DDPRateLimiter": false, "Deps": false, "EJSON": false, "Email": false, "HTTP": false, "Log": false, "Match": false, "Meteor": false, "Mongo": false, "MongoInternals": false, "Npm": false, "Package": false, "Plugin": false, "process": false, "Random": false, "ReactiveDict": false, "ReactiveVar": false, "Router": false, "ServiceConfiguration": false, "Session": false, "share": false, "Spacebars": false, "Template": false, "Tinytest": false, "Tracker": false, "UI": false, "Utils": false, "WebApp": false, "WebAppInternals": false }, "mongo": { "_isWindows": false, "_rand": false, "BulkWriteResult": false, "cat": false, "cd": false, "connect": false, "db": false, "getHostName": false, "getMemInfo": false, "hostname": false, "ISODate": false, "listFiles": false, "load": false, "ls": false, "md5sumFile": false, "mkdir": false, "Mongo": false, "NumberInt": false, "NumberLong": false, "ObjectId": false, "PlanCache": false, "print": false, "printjson": false, "pwd": false, "quit": false, "removeFile": false, "rs": false, "sh": false, "UUID": false, "version": false, "WriteResult": false }, "applescript": { "$": false, "Application": false, "Automation": false, "console": false, "delay": false, "Library": false, "ObjC": false, "ObjectSpecifier": false, "Path": false, "Progress": false, "Ref": false }, "serviceworker": { "caches": false, "Cache": false, "CacheStorage": false, "Client": false, "clients": false, "Clients": false, "ExtendableEvent": false, "ExtendableMessageEvent": false, "FetchEvent": false, "importScripts": false, "registration": false, "self": false, "ServiceWorker": false, "ServiceWorkerContainer": false, "ServiceWorkerGlobalScope": false, "ServiceWorkerMessageEvent": false, "ServiceWorkerRegistration": false, "skipWaiting": false, "WindowClient": false }, "atomtest": { "advanceClock": false, "fakeClearInterval": false, "fakeClearTimeout": false, "fakeSetInterval": false, "fakeSetTimeout": false, "resetTimeouts": false, "waitsForPromise": false }, "embertest": { "andThen": false, "click": false, "currentPath": false, "currentRouteName": false, "currentURL": false, "fillIn": false, "find": false, "findWithAssert": false, "keyEvent": false, "pauseTest": false, "resumeTest": false, "triggerEvent": false, "visit": false }, "protractor": { "$": false, "$$": false, "browser": false, "By": false, "by": false, "DartObject": false, "element": false, "protractor": false }, "shared-node-browser": { "clearInterval": false, "clearTimeout": false, "console": false, "setInterval": false, "setTimeout": false }, "webextensions": { "browser": false, "chrome": false, "opr": false }, "greasemonkey": { "GM_addStyle": false, "GM_deleteValue": false, "GM_getResourceText": false, "GM_getResourceURL": false, "GM_getValue": false, "GM_info": false, "GM_listValues": false, "GM_log": false, "GM_openInTab": false, "GM_registerMenuCommand": false, "GM_setClipboard": false, "GM_setValue": false, "GM_xmlhttpRequest": false, "unsafeWindow": false } }; }); $__System.registerDynamic('151', ['150'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; module.exports = $__require('150'); }); $__System.registerDynamic("152", ["15", "d4", "cf", "1d", "17", "a5", "5c", "145", "d0", "d6", "f", "146", "151", "11", "153", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _keys = $__require("15"); var _keys2 = _interopRequireDefault(_keys); var _create = $__require("d4"); var _create2 = _interopRequireDefault(_create); var _map = $__require("cf"); var _map2 = _interopRequireDefault(_map); var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _includes = $__require("a5"); var _includes2 = _interopRequireDefault(_includes); var _repeat = $__require("5c"); var _repeat2 = _interopRequireDefault(_repeat); var _renamer = $__require("145"); var _renamer2 = _interopRequireDefault(_renamer); var _index = $__require("d0"); var _index2 = _interopRequireDefault(_index); var _defaults = $__require("d6"); var _defaults2 = _interopRequireDefault(_defaults); var _babelMessages = $__require("f"); var messages = _interopRequireWildcard(_babelMessages); var _binding2 = $__require("146"); var _binding3 = _interopRequireDefault(_binding2); var _globals = $__require("151"); var _globals2 = _interopRequireDefault(_globals); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); var _cache = $__require("153"); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _crawlCallsCount = 0; function getCache(path, parentScope, self) { var scopes = _cache.scope.get(path.node) || []; for (var _iterator = scopes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 scope = _ref; if (scope.parent === parentScope && scope.path === path) return scope; } scopes.push(self); if (!_cache.scope.has(path.node)) { _cache.scope.set(path.node, scopes); } } function gatherNodeParts(node, parts) { if (t.isModuleDeclaration(node)) { if (node.source) { gatherNodeParts(node.source, parts); } else if (node.specifiers && node.specifiers.length) { for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var specifier = _ref2; 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 _iterator3 = node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var prop = _ref3; gatherNodeParts(prop.key || prop.argument, parts); } } } var collectorVisitor = { For: function For(path) { for (var _iterator4 = t.FOR_INIT_KEYS, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { var _ref4; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref4 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref4 = _i4.value; } var key = _ref4; var declar = path.get(key); if (declar.isVar()) path.scope.getFunctionParent().registerBinding("var", declar); } }, Declaration: function Declaration(path) { if (path.isBlockScoped()) return; if (path.isExportDeclaration() && path.get("declaration").isDeclaration()) return; path.scope.getFunctionParent().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(left); } }, 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 _iterator5 = declar.declarations, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { var _ref5; if (_isArray5) { if (_i5 >= _iterator5.length) break; _ref5 = _iterator5[_i5++]; } else { _i5 = _iterator5.next(); if (_i5.done) break; _ref5 = _i5.value; } var decl = _ref5; var ids = t.getBindingIdentifiers(decl); for (var name in ids) { var _binding = scope.getBinding(name); if (_binding) _binding.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.get("argument")); }, UnaryExpression: function UnaryExpression(path, state) { if (path.node.operator === "delete") { state.constantViolations.push(path.get("argument")); } }, 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 _iterator6 = paths, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) { var _ref6; if (_isArray6) { if (_i6 >= _iterator6.length) break; _ref6 = _iterator6[_i6++]; } else { _i6 = _iterator6.next(); if (_i6.done) break; _ref6 = _i6.value; } var bodyPath = _ref6; if (bodyPath.isFunctionDeclaration()) { path.scope.getBlockParent().registerDeclaration(bodyPath); } } } }; var uid = 0; var Scope = function () { function Scope(path, parentScope) { (0, _classCallCheck3.default)(this, Scope); if (parentScope && parentScope.block === path.node) { return parentScope; } var cached = getCache(path, parentScope, this); if (cached) return cached; this.uid = uid++; this.parent = parentScope; this.hub = path.hub; this.parentBlock = path.parent; this.block = path.node; this.path = path; this.labels = new _map2.default(); } Scope.prototype.traverse = function traverse(node, opts, state) { (0, _index2.default)(node, opts, this, state, this.path); }; Scope.prototype.generateDeclaredUidIdentifier = function generateDeclaredUidIdentifier() { var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; var id = this.generateUidIdentifier(name); this.push({ id: id }); return id; }; Scope.prototype.generateUidIdentifier = function generateUidIdentifier() { var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; return t.identifier(this.generateUid(name)); }; Scope.prototype.generateUid = function generateUid() { var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp"; name = t.toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, ""); var uid = void 0; 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; }; Scope.prototype._generateUid = function _generateUid(name, i) { var id = name; if (i > 1) id += i; return "_" + id; }; Scope.prototype.generateUidIdentifierBasedOnNode = function generateUidIdentifierBasedOnNode(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.generateUidIdentifier(id.slice(0, 20)); }; Scope.prototype.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; }; Scope.prototype.maybeGenerateMemoised = function maybeGenerateMemoised(node, dontPush) { if (this.isStatic(node)) { return null; } else { var _id2 = this.generateUidIdentifierBasedOnNode(node); if (!dontPush) this.push({ id: _id2 }); return _id2; } }; Scope.prototype.checkBlockScopedCollisions = function checkBlockScopedCollisions(local, kind, name, id) { if (kind === "param") 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, messages.get("scopeDuplicateDeclaration", name), TypeError); } }; Scope.prototype.rename = function rename(oldName, newName, block) { var binding = this.getBinding(oldName); if (binding) { newName = newName || this.generateUidIdentifier(oldName).name; return new _renamer2.default(binding, oldName, newName).rename(block); } }; Scope.prototype._renameFromMap = function _renameFromMap(map, oldName, newName, value) { if (map[oldName]) { map[newName] = value; map[oldName] = null; } }; Scope.prototype.dump = function dump() { var sep = (0, _repeat2.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); }; Scope.prototype.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 = "toArray"; var args = [node]; if (i === true) { helperName = "toConsumableArray"; } else if (i) { args.push(t.numericLiteral(i)); helperName = "slicedToArray"; } return t.callExpression(file.addHelper(helperName), args); }; Scope.prototype.hasLabel = function hasLabel(name) { return !!this.getLabel(name); }; Scope.prototype.getLabel = function getLabel(name) { return this.labels.get(name); }; Scope.prototype.registerLabel = function registerLabel(path) { this.labels.set(path.node.label.name, path); }; Scope.prototype.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 _iterator7 = declarations, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) { var _ref7; if (_isArray7) { if (_i7 >= _iterator7.length) break; _ref7 = _iterator7[_i7++]; } else { _i7 = _iterator7.next(); if (_i7.done) break; _ref7 = _i7.value; } var declar = _ref7; 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 _iterator8 = specifiers, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3.default)(_iterator8);;) { var _ref8; if (_isArray8) { if (_i8 >= _iterator8.length) break; _ref8 = _iterator8[_i8++]; } else { _i8 = _iterator8.next(); if (_i8.done) break; _ref8 = _i8.value; } var specifier = _ref8; 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); } }; Scope.prototype.buildUndefinedNode = function buildUndefinedNode() { if (this.hasBinding("undefined")) { return t.unaryExpression("void", t.numericLiteral(0), true); } else { return t.identifier("undefined"); } }; Scope.prototype.registerConstantViolation = function registerConstantViolation(path) { var ids = path.getBindingIdentifiers(); for (var name in ids) { var binding = this.getBinding(name); if (binding) binding.reassign(path); } }; Scope.prototype.registerBinding = function registerBinding(kind, path) { var bindingPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : path; if (!kind) throw new ReferenceError("no `kind`"); if (path.isVariableDeclaration()) { var declarators = path.get("declarations"); for (var _iterator9 = declarators, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3.default)(_iterator9);;) { var _ref9; if (_isArray9) { if (_i9 >= _iterator9.length) break; _ref9 = _iterator9[_i9++]; } else { _i9 = _iterator9.next(); if (_i9.done) break; _ref9 = _i9.value; } var declar = _ref9; this.registerBinding(kind, declar); } return; } var parent = this.getProgramParent(); var ids = path.getBindingIdentifiers(true); for (var name in ids) { for (var _iterator10 = ids[name], _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, _getIterator3.default)(_iterator10);;) { var _ref10; if (_isArray10) { if (_i10 >= _iterator10.length) break; _ref10 = _iterator10[_i10++]; } else { _i10 = _iterator10.next(); if (_i10.done) break; _ref10 = _i10.value; } var _id3 = _ref10; var local = this.getOwnBinding(name); if (local) { if (local.identifier === _id3) continue; this.checkBlockScopedCollisions(local, kind, name, _id3); } if (local && local.path.isFlow()) local = null; parent.references[name] = true; this.bindings[name] = new _binding3.default({ identifier: _id3, existing: local, scope: this, path: bindingPath, kind: kind }); } } }; Scope.prototype.addGlobal = function addGlobal(node) { this.globals[node.name] = node; }; Scope.prototype.hasUid = function hasUid(name) { var scope = this; do { if (scope.uids[name]) return true; } while (scope = scope.parent); return false; }; Scope.prototype.hasGlobal = function hasGlobal(name) { var scope = this; do { if (scope.globals[name]) return true; } while (scope = scope.parent); return false; }; Scope.prototype.hasReference = function hasReference(name) { var scope = this; do { if (scope.references[name]) return true; } while (scope = scope.parent); return false; }; Scope.prototype.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 _iterator11 = node.body, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, _getIterator3.default)(_iterator11);;) { var _ref11; if (_isArray11) { if (_i11 >= _iterator11.length) break; _ref11 = _iterator11[_i11++]; } else { _i11 = _iterator11.next(); if (_i11.done) break; _ref11 = _i11.value; } var method = _ref11; 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 _iterator12 = node.elements, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, _getIterator3.default)(_iterator12);;) { var _ref12; if (_isArray12) { if (_i12 >= _iterator12.length) break; _ref12 = _iterator12[_i12++]; } else { _i12 = _iterator12.next(); if (_i12.done) break; _ref12 = _i12.value; } var elem = _ref12; if (!this.isPure(elem, constantsOnly)) return false; } return true; } else if (t.isObjectExpression(node)) { for (var _iterator13 = node.properties, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, _getIterator3.default)(_iterator13);;) { var _ref13; if (_isArray13) { if (_i13 >= _iterator13.length) break; _ref13 = _iterator13[_i13++]; } else { _i13 = _iterator13.next(); if (_i13.done) break; _ref13 = _i13.value; } var prop = _ref13; 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.isClassProperty(node) || t.isObjectProperty(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 { return t.isPureish(node); } }; Scope.prototype.setData = function setData(key, val) { return this.data[key] = val; }; Scope.prototype.getData = function getData(key) { var scope = this; do { var data = scope.data[key]; if (data != null) return data; } while (scope = scope.parent); }; Scope.prototype.removeData = function removeData(key) { var scope = this; do { var data = scope.data[key]; if (data != null) scope.data[key] = null; } while (scope = scope.parent); }; Scope.prototype.init = function init() { if (!this.references) this.crawl(); }; Scope.prototype.crawl = function crawl() { _crawlCallsCount++; this._crawl(); _crawlCallsCount--; }; Scope.prototype._crawl = function _crawl() { var path = this.path; this.references = (0, _create2.default)(null); this.bindings = (0, _create2.default)(null); this.globals = (0, _create2.default)(null); this.uids = (0, _create2.default)(null); this.data = (0, _create2.default)(null); if (path.isLoop()) { for (var _iterator14 = t.FOR_INIT_KEYS, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, _getIterator3.default)(_iterator14);;) { 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 : (0, _getIterator3.default)(_iterator15);;) { 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 : (0, _getIterator3.default)(_iterator16);;) { 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 : (0, _getIterator3.default)(_iterator17);;) { 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 : (0, _getIterator3.default)(_iterator18);;) { 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); } }; Scope.prototype.push = function push(opts) { var path = this.path; if (!path.isBlockStatement() && !path.isProgram()) { path = this.getBlockParent().path; } if (path.isSwitchStatement()) { path = this.getFunctionParent().path; } if (path.isLoop() || path.isCatchClause() || path.isFunction()) { t.ensureBlock(path.node); 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._generated = true; 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()); }; Scope.prototype.getProgramParent = function getProgramParent() { var scope = this; do { if (scope.path.isProgram()) { return scope; } } while (scope = scope.parent); throw new Error("We couldn't find a Function or Program..."); }; Scope.prototype.getFunctionParent = function getFunctionParent() { var scope = this; do { if (scope.path.isFunctionParent()) { return scope; } } while (scope = scope.parent); throw new Error("We couldn't find a Function or Program..."); }; Scope.prototype.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..."); }; Scope.prototype.getAllBindings = function getAllBindings() { var ids = (0, _create2.default)(null); var scope = this; do { (0, _defaults2.default)(ids, scope.bindings); scope = scope.parent; } while (scope); return ids; }; Scope.prototype.getAllBindingsOfKind = function getAllBindingsOfKind() { var ids = (0, _create2.default)(null); for (var _iterator19 = arguments, _isArray19 = Array.isArray(_iterator19), _i19 = 0, _iterator19 = _isArray19 ? _iterator19 : (0, _getIterator3.default)(_iterator19);;) { var _ref19; if (_isArray19) { if (_i19 >= _iterator19.length) break; _ref19 = _iterator19[_i19++]; } else { _i19 = _iterator19.next(); if (_i19.done) break; _ref19 = _i19.value; } var kind = _ref19; var scope = this; do { for (var name in scope.bindings) { var binding = scope.bindings[name]; if (binding.kind === kind) ids[name] = binding; } scope = scope.parent; } while (scope); } return ids; }; Scope.prototype.bindingIdentifierEquals = function bindingIdentifierEquals(name, node) { return this.getBindingIdentifier(name) === node; }; Scope.prototype.warnOnFlowBinding = function warnOnFlowBinding(binding) { if (_crawlCallsCount === 0 && binding && binding.path.isFlow()) { console.warn("\n You or one of the Babel plugins you are using are using Flow declarations as bindings.\n Support for this will be removed in version 7. To find out the caller, grep for this\n message and change it to a `console.trace()`.\n "); } return binding; }; Scope.prototype.getBinding = function getBinding(name) { var scope = this; do { var binding = scope.getOwnBinding(name); if (binding) return this.warnOnFlowBinding(binding); } while (scope = scope.parent); }; Scope.prototype.getOwnBinding = function getOwnBinding(name) { return this.warnOnFlowBinding(this.bindings[name]); }; Scope.prototype.getBindingIdentifier = function getBindingIdentifier(name) { var info = this.getBinding(name); return info && info.identifier; }; Scope.prototype.getOwnBindingIdentifier = function getOwnBindingIdentifier(name) { var binding = this.bindings[name]; return binding && binding.identifier; }; Scope.prototype.hasOwnBinding = function hasOwnBinding(name) { return !!this.getOwnBinding(name); }; Scope.prototype.hasBinding = function hasBinding(name, noGlobals) { if (!name) return false; if (this.hasOwnBinding(name)) return true; if (this.parentHasBinding(name, noGlobals)) return true; if (this.hasUid(name)) return true; if (!noGlobals && (0, _includes2.default)(Scope.globals, name)) return true; if (!noGlobals && (0, _includes2.default)(Scope.contextVariables, name)) return true; return false; }; Scope.prototype.parentHasBinding = function parentHasBinding(name, noGlobals) { return this.parent && this.parent.hasBinding(name, noGlobals); }; Scope.prototype.moveBindingTo = function moveBindingTo(name, scope) { var info = this.getBinding(name); if (info) { info.scope.removeOwnBinding(name); info.scope = scope; scope.bindings[name] = info; } }; Scope.prototype.removeOwnBinding = function removeOwnBinding(name) { delete this.bindings[name]; }; Scope.prototype.removeBinding = function removeBinding(name) { var info = this.getBinding(name); if (info) { info.scope.removeOwnBinding(name); } var scope = this; do { if (scope.uids[name]) { scope.uids[name] = false; } } while (scope = scope.parent); }; return Scope; }(); Scope.globals = (0, _keys2.default)(_globals2.default.builtin); Scope.contextVariables = ["arguments", "undefined", "Infinity", "NaN"]; exports.default = Scope; module.exports = exports["default"]; }); $__System.registerDynamic("154", ["17", "11", "155", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.findParent = findParent; exports.find = find; exports.getFunctionParent = getFunctionParent; exports.getStatementParent = getStatementParent; exports.getEarliestCommonAncestorFrom = getEarliestCommonAncestorFrom; exports.getDeepestCommonAncestorFrom = getDeepestCommonAncestorFrom; exports.getAncestry = getAncestry; exports.isAncestor = isAncestor; exports.isDescendant = isDescendant; exports.inType = inType; exports.inShadow = inShadow; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); var _index = $__require("155"); var _index2 = _interopRequireDefault(_index); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function findParent(callback) { var path = this; while (path = path.parentPath) { if (callback(path)) return path; } return null; } function find(callback) { var path = this; do { if (callback(path)) return path; } while (path = path.parentPath); return null; } function getFunctionParent() { return this.findParent(function (path) { return path.isFunction() || path.isProgram(); }); } function getStatementParent() { var path = this; do { if (Array.isArray(path.container)) { return path; } } while (path = path.parentPath); } function getEarliestCommonAncestorFrom(paths) { return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) { var earliest = void 0; var keys = t.VISITOR_KEYS[deepest.type]; for (var _iterator = ancestries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 ancestry = _ref; var path = ancestry[i + 1]; if (!earliest) { earliest = path; continue; } if (path.listKey && earliest.listKey === path.listKey) { if (path.key < earliest.key) { earliest = path; continue; } } var earliestKeyIndex = keys.indexOf(earliest.parentKey); var currentKeyIndex = keys.indexOf(path.parentKey); if (earliestKeyIndex > currentKeyIndex) { earliest = path; } } return earliest; }); } function getDeepestCommonAncestorFrom(paths, filter) { var _this = this; if (!paths.length) { return this; } if (paths.length === 1) { return paths[0]; } var minDepth = Infinity; var lastCommonIndex = void 0, lastCommon = void 0; var ancestries = paths.map(function (path) { var ancestry = []; do { ancestry.unshift(path); } while ((path = path.parentPath) && path !== _this); if (ancestry.length < minDepth) { minDepth = ancestry.length; } return ancestry; }); var first = ancestries[0]; depthLoop: for (var i = 0; i < minDepth; i++) { var shouldMatch = first[i]; for (var _iterator2 = ancestries, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var ancestry = _ref2; if (ancestry[i] !== shouldMatch) { break depthLoop; } } lastCommonIndex = i; lastCommon = shouldMatch; } if (lastCommon) { if (filter) { return filter(lastCommon, lastCommonIndex, ancestries); } else { return lastCommon; } } else { throw new Error("Couldn't find intersection"); } } function getAncestry() { var path = this; var paths = []; do { paths.push(path); } while (path = path.parentPath); return paths; } function isAncestor(maybeDescendant) { return maybeDescendant.isDescendant(this); } function isDescendant(maybeAncestor) { return !!this.findParent(function (parent) { return parent === maybeAncestor; }); } function inType() { var path = this; while (path) { for (var _iterator3 = arguments, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var type = _ref3; if (path.node.type === type) return true; } path = path.parentPath; } return false; } function inShadow(key) { var parentFn = this.isFunction() ? this : this.findParent(function (p) { return p.isFunction(); }); if (!parentFn) return; if (parentFn.isFunctionExpression() || parentFn.isFunctionDeclaration()) { var shadow = parentFn.node.shadow; if (shadow && (!key || shadow[key] !== false)) { return parentFn; } } else if (parentFn.isArrowFunctionExpression()) { return parentFn; } return null; } }); $__System.registerDynamic("156", ["17", "11", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.default = function (node) { if (!this.isReferenced()) return; var binding = this.scope.getBinding(node.name); if (binding) { if (binding.identifier.typeAnnotation) { return binding.identifier.typeAnnotation; } else { return getTypeAnnotationBindingConstantViolations(this, node.name); } } if (node.name === "undefined") { return t.voidTypeAnnotation(); } else if (node.name === "NaN" || node.name === "Infinity") { return t.numberTypeAnnotation(); } else if (node.name === "arguments") {} }; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function getTypeAnnotationBindingConstantViolations(path, name) { var binding = path.scope.getBinding(name); var types = []; path.typeAnnotation = t.unionTypeAnnotation(types); var functionConstantViolations = []; var constantViolations = getConstantViolationsBefore(binding, path, functionConstantViolations); var testType = getConditionalAnnotation(path, name); if (testType) { var testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement); constantViolations = constantViolations.filter(function (path) { return testConstantViolations.indexOf(path) < 0; }); types.push(testType.typeAnnotation); } if (constantViolations.length) { constantViolations = constantViolations.concat(functionConstantViolations); for (var _iterator = constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 violation = _ref; types.push(violation.getTypeAnnotation()); } } if (types.length) { return t.createUnionTypeAnnotation(types); } } function getConstantViolationsBefore(binding, path, functions) { var violations = binding.constantViolations.slice(); violations.unshift(binding.path); return violations.filter(function (violation) { violation = violation.resolve(); var status = violation._guessExecutionStatusRelativeTo(path); if (functions && status === "function") functions.push(violation); return status === "before"; }); } function inferAnnotationFromBinaryExpression(name, path) { var operator = path.node.operator; var right = path.get("right").resolve(); var left = path.get("left").resolve(); var target = void 0; if (left.isIdentifier({ name: name })) { target = right; } else if (right.isIdentifier({ name: name })) { target = left; } if (target) { if (operator === "===") { return target.getTypeAnnotation(); } else if (t.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) { return t.numberTypeAnnotation(); } else { return; } } else { if (operator !== "===") return; } var typeofPath = void 0; var typePath = void 0; if (left.isUnaryExpression({ operator: "typeof" })) { typeofPath = left; typePath = right; } else if (right.isUnaryExpression({ operator: "typeof" })) { typeofPath = right; typePath = left; } if (!typePath && !typeofPath) return; typePath = typePath.resolve(); if (!typePath.isLiteral()) return; var typeValue = typePath.node.value; if (typeof typeValue !== "string") return; if (!typeofPath.get("argument").isIdentifier({ name: name })) return; return t.createTypeAnnotationBasedOnTypeof(typePath.node.value); } function getParentConditionalPath(path) { var parentPath = void 0; while (parentPath = path.parentPath) { if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) { if (path.key === "test") { return; } else { return parentPath; } } else { path = parentPath; } } } function getConditionalAnnotation(path, name) { var ifStatement = getParentConditionalPath(path); if (!ifStatement) return; var test = ifStatement.get("test"); var paths = [test]; var types = []; do { var _path = paths.shift().resolve(); if (_path.isLogicalExpression()) { paths.push(_path.get("left")); paths.push(_path.get("right")); } if (_path.isBinaryExpression()) { var type = inferAnnotationFromBinaryExpression(name, _path); if (type) types.push(type); } } while (paths.length); if (types.length) { return { typeAnnotation: t.createUnionTypeAnnotation(types), ifStatement: ifStatement }; } else { return getConditionalAnnotation(ifStatement, name); } } module.exports = exports["default"]; }); $__System.registerDynamic("157", ["156", "11", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.ClassDeclaration = exports.ClassExpression = exports.FunctionDeclaration = exports.ArrowFunctionExpression = exports.FunctionExpression = exports.Identifier = undefined; var _infererReference = $__require("156"); Object.defineProperty(exports, "Identifier", { enumerable: true, get: function get() { return _interopRequireDefault(_infererReference).default; } }); exports.VariableDeclarator = VariableDeclarator; exports.TypeCastExpression = TypeCastExpression; exports.NewExpression = NewExpression; exports.TemplateLiteral = TemplateLiteral; exports.UnaryExpression = UnaryExpression; exports.BinaryExpression = BinaryExpression; exports.LogicalExpression = LogicalExpression; exports.ConditionalExpression = ConditionalExpression; exports.SequenceExpression = SequenceExpression; exports.AssignmentExpression = AssignmentExpression; exports.UpdateExpression = UpdateExpression; exports.StringLiteral = StringLiteral; exports.NumericLiteral = NumericLiteral; exports.BooleanLiteral = BooleanLiteral; exports.NullLiteral = NullLiteral; exports.RegExpLiteral = RegExpLiteral; exports.ObjectExpression = ObjectExpression; exports.ArrayExpression = ArrayExpression; exports.RestElement = RestElement; exports.CallExpression = CallExpression; exports.TaggedTemplateExpression = TaggedTemplateExpression; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function VariableDeclarator() { var id = this.get("id"); if (id.isIdentifier()) { return this.get("init").getTypeAnnotation(); } else { return; } } function TypeCastExpression(node) { return node.typeAnnotation; } TypeCastExpression.validParent = true; function NewExpression(node) { if (this.get("callee").isIdentifier()) { return t.genericTypeAnnotation(node.callee); } } function TemplateLiteral() { return t.stringTypeAnnotation(); } function UnaryExpression(node) { var operator = node.operator; if (operator === "void") { return t.voidTypeAnnotation(); } else if (t.NUMBER_UNARY_OPERATORS.indexOf(operator) >= 0) { return t.numberTypeAnnotation(); } else if (t.STRING_UNARY_OPERATORS.indexOf(operator) >= 0) { return t.stringTypeAnnotation(); } else if (t.BOOLEAN_UNARY_OPERATORS.indexOf(operator) >= 0) { return t.booleanTypeAnnotation(); } } function BinaryExpression(node) { var operator = node.operator; if (t.NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) { return t.numberTypeAnnotation(); } else if (t.BOOLEAN_BINARY_OPERATORS.indexOf(operator) >= 0) { return t.booleanTypeAnnotation(); } else if (operator === "+") { var right = this.get("right"); var left = this.get("left"); if (left.isBaseType("number") && right.isBaseType("number")) { return t.numberTypeAnnotation(); } else if (left.isBaseType("string") || right.isBaseType("string")) { return t.stringTypeAnnotation(); } return t.unionTypeAnnotation([t.stringTypeAnnotation(), t.numberTypeAnnotation()]); } } function LogicalExpression() { return t.createUnionTypeAnnotation([this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()]); } function ConditionalExpression() { return t.createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()]); } function SequenceExpression() { return this.get("expressions").pop().getTypeAnnotation(); } function AssignmentExpression() { return this.get("right").getTypeAnnotation(); } function UpdateExpression(node) { var operator = node.operator; if (operator === "++" || operator === "--") { return t.numberTypeAnnotation(); } } function StringLiteral() { return t.stringTypeAnnotation(); } function NumericLiteral() { return t.numberTypeAnnotation(); } function BooleanLiteral() { return t.booleanTypeAnnotation(); } function NullLiteral() { return t.nullLiteralTypeAnnotation(); } function RegExpLiteral() { return t.genericTypeAnnotation(t.identifier("RegExp")); } function ObjectExpression() { return t.genericTypeAnnotation(t.identifier("Object")); } function ArrayExpression() { return t.genericTypeAnnotation(t.identifier("Array")); } function RestElement() { return ArrayExpression(); } RestElement.validParent = true; function Func() { return t.genericTypeAnnotation(t.identifier("Function")); } exports.FunctionExpression = Func; exports.ArrowFunctionExpression = Func; exports.FunctionDeclaration = Func; exports.ClassExpression = Func; exports.ClassDeclaration = Func; function CallExpression() { return resolveCall(this.get("callee")); } function TaggedTemplateExpression() { return resolveCall(this.get("tag")); } function resolveCall(callee) { callee = callee.resolve(); if (callee.isFunction()) { if (callee.is("async")) { if (callee.is("generator")) { return t.genericTypeAnnotation(t.identifier("AsyncIterator")); } else { return t.genericTypeAnnotation(t.identifier("Promise")); } } else { if (callee.node.returnType) { return callee.node.returnType; } else {} } } } }); $__System.registerDynamic("158", ["17", "157", "11", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.getTypeAnnotation = getTypeAnnotation; exports._getTypeAnnotation = _getTypeAnnotation; exports.isBaseType = isBaseType; exports.couldBeBaseType = couldBeBaseType; exports.baseTypeStrictlyMatches = baseTypeStrictlyMatches; exports.isGenericType = isGenericType; var _inferers = $__require("157"); var inferers = _interopRequireWildcard(_inferers); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function getTypeAnnotation() { if (this.typeAnnotation) return this.typeAnnotation; var type = this._getTypeAnnotation() || t.anyTypeAnnotation(); if (t.isTypeAnnotation(type)) type = type.typeAnnotation; return this.typeAnnotation = type; } function _getTypeAnnotation() { var node = this.node; if (!node) { if (this.key === "init" && this.parentPath.isVariableDeclarator()) { var declar = this.parentPath.parentPath; var declarParent = declar.parentPath; if (declar.key === "left" && declarParent.isForInStatement()) { return t.stringTypeAnnotation(); } if (declar.key === "left" && declarParent.isForOfStatement()) { return t.anyTypeAnnotation(); } return t.voidTypeAnnotation(); } else { return; } } if (node.typeAnnotation) { return node.typeAnnotation; } var inferer = inferers[node.type]; if (inferer) { return inferer.call(this, node); } inferer = inferers[this.parentPath.type]; if (inferer && inferer.validParent) { return this.parentPath.getTypeAnnotation(); } } function isBaseType(baseName, soft) { return _isBaseType(baseName, this.getTypeAnnotation(), soft); } function _isBaseType(baseName, type, soft) { if (baseName === "string") { return t.isStringTypeAnnotation(type); } else if (baseName === "number") { return t.isNumberTypeAnnotation(type); } else if (baseName === "boolean") { return t.isBooleanTypeAnnotation(type); } else if (baseName === "any") { return t.isAnyTypeAnnotation(type); } else if (baseName === "mixed") { return t.isMixedTypeAnnotation(type); } else if (baseName === "empty") { return t.isEmptyTypeAnnotation(type); } else if (baseName === "void") { return t.isVoidTypeAnnotation(type); } else { if (soft) { return false; } else { throw new Error("Unknown base type " + baseName); } } } function couldBeBaseType(name) { var type = this.getTypeAnnotation(); if (t.isAnyTypeAnnotation(type)) return true; if (t.isUnionTypeAnnotation(type)) { for (var _iterator = type.types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 type2 = _ref; if (t.isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) { return true; } } return false; } else { return _isBaseType(name, type, true); } } function baseTypeStrictlyMatches(right) { var left = this.getTypeAnnotation(); right = right.getTypeAnnotation(); if (!t.isAnyTypeAnnotation(left) && t.isFlowBaseAnnotation(left)) { return right.type === left.type; } } function isGenericType(genericName) { var type = this.getTypeAnnotation(); return t.isGenericTypeAnnotation(type) && t.isIdentifier(type.id, { name: genericName }); } }); $__System.registerDynamic("159", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; // Copyright 2014, 2015, 2016, 2017 Simon Lydell // License: MIT. (See LICENSE.) Object.defineProperty(exports, "__esModule", { value: true }); // This regex comes from regex.coffee, and is inserted here by generate-index.js // (run `npm run build`). exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g; exports.matchToToken = function (match) { var token = { type: "invalid", value: match[0] }; if (match[1]) token.type = "string", token.closed = !!(match[3] || match[4]);else if (match[5]) token.type = "comment";else if (match[6]) token.type = "comment", token.closed = !!match[7];else if (match[8]) token.type = "regex";else if (match[9]) token.type = "number";else if (match[10]) token.type = "name";else if (match[11]) token.type = "punctuator";else if (match[12]) token.type = "whitespace"; return token; }; }); $__System.registerDynamic('15a', [], true, function ($__require, exports, module) { 'use strict'; var global = this || self, GLOBAL = global; var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; module.exports = function (str) { if (typeof str !== 'string') { throw new TypeError('Expected a string'); } return str.replace(matchOperatorsRe, '\\$&'); }; }); $__System.registerDynamic('15b', [], true, function ($__require, exports, module) { 'use strict'; var global = this || self, GLOBAL = global; function assembleStyles() { var styles = { modifiers: { reset: [0, 0], bold: [1, 22], // 21 isn't widely supported and 22 does the same thing dim: [2, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, colors: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], gray: [90, 39] }, bgColors: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49] } }; // fix humans styles.colors.grey = styles.colors.gray; Object.keys(styles).forEach(function (groupName) { var group = styles[groupName]; Object.keys(group).forEach(function (styleName) { var style = group[styleName]; styles[styleName] = group[styleName] = { open: '\u001b[' + style[0] + 'm', close: '\u001b[' + style[1] + 'm' }; }); Object.defineProperty(styles, groupName, { value: group, enumerable: false }); }); return styles; } module.exports = assembleStyles(); /* Object.defineProperty(module, 'exports', { enumerable: true, get: assembleStyles }); */ }); $__System.registerDynamic('15c', ['15d'], true, function ($__require, exports, module) { 'use strict'; var global = this || self, GLOBAL = global; var ansiRegex = $__require('15d')(); module.exports = function (str) { return typeof str === 'string' ? str.replace(ansiRegex, '') : str; }; }); $__System.registerDynamic('15d', [], true, function ($__require, exports, module) { 'use strict'; var global = this || self, GLOBAL = global; module.exports = function () { return (/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g ); }; }); $__System.registerDynamic('15e', ['15d'], true, function ($__require, exports, module) { 'use strict'; var global = this || self, GLOBAL = global; var ansiRegex = $__require('15d'); var re = new RegExp(ansiRegex().source); // remove the `g` flag module.exports = re.test.bind(re); }); $__System.registerDynamic('15f', ['c'], true, function ($__require, exports, module) { 'use strict'; var process = $__require('c'); var global = this || self, GLOBAL = global; var argv = process.argv; var terminator = argv.indexOf('--'); var hasFlag = function (flag) { flag = '--' + flag; var pos = argv.indexOf(flag); return pos !== -1 && (terminator !== -1 ? pos < terminator : true); }; module.exports = function () { if ('FORCE_COLOR' in process.env) { return true; } if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) { return false; } if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) { return true; } if (process.stdout && !process.stdout.isTTY) { return false; } if (process.platform === 'win32') { return true; } if ('COLORTERM' in process.env) { return true; } if (process.env.TERM === 'dumb') { return false; } if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { return true; } return false; }(); }); $__System.registerDynamic('160', ['15a', '15b', '15c', '15e', '15f', 'c'], true, function ($__require, exports, module) { 'use strict'; var process = $__require('c'); var global = this || self, GLOBAL = global; var escapeStringRegexp = $__require('15a'); var ansiStyles = $__require('15b'); var stripAnsi = $__require('15c'); var hasAnsi = $__require('15e'); var supportsColor = $__require('15f'); var defineProps = Object.defineProperties; var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM); function Chalk(options) { // detect mode if not set manually this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled; } // use bright blue on Windows as the normal blue color is illegible if (isSimpleWindowsTerm) { ansiStyles.blue.open = '\u001b[94m'; } var styles = function () { var ret = {}; Object.keys(ansiStyles).forEach(function (key) { ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); ret[key] = { get: function () { return build.call(this, this._styles.concat(key)); } }; }); return ret; }(); var proto = defineProps(function chalk() {}, styles); function build(_styles) { var builder = function () { return applyStyle.apply(builder, arguments); }; builder._styles = _styles; builder.enabled = this.enabled; // __proto__ is used because we must return a function, but there is // no way to create a function with a different prototype. /* eslint-disable no-proto */ builder.__proto__ = proto; return builder; } function applyStyle() { // support varags, but simply cast to string in case there's only one arg var args = arguments; var argsLen = args.length; var str = argsLen !== 0 && String(arguments[0]); if (argsLen > 1) { // don't slice `arguments`, it prevents v8 optimizations for (var a = 1; a < argsLen; a++) { str += ' ' + args[a]; } } if (!this.enabled || !str) { return str; } var nestedStyles = this._styles; var i = nestedStyles.length; // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, // see https://github.com/chalk/chalk/issues/58 // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. var originalDim = ansiStyles.dim.open; if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { ansiStyles.dim.open = ''; } while (i--) { var code = ansiStyles[nestedStyles[i]]; // Replace any instances already present with a re-opening code // otherwise only the part of the string until said closing code // will be colored, and the rest will simply be 'plain'. str = code.open + str.replace(code.closeRe, code.open) + code.close; } // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. ansiStyles.dim.open = originalDim; return str; } function init() { var ret = {}; Object.keys(styles).forEach(function (name) { ret[name] = { get: function () { return build.call(this, [name]); } }; }); return ret; } defineProps(Chalk.prototype, init()); module.exports = new Chalk(); module.exports.styles = ansiStyles; module.exports.hasColor = hasAnsi; module.exports.stripColor = stripAnsi; module.exports.supportsColor = supportsColor; }); $__System.registerDynamic("d5", ["159", "ff", "160"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (rawLines, lineNumber, colNumber) { var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; colNumber = Math.max(colNumber, 0); var highlighted = opts.highlightCode && _chalk2.default.supportsColor || opts.forceColor; var chalk = _chalk2.default; if (opts.forceColor) { chalk = new _chalk2.default.constructor({ enabled: true }); } var maybeHighlight = function maybeHighlight(chalkFn, string) { return highlighted ? chalkFn(string) : string; }; var defs = getDefs(chalk); if (highlighted) rawLines = highlight(defs, rawLines); var linesAbove = opts.linesAbove || 2; var linesBelow = opts.linesBelow || 3; var lines = rawLines.split(NEWLINE); var start = Math.max(lineNumber - (linesAbove + 1), 0); var end = Math.min(lines.length, lineNumber + linesBelow); if (!lineNumber && !colNumber) { start = 0; end = lines.length; } 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 + " | "; if (number === lineNumber) { var markerLine = ""; if (colNumber) { var markerSpacing = line.slice(0, colNumber - 1).replace(/[^\t]/g, " "); markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^")].join(""); } return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join(""); } else { return " " + maybeHighlight(defs.gutter, gutter) + line; } }).join("\n"); if (highlighted) { return chalk.reset(frame); } else { return frame; } }; var _jsTokens = $__require("159"); var _jsTokens2 = _interopRequireDefault(_jsTokens); var _esutils = $__require("ff"); var _esutils2 = _interopRequireDefault(_esutils); var _chalk = $__require("160"); var _chalk2 = _interopRequireDefault(_chalk); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function getDefs(chalk) { return { keyword: chalk.cyan, capitalized: chalk.yellow, jsx_tag: chalk.yellow, punctuator: chalk.yellow, number: chalk.magenta, string: chalk.green, regex: chalk.magenta, comment: chalk.grey, invalid: chalk.white.bgRed.bold, gutter: chalk.grey, marker: chalk.red.bold }; } var NEWLINE = /\r\n|[\n\r\u2028\u2029]/; var JSX_TAG = /^[a-z][\w-]*$/i; var BRACKET = /^[()\[\]{}]$/; function getTokenType(match) { var _match$slice = match.slice(-2), offset = _match$slice[0], text = _match$slice[1]; var token = (0, _jsTokens.matchToToken)(match); if (token.type === "name") { if (_esutils2.default.keyword.isReservedWordES6(token.value)) { return "keyword"; } if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var declar = _ref; if (declar.init) { exprs.push(t.expressionStatement(t.assignmentExpression("=", declar.id, declar.init))); } } path.replaceWithMultiple(exprs); } }; function replaceWithMultiple(nodes) { this.resync(); nodes = this._verifyNodeList(nodes); t.inheritLeadingComments(nodes[0], this.node); t.inheritTrailingComments(nodes[nodes.length - 1], this.node); this.node = this.container[this.key] = null; this.insertAfter(nodes); if (this.node) { this.requeue(); } else { this.remove(); } } function replaceWithSourceString(replacement) { this.resync(); try { replacement = "(" + replacement + ")"; replacement = (0, _babylon.parse)(replacement); } catch (err) { var loc = err.loc; if (loc) { err.message += " - make sure this is an expression."; err.message += "\n" + (0, _babelCodeFrame2.default)(replacement, loc.line, loc.column + 1); } throw err; } replacement = replacement.program.body[0].expression; _index2.default.removeProperties(replacement); return this.replaceWith(replacement); } function replaceWith(replacement) { this.resync(); if (this.removed) { throw new Error("You can't replace this node, we've already removed it"); } if (replacement instanceof _index4.default) { replacement = replacement.node; } if (!replacement) { throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead"); } if (this.node === replacement) { return; } if (this.isProgram() && !t.isProgram(replacement)) { throw new Error("You can only replace a Program root node with another Program node"); } if (Array.isArray(replacement)) { throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`"); } if (typeof replacement === "string") { throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`"); } if (this.isNodeType("Statement") && t.isExpression(replacement)) { if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) { replacement = t.expressionStatement(replacement); } } if (this.isNodeType("Expression") && t.isStatement(replacement)) { if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) { return this.replaceExpressionWithStatements([replacement]); } } var oldNode = this.node; if (oldNode) { t.inheritsComments(replacement, oldNode); t.removeComments(oldNode); } this._replaceWith(replacement); this.type = replacement.type; this.setScope(); this.requeue(); } function _replaceWith(node) { if (!this.container) { throw new ReferenceError("Container is falsy"); } if (this.inList) { t.validate(this.parent, this.key, [node]); } else { t.validate(this.parent, this.key, node); } this.debug(function () { return "Replace with " + (node && node.type); }); this.node = this.container[this.key] = node; } function replaceExpressionWithStatements(nodes) { this.resync(); var toSequenceExpression = t.toSequenceExpression(nodes, this.scope); if (t.isSequenceExpression(toSequenceExpression)) { var exprs = toSequenceExpression.expressions; if (exprs.length >= 2 && this.parentPath.isExpressionStatement()) { this._maybePopFromStatements(exprs); } if (exprs.length === 1) { this.replaceWith(exprs[0]); } else { this.replaceWith(toSequenceExpression); } } else if (toSequenceExpression) { this.replaceWith(toSequenceExpression); } else { var container = t.functionExpression(null, [], t.blockStatement(nodes)); container.shadow = true; this.replaceWith(t.callExpression(container, [])); this.traverse(hoistVariablesVisitor); var completionRecords = this.get("callee").getCompletionRecords(); for (var _iterator2 = completionRecords, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var path = _ref2; if (!path.isExpressionStatement()) continue; var loop = path.findParent(function (path) { return path.isLoop(); }); if (loop) { var uid = loop.getData("expressionReplacementReturnUid"); if (!uid) { var callee = this.get("callee"); uid = callee.scope.generateDeclaredUidIdentifier("ret"); callee.get("body").pushContainer("body", t.returnStatement(uid)); loop.setData("expressionReplacementReturnUid", uid); } else { uid = t.identifier(uid.name); } path.get("expression").replaceWith(t.assignmentExpression("=", uid, path.node.expression)); } else { path.replaceWith(t.returnStatement(path.node.expression)); } } return this.node; } } function replaceInline(nodes) { this.resync(); if (Array.isArray(nodes)) { if (Array.isArray(this.container)) { nodes = this._verifyNodeList(nodes); this._containerInsertAfter(nodes); return this.remove(); } else { return this.replaceWithMultiple(nodes); } } else { return this.replaceWith(nodes); } } }); $__System.registerDynamic('162', ['163', '37', '164', '165', '166', 'c'], true, function ($__require, exports, module) { 'use strict'; var process = $__require('c'); var global = this || self, GLOBAL = global; var global = $__require('163'), core = $__require('37'), dP = $__require('164'), DESCRIPTORS = $__require('165'), SPECIES = $__require('166')('species'); module.exports = function (KEY) { var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { configurable: true, get: function () { return this; } }); }; }); $__System.registerDynamic('167', ['164', '168', '169', '10c', '16a', '16b', '16c', '16d', '16e', '162', '165', '16f', 'c'], true, function ($__require, exports, module) { 'use strict'; var process = $__require('c'); var global = this || self, GLOBAL = global; var dP = $__require('164').f, create = $__require('168'), redefineAll = $__require('169'), ctx = $__require('10c'), anInstance = $__require('16a'), defined = $__require('16b'), forOf = $__require('16c'), $iterDefine = $__require('16d'), step = $__require('16e'), setSpecies = $__require('162'), DESCRIPTORS = $__require('165'), fastKey = $__require('16f').fastKey, SIZE = DESCRIPTORS ? '_s' : 'size'; var getEntry = function (that, key) { // fast case var index = fastKey(key), entry; if (index !== 'F') return that._i[index]; // frozen object case for (entry = that._f; entry; entry = entry.n) { if (entry.k == key) return entry; } }; module.exports = { getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { var C = wrapper(function (that, iterable) { anInstance(that, C, NAME, '_i'); that._i = create(null); // index that._f = undefined; // first entry that._l = undefined; // last entry that[SIZE] = 0; // size if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); }); redefineAll(C.prototype, { // 23.1.3.1 Map.prototype.clear() // 23.2.3.2 Set.prototype.clear() clear: function clear() { for (var that = this, data = that._i, entry = that._f; entry; entry = entry.n) { entry.r = true; if (entry.p) entry.p = entry.p.n = undefined; delete data[entry.i]; } that._f = that._l = undefined; that[SIZE] = 0; }, // 23.1.3.3 Map.prototype.delete(key) // 23.2.3.4 Set.prototype.delete(value) 'delete': function (key) { var that = this, entry = getEntry(that, key); if (entry) { var next = entry.n, prev = entry.p; delete that._i[entry.i]; entry.r = true; if (prev) prev.n = next; if (next) next.p = prev; if (that._f == entry) that._f = next; if (that._l == entry) that._l = prev; that[SIZE]--; }return !!entry; }, // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) forEach: function forEach(callbackfn /*, that = undefined */) { anInstance(this, C, 'forEach'); var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3), entry; while (entry = entry ? entry.n : this._f) { f(entry.v, entry.k, this); // revert to the last existing entry while (entry && entry.r) entry = entry.p; } }, // 23.1.3.7 Map.prototype.has(key) // 23.2.3.7 Set.prototype.has(value) has: function has(key) { return !!getEntry(this, key); } }); if (DESCRIPTORS) dP(C.prototype, 'size', { get: function () { return defined(this[SIZE]); } }); return C; }, def: function (that, key, value) { var entry = getEntry(that, key), prev, index; // change existing entry if (entry) { entry.v = value; // create new entry } else { that._l = entry = { i: index = fastKey(key, true), // <- index k: key, // <- key v: value, // <- value p: prev = that._l, // <- previous entry n: undefined, // <- next entry r: false // <- removed }; if (!that._f) that._f = entry; if (prev) prev.n = entry; that[SIZE]++; // add to index if (index !== 'F') that._i[index] = entry; }return that; }, getEntry: getEntry, setStrong: function (C, NAME, IS_MAP) { // add .keys, .values, .entries, [@@iterator] // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 $iterDefine(C, NAME, function (iterated, kind) { this._t = iterated; // target this._k = kind; // kind this._l = undefined; // previous }, function () { var that = this, kind = that._k, entry = that._l; // revert to the last existing entry while (entry && entry.r) entry = entry.p; // get next entry if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { // or finish the iteration that._t = undefined; return step(1); } // return step by kind if (kind == 'keys') return step(0, entry.k); if (kind == 'values') return step(0, entry.v); return step(0, [entry.k, entry.v]); }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); // add [@@species], 23.1.2.2, 23.2.2.2 setSpecies(NAME); } }; }); $__System.registerDynamic('170', ['167', '33', 'c'], true, function ($__require, exports, module) { 'use strict'; var process = $__require('c'); var global = this || self, GLOBAL = global; var strong = $__require('167'); // 23.1 Map Objects module.exports = $__require('33')('Map', function (get) { return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.1.3.6 Map.prototype.get(key) get: function get(key) { var entry = strong.getEntry(this, key); return entry && entry.v; }, // 23.1.3.9 Map.prototype.set(key, value) set: function set(key, value) { return strong.def(this, key === 0 ? 0 : key, value); } }, strong, true); }); $__System.registerDynamic('171', ['16c', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; var forOf = $__require('16c'); module.exports = function (iter, ITERATOR) { var result = []; forOf(iter, false, result.push, result, ITERATOR); return result; }; }); $__System.registerDynamic('172', ['173', '171', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; // https://github.com/DavidBruant/Map-Set.prototype.toJSON var classof = $__require('173'), from = $__require('171'); module.exports = function (NAME) { return function toJSON() { if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); return from(this); }; }; }); $__System.registerDynamic('174', ['c6', '172', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; // https://github.com/DavidBruant/Map-Set.prototype.toJSON var $export = $__require('c6'); $export($export.P + $export.R, 'Map', { toJSON: $__require('172')('Map') }); }); $__System.registerDynamic('175', ['35', '176', '36', '170', '174', '37', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; $__require('35'); $__require('176'); $__require('36'); $__require('170'); $__require('174'); module.exports = $__require('37').Map; }); $__System.registerDynamic("cf", ["175"], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; module.exports = { "default": $__require("175"), __esModule: true }; }); $__System.registerDynamic("177", ["30", "17", "cf", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _typeof2 = $__require("30"); var _typeof3 = _interopRequireDefault(_typeof2); var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _map = $__require("cf"); var _map2 = _interopRequireDefault(_map); exports.evaluateTruthy = evaluateTruthy; exports.evaluate = evaluate; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var VALID_CALLEES = ["String", "Number", "Math"]; var INVALID_METHODS = ["random"]; function evaluateTruthy() { var res = this.evaluate(); if (res.confident) return !!res.value; } function evaluate() { var confident = true; var deoptPath = void 0; var seen = new _map2.default(); function deopt(path) { if (!confident) return; deoptPath = path; confident = false; } var value = evaluate(this); if (!confident) value = undefined; return { confident: confident, deopt: deoptPath, value: value }; function evaluate(path) { var node = path.node; if (seen.has(node)) { var existing = seen.get(node); if (existing.resolved) { return existing.value; } else { deopt(path); return; } } else { var item = { resolved: false }; seen.set(node, item); var val = _evaluate(path); if (confident) { item.resolved = true; item.value = val; } return val; } } function _evaluate(path) { if (!confident) return; var node = path.node; if (path.isSequenceExpression()) { var exprs = path.get("expressions"); return evaluate(exprs[exprs.length - 1]); } if (path.isStringLiteral() || path.isNumericLiteral() || path.isBooleanLiteral()) { return node.value; } if (path.isNullLiteral()) { return null; } if (path.isTemplateLiteral()) { var str = ""; var i = 0; var _exprs = path.get("expressions"); for (var _iterator = node.quasis, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 elem = _ref; if (!confident) break; str += elem.value.cooked; var expr = _exprs[i++]; if (expr) str += String(evaluate(expr)); } if (!confident) return; return str; } if (path.isConditionalExpression()) { var testResult = evaluate(path.get("test")); if (!confident) return; if (testResult) { return evaluate(path.get("consequent")); } else { return evaluate(path.get("alternate")); } } if (path.isExpressionWrapper()) { return evaluate(path.get("expression")); } if (path.isMemberExpression() && !path.parentPath.isCallExpression({ callee: node })) { var property = path.get("property"); var object = path.get("object"); if (object.isLiteral() && property.isIdentifier()) { var _value = object.node.value; var type = typeof _value === "undefined" ? "undefined" : (0, _typeof3.default)(_value); if (type === "number" || type === "string") { return _value[property.node.name]; } } } if (path.isReferencedIdentifier()) { var binding = path.scope.getBinding(node.name); if (binding && binding.constantViolations.length > 0) { return deopt(binding.path); } if (binding && path.node.start < binding.path.node.end) { return deopt(binding.path); } if (binding && binding.hasValue) { return binding.value; } else { if (node.name === "undefined") { return binding ? deopt(binding.path) : undefined; } else if (node.name === "Infinity") { return binding ? deopt(binding.path) : Infinity; } else if (node.name === "NaN") { return binding ? deopt(binding.path) : NaN; } var resolved = path.resolve(); if (resolved === path) { return deopt(path); } else { return evaluate(resolved); } } } if (path.isUnaryExpression({ prefix: true })) { if (node.operator === "void") { return undefined; } var argument = path.get("argument"); if (node.operator === "typeof" && (argument.isFunction() || argument.isClass())) { return "function"; } var arg = evaluate(argument); if (!confident) return; switch (node.operator) { case "!": return !arg; case "+": return +arg; case "-": return -arg; case "~": return ~arg; case "typeof": return typeof arg === "undefined" ? "undefined" : (0, _typeof3.default)(arg); } } if (path.isArrayExpression()) { var arr = []; var elems = path.get("elements"); for (var _iterator2 = elems, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _elem = _ref2; _elem = _elem.evaluate(); if (_elem.confident) { arr.push(_elem.value); } else { return deopt(_elem); } } return arr; } if (path.isObjectExpression()) { var obj = {}; var props = path.get("properties"); for (var _iterator3 = props, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var prop = _ref3; if (prop.isObjectMethod() || prop.isSpreadProperty()) { return deopt(prop); } var keyPath = prop.get("key"); var key = keyPath; if (prop.node.computed) { key = key.evaluate(); if (!key.confident) { return deopt(keyPath); } key = key.value; } else if (key.isIdentifier()) { key = key.node.name; } else { key = key.node.value; } var valuePath = prop.get("value"); var _value2 = valuePath.evaluate(); if (!_value2.confident) { return deopt(valuePath); } _value2 = _value2.value; obj[key] = _value2; } return obj; } if (path.isLogicalExpression()) { var wasConfident = confident; var left = evaluate(path.get("left")); var leftConfident = confident; confident = wasConfident; var right = evaluate(path.get("right")); var rightConfident = confident; confident = leftConfident && rightConfident; switch (node.operator) { case "||": if (left && leftConfident) { confident = true; return left; } if (!confident) return; return left || right; case "&&": if (!left && leftConfident || !right && rightConfident) { confident = true; } if (!confident) return; return left && right; } } if (path.isBinaryExpression()) { var _left = evaluate(path.get("left")); if (!confident) return; var _right = evaluate(path.get("right")); if (!confident) return; switch (node.operator) { case "-": return _left - _right; case "+": return _left + _right; case "/": return _left / _right; case "*": return _left * _right; case "%": return _left % _right; case "**": return Math.pow(_left, _right); case "<": return _left < _right; case ">": return _left > _right; case "<=": return _left <= _right; case ">=": return _left >= _right; case "==": return _left == _right; case "!=": return _left != _right; case "===": return _left === _right; case "!==": return _left !== _right; case "|": return _left | _right; case "&": return _left & _right; case "^": return _left ^ _right; case "<<": return _left << _right; case ">>": return _left >> _right; case ">>>": return _left >>> _right; } } if (path.isCallExpression()) { var callee = path.get("callee"); var context = void 0; var func = void 0; if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name, true) && VALID_CALLEES.indexOf(callee.node.name) >= 0) { func = global[node.callee.name]; } if (callee.isMemberExpression()) { var _object = callee.get("object"); var _property = callee.get("property"); if (_object.isIdentifier() && _property.isIdentifier() && VALID_CALLEES.indexOf(_object.node.name) >= 0 && INVALID_METHODS.indexOf(_property.node.name) < 0) { context = global[_object.node.name]; func = context[_property.node.name]; } if (_object.isLiteral() && _property.isIdentifier()) { var _type = (0, _typeof3.default)(_object.node.value); if (_type === "string" || _type === "number") { context = _object.node.value; func = context[_property.node.name]; } } } if (func) { var args = path.get("arguments").map(evaluate); if (!confident) return; return func.apply(context, args); } } deopt(path); } } }); $__System.registerDynamic("178", ["11", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.toComputedKey = toComputedKey; exports.ensureBlock = ensureBlock; exports.arrowFunctionToShadowed = arrowFunctionToShadowed; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function toComputedKey() { var node = this.node; var key = void 0; if (this.isMemberExpression()) { key = node.property; } else if (this.isProperty() || this.isMethod()) { key = node.key; } else { throw new ReferenceError("todo"); } if (!node.computed) { if (t.isIdentifier(key)) key = t.stringLiteral(key.name); } return key; } function ensureBlock() { return t.ensureBlock(this.node); } function arrowFunctionToShadowed() { if (!this.isArrowFunctionExpression()) return; this.ensureBlock(); var node = this.node; node.expression = false; node.type = "FunctionExpression"; node.shadow = node.shadow || true; } }); $__System.registerDynamic("179", ["17", "a5", "11", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.is = undefined; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.matchesPattern = matchesPattern; exports.has = has; exports.isStatic = isStatic; exports.isnt = isnt; exports.equals = equals; exports.isNodeType = isNodeType; exports.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression; exports.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement; exports.isCompletionRecord = isCompletionRecord; exports.isStatementOrBlock = isStatementOrBlock; exports.referencesImport = referencesImport; exports.getSource = getSource; exports.willIMaybeExecuteBefore = willIMaybeExecuteBefore; exports._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo; exports._guessExecutionStatusRelativeToDifferentFunctions = _guessExecutionStatusRelativeToDifferentFunctions; exports.resolve = resolve; exports._resolve = _resolve; var _includes = $__require("a5"); var _includes2 = _interopRequireDefault(_includes); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function matchesPattern(pattern, allowPartial) { if (!this.isMemberExpression()) return false; var parts = pattern.split("."); var search = [this.node]; var i = 0; function matches(name) { var part = parts[i]; return part === "*" || name === part; } while (search.length) { var node = search.shift(); if (allowPartial && i === parts.length) { return true; } if (t.isIdentifier(node)) { if (!matches(node.name)) return false; } else if (t.isLiteral(node)) { if (!matches(node.value)) return false; } else if (t.isMemberExpression(node)) { if (node.computed && !t.isLiteral(node.property)) { return false; } else { search.unshift(node.property); search.unshift(node.object); continue; } } else if (t.isThisExpression(node)) { if (!matches("this")) return false; } else { return false; } if (++i > parts.length) { return false; } } return i === parts.length; } function has(key) { var val = this.node && this.node[key]; if (val && Array.isArray(val)) { return !!val.length; } else { return !!val; } } function isStatic() { return this.scope.isStatic(this.node); } var is = exports.is = has; function isnt(key) { return !this.has(key); } function equals(key, value) { return this.node[key] === value; } function isNodeType(type) { return t.isType(this.type, type); } function canHaveVariableDeclarationOrExpression() { return (this.key === "init" || this.key === "left") && this.parentPath.isFor(); } function canSwapBetweenExpressionAndStatement(replacement) { if (this.key !== "body" || !this.parentPath.isArrowFunctionExpression()) { return false; } if (this.isExpression()) { return t.isBlockStatement(replacement); } else if (this.isBlockStatement()) { return t.isExpression(replacement); } return false; } function isCompletionRecord(allowInsideFunction) { var path = this; var first = true; do { var container = path.container; if (path.isFunction() && !first) { return !!allowInsideFunction; } first = false; if (Array.isArray(container) && path.key !== container.length - 1) { return false; } } while ((path = path.parentPath) && !path.isProgram()); return true; } function isStatementOrBlock() { if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) { return false; } else { return (0, _includes2.default)(t.STATEMENT_OR_BLOCK_KEYS, this.key); } } function referencesImport(moduleSource, importName) { if (!this.isReferencedIdentifier()) return false; var binding = this.scope.getBinding(this.node.name); if (!binding || binding.kind !== "module") return false; var path = binding.path; var parent = path.parentPath; if (!parent.isImportDeclaration()) return false; if (parent.node.source.value === moduleSource) { if (!importName) return true; } else { return false; } if (path.isImportDefaultSpecifier() && importName === "default") { return true; } if (path.isImportNamespaceSpecifier() && importName === "*") { return true; } if (path.isImportSpecifier() && path.node.imported.name === importName) { return true; } return false; } function getSource() { var node = this.node; if (node.end) { return this.hub.file.code.slice(node.start, node.end); } else { return ""; } } function willIMaybeExecuteBefore(target) { return this._guessExecutionStatusRelativeTo(target) !== "after"; } function _guessExecutionStatusRelativeTo(target) { var targetFuncParent = target.scope.getFunctionParent(); var selfFuncParent = this.scope.getFunctionParent(); if (targetFuncParent.node !== selfFuncParent.node) { var status = this._guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent); if (status) { return status; } else { target = targetFuncParent.path; } } var targetPaths = target.getAncestry(); if (targetPaths.indexOf(this) >= 0) return "after"; var selfPaths = this.getAncestry(); var commonPath = void 0; var targetIndex = void 0; var selfIndex = void 0; for (selfIndex = 0; selfIndex < selfPaths.length; selfIndex++) { var selfPath = selfPaths[selfIndex]; targetIndex = targetPaths.indexOf(selfPath); if (targetIndex >= 0) { commonPath = selfPath; break; } } if (!commonPath) { return "before"; } var targetRelationship = targetPaths[targetIndex - 1]; var selfRelationship = selfPaths[selfIndex - 1]; if (!targetRelationship || !selfRelationship) { return "before"; } if (targetRelationship.listKey && targetRelationship.container === selfRelationship.container) { return targetRelationship.key > selfRelationship.key ? "before" : "after"; } var targetKeyPosition = t.VISITOR_KEYS[targetRelationship.type].indexOf(targetRelationship.key); var selfKeyPosition = t.VISITOR_KEYS[selfRelationship.type].indexOf(selfRelationship.key); return targetKeyPosition > selfKeyPosition ? "before" : "after"; } function _guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent) { var targetFuncPath = targetFuncParent.path; if (!targetFuncPath.isFunctionDeclaration()) return; var binding = targetFuncPath.scope.getBinding(targetFuncPath.node.id.name); if (!binding.references) return "before"; var referencePaths = binding.referencePaths; for (var _iterator = referencePaths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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; if (path.key !== "callee" || !path.parentPath.isCallExpression()) { return; } } var allStatus = void 0; for (var _iterator2 = referencePaths, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _path = _ref2; var childOfFunction = !!_path.find(function (path) { return path.node === targetFuncPath.node; }); if (childOfFunction) continue; var status = this._guessExecutionStatusRelativeTo(_path); if (allStatus) { if (allStatus !== status) return; } else { allStatus = status; } } return allStatus; } function resolve(dangerous, resolved) { return this._resolve(dangerous, resolved) || this; } function _resolve(dangerous, resolved) { if (resolved && resolved.indexOf(this) >= 0) return; resolved = resolved || []; resolved.push(this); if (this.isVariableDeclarator()) { if (this.get("id").isIdentifier()) { return this.get("init").resolve(dangerous, resolved); } else {} } else if (this.isReferencedIdentifier()) { var binding = this.scope.getBinding(this.node.name); if (!binding) return; if (!binding.constant) return; if (binding.kind === "module") return; if (binding.path !== this) { var ret = binding.path.resolve(dangerous, resolved); if (this.find(function (parent) { return parent.node === ret.node; })) return; return ret; } } else if (this.isTypeCastExpression()) { return this.get("expression").resolve(dangerous, resolved); } else if (dangerous && this.isMemberExpression()) { var targetKey = this.toComputedKey(); if (!t.isLiteral(targetKey)) return; var targetName = targetKey.value; var target = this.get("object").resolve(dangerous, resolved); if (target.isObjectExpression()) { var props = target.get("properties"); for (var _iterator3 = props, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var prop = _ref3; if (!prop.isProperty()) continue; var key = prop.get("key"); var match = prop.isnt("computed") && key.isIdentifier({ name: targetName }); match = match || key.isLiteral({ value: targetName }); if (match) return prop.get("value").resolve(dangerous, resolved); } } else if (target.isArrayExpression() && !isNaN(+targetName)) { var elems = target.get("elements"); var elem = elems[targetName]; if (elem) return elem.resolve(dangerous, resolved); } } } }); $__System.registerDynamic("17a", ["17", "d0", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.call = call; exports._call = _call; exports.isBlacklisted = isBlacklisted; exports.visit = visit; exports.skip = skip; exports.skipKey = skipKey; exports.stop = stop; exports.setScope = setScope; exports.setContext = setContext; exports.resync = resync; exports._resyncParent = _resyncParent; exports._resyncKey = _resyncKey; exports._resyncList = _resyncList; exports._resyncRemoved = _resyncRemoved; exports.popContext = popContext; exports.pushContext = pushContext; exports.setup = setup; exports.setKey = setKey; exports.requeue = requeue; exports._getQueueContexts = _getQueueContexts; var _index = $__require("d0"); var _index2 = _interopRequireDefault(_index); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function call(key) { var opts = this.opts; this.debug(function () { return key; }); if (this.node) { if (this._call(opts[key])) return true; } if (this.node) { return this._call(opts[this.node.type] && opts[this.node.type][key]); } return false; } function _call(fns) { if (!fns) return false; for (var _iterator = fns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 fn = _ref; if (!fn) continue; var node = this.node; if (!node) return true; var ret = fn.call(this.state, this, this.state); if (ret) throw new Error("Unexpected return value from visitor method " + fn); if (this.node !== node) return true; if (this.shouldStop || this.shouldSkip || this.removed) return true; } return false; } function isBlacklisted() { var blacklist = this.opts.blacklist; return blacklist && blacklist.indexOf(this.node.type) > -1; } function visit() { if (!this.node) { return false; } if (this.isBlacklisted()) { return false; } if (this.opts.shouldSkip && this.opts.shouldSkip(this)) { return false; } if (this.call("enter") || this.shouldSkip) { this.debug(function () { return "Skip..."; }); return this.shouldStop; } this.debug(function () { return "Recursing into..."; }); _index2.default.node(this.node, this.opts, this.scope, this.state, this, this.skipKeys); this.call("exit"); return this.shouldStop; } function skip() { this.shouldSkip = true; } function skipKey(key) { this.skipKeys[key] = true; } function stop() { this.shouldStop = true; this.shouldSkip = true; } function setScope() { if (this.opts && this.opts.noScope) return; var target = this.context && this.context.scope; if (!target) { var path = this.parentPath; while (path && !target) { if (path.opts && path.opts.noScope) return; target = path.scope; path = path.parentPath; } } this.scope = this.getScope(target); if (this.scope) this.scope.init(); } function setContext(context) { this.shouldSkip = false; this.shouldStop = false; this.removed = false; this.skipKeys = {}; if (context) { this.context = context; this.state = context.state; this.opts = context.opts; } this.setScope(); return this; } function resync() { if (this.removed) return; this._resyncParent(); this._resyncList(); this._resyncKey(); } function _resyncParent() { if (this.parentPath) { this.parent = this.parentPath.node; } } function _resyncKey() { if (!this.container) return; if (this.node === this.container[this.key]) return; if (Array.isArray(this.container)) { for (var i = 0; i < this.container.length; i++) { if (this.container[i] === this.node) { return this.setKey(i); } } } else { for (var key in this.container) { if (this.container[key] === this.node) { return this.setKey(key); } } } this.key = null; } function _resyncList() { if (!this.parent || !this.inList) return; var newContainer = this.parent[this.listKey]; if (this.container === newContainer) return; this.container = newContainer || null; } function _resyncRemoved() { if (this.key == null || !this.container || this.container[this.key] !== this.node) { this._markRemoved(); } } function popContext() { this.contexts.pop(); this.setContext(this.contexts[this.contexts.length - 1]); } function pushContext(context) { this.contexts.push(context); this.setContext(context); } function setup(parentPath, container, listKey, key) { this.inList = !!listKey; this.listKey = listKey; this.parentKey = listKey || key; this.container = container; this.parentPath = parentPath || this.parentPath; this.setKey(key); } function setKey(key) { this.key = key; this.node = this.container[this.key]; this.type = this.node && this.node.type; } function requeue() { var pathToQueue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this; if (pathToQueue.removed) return; var contexts = this.contexts; for (var _iterator2 = contexts, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var context = _ref2; context.maybeQueue(pathToQueue); } } function _getQueueContexts() { var path = this; var contexts = this.contexts; while (!contexts.length) { path = path.parentPath; contexts = path.contexts; } return contexts; } }); $__System.registerDynamic("17b", ["c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var hooks = exports.hooks = [function (self, parent) { var removeParent = self.key === "test" && (parent.isWhile() || parent.isSwitchCase()) || self.key === "declaration" && parent.isExportDeclaration() || self.key === "body" && parent.isLabeledStatement() || self.listKey === "declarations" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self.key === "expression" && parent.isExpressionStatement(); if (removeParent) { parent.remove(); return true; } }, function (self, parent) { if (parent.isSequenceExpression() && parent.node.expressions.length === 1) { parent.replaceWith(parent.node.expressions[0]); return true; } }, function (self, parent) { if (parent.isBinary()) { if (self.key === "left") { parent.replaceWith(parent.node.right); } else { parent.replaceWith(parent.node.left); } return true; } }, function (self, parent) { if (parent.isIfStatement() && (self.key === "consequent" || self.key === "alternate") || self.key === "body" && (parent.isLoop() || parent.isArrowFunctionExpression())) { self.replaceWith({ type: "BlockStatement", body: [] }); return true; } }]; }); $__System.registerDynamic("17c", ["17", "17b", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.remove = remove; exports._callRemovalHooks = _callRemovalHooks; exports._remove = _remove; exports._markRemoved = _markRemoved; exports._assertUnremoved = _assertUnremoved; var _removalHooks = $__require("17b"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function remove() { this._assertUnremoved(); this.resync(); if (this._callRemovalHooks()) { this._markRemoved(); return; } this.shareCommentsWithSiblings(); this._remove(); this._markRemoved(); } function _callRemovalHooks() { for (var _iterator = _removalHooks.hooks, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 fn = _ref; if (fn(this, this.parentPath)) return true; } } function _remove() { if (Array.isArray(this.container)) { this.container.splice(this.key, 1); this.updateSiblingKeys(this.key, -1); } else { this._replaceWith(null); } } function _markRemoved() { this.shouldSkip = true; this.removed = true; this.node = null; } function _assertUnremoved() { if (this.removed) { throw this.buildCodeFrameError("NodePath has been removed so is read-only."); } } }); $__System.registerDynamic("1d", [], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.default = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; }); $__System.registerDynamic("17d", ["17", "1d", "11", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var referenceVisitor = { ReferencedIdentifier: function ReferencedIdentifier(path, state) { if (path.isJSXIdentifier() && _babelTypes.react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) { return; } if (path.node.name === "this") { var scope = path.scope; do { if (scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) break; } while (scope = scope.parent); if (scope) state.breakOnScopePaths.push(scope.path); } var binding = path.scope.getBinding(path.node.name); if (!binding) return; if (binding !== state.scope.getBinding(path.node.name)) return; state.bindings[path.node.name] = binding; } }; var PathHoister = function () { function PathHoister(path, scope) { (0, _classCallCheck3.default)(this, PathHoister); this.breakOnScopePaths = []; this.bindings = {}; this.scopes = []; this.scope = scope; this.path = path; this.attachAfter = false; } PathHoister.prototype.isCompatibleScope = function isCompatibleScope(scope) { for (var key in this.bindings) { var binding = this.bindings[key]; if (!scope.bindingIdentifierEquals(key, binding.identifier)) { return false; } } return true; }; PathHoister.prototype.getCompatibleScopes = function getCompatibleScopes() { var scope = this.path.scope; do { if (this.isCompatibleScope(scope)) { this.scopes.push(scope); } else { break; } if (this.breakOnScopePaths.indexOf(scope.path) >= 0) { break; } } while (scope = scope.parent); }; PathHoister.prototype.getAttachmentPath = function getAttachmentPath() { var path = this._getAttachmentPath(); if (!path) return; var targetScope = path.scope; if (targetScope.path === path) { targetScope = path.scope.parent; } if (targetScope.path.isProgram() || targetScope.path.isFunction()) { for (var name in this.bindings) { if (!targetScope.hasOwnBinding(name)) continue; var binding = this.bindings[name]; if (binding.kind === "param") continue; if (this.getAttachmentParentForPath(binding.path).key > path.key) { this.attachAfter = true; path = binding.path; for (var _iterator = binding.constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 violationPath = _ref; if (this.getAttachmentParentForPath(violationPath).key > path.key) { path = violationPath; } } } } } if (path.parentPath.isExportDeclaration()) { path = path.parentPath; } return path; }; PathHoister.prototype._getAttachmentPath = function _getAttachmentPath() { var scopes = this.scopes; var scope = scopes.pop(); if (!scope) return; if (scope.path.isFunction()) { if (this.hasOwnParamBindings(scope)) { if (this.scope === scope) return; return scope.path.get("body").get("body")[0]; } else { return this.getNextScopeAttachmentParent(); } } else if (scope.path.isProgram()) { return this.getNextScopeAttachmentParent(); } }; PathHoister.prototype.getNextScopeAttachmentParent = function getNextScopeAttachmentParent() { var scope = this.scopes.pop(); if (scope) return this.getAttachmentParentForPath(scope.path); }; PathHoister.prototype.getAttachmentParentForPath = function getAttachmentParentForPath(path) { do { if (!path.parentPath || Array.isArray(path.container) && path.isStatement() || path.isVariableDeclarator() && path.parentPath.node !== null && path.parentPath.node.declarations.length > 1) return path; } while (path = path.parentPath); }; PathHoister.prototype.hasOwnParamBindings = function hasOwnParamBindings(scope) { for (var name in this.bindings) { if (!scope.hasOwnBinding(name)) continue; var binding = this.bindings[name]; if (binding.kind === "param" && binding.constant) return true; } return false; }; PathHoister.prototype.run = function run() { var node = this.path.node; if (node._hoisted) return; node._hoisted = true; this.path.traverse(referenceVisitor, this); this.getCompatibleScopes(); var attachTo = this.getAttachmentPath(); if (!attachTo) return; if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return; var uid = attachTo.scope.generateUidIdentifier("ref"); var declarator = t.variableDeclarator(uid, this.path.node); var insertFn = this.attachAfter ? "insertAfter" : "insertBefore"; attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : t.variableDeclaration("var", [declarator])]); var parent = this.path.parentPath; if (parent.isJSXElement() && this.path.container === parent.node.children) { uid = t.JSXExpressionContainer(uid); } this.path.replaceWith(uid); }; return PathHoister; }(); exports.default = PathHoister; module.exports = exports["default"]; }); $__System.registerDynamic("17e", ["30", "17", "153", "17d", "155", "11", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _typeof2 = $__require("30"); var _typeof3 = _interopRequireDefault(_typeof2); var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.insertBefore = insertBefore; exports._containerInsert = _containerInsert; exports._containerInsertBefore = _containerInsertBefore; exports._containerInsertAfter = _containerInsertAfter; exports._maybePopFromStatements = _maybePopFromStatements; exports.insertAfter = insertAfter; exports.updateSiblingKeys = updateSiblingKeys; exports._verifyNodeList = _verifyNodeList; exports.unshiftContainer = unshiftContainer; exports.pushContainer = pushContainer; exports.hoist = hoist; var _cache = $__require("153"); var _hoister = $__require("17d"); var _hoister2 = _interopRequireDefault(_hoister); var _index = $__require("155"); var _index2 = _interopRequireDefault(_index); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function insertBefore(nodes) { this._assertUnremoved(); nodes = this._verifyNodeList(nodes); if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) { return this.parentPath.insertBefore(nodes); } else if (this.isNodeType("Expression") || this.parentPath.isForStatement() && this.key === "init") { if (this.node) nodes.push(this.node); this.replaceExpressionWithStatements(nodes); } else { this._maybePopFromStatements(nodes); if (Array.isArray(this.container)) { return this._containerInsertBefore(nodes); } else if (this.isStatementOrBlock()) { if (this.node) nodes.push(this.node); this._replaceWith(t.blockStatement(nodes)); } else { throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?"); } } return [this]; } function _containerInsert(from, nodes) { this.updateSiblingKeys(from, nodes.length); var paths = []; for (var i = 0; i < nodes.length; i++) { var to = from + i; var node = nodes[i]; this.container.splice(to, 0, node); if (this.context) { var path = this.context.create(this.parent, this.container, to, this.listKey); if (this.context.queue) path.pushContext(this.context); paths.push(path); } else { paths.push(_index2.default.get({ parentPath: this.parentPath, parent: this.parent, container: this.container, listKey: this.listKey, key: to })); } } var contexts = this._getQueueContexts(); for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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.setScope(); _path.debug(function () { return "Inserted."; }); for (var _iterator2 = contexts, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var context = _ref2; context.maybeQueue(_path, true); } } return paths; } function _containerInsertBefore(nodes) { return this._containerInsert(this.key, nodes); } function _containerInsertAfter(nodes) { return this._containerInsert(this.key + 1, nodes); } function _maybePopFromStatements(nodes) { var last = nodes[nodes.length - 1]; var isIdentifier = t.isIdentifier(last) || t.isExpressionStatement(last) && t.isIdentifier(last.expression); if (isIdentifier && !this.isCompletionRecord()) { nodes.pop(); } } function insertAfter(nodes) { this._assertUnremoved(); nodes = this._verifyNodeList(nodes); if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) { return this.parentPath.insertAfter(nodes); } else if (this.isNodeType("Expression") || this.parentPath.isForStatement() && this.key === "init") { if (this.node) { var temp = this.scope.generateDeclaredUidIdentifier(); nodes.unshift(t.expressionStatement(t.assignmentExpression("=", temp, this.node))); nodes.push(t.expressionStatement(temp)); } this.replaceExpressionWithStatements(nodes); } else { this._maybePopFromStatements(nodes); if (Array.isArray(this.container)) { return this._containerInsertAfter(nodes); } else if (this.isStatementOrBlock()) { if (this.node) nodes.unshift(this.node); this._replaceWith(t.blockStatement(nodes)); } else { throw new Error("We don't know what to do with this node type. " + "We were previously a Statement but we can't fit in here?"); } } return [this]; } function updateSiblingKeys(fromIndex, incrementBy) { if (!this.parent) return; var paths = _cache.path.get(this.parent); for (var i = 0; i < paths.length; i++) { var path = paths[i]; if (path.key >= fromIndex) { path.key += incrementBy; } } } function _verifyNodeList(nodes) { if (!nodes) { return []; } if (nodes.constructor !== Array) { nodes = [nodes]; } for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; var msg = void 0; if (!node) { msg = "has falsy node"; } else if ((typeof node === "undefined" ? "undefined" : (0, _typeof3.default)(node)) !== "object") { msg = "contains a non-object node"; } else if (!node.type) { msg = "without a type"; } else if (node instanceof _index2.default) { msg = "has a NodePath when it expected a raw object"; } if (msg) { var type = Array.isArray(node) ? "array" : typeof node === "undefined" ? "undefined" : (0, _typeof3.default)(node); throw new Error("Node list " + msg + " with the index of " + i + " and type of " + type); } } return nodes; } function unshiftContainer(listKey, nodes) { this._assertUnremoved(); nodes = this._verifyNodeList(nodes); var path = _index2.default.get({ parentPath: this, parent: this.node, container: this.node[listKey], listKey: listKey, key: 0 }); return path.insertBefore(nodes); } function pushContainer(listKey, nodes) { this._assertUnremoved(); nodes = this._verifyNodeList(nodes); var container = this.node[listKey]; var path = _index2.default.get({ parentPath: this, parent: this.node, container: container, listKey: listKey, key: container.length }); return path.replaceWithMultiple(nodes); } function hoist() { var scope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.scope; var hoister = new _hoister2.default(this, scope); return hoister.run(); } }); $__System.registerDynamic("17f", ["d4", "17", "155", "11", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _create = $__require("d4"); var _create2 = _interopRequireDefault(_create); var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.getStatementParent = getStatementParent; exports.getOpposite = getOpposite; exports.getCompletionRecords = getCompletionRecords; exports.getSibling = getSibling; exports.getPrevSibling = getPrevSibling; exports.getNextSibling = getNextSibling; exports.getAllNextSiblings = getAllNextSiblings; exports.getAllPrevSiblings = getAllPrevSiblings; exports.get = get; exports._getKey = _getKey; exports._getPattern = _getPattern; exports.getBindingIdentifiers = getBindingIdentifiers; exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers; exports.getBindingIdentifierPaths = getBindingIdentifierPaths; exports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths; var _index = $__require("155"); var _index2 = _interopRequireDefault(_index); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function getStatementParent() { var path = this; do { if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) { break; } else { path = path.parentPath; } } while (path); if (path && (path.isProgram() || path.isFile())) { throw new Error("File/Program node, we can't possibly find a statement parent to this"); } return path; } function getOpposite() { if (this.key === "left") { return this.getSibling("right"); } else if (this.key === "right") { return this.getSibling("left"); } } function getCompletionRecords() { var paths = []; var add = function add(path) { if (path) paths = paths.concat(path.getCompletionRecords()); }; if (this.isIfStatement()) { add(this.get("consequent")); add(this.get("alternate")); } else if (this.isDoExpression() || this.isFor() || this.isWhile()) { add(this.get("body")); } else if (this.isProgram() || this.isBlockStatement()) { add(this.get("body").pop()); } else if (this.isFunction()) { return this.get("body").getCompletionRecords(); } else if (this.isTryStatement()) { add(this.get("block")); add(this.get("handler")); add(this.get("finalizer")); } else { paths.push(this); } return paths; } function getSibling(key) { return _index2.default.get({ parentPath: this.parentPath, parent: this.parent, container: this.container, listKey: this.listKey, key: key }); } function getPrevSibling() { return this.getSibling(this.key - 1); } function getNextSibling() { return this.getSibling(this.key + 1); } function getAllNextSiblings() { var _key = this.key; var sibling = this.getSibling(++_key); var siblings = []; while (sibling.node) { siblings.push(sibling); sibling = this.getSibling(++_key); } return siblings; } function getAllPrevSiblings() { var _key = this.key; var sibling = this.getSibling(--_key); var siblings = []; while (sibling.node) { siblings.push(sibling); sibling = this.getSibling(--_key); } return siblings; } function get(key, context) { if (context === true) context = this.context; var parts = key.split("."); if (parts.length === 1) { return this._getKey(key, context); } else { return this._getPattern(parts, context); } } function _getKey(key, context) { var _this = this; var node = this.node; var container = node[key]; if (Array.isArray(container)) { return container.map(function (_, i) { return _index2.default.get({ listKey: key, parentPath: _this, parent: node, container: container, key: i }).setContext(context); }); } else { return _index2.default.get({ parentPath: this, parent: node, container: node, key: key }).setContext(context); } } function _getPattern(parts, context) { var path = this; for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 part = _ref; if (part === ".") { path = path.parentPath; } else { if (Array.isArray(path)) { path = path[part]; } else { path = path.get(part, context); } } } return path; } function getBindingIdentifiers(duplicates) { return t.getBindingIdentifiers(this.node, duplicates); } function getOuterBindingIdentifiers(duplicates) { return t.getOuterBindingIdentifiers(this.node, duplicates); } function getBindingIdentifierPaths() { var duplicates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var outerOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var path = this; var search = [].concat(path); var ids = (0, _create2.default)(null); while (search.length) { var id = search.shift(); if (!id) continue; if (!id.node) continue; var keys = t.getBindingIdentifiers.keys[id.node.type]; if (id.isIdentifier()) { if (duplicates) { var _ids = ids[id.node.name] = ids[id.node.name] || []; _ids.push(id); } else { ids[id.node.name] = id; } continue; } if (id.isExportDeclaration()) { var declaration = id.get("declaration"); if (declaration.isDeclaration()) { search.push(declaration); } continue; } if (outerOnly) { if (id.isFunctionDeclaration()) { search.push(id.get("id")); continue; } if (id.isFunctionExpression()) { continue; } } if (keys) { for (var i = 0; i < keys.length; i++) { var key = keys[i]; var child = id.get(key); if (Array.isArray(child) || child.node) { search = search.concat(child); } } } } return ids; } function getOuterBindingIdentifierPaths(duplicates) { return this.getBindingIdentifierPaths(duplicates, true); } }); $__System.registerDynamic("180", ["c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.shareCommentsWithSiblings = shareCommentsWithSiblings; exports.addComment = addComment; exports.addComments = addComments; function shareCommentsWithSiblings() { if (typeof this.key === "string") return; var node = this.node; if (!node) return; var trailing = node.trailingComments; var leading = node.leadingComments; if (!trailing && !leading) return; var prev = this.getSibling(this.key - 1); var next = this.getSibling(this.key + 1); if (!prev.node) prev = next; if (!next.node) next = prev; prev.addComments("trailing", leading); next.addComments("leading", trailing); } function addComment(type, content, line) { this.addComments(type, [{ type: line ? "CommentLine" : "CommentBlock", value: content }]); } function addComments(type, comments) { if (!comments) return; var node = this.node; if (!node) return; var key = type + "Comments"; if (node[key]) { node[key] = node[key].concat(comments); } else { node[key] = comments; } } }); $__System.registerDynamic("155", ["17", "1d", "181", "5e", "141", "d0", "d1", "152", "11", "153", "154", "158", "161", "177", "178", "179", "17a", "17c", "17e", "17f", "180", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _virtualTypes = $__require("181"); var virtualTypes = _interopRequireWildcard(_virtualTypes); var _debug2 = $__require("5e"); var _debug3 = _interopRequireDefault(_debug2); var _invariant = $__require("141"); var _invariant2 = _interopRequireDefault(_invariant); var _index = $__require("d0"); var _index2 = _interopRequireDefault(_index); var _assign = $__require("d1"); var _assign2 = _interopRequireDefault(_assign); var _scope = $__require("152"); var _scope2 = _interopRequireDefault(_scope); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); var _cache = $__require("153"); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _debug = (0, _debug3.default)("babel"); var NodePath = function () { function NodePath(hub, parent) { (0, _classCallCheck3.default)(this, NodePath); 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, _invariant2.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 = void 0; 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; }; NodePath.prototype.getScope = function getScope(scope) { var ourScope = scope; if (this.isScope()) { ourScope = new _scope2.default(this, scope); } return ourScope; }; NodePath.prototype.setData = function setData(key, val) { return this.data[key] = val; }; NodePath.prototype.getData = function getData(key, def) { var val = this.data[key]; if (!val && def) val = this.data[key] = def; return val; }; NodePath.prototype.buildCodeFrameError = function buildCodeFrameError(msg) { var Error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SyntaxError; return this.hub.file.buildCodeFrameError(this.node, msg, Error); }; NodePath.prototype.traverse = function traverse(visitor, state) { (0, _index2.default)(this.node, visitor, this.scope, state, this); }; NodePath.prototype.mark = function mark(type, message) { this.hub.file.metadata.marked.push({ type: type, message: message, loc: this.node.loc }); }; NodePath.prototype.set = function set(key, node) { t.validate(this.node, key, node); this.node[key] = node; }; NodePath.prototype.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("."); }; NodePath.prototype.debug = function debug(buildMessage) { if (!_debug.enabled) return; _debug(this.getPathLocation() + " " + this.type + ": " + buildMessage()); }; return NodePath; }(); exports.default = NodePath; (0, _assign2.default)(NodePath.prototype, $__require("154")); (0, _assign2.default)(NodePath.prototype, $__require("158")); (0, _assign2.default)(NodePath.prototype, $__require("161")); (0, _assign2.default)(NodePath.prototype, $__require("177")); (0, _assign2.default)(NodePath.prototype, $__require("178")); (0, _assign2.default)(NodePath.prototype, $__require("179")); (0, _assign2.default)(NodePath.prototype, $__require("17a")); (0, _assign2.default)(NodePath.prototype, $__require("17c")); (0, _assign2.default)(NodePath.prototype, $__require("17e")); (0, _assign2.default)(NodePath.prototype, $__require("17f")); (0, _assign2.default)(NodePath.prototype, $__require("180")); 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; NodePath.prototype[typeKey] = function (opts) { return t[typeKey](this.node, opts); }; NodePath.prototype["assert" + type] = function (opts) { if (!this[typeKey](opts)) { throw new TypeError("Expected node path of type " + type); } }; }; for (var _iterator = t.TYPES, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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; } module.exports = exports["default"]; }); $__System.registerDynamic("182", ["17", "1d", "155", "11", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _classCallCheck2 = $__require("1d"); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _path2 = $__require("155"); var _path3 = _interopRequireDefault(_path2); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var testing = "production" === "test"; var TraversalContext = function () { function TraversalContext(scope, opts, state, parentPath) { (0, _classCallCheck3.default)(this, TraversalContext); this.queue = null; this.parentPath = parentPath; this.scope = scope; this.state = state; this.opts = opts; } TraversalContext.prototype.shouldVisit = function shouldVisit(node) { var opts = this.opts; if (opts.enter || opts.exit) return true; if (opts[node.type]) return true; var keys = t.VISITOR_KEYS[node.type]; if (!keys || !keys.length) return false; for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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]) return true; } return false; }; TraversalContext.prototype.create = function create(node, obj, key, listKey) { return _path3.default.get({ parentPath: this.parentPath, parent: node, container: obj, key: key, listKey: listKey }); }; TraversalContext.prototype.maybeQueue = function maybeQueue(path, notPriority) { if (this.trap) { throw new Error("Infinite cycle detected"); } if (this.queue) { if (notPriority) { this.queue.push(path); } else { this.priorityQueue.push(path); } } }; TraversalContext.prototype.visitMultiple = function visitMultiple(container, parent, listKey) { if (container.length === 0) return false; var queue = []; for (var key = 0; key < container.length; key++) { var node = container[key]; if (node && this.shouldVisit(node)) { queue.push(this.create(parent, container, key, listKey)); } } return this.visitQueue(queue); }; TraversalContext.prototype.visitSingle = function visitSingle(node, key) { if (this.shouldVisit(node[key])) { return this.visitQueue([this.create(node, node, key)]); } else { return false; } }; TraversalContext.prototype.visitQueue = function visitQueue(queue) { this.queue = queue; this.priorityQueue = []; var visited = []; var stop = false; for (var _iterator2 = queue, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var path = _ref2; path.resync(); if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) { path.pushContext(this); } if (path.key === null) continue; if (testing && queue.length >= 10000) { this.trap = true; } if (visited.indexOf(path.node) >= 0) continue; visited.push(path.node); if (path.visit()) { stop = true; break; } if (this.priorityQueue.length) { stop = this.visitQueue(this.priorityQueue); this.priorityQueue = []; this.queue = queue; if (stop) break; } } for (var _iterator3 = queue, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var _path = _ref3; _path.popContext(); } this.queue = null; return stop; }; TraversalContext.prototype.visit = function visit(node, key) { var nodes = node[key]; if (!nodes) return false; if (Array.isArray(nodes)) { return this.visitMultiple(nodes, node, key); } else { return this.visitSingle(node, key); } }; return TraversalContext; }(); exports.default = TraversalContext; module.exports = exports["default"]; }); $__System.registerDynamic("181", ["11", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; 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 = undefined; var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } var ReferencedIdentifier = exports.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 (_babelTypes.react.isCompatTag(node.name)) return false; } else { return false; } } return t.isReferenced(node, parent); } }; var ReferencedMemberExpression = exports.ReferencedMemberExpression = { types: ["MemberExpression"], checkPath: function checkPath(_ref2) { var node = _ref2.node, parent = _ref2.parent; return t.isMemberExpression(node) && t.isReferenced(node, parent); } }; var BindingIdentifier = exports.BindingIdentifier = { types: ["Identifier"], checkPath: function checkPath(_ref3) { var node = _ref3.node, parent = _ref3.parent; return t.isIdentifier(node) && t.isBinding(node, parent); } }; var Statement = exports.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; } } }; var Expression = exports.Expression = { types: ["Expression"], checkPath: function checkPath(path) { if (path.isIdentifier()) { return path.isReferencedIdentifier(); } else { return t.isExpression(path.node); } } }; var Scope = exports.Scope = { types: ["Scopable"], checkPath: function checkPath(path) { return t.isScope(path.node, path.parent); } }; var Referenced = exports.Referenced = { checkPath: function checkPath(path) { return t.isReferenced(path.node, path.parent); } }; var BlockScoped = exports.BlockScoped = { checkPath: function checkPath(path) { return t.isBlockScoped(path.node); } }; var Var = exports.Var = { types: ["VariableDeclaration"], checkPath: function checkPath(path) { return t.isVar(path.node); } }; var User = exports.User = { checkPath: function checkPath(path) { return path.node && !!path.node.loc; } }; var Generated = exports.Generated = { checkPath: function checkPath(path) { return !path.isUser(); } }; var Pure = exports.Pure = { checkPath: function checkPath(path, opts) { return path.scope.isPure(path.node, opts); } }; var Flow = exports.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; } } }; }); $__System.registerDynamic("183", ["30", "15", "17", "181", "f", "11", "ce", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; var _typeof2 = $__require("30"); var _typeof3 = _interopRequireDefault(_typeof2); var _keys = $__require("15"); var _keys2 = _interopRequireDefault(_keys); var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); exports.explode = explode; exports.verify = verify; exports.merge = merge; var _virtualTypes = $__require("181"); var virtualTypes = _interopRequireWildcard(_virtualTypes); var _babelMessages = $__require("f"); var messages = _interopRequireWildcard(_babelMessages); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); var _clone = $__require("ce"); var _clone2 = _interopRequireDefault(_clone); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function explode(visitor) { if (visitor._exploded) return visitor; visitor._exploded = true; for (var nodeType in visitor) { if (shouldIgnoreKey(nodeType)) continue; var parts = nodeType.split("|"); if (parts.length === 1) continue; var fns = visitor[nodeType]; delete visitor[nodeType]; for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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 part = _ref; visitor[part] = fns; } } verify(visitor); delete visitor.__esModule; ensureEntranceObjects(visitor); ensureCallbackArrays(visitor); for (var _iterator2 = (0, _keys2.default)(visitor), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _nodeType3 = _ref2; if (shouldIgnoreKey(_nodeType3)) continue; var wrapper = virtualTypes[_nodeType3]; if (!wrapper) continue; var _fns2 = visitor[_nodeType3]; for (var type in _fns2) { _fns2[type] = wrapCheck(wrapper, _fns2[type]); } delete visitor[_nodeType3]; if (wrapper.types) { for (var _iterator4 = wrapper.types, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) { var _ref4; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref4 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref4 = _i4.value; } var _type = _ref4; if (visitor[_type]) { mergePair(visitor[_type], _fns2); } else { visitor[_type] = _fns2; } } } else { mergePair(visitor, _fns2); } } for (var _nodeType in visitor) { if (shouldIgnoreKey(_nodeType)) continue; var _fns = visitor[_nodeType]; var aliases = t.FLIPPED_ALIAS_KEYS[_nodeType]; var deprecratedKey = t.DEPRECATED_KEYS[_nodeType]; if (deprecratedKey) { console.trace("Visitor defined for " + _nodeType + " but it has been renamed to " + deprecratedKey); aliases = [deprecratedKey]; } if (!aliases) continue; delete visitor[_nodeType]; for (var _iterator3 = aliases, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var alias = _ref3; var existing = visitor[alias]; if (existing) { mergePair(existing, _fns); } else { visitor[alias] = (0, _clone2.default)(_fns); } } } for (var _nodeType2 in visitor) { if (shouldIgnoreKey(_nodeType2)) continue; ensureCallbackArrays(visitor[_nodeType2]); } return visitor; } function verify(visitor) { if (visitor._verified) return; if (typeof visitor === "function") { throw new Error(messages.get("traverseVerifyRootFunction")); } for (var nodeType in visitor) { if (nodeType === "enter" || nodeType === "exit") { validateVisitorMethods(nodeType, visitor[nodeType]); } if (shouldIgnoreKey(nodeType)) continue; if (t.TYPES.indexOf(nodeType) < 0) { throw new Error(messages.get("traverseVerifyNodeType", nodeType)); } var visitors = visitor[nodeType]; if ((typeof visitors === "undefined" ? "undefined" : (0, _typeof3.default)(visitors)) === "object") { for (var visitorKey in visitors) { if (visitorKey === "enter" || visitorKey === "exit") { validateVisitorMethods(nodeType + "." + visitorKey, visitors[visitorKey]); } else { throw new Error(messages.get("traverseVerifyVisitorProperty", nodeType, visitorKey)); } } } } visitor._verified = true; } function validateVisitorMethods(path, val) { var fns = [].concat(val); for (var _iterator5 = fns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) { var _ref5; if (_isArray5) { if (_i5 >= _iterator5.length) break; _ref5 = _iterator5[_i5++]; } else { _i5 = _iterator5.next(); if (_i5.done) break; _ref5 = _i5.value; } var fn = _ref5; if (typeof fn !== "function") { throw new TypeError("Non-function found defined in " + path + " with type " + (typeof fn === "undefined" ? "undefined" : (0, _typeof3.default)(fn))); } } } function merge(visitors) { var states = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var wrapper = arguments[2]; var rootVisitor = {}; for (var i = 0; i < visitors.length; i++) { var visitor = visitors[i]; var state = states[i]; explode(visitor); for (var type in visitor) { var visitorType = visitor[type]; if (state || wrapper) { visitorType = wrapWithStateOrWrapper(visitorType, state, wrapper); } var nodeVisitor = rootVisitor[type] = rootVisitor[type] || {}; mergePair(nodeVisitor, visitorType); } } return rootVisitor; } function wrapWithStateOrWrapper(oldVisitor, state, wrapper) { var newVisitor = {}; var _loop = function _loop(key) { var fns = oldVisitor[key]; if (!Array.isArray(fns)) return "continue"; fns = fns.map(function (fn) { var newFn = fn; if (state) { newFn = function newFn(path) { return fn.call(state, path, state); }; } if (wrapper) { newFn = wrapper(state.key, key, newFn); } return newFn; }); newVisitor[key] = fns; }; for (var key in oldVisitor) { var _ret = _loop(key); if (_ret === "continue") continue; } return newVisitor; } function ensureEntranceObjects(obj) { for (var key in obj) { if (shouldIgnoreKey(key)) continue; var fns = obj[key]; if (typeof fns === "function") { obj[key] = { enter: fns }; } } } function ensureCallbackArrays(obj) { if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter]; if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit]; } function wrapCheck(wrapper, fn) { var newFn = function newFn(path) { if (wrapper.checkPath(path)) { return fn.apply(this, arguments); } }; newFn.toString = function () { return fn.toString(); }; return newFn; } function shouldIgnoreKey(key) { if (key[0] === "_") return true; if (key === "enter" || key === "exit" || key === "shouldSkip") return true; if (key === "blacklist" || key === "noScope" || key === "skipKeys") return true; return false; } function mergePair(dest, src) { for (var key in src) { dest[key] = [].concat(dest[key] || [], src[key]); } } }); $__System.registerDynamic("f", ["5b", "@node/util"], true, function ($__require, exports, module) { "use strict"; var global = this || self, GLOBAL = global; exports.__esModule = true; exports.MESSAGES = undefined; var _stringify = $__require("5b"); var _stringify2 = _interopRequireDefault(_stringify); exports.get = get; exports.parseArgs = parseArgs; var _util = $__require("@node/util"); var util = _interopRequireWildcard(_util); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var MESSAGES = exports.MESSAGES = { tailCallReassignmentDeopt: "Function reference has been reassigned, so it will probably be dereferenced, therefore we can't optimise this with confidence", classesIllegalBareSuper: "Illegal use of bare super", classesIllegalSuperCall: "Direct super call is illegal in non-constructor, use super.$1() instead", scopeDuplicateDeclaration: "Duplicate declaration $1", settersNoRest: "Setters aren't allowed to have a rest", noAssignmentsInForHead: "No assignments allowed in for-in/of head", expectedMemberExpressionOrIdentifier: "Expected type MemberExpression or Identifier", invalidParentForThisNode: "We don't know how to handle this node within the current parent - please open an issue", readOnly: "$1 is read-only", unknownForHead: "Unknown node type $1 in ForStatement", didYouMean: "Did you mean $1?", codeGeneratorDeopt: "Note: The code generator has deoptimised the styling of $1 as it exceeds the max of $2.", missingTemplatesDirectory: "no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues", unsupportedOutputType: "Unsupported output type $1", illegalMethodName: "Illegal method name $1", lostTrackNodePath: "We lost track of this node's position, likely because the AST was directly manipulated", modulesIllegalExportName: "Illegal export $1", modulesDuplicateDeclarations: "Duplicate module declarations with the same source but in different scopes", undeclaredVariable: "Reference to undeclared variable $1", undeclaredVariableType: "Referencing a type alias outside of a type annotation", undeclaredVariableSuggestion: "Reference to undeclared variable $1 - did you mean $2?", traverseNeedsParent: "You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a $1 node without passing scope and parentPath.", traverseVerifyRootFunction: "You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?", traverseVerifyVisitorProperty: "You passed `traverse()` a visitor object with the property $1 that has the invalid property $2", traverseVerifyNodeType: "You gave us a visitor for the node type $1 but it's not a valid type", pluginNotObject: "Plugin $2 specified in $1 was expected to return an object when invoked but returned $3", pluginNotFunction: "Plugin $2 specified in $1 was expected to return a function but returned $3", pluginUnknown: "Unknown plugin $1 specified in $2 at $3, attempted to resolve relative to $4", pluginInvalidProperty: "Plugin $2 specified in $1 provided an invalid property of $3" }; function get(key) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var msg = MESSAGES[key]; if (!msg) throw new ReferenceError("Unknown message " + (0, _stringify2.default)(key)); args = parseArgs(args); return msg.replace(/\$(\d+)/g, function (str, i) { return args[i - 1]; }); } function parseArgs(args) { return args.map(function (val) { if (val != null && val.inspect) { return val.inspect(); } else { try { return (0, _stringify2.default)(val) || val + ""; } catch (e) { return util.inspect(val); } } }); } }); $__System.registerDynamic('184', ['185', '4b', '7b'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseGetTag = $__require('185'), isArray = $__require('4b'), isObjectLike = $__require('7b'); /** `Object#toString` result references. */ var stringTag = '[object String]'; /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag; } module.exports = isString; }); $__System.registerDynamic('90', ['185', '7b'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseGetTag = $__require('185'), isObjectLike = $__require('7b'); /** `Object#toString` result references. */ var symbolTag = '[object Symbol]'; /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag; } module.exports = isSymbol; }); $__System.registerDynamic('186', ['81', '90'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var isObject = $__require('81'), isSymbol = $__require('90'); /** Used as references for various `Number` constants. */ var NAN = 0 / 0; /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Built-in method references without a dependency on `root`. */ var freeParseInt = parseInt; /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? other + '' : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; } module.exports = toNumber; }); $__System.registerDynamic('187', ['186'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var toNumber = $__require('186'); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_INTEGER = 1.7976931348623157e+308; /** * Converts `value` to a finite number. * * @static * @memberOf _ * @since 4.12.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted number. * @example * * _.toFinite(3.2); * // => 3.2 * * _.toFinite(Number.MIN_VALUE); * // => 5e-324 * * _.toFinite(Infinity); * // => 1.7976931348623157e+308 * * _.toFinite('3.2'); * // => 3.2 */ function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = value < 0 ? -1 : 1; return sign * MAX_INTEGER; } return value === value ? value : 0; } module.exports = toFinite; }); $__System.registerDynamic('3c', ['187'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var toFinite = $__require('187'); /** * Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { var result = toFinite(value), remainder = result % 1; return result === result ? remainder ? result - remainder : result : 0; } module.exports = toInteger; }); $__System.registerDynamic("49", [], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ 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; }); $__System.registerDynamic('188', ['49'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var arrayMap = $__require('49'); /** * The base implementation of `_.values` and `_.valuesIn` which creates an * array of `object` property values corresponding to the property names * of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the array of property values. */ function baseValues(object, props) { return arrayMap(props, function (key) { return object[key]; }); } module.exports = baseValues; }); $__System.registerDynamic('189', ['188', '40'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseValues = $__require('188'), keys = $__require('40'); /** * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.values(new Foo); * // => [1, 2] (iteration order is not guaranteed) * * _.values('hi'); * // => ['h', 'i'] */ function values(object) { return object == null ? [] : baseValues(object, keys(object)); } module.exports = values; }); $__System.registerDynamic('a5', ['127', '3f', '184', '3c', '189'], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; var baseIndexOf = $__require('127'), isArrayLike = $__require('3f'), isString = $__require('184'), toInteger = $__require('3c'), values = $__require('189'); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * * _.includes([1, 2, 3], 1); * // => true * * _.includes([1, 2, 3], 1, 2); * // => false * * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * * _.includes('abcd', 'bc'); * // => true */ 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; }); $__System.registerDynamic('c7', ['18a', '18b', '18c', '18d', '18e', '18f', 'c'], true, function ($__require, exports, module) { 'use strict'; // 19.1.2.1 Object.assign(target, source, ...) var process = $__require('c'); var global = this || self, GLOBAL = global; var getKeys = $__require('18a'), gOPS = $__require('18b'), pIE = $__require('18c'), toObject = $__require('18d'), IObject = $__require('18e'), $assign = Object.assign; // should work with symbols and should have deterministic property order (V8 bug) module.exports = !$assign || $__require('18f')(function () { var A = {}, B = {}, S = Symbol(), K = 'abcdefghijklmnopqrst'; A[S] = 7; K.split('').forEach(function (k) { B[k] = k; }); return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars var T = toObject(target), aLen = arguments.length, index = 1, getSymbols = gOPS.f, isEnum = pIE.f; while (aLen > index) { var S = IObject(arguments[index++]), keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S), length = keys.length, j = 0, key; while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; }return T; } : $assign; }); $__System.registerDynamic('32', ['169', '16f', '10b', '10a', '16a', '16c', '190', '191', 'c'], true, function ($__require, exports, module) { 'use strict'; var process = $__require('c'); var global = this || self, GLOBAL = global; var redefineAll = $__require('169'), getWeak = $__require('16f').getWeak, anObject = $__require('10b'), isObject = $__require('10a'), anInstance = $__require('16a'), forOf = $__require('16c'), createArrayMethod = $__require('190'), $has = $__require('191'), arrayFind = createArrayMethod(5), arrayFindIndex = createArrayMethod(6), id = 0; // fallback for uncaught frozen keys var uncaughtFrozenStore = function (that) { return that._l || (that._l = new UncaughtFrozenStore()); }; var UncaughtFrozenStore = function () { this.a = []; }; var findUncaughtFrozen = function (store, key) { return arrayFind(store.a, function (it) { return it[0] === key; }); }; UncaughtFrozenStore.prototype = { get: function (key) { var entry = findUncaughtFrozen(this, key); if (entry) return entry[1]; }, has: function (key) { return !!findUncaughtFrozen(this, key); }, set: function (key, value) { var entry = findUncaughtFrozen(this, key); if (entry) entry[1] = value;else this.a.push([key, value]); }, 'delete': function (key) { var index = arrayFindIndex(this.a, function (it) { return it[0] === key; }); if (~index) this.a.splice(index, 1); return !!~index; } }; module.exports = { getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { var C = wrapper(function (that, iterable) { anInstance(that, C, NAME, '_i'); that._i = id++; // collection id that._l = undefined; // leak store for uncaught frozen objects if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); }); redefineAll(C.prototype, { // 23.3.3.2 WeakMap.prototype.delete(key) // 23.4.3.3 WeakSet.prototype.delete(value) 'delete': function (key) { if (!isObject(key)) return false; var data = getWeak(key); if (data === true) return uncaughtFrozenStore(this)['delete'](key); return data && $has(data, this._i) && delete data[this._i]; }, // 23.3.3.4 WeakMap.prototype.has(key) // 23.4.3.4 WeakSet.prototype.has(value) has: function has(key) { if (!isObject(key)) return false; var data = getWeak(key); if (data === true) return uncaughtFrozenStore(this).has(key); return data && $has(data, this._i); } }); return C; }, def: function (that, key, value) { var data = getWeak(anObject(key), true); if (data === true) uncaughtFrozenStore(that).set(key, value);else data[that._i] = value; return that; }, ufstore: uncaughtFrozenStore }; }); $__System.registerDynamic('169', ['192', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; var hide = $__require('192'); module.exports = function (target, src, safe) { for (var key in src) { if (safe && target[key]) target[key] = src[key];else hide(target, key, src[key]); }return target; }; }); $__System.registerDynamic('193', ['10b', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; // call something on iterator step with safe closing on error var anObject = $__require('10b'); module.exports = function (iterator, fn, value, entries) { try { return entries ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) } catch (e) { var ret = iterator['return']; if (ret !== undefined) anObject(ret.call(iterator)); throw e; } }; }); $__System.registerDynamic('194', ['195', '166', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; // check on default Array iterator var Iterators = $__require('195'), ITERATOR = $__require('166')('iterator'), ArrayProto = Array.prototype; module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); }; }); $__System.registerDynamic('16c', ['10c', '193', '194', '10b', '196', '197', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; var ctx = $__require('10c'), call = $__require('193'), isArrayIter = $__require('194'), anObject = $__require('10b'), toLength = $__require('196'), getIterFn = $__require('197'), BREAK = {}, RETURN = {}; var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable), f = ctx(fn, that, entries ? 2 : 1), index = 0, length, step, iterator, result; if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); // fast case for arrays with default iterator if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); if (result === BREAK || result === RETURN) return result; } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { result = call(iterator, f, step.value, entries); if (result === BREAK || result === RETURN) return result; } }; exports.BREAK = BREAK; exports.RETURN = RETURN; }); $__System.registerDynamic('16a', ['c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; module.exports = function (it, Constructor, name, forbiddenField) { if (!(it instanceof Constructor) || forbiddenField !== undefined && forbiddenField in it) { throw TypeError(name + ': incorrect invocation!'); }return it; }; }); $__System.registerDynamic('198', ['10a', '199', '166', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; var isObject = $__require('10a'), isArray = $__require('199'), SPECIES = $__require('166')('species'); module.exports = function (original) { var C; if (isArray(original)) { C = original.constructor; // cross-realm fallback if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; if (isObject(C)) { C = C[SPECIES]; if (C === null) C = undefined; } }return C === undefined ? Array : C; }; }); $__System.registerDynamic('19a', ['198', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; // 9.4.2.3 ArraySpeciesCreate(originalArray, length) var speciesConstructor = $__require('198'); module.exports = function (original, length) { return new (speciesConstructor(original))(length); }; }); $__System.registerDynamic('190', ['10c', '18e', '18d', '196', '19a', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; // 0 -> Array#forEach // 1 -> Array#map // 2 -> Array#filter // 3 -> Array#some // 4 -> Array#every // 5 -> Array#find // 6 -> Array#findIndex var ctx = $__require('10c'), IObject = $__require('18e'), toObject = $__require('18d'), toLength = $__require('196'), asc = $__require('19a'); module.exports = function (TYPE, $create) { var IS_MAP = TYPE == 1, IS_FILTER = TYPE == 2, IS_SOME = TYPE == 3, IS_EVERY = TYPE == 4, IS_FIND_INDEX = TYPE == 6, NO_HOLES = TYPE == 5 || IS_FIND_INDEX, create = $create || asc; return function ($this, callbackfn, that) { var O = toObject($this), self = IObject(O), f = ctx(callbackfn, that, 3), length = toLength(self.length), index = 0, result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined, val, res; for (; length > index; index++) if (NO_HOLES || index in self) { val = self[index]; res = f(val, index, O); if (TYPE) { if (IS_MAP) result[index] = res; // map else if (res) switch (TYPE) { case 3: return true; // some case 5: return val; // find case 6: return index; // findIndex case 2: result.push(val); // filter } else if (IS_EVERY) return false; // every } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; }; }; }); $__System.registerDynamic('33', ['163', 'c6', '16f', '18f', '192', '169', '16c', '16a', '10a', '19b', '164', '190', '165', 'c'], true, function ($__require, exports, module) { 'use strict'; var process = $__require('c'); var global = this || self, GLOBAL = global; var global = $__require('163'), $export = $__require('c6'), meta = $__require('16f'), fails = $__require('18f'), hide = $__require('192'), redefineAll = $__require('169'), forOf = $__require('16c'), anInstance = $__require('16a'), isObject = $__require('10a'), setToStringTag = $__require('19b'), dP = $__require('164').f, each = $__require('190')(0), DESCRIPTORS = $__require('165'); module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { var Base = global[NAME], C = Base, ADDER = IS_MAP ? 'set' : 'add', proto = C && C.prototype, O = {}; if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { new C().entries().next(); }))) { // create collection constructor C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); redefineAll(C.prototype, methods); meta.NEED = true; } else { C = wrapper(function (target, iterable) { anInstance(target, C, NAME, '_c'); target._c = new Base(); if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target); }); each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) { var IS_ADDER = KEY == 'add' || KEY == 'set'; if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) { anInstance(this, C, KEY); if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false; var result = this._c[KEY](a === 0 ? 0 : a, b); return IS_ADDER ? this : result; }); }); if ('size' in proto) dP(C.prototype, 'size', { get: function () { return this._c.size; } }); } setToStringTag(C, NAME); O[NAME] = C; $export($export.G + $export.W + $export.F, O); if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); return C; }; }); $__System.registerDynamic('19c', ['190', '19d', '16f', 'c7', '32', '10a', '33', 'c'], true, function ($__require, exports, module) { 'use strict'; var process = $__require('c'); var global = this || self, GLOBAL = global; var each = $__require('190')(0), redefine = $__require('19d'), meta = $__require('16f'), assign = $__require('c7'), weak = $__require('32'), isObject = $__require('10a'), getWeak = meta.getWeak, isExtensible = Object.isExtensible, uncaughtFrozenStore = weak.ufstore, tmp = {}, InternalMap; var wrapper = function (get) { return function WeakMap() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }; var methods = { // 23.3.3.3 WeakMap.prototype.get(key) get: function get(key) { if (isObject(key)) { var data = getWeak(key); if (data === true) return uncaughtFrozenStore(this).get(key); return data ? data[this._i] : undefined; } }, // 23.3.3.5 WeakMap.prototype.set(key, value) set: function set(key, value) { return weak.def(this, key, value); } }; // 23.3 WeakMap Objects var $WeakMap = module.exports = $__require('33')('WeakMap', wrapper, methods, weak, true, true); // IE11 WeakMap frozen keys fix if (new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7) { InternalMap = weak.getConstructor(wrapper); assign(InternalMap.prototype, methods); meta.NEED = true; each(['delete', 'has', 'get', 'set'], function (key) { var proto = $WeakMap.prototype, method = proto[key]; redefine(proto, key, function (a, b) { // store frozen objects on internal weakmap shim if (isObject(a) && !isExtensible(a)) { if (!this._f) this._f = new InternalMap(); var result = this._f[key](a, b); return key == 'set' ? this : result; // store all the rest on native weakmap }return method.call(this, a, b); }); }); } }); $__System.registerDynamic('19e', ['35', '36', '19c', '37', 'c'], true, function ($__require, exports, module) { var process = $__require('c'); var global = this || self, GLOBAL = global; $__require('35'); $__require('36'); $__require('19c'); module.exports = $__require('37').WeakMap; }); $__System.registerDynamic("19f", ["19e"], true, function ($__require, exports, module) { var global = this || self, GLOBAL = global; module.exports = { "default": $__require("19e"), __esModule: true }; }); $__System.registerDynamic("153", ["19f", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.scope = exports.path = undefined; var _weakMap = $__require("19f"); var _weakMap2 = _interopRequireDefault(_weakMap); exports.clear = clear; exports.clearPath = clearPath; exports.clearScope = clearScope; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var path = exports.path = new _weakMap2.default(); var scope = exports.scope = new _weakMap2.default(); function clear() { clearPath(); clearScope(); } function clearPath() { exports.path = path = new _weakMap2.default(); } function clearScope() { exports.scope = scope = new _weakMap2.default(); } }); $__System.registerDynamic("d0", ["17", "155", "152", "13e", "182", "183", "f", "a5", "11", "153", "c"], true, function ($__require, exports, module) { "use strict"; var process = $__require("c"); var global = this || self, GLOBAL = global; exports.__esModule = true; exports.visitors = exports.Hub = exports.Scope = exports.NodePath = undefined; var _getIterator2 = $__require("17"); var _getIterator3 = _interopRequireDefault(_getIterator2); var _path = $__require("155"); Object.defineProperty(exports, "NodePath", { enumerable: true, get: function get() { return _interopRequireDefault(_path).default; } }); var _scope = $__require("152"); Object.defineProperty(exports, "Scope", { enumerable: true, get: function get() { return _interopRequireDefault(_scope).default; } }); var _hub = $__require("13e"); Object.defineProperty(exports, "Hub", { enumerable: true, get: function get() { return _interopRequireDefault(_hub).default; } }); exports.default = traverse; var _context = $__require("182"); var _context2 = _interopRequireDefault(_context); var _visitors = $__require("183"); var visitors = _interopRequireWildcard(_visitors); var _babelMessages = $__require("f"); var messages = _interopRequireWildcard(_babelMessages); var _includes = $__require("a5"); var _includes2 = _interopRequireDefault(_includes); var _babelTypes = $__require("11"); var t = _interopRequireWildcard(_babelTypes); var _cache = $__require("153"); var cache = _interopRequireWildcard(_cache); 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)) newObj[key] = obj[key]; } }newObj.default = obj;return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.visitors = visitors; 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(messages.get("traverseNeedsParent", parent.type)); } } visitors.explode(opts); traverse.node(parent, opts, scope, state, parentPath); } traverse.visitors = visitors; traverse.verify = visitors.verify; traverse.explode = visitors.explode; traverse.NodePath = $__require("155"); traverse.Scope = $__require("152"); traverse.Hub = $__require("13e"); 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 _context2.default(scope, opts, state, parentPath); for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_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, scope, type, blacklistTypes) { if ((0, _includes2.default)(blacklistTypes, tree.type)) return false; if (tree.type === type) return true; var state = { has: false, type: type }; traverse(tree, { blacklist: blacklistTypes, enter: hasBlacklistedType }, scope, state); return state.has; }; traverse.clearCache = function () { cache.clear(); }; traverse.clearCache.clearPath = cache.clearPath; traverse.clearCache.clearScope = cache.clearScope; traverse.copyCache = function (source, destination) { if (cache.path.has(source)) { cache.path.set(destination, cache.path.get(source)); } }; }); $__System.registerDynamic('d7', [], true, function ($__require, exports, module) { 'use strict'; var global = this || self, GLOBAL = global; Object.defineProperty(exports, '__esModule', { value: true }); /* eslint max-len: 0 */ // This is a trick taken from Esprima. It turns out that, on // non-Chrome browsers, to check whether a string is in a set, a // predicate containing a big ugly `switch` statement is faster than // a regular expression, and on Chrome the two are about on par. // This function uses `eval` (non-lexical) to produce such a // predicate from a space-separated string of words. // // It starts by sorting the words by length. function makePredicate(words) { words = words.split(" "); return function (str) { return words.indexOf(str) >= 0; }; } // Reserved word lists for various dialects of the language var reservedWords = { 6: makePredicate("enum await"), strict: makePredicate("implements interface let package private protected public static yield"), strictBind: makePredicate("eval arguments") }; // And the keywords 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"); // ## Character categories // Big ugly regular expressions that match characters in the // whitespace, identifier, and identifier-start categories. These // are only applied when a character is found to actually have a // code point above 128. // Generated by `bin/generate-identifier-regex.js`. 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\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC"; 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\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\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\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\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-\u0C03\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\u0D01-\u0D03\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\u1CF8\u1CF9\u1DC0-\u1DF5\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\uA900-\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; // These are a run-length and offset encoded representation of the // >0xffff code points that are a valid part of identifiers. The // offset starts at 0x10000, and each pair of numbers represents an // offset to the next range, and then a size of the range. They were // generated by `bin/generate-identifier-regex.js`. // eslint-disable-next-line comma-spacing var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 17, 26, 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, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 785, 52, 76, 44, 33, 24, 27, 35, 42, 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, 25, 391, 63, 32, 0, 449, 56, 264, 8, 2, 36, 18, 0, 50, 29, 881, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 881, 68, 12, 0, 67, 12, 65, 0, 32, 6124, 20, 754, 9486, 1, 3071, 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, 10591, 541]; // eslint-disable-next-line comma-spacing var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 10, 2, 4, 9, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 87, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 423, 9, 838, 7, 2, 7, 17, 9, 57, 21, 2, 13, 19882, 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]; // This has a complexity linear to the value of the code. The // assumption is that looking up astral identifier characters is // rare. 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; } } // Test whether a given character code starts an identifier. 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); } // Test whether a given character is part of an identifier. 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); } // A second optional argument can be given to further configure var defaultOptions = { // Source type ("script" or "module") for different semantics sourceType: "script", // Source filename. sourceFilename: undefined, // Line from which to start counting source. Useful for // integration with other tools. startLine: 1, // When enabled, a return at the top level is not considered an // error. allowReturnOutsideFunction: false, // When enabled, import/export statements are not constrained to // appearing at the top of the program. allowImportExportEverywhere: false, // TODO allowSuperOutsideMethod: false, // An array of plugins to enable plugins: [], // TODO strictMode: null }; // Interpret and default an options object function getOptions(opts) { var options = {}; for (var key in defaultOptions) { options[key] = opts && key in opts ? opts[key] : defaultOptions[key]; } return options; } var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; var inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; var possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }; // ## Token types // The assignment of fine-grained, information-carrying type objects // allows the tokenizer to store the information it has about a // token in a way that is very cheap for the parser to look up. // All token type variables start with an underscore, to make them // easy to recognize. // The `beforeExpr` property is used to disambiguate between regular // expressions and divisions. It is set on all token types that can // be followed by an expression (thus, a slash after them would be a // regular expression). // // `isLoop` marks a keyword as starting a loop, which is important // to know when parsing a label, in order to allow or disallow // continue jumps to that label. var beforeExpr = true; var startsExpr = true; var isLoop = true; var isAssign = true; var prefix = true; var postfix = true; var TokenType = function TokenType(label) { var conf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; classCallCheck(this, TokenType); this.label = label; this.keyword = conf.keyword; this.beforeExpr = !!conf.beforeExpr; this.startsExpr = !!conf.startsExpr; this.rightAssociative = !!conf.rightAssociative; this.isLoop = !!conf.isLoop; this.isAssign = !!conf.isAssign; this.prefix = !!conf.prefix; this.postfix = !!conf.postfix; this.binop = conf.binop || null; this.updateContext = null; }; var KeywordTokenType = function (_TokenType) { inherits(KeywordTokenType, _TokenType); function KeywordTokenType(name) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; classCallCheck(this, KeywordTokenType); options.keyword = name; return possibleConstructorReturn(this, _TokenType.call(this, name, options)); } return KeywordTokenType; }(TokenType); var BinopTokenType = function (_TokenType2) { inherits(BinopTokenType, _TokenType2); function BinopTokenType(name, prec) { classCallCheck(this, BinopTokenType); return possibleConstructorReturn(this, _TokenType2.call(this, name, { beforeExpr: beforeExpr, binop: prec })); } return BinopTokenType; }(TokenType); var types = { num: new TokenType("num", { startsExpr: startsExpr }), regexp: new TokenType("regexp", { startsExpr: startsExpr }), string: new TokenType("string", { startsExpr: startsExpr }), name: new TokenType("name", { startsExpr: startsExpr }), eof: new TokenType("eof"), // Punctuation token types. 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 }), 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("@"), // Operators. These carry several kinds of properties to help the // parser use them properly (the presence of these properties is // what categorizes them as operators). // // `binop`, when present, specifies that this operator is a binary // operator, and will refer to its precedence. // // `prefix` and `postfix` mark the operator as a prefix or postfix // unary operator. // // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as // binary operators with a very low precedence, that should result // in AssignmentExpression nodes. eq: new TokenType("=", { beforeExpr: beforeExpr, isAssign: isAssign }), assign: new TokenType("_=", { beforeExpr: beforeExpr, isAssign: isAssign }), incDec: new TokenType("++/--", { prefix: prefix, postfix: postfix, startsExpr: startsExpr }), prefix: new TokenType("prefix", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }), 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 }), "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 }) }; // Map keyword names to token types. Object.keys(keywords).forEach(function (name) { types["_" + name] = keywords[name]; }); // Matches a whole line break (where CRLF is considered a single // line break). Used to count lines. 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]/; // The algorithm used to determine whether a regexp can appear at a // given point in the program is loosely based on sweet.js' approach. // See https://github.com/mozilla/sweet.js/wiki/design var TokContext = function TokContext(token, isExpr, preserveSpace, override) { classCallCheck(this, TokContext); 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) }; // Token-specific context update code 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) { 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; } } }; 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 () { // tokExprAllowed stays unchanged }; types._function.updateContext = function () { if (this.curContext() !== types$1.braceStatement) { 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; }; // These are used when `options.locations` is on, for the // `startLoc` and `endLoc` properties. var Position = function Position(line, col) { classCallCheck(this, Position); this.line = line; this.column = col; }; var SourceLocation = function SourceLocation(start, end) { classCallCheck(this, SourceLocation); this.start = start; this.end = end; }; // The `getLineInfo` function is mostly useful when the // `locations` option is off (for performance reasons) and you // want to find the line/column position for a given character // offset. `input` should be the code string that the offset refers // into. 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); } } } var State = function () { function State() { classCallCheck(this, State); } State.prototype.init = function init(options, input) { this.strict = options.strictMode === false ? false : options.sourceType === "module"; this.input = input; this.potentialArrowAt = -1; this.inMethod = this.inFunction = this.inGenerator = this.inAsync = this.inPropertyName = this.inType = this.inClassProperty = this.noAnonFunctionType = false; this.labels = []; this.decorators = []; this.tokens = []; this.comments = []; this.trailingComments = []; this.leadingComments = []; this.commentStack = []; 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 = []; return this; }; // TODO // TODO // Used to signify the start of a potential arrow function // Flags to track whether we are in a function, a generator. // Labels in scope. // Leading decorators. // Token store. // Comment store. // Comment attachment store // The current position of the tokenizer in the input. // Properties of the current token: // Its type // For tokens that include more information than their type, the value // Its start and end offset // And, if locations are used, the {line, column} object // corresponding to those offsets // Position information for the previous token // The context stack is used to superficially track syntactic // context to predict whether a regular expression is allowed in a // given position. // Used to signal to callers of `readWord1` whether the word // contained any escape sequences. This is needed because words with // escape sequences must not be interpreted as keywords. // TODO // Names of exports store. `default` is stored as a name for both // `export default foo;` and `export { foo as default };`. State.prototype.curPosition = function curPosition() { return new Position(this.curLine, this.pos - this.lineStart); }; State.prototype.clone = function clone(skipArrays) { var state = new State(); for (var key in this) { var val = this[key]; if ((!skipArrays || key === "context") && Array.isArray(val)) { val = val.slice(); } state[key] = val; } return state; }; return State; }(); // Object type used to represent tokens. Note that normally, tokens // simply exist as properties on the parser object. This is only // used for the onToken callback and the external tokenizer. var Token = function Token(state) { classCallCheck(this, Token); this.type = state.type; this.value = state.value; this.start = state.start; this.end = state.end; this.loc = new SourceLocation(state.startLoc, state.endLoc); }; // ## Tokenizer function codePointToString(code) { // UTF-16 Decoding if (code <= 0xFFFF) { return String.fromCharCode(code); } else { return String.fromCharCode((code - 0x10000 >> 10) + 0xD800, (code - 0x10000 & 1023) + 0xDC00); } } var Tokenizer = function () { function Tokenizer(options, input) { classCallCheck(this, Tokenizer); this.state = new State(); this.state.init(options, input); } // Move to the next token Tokenizer.prototype.next = function next() { if (!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(); }; // TODO Tokenizer.prototype.eat = function eat(type) { if (this.match(type)) { this.next(); return true; } else { return false; } }; // TODO Tokenizer.prototype.match = function match(type) { return this.state.type === type; }; // TODO Tokenizer.prototype.isKeyword = function isKeyword$$1(word) { return isKeyword(word); }; // TODO Tokenizer.prototype.lookahead = function lookahead() { var old = this.state; this.state = old.clone(true); this.isLookahead = true; this.next(); this.isLookahead = false; var curr = this.state.clone(true); this.state = old; return curr; }; // Toggle strict mode. Re-reads the next number or string to please // pedantic tests (`"use strict"; 010;` should fail). Tokenizer.prototype.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(); }; Tokenizer.prototype.curContext = function curContext() { return this.state.context[this.state.context.length - 1]; }; // Read a single token, updating the parser object's token-related // properties. Tokenizer.prototype.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) return this.finishToken(types.eof); if (curContext.override) { return curContext.override(this); } else { return this.readToken(this.fullCharCodeAtPos()); } }; Tokenizer.prototype.readToken = function readToken(code) { // Identifier or keyword. '\uXXXX' sequences are allowed in // identifiers, so '\' also dispatches to that. if (isIdentifierStart(code) || code === 92 /* '\' */) { return this.readWord(); } else { return this.getTokenFromCode(code); } }; Tokenizer.prototype.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; }; Tokenizer.prototype.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) { this.state.tokens.push(comment); this.state.comments.push(comment); this.addComment(comment); } }; Tokenizer.prototype.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 = void 0; 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()); }; Tokenizer.prototype.skipLineComment = function skipLineComment(startSkip) { var start = this.state.pos; var startLoc = this.state.curPosition(); var ch = this.input.charCodeAt(this.state.pos += startSkip); while (this.state.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) { ++this.state.pos; 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()); }; // Called at the start of the parse and after every token. Skips // whitespace and comments, and. Tokenizer.prototype.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; } } } }; // Called at the end of every token. Sets `end`, `val`, and // maintains `context` and `exprAllowed`, and skips the space after // the token, so that the next one's `start` will point at the // right position. Tokenizer.prototype.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); }; // ### Token reading // This is the function that is called to fetch the next token. It // is somewhat obscure, because it works in character codes rather // than characters, and because operator parsing has been inlined // into it. // // All in the name of speed. // Tokenizer.prototype.readToken_dot = function readToken_dot() { var next = this.input.charCodeAt(this.state.pos + 1); if (next >= 48 && next <= 57) { return this.readNumber(true); } var next2 = this.input.charCodeAt(this.state.pos + 2); if (next === 46 && next2 === 46) { // 46 = dot '.' this.state.pos += 3; return this.finishToken(types.ellipsis); } else { ++this.state.pos; return this.finishToken(types.dot); } }; Tokenizer.prototype.readToken_slash = function readToken_slash() { // '/' if (this.state.exprAllowed) { ++this.state.pos; return this.readRegexp(); } var next = this.input.charCodeAt(this.state.pos + 1); if (next === 61) { return this.finishOp(types.assign, 2); } else { return this.finishOp(types.slash, 1); } }; Tokenizer.prototype.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); if (next === 42) { // '*' width++; next = this.input.charCodeAt(this.state.pos + 2); type = types.exponent; } if (next === 61) { width++; type = types.assign; } return this.finishOp(type, width); }; Tokenizer.prototype.readToken_pipe_amp = function readToken_pipe_amp(code) { // '|&' var next = this.input.charCodeAt(this.state.pos + 1); if (next === code) return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2); if (next === 61) return this.finishOp(types.assign, 2); if (code === 124 && next === 125 && this.hasPlugin("flow")) return this.finishOp(types.braceBarR, 2); return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1); }; Tokenizer.prototype.readToken_caret = function readToken_caret() { // '^' var next = this.input.charCodeAt(this.state.pos + 1); if (next === 61) { return this.finishOp(types.assign, 2); } else { return this.finishOp(types.bitwiseXOR, 1); } }; Tokenizer.prototype.readToken_plus_min = function readToken_plus_min(code) { // '+-' var next = this.input.charCodeAt(this.state.pos + 1); if (next === code) { if (next === 45 && this.input.charCodeAt(this.state.pos + 2) === 62 && lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos))) { // A `-->` line comment this.skipLineComment(3); this.skipSpace(); return this.nextToken(); } return this.finishOp(types.incDec, 2); } if (next === 61) { return this.finishOp(types.assign, 2); } else { return this.finishOp(types.plusMin, 1); } }; Tokenizer.prototype.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) return this.finishOp(types.assign, size + 1); return this.finishOp(types.bitShift, size); } if (next === 33 && code === 60 && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) { if (this.inModule) this.unexpected(); // `