]> git.proxmox.com Git - mirror_novnc.git/blame - vendor/browser-es-module-loader/dist/babel-worker.js
Add eslint and fix reported issues
[mirror_novnc.git] / vendor / browser-es-module-loader / dist / babel-worker.js
CommitLineData
399fa2ee
SR
1(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2'use strict';
3module.exports = function () {
4 return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
5};
6
7},{}],2:[function(require,module,exports){
8'use strict';
9
10function assembleStyles () {
11 var styles = {
12 modifiers: {
13 reset: [0, 0],
14 bold: [1, 22], // 21 isn't widely supported and 22 does the same thing
15 dim: [2, 22],
16 italic: [3, 23],
17 underline: [4, 24],
18 inverse: [7, 27],
19 hidden: [8, 28],
20 strikethrough: [9, 29]
21 },
22 colors: {
23 black: [30, 39],
24 red: [31, 39],
25 green: [32, 39],
26 yellow: [33, 39],
27 blue: [34, 39],
28 magenta: [35, 39],
29 cyan: [36, 39],
30 white: [37, 39],
31 gray: [90, 39]
32 },
33 bgColors: {
34 bgBlack: [40, 49],
35 bgRed: [41, 49],
36 bgGreen: [42, 49],
37 bgYellow: [43, 49],
38 bgBlue: [44, 49],
39 bgMagenta: [45, 49],
40 bgCyan: [46, 49],
41 bgWhite: [47, 49]
42 }
43 };
44
45 // fix humans
46 styles.colors.grey = styles.colors.gray;
47
48 Object.keys(styles).forEach(function (groupName) {
49 var group = styles[groupName];
50
51 Object.keys(group).forEach(function (styleName) {
52 var style = group[styleName];
53
54 styles[styleName] = group[styleName] = {
55 open: '\u001b[' + style[0] + 'm',
56 close: '\u001b[' + style[1] + 'm'
57 };
58 });
59
60 Object.defineProperty(styles, groupName, {
61 value: group,
62 enumerable: false
63 });
64 });
65
66 return styles;
67}
68
69Object.defineProperty(module, 'exports', {
70 enumerable: true,
71 get: assembleStyles
72});
73
74},{}],3:[function(require,module,exports){
75"use strict";
76
77exports.__esModule = true;
78
79exports.default = function (rawLines, lineNumber, colNumber) {
80 var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
81
82 colNumber = Math.max(colNumber, 0);
83
84 var highlighted = opts.highlightCode && _chalk2.default.supportsColor || opts.forceColor;
85 var chalk = _chalk2.default;
86 if (opts.forceColor) {
87 chalk = new _chalk2.default.constructor({ enabled: true });
88 }
89 var maybeHighlight = function maybeHighlight(chalkFn, string) {
90 return highlighted ? chalkFn(string) : string;
91 };
92 var defs = getDefs(chalk);
93 if (highlighted) rawLines = highlight(defs, rawLines);
94
95 var linesAbove = opts.linesAbove || 2;
96 var linesBelow = opts.linesBelow || 3;
97
98 var lines = rawLines.split(NEWLINE);
99 var start = Math.max(lineNumber - (linesAbove + 1), 0);
100 var end = Math.min(lines.length, lineNumber + linesBelow);
101
102 if (!lineNumber && !colNumber) {
103 start = 0;
104 end = lines.length;
105 }
106
107 var numberMaxWidth = String(end).length;
108
109 var frame = lines.slice(start, end).map(function (line, index) {
110 var number = start + 1 + index;
111 var paddedNumber = (" " + number).slice(-numberMaxWidth);
112 var gutter = " " + paddedNumber + " | ";
113 if (number === lineNumber) {
114 var markerLine = "";
115 if (colNumber) {
116 var markerSpacing = line.slice(0, colNumber - 1).replace(/[^\t]/g, " ");
117 markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^")].join("");
118 }
119 return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join("");
120 } else {
121 return " " + maybeHighlight(defs.gutter, gutter) + line;
122 }
123 }).join("\n");
124
125 if (highlighted) {
126 return chalk.reset(frame);
127 } else {
128 return frame;
129 }
130};
131
132var _jsTokens = require("js-tokens");
133
134var _jsTokens2 = _interopRequireDefault(_jsTokens);
135
136var _esutils = require("esutils");
137
138var _esutils2 = _interopRequireDefault(_esutils);
139
140var _chalk = require("chalk");
141
142var _chalk2 = _interopRequireDefault(_chalk);
143
144function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
145
146function getDefs(chalk) {
147 return {
148 keyword: chalk.cyan,
149 capitalized: chalk.yellow,
150 jsx_tag: chalk.yellow,
151 punctuator: chalk.yellow,
152
153 number: chalk.magenta,
154 string: chalk.green,
155 regex: chalk.magenta,
156 comment: chalk.grey,
157 invalid: chalk.white.bgRed.bold,
158 gutter: chalk.grey,
159 marker: chalk.red.bold
160 };
161}
162
163var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
164
165var JSX_TAG = /^[a-z][\w-]*$/i;
166
167var BRACKET = /^[()\[\]{}]$/;
168
169function getTokenType(match) {
170 var _match$slice = match.slice(-2),
171 offset = _match$slice[0],
172 text = _match$slice[1];
173
174 var token = (0, _jsTokens.matchToToken)(match);
175
176 if (token.type === "name") {
177 if (_esutils2.default.keyword.isReservedWordES6(token.value)) {
178 return "keyword";
179 }
180
181 if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) {
182 return "jsx_tag";
183 }
184
185 if (token.value[0] !== token.value[0].toLowerCase()) {
186 return "capitalized";
187 }
188 }
189
190 if (token.type === "punctuator" && BRACKET.test(token.value)) {
191 return "bracket";
192 }
193
194 return token.type;
195}
196
197function highlight(defs, text) {
198 return text.replace(_jsTokens2.default, function () {
199 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
200 args[_key] = arguments[_key];
201 }
202
203 var type = getTokenType(args);
204 var colorize = defs[type];
205 if (colorize) {
206 return args[0].split(NEWLINE).map(function (str) {
207 return colorize(str);
208 }).join("\n");
209 } else {
210 return args[0];
211 }
212 });
213}
214
215module.exports = exports["default"];
216},{"chalk":122,"esutils":240,"js-tokens":248}],4:[function(require,module,exports){
217module.exports = require("./lib/api/node.js");
218
219},{"./lib/api/node.js":5}],5:[function(require,module,exports){
220"use strict";
221
222exports.__esModule = true;
223exports.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;
224
225var _file = require("../transformation/file");
226
227Object.defineProperty(exports, "File", {
228 enumerable: true,
229 get: function get() {
230 return _interopRequireDefault(_file).default;
231 }
232});
233
234var _config = require("../transformation/file/options/config");
235
236Object.defineProperty(exports, "options", {
237 enumerable: true,
238 get: function get() {
239 return _interopRequireDefault(_config).default;
240 }
241});
242
243var _buildExternalHelpers = require("../tools/build-external-helpers");
244
245Object.defineProperty(exports, "buildExternalHelpers", {
246 enumerable: true,
247 get: function get() {
248 return _interopRequireDefault(_buildExternalHelpers).default;
249 }
250});
251
252var _babelTemplate = require("babel-template");
253
254Object.defineProperty(exports, "template", {
255 enumerable: true,
256 get: function get() {
257 return _interopRequireDefault(_babelTemplate).default;
258 }
259});
260
261var _resolvePlugin = require("../helpers/resolve-plugin");
262
263Object.defineProperty(exports, "resolvePlugin", {
264 enumerable: true,
265 get: function get() {
266 return _interopRequireDefault(_resolvePlugin).default;
267 }
268});
269
270var _resolvePreset = require("../helpers/resolve-preset");
271
272Object.defineProperty(exports, "resolvePreset", {
273 enumerable: true,
274 get: function get() {
275 return _interopRequireDefault(_resolvePreset).default;
276 }
277});
278
279var _package = require("../../package");
280
281Object.defineProperty(exports, "version", {
282 enumerable: true,
283 get: function get() {
284 return _package.version;
285 }
286});
287exports.Plugin = Plugin;
288exports.transformFile = transformFile;
289exports.transformFileSync = transformFileSync;
290
291var _fs = require("fs");
292
293var _fs2 = _interopRequireDefault(_fs);
294
295var _util = require("../util");
296
297var util = _interopRequireWildcard(_util);
298
299var _babelMessages = require("babel-messages");
300
301var messages = _interopRequireWildcard(_babelMessages);
302
303var _babelTypes = require("babel-types");
304
305var t = _interopRequireWildcard(_babelTypes);
306
307var _babelTraverse = require("babel-traverse");
308
309var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
310
311var _optionManager = require("../transformation/file/options/option-manager");
312
313var _optionManager2 = _interopRequireDefault(_optionManager);
314
315var _pipeline = require("../transformation/pipeline");
316
317var _pipeline2 = _interopRequireDefault(_pipeline);
318
319function _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; } }
320
321function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
322
323exports.util = util;
324exports.messages = messages;
325exports.types = t;
326exports.traverse = _babelTraverse2.default;
327exports.OptionManager = _optionManager2.default;
328function Plugin(alias) {
329 throw new Error("The (" + alias + ") Babel 5 plugin is being run with Babel 6.");
330}
331
332exports.Pipeline = _pipeline2.default;
333
334
335var pipeline = new _pipeline2.default();
336var analyse = exports.analyse = pipeline.analyse.bind(pipeline);
337var transform = exports.transform = pipeline.transform.bind(pipeline);
338var transformFromAst = exports.transformFromAst = pipeline.transformFromAst.bind(pipeline);
339
340function transformFile(filename, opts, callback) {
341 if (typeof opts === "function") {
342 callback = opts;
343 opts = {};
344 }
345
346 opts.filename = filename;
347
348 _fs2.default.readFile(filename, function (err, code) {
349 var result = void 0;
350
351 if (!err) {
352 try {
353 result = transform(code, opts);
354 } catch (_err) {
355 err = _err;
356 }
357 }
358
359 if (err) {
360 callback(err);
361 } else {
362 callback(null, result);
363 }
364 });
365}
366
367function transformFileSync(filename) {
368 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
369
370 opts.filename = filename;
371 return transform(_fs2.default.readFileSync(filename, "utf8"), opts);
372}
373},{"../../package":31,"../helpers/resolve-plugin":11,"../helpers/resolve-preset":12,"../tools/build-external-helpers":15,"../transformation/file":16,"../transformation/file/options/config":20,"../transformation/file/options/option-manager":22,"../transformation/pipeline":27,"../util":30,"babel-messages":53,"babel-template":75,"babel-traverse":79,"babel-types":112,"fs":120}],6:[function(require,module,exports){
374"use strict";
375
376exports.__esModule = true;
377exports.default = getPossiblePluginNames;
378function getPossiblePluginNames(pluginName) {
379 return ["babel-plugin-" + pluginName, pluginName];
380}
381module.exports = exports["default"];
382},{}],7:[function(require,module,exports){
383"use strict";
384
385exports.__esModule = true;
386exports.default = getPossiblePresetNames;
387function getPossiblePresetNames(presetName) {
388 var possibleNames = ["babel-preset-" + presetName, presetName];
389
390 var matches = presetName.match(/^(@[^/]+)\/(.+)$/);
391 if (matches) {
392 var orgName = matches[1],
393 presetPath = matches[2];
394
395 possibleNames.push(orgName + "/babel-preset-" + presetPath);
396 }
397
398 return possibleNames;
399}
400module.exports = exports["default"];
401},{}],8:[function(require,module,exports){
402"use strict";
403
404exports.__esModule = true;
405
406var _getIterator2 = require("babel-runtime/core-js/get-iterator");
407
408var _getIterator3 = _interopRequireDefault(_getIterator2);
409
410exports.default = function (dest, src) {
411 if (!dest || !src) return;
412
413 return (0, _mergeWith2.default)(dest, src, function (a, b) {
414 if (b && Array.isArray(a)) {
415 var newArray = b.slice(0);
416
417 for (var _iterator = a, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
418 var _ref;
419
420 if (_isArray) {
421 if (_i >= _iterator.length) break;
422 _ref = _iterator[_i++];
423 } else {
424 _i = _iterator.next();
425 if (_i.done) break;
426 _ref = _i.value;
427 }
428
429 var item = _ref;
430
431 if (newArray.indexOf(item) < 0) {
432 newArray.push(item);
433 }
434 }
435
436 return newArray;
437 }
438 });
439};
440
441var _mergeWith = require("lodash/mergeWith");
442
443var _mergeWith2 = _interopRequireDefault(_mergeWith);
444
445function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
446
447module.exports = exports["default"];
448},{"babel-runtime/core-js/get-iterator":56,"lodash/mergeWith":451}],9:[function(require,module,exports){
449"use strict";
450
451exports.__esModule = true;
452
453exports.default = function (ast, comments, tokens) {
454 if (ast) {
455 if (ast.type === "Program") {
456 return t.file(ast, comments || [], tokens || []);
457 } else if (ast.type === "File") {
458 return ast;
459 }
460 }
461
462 throw new Error("Not a valid ast?");
463};
464
465var _babelTypes = require("babel-types");
466
467var t = _interopRequireWildcard(_babelTypes);
468
469function _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; } }
470
471module.exports = exports["default"];
472},{"babel-types":112}],10:[function(require,module,exports){
473"use strict";
474
475exports.__esModule = true;
476exports.default = resolveFromPossibleNames;
477
478var _resolve = require("./resolve");
479
480var _resolve2 = _interopRequireDefault(_resolve);
481
482function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
483
484function resolveFromPossibleNames(possibleNames, dirname) {
485 return possibleNames.reduce(function (accum, curr) {
486 return accum || (0, _resolve2.default)(curr, dirname);
487 }, null);
488}
489module.exports = exports["default"];
490},{"./resolve":13}],11:[function(require,module,exports){
491(function (process){
492"use strict";
493
494exports.__esModule = true;
495exports.default = resolvePlugin;
496
497var _resolveFromPossibleNames = require("./resolve-from-possible-names");
498
499var _resolveFromPossibleNames2 = _interopRequireDefault(_resolveFromPossibleNames);
500
501var _getPossiblePluginNames = require("./get-possible-plugin-names");
502
503var _getPossiblePluginNames2 = _interopRequireDefault(_getPossiblePluginNames);
504
505function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
506
507function resolvePlugin(pluginName) {
508 var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd();
509
510 return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePluginNames2.default)(pluginName), dirname);
511}
512module.exports = exports["default"];
513}).call(this,require('_process'))
514},{"./get-possible-plugin-names":6,"./resolve-from-possible-names":10,"_process":471}],12:[function(require,module,exports){
515(function (process){
516"use strict";
517
518exports.__esModule = true;
519exports.default = resolvePreset;
520
521var _resolveFromPossibleNames = require("./resolve-from-possible-names");
522
523var _resolveFromPossibleNames2 = _interopRequireDefault(_resolveFromPossibleNames);
524
525var _getPossiblePresetNames = require("./get-possible-preset-names");
526
527var _getPossiblePresetNames2 = _interopRequireDefault(_getPossiblePresetNames);
528
529function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
530
531function resolvePreset(presetName) {
532 var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd();
533
534 return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePresetNames2.default)(presetName), dirname);
535}
536module.exports = exports["default"];
537}).call(this,require('_process'))
538},{"./get-possible-preset-names":7,"./resolve-from-possible-names":10,"_process":471}],13:[function(require,module,exports){
539(function (process){
540"use strict";
541
542exports.__esModule = true;
543
544var _typeof2 = require("babel-runtime/helpers/typeof");
545
546var _typeof3 = _interopRequireDefault(_typeof2);
547
548exports.default = function (loc) {
549 var relative = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd();
550
551 if ((typeof _module2.default === "undefined" ? "undefined" : (0, _typeof3.default)(_module2.default)) === "object") return null;
552
553 var relativeMod = relativeModules[relative];
554
555 if (!relativeMod) {
556 relativeMod = new _module2.default();
557
558 var filename = _path2.default.join(relative, ".babelrc");
559 relativeMod.id = filename;
560 relativeMod.filename = filename;
561
562 relativeMod.paths = _module2.default._nodeModulePaths(relative);
563 relativeModules[relative] = relativeMod;
564 }
565
566 try {
567 return _module2.default._resolveFilename(loc, relativeMod);
568 } catch (err) {
569 return null;
570 }
571};
572
573var _module = require("module");
574
575var _module2 = _interopRequireDefault(_module);
576
577var _path = require("path");
578
579var _path2 = _interopRequireDefault(_path);
580
581function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
582
583var relativeModules = {};
584
585module.exports = exports["default"];
586}).call(this,require('_process'))
587},{"_process":471,"babel-runtime/helpers/typeof":74,"module":120,"path":469}],14:[function(require,module,exports){
588"use strict";
589
590exports.__esModule = true;
591
592var _map = require("babel-runtime/core-js/map");
593
594var _map2 = _interopRequireDefault(_map);
595
596var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
597
598var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
599
600var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn");
601
602var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
603
604var _inherits2 = require("babel-runtime/helpers/inherits");
605
606var _inherits3 = _interopRequireDefault(_inherits2);
607
608function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
609
610var Store = function (_Map) {
611 (0, _inherits3.default)(Store, _Map);
612
613 function Store() {
614 (0, _classCallCheck3.default)(this, Store);
615
616 var _this = (0, _possibleConstructorReturn3.default)(this, _Map.call(this));
617
618 _this.dynamicData = {};
619 return _this;
620 }
621
622 Store.prototype.setDynamic = function setDynamic(key, fn) {
623 this.dynamicData[key] = fn;
624 };
625
626 Store.prototype.get = function get(key) {
627 if (this.has(key)) {
628 return _Map.prototype.get.call(this, key);
629 } else {
630 if (Object.prototype.hasOwnProperty.call(this.dynamicData, key)) {
631 var val = this.dynamicData[key]();
632 this.set(key, val);
633 return val;
634 }
635 }
636 };
637
638 return Store;
639}(_map2.default);
640
641exports.default = Store;
642module.exports = exports["default"];
643},{"babel-runtime/core-js/map":58,"babel-runtime/helpers/classCallCheck":70,"babel-runtime/helpers/inherits":71,"babel-runtime/helpers/possibleConstructorReturn":73}],15:[function(require,module,exports){
644"use strict";
645
646exports.__esModule = true;
647
648exports.default = function (whitelist) {
649 var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "global";
650
651 var namespace = t.identifier("babelHelpers");
652
653 var builder = function builder(body) {
654 return buildHelpers(body, namespace, whitelist);
655 };
656
657 var tree = void 0;
658
659 var build = {
660 global: buildGlobal,
661 umd: buildUmd,
662 var: buildVar
663 }[outputType];
664
665 if (build) {
666 tree = build(namespace, builder);
667 } else {
668 throw new Error(messages.get("unsupportedOutputType", outputType));
669 }
670
671 return (0, _babelGenerator2.default)(tree).code;
672};
673
674var _babelHelpers = require("babel-helpers");
675
676var helpers = _interopRequireWildcard(_babelHelpers);
677
678var _babelGenerator = require("babel-generator");
679
680var _babelGenerator2 = _interopRequireDefault(_babelGenerator);
681
682var _babelMessages = require("babel-messages");
683
684var messages = _interopRequireWildcard(_babelMessages);
685
686var _babelTemplate = require("babel-template");
687
688var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
689
690var _babelTypes = require("babel-types");
691
692var t = _interopRequireWildcard(_babelTypes);
693
694function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
695
696function _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; } }
697
698var 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");
699
700function buildGlobal(namespace, builder) {
701 var body = [];
702 var container = t.functionExpression(null, [t.identifier("global")], t.blockStatement(body));
703 var tree = t.program([t.expressionStatement(t.callExpression(container, [helpers.get("selfGlobal")]))]);
704
705 body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.assignmentExpression("=", t.memberExpression(t.identifier("global"), namespace), t.objectExpression([])))]));
706
707 builder(body);
708
709 return tree;
710}
711
712function buildUmd(namespace, builder) {
713 var body = [];
714 body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.identifier("global"))]));
715
716 builder(body);
717
718 return t.program([buildUmdWrapper({
719 FACTORY_PARAMETERS: t.identifier("global"),
720 BROWSER_ARGUMENTS: t.assignmentExpression("=", t.memberExpression(t.identifier("root"), namespace), t.objectExpression([])),
721 COMMON_ARGUMENTS: t.identifier("exports"),
722 AMD_ARGUMENTS: t.arrayExpression([t.stringLiteral("exports")]),
723 FACTORY_BODY: body,
724 UMD_ROOT: t.identifier("this")
725 })]);
726}
727
728function buildVar(namespace, builder) {
729 var body = [];
730 body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.objectExpression([]))]));
731 builder(body);
732 body.push(t.expressionStatement(namespace));
733 return t.program(body);
734}
735
736function buildHelpers(body, namespace, whitelist) {
737 helpers.list.forEach(function (name) {
738 if (whitelist && whitelist.indexOf(name) < 0) return;
739
740 var key = t.identifier(name);
741 body.push(t.expressionStatement(t.assignmentExpression("=", t.memberExpression(namespace, key), helpers.get(name))));
742 });
743}
744module.exports = exports["default"];
745},{"babel-generator":43,"babel-helpers":52,"babel-messages":53,"babel-template":75,"babel-types":112}],16:[function(require,module,exports){
746(function (process){
747"use strict";
748
749exports.__esModule = true;
750exports.File = undefined;
751
752var _typeof2 = require("babel-runtime/helpers/typeof");
753
754var _typeof3 = _interopRequireDefault(_typeof2);
755
756var _getIterator2 = require("babel-runtime/core-js/get-iterator");
757
758var _getIterator3 = _interopRequireDefault(_getIterator2);
759
760var _create = require("babel-runtime/core-js/object/create");
761
762var _create2 = _interopRequireDefault(_create);
763
764var _assign = require("babel-runtime/core-js/object/assign");
765
766var _assign2 = _interopRequireDefault(_assign);
767
768var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
769
770var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
771
772var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn");
773
774var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
775
776var _inherits2 = require("babel-runtime/helpers/inherits");
777
778var _inherits3 = _interopRequireDefault(_inherits2);
779
780var _babelHelpers = require("babel-helpers");
781
782var _babelHelpers2 = _interopRequireDefault(_babelHelpers);
783
784var _metadata = require("./metadata");
785
786var metadataVisitor = _interopRequireWildcard(_metadata);
787
788var _convertSourceMap = require("convert-source-map");
789
790var _convertSourceMap2 = _interopRequireDefault(_convertSourceMap);
791
792var _optionManager = require("./options/option-manager");
793
794var _optionManager2 = _interopRequireDefault(_optionManager);
795
796var _pluginPass = require("../plugin-pass");
797
798var _pluginPass2 = _interopRequireDefault(_pluginPass);
799
800var _babelTraverse = require("babel-traverse");
801
802var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
803
804var _sourceMap = require("source-map");
805
806var _sourceMap2 = _interopRequireDefault(_sourceMap);
807
808var _babelGenerator = require("babel-generator");
809
810var _babelGenerator2 = _interopRequireDefault(_babelGenerator);
811
812var _babelCodeFrame = require("babel-code-frame");
813
814var _babelCodeFrame2 = _interopRequireDefault(_babelCodeFrame);
815
816var _defaults = require("lodash/defaults");
817
818var _defaults2 = _interopRequireDefault(_defaults);
819
820var _logger = require("./logger");
821
822var _logger2 = _interopRequireDefault(_logger);
823
824var _store = require("../../store");
825
826var _store2 = _interopRequireDefault(_store);
827
828var _babylon = require("babylon");
829
830var _util = require("../../util");
831
832var util = _interopRequireWildcard(_util);
833
834var _path = require("path");
835
836var _path2 = _interopRequireDefault(_path);
837
838var _babelTypes = require("babel-types");
839
840var t = _interopRequireWildcard(_babelTypes);
841
842var _resolve = require("../../helpers/resolve");
843
844var _resolve2 = _interopRequireDefault(_resolve);
845
846var _blockHoist = require("../internal-plugins/block-hoist");
847
848var _blockHoist2 = _interopRequireDefault(_blockHoist);
849
850var _shadowFunctions = require("../internal-plugins/shadow-functions");
851
852var _shadowFunctions2 = _interopRequireDefault(_shadowFunctions);
853
854function _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; } }
855
856function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
857
858var shebangRegex = /^#!.*/;
859
860var INTERNAL_PLUGINS = [[_blockHoist2.default], [_shadowFunctions2.default]];
861
862var errorVisitor = {
863 enter: function enter(path, state) {
864 var loc = path.node.loc;
865 if (loc) {
866 state.loc = loc;
867 path.stop();
868 }
869 }
870};
871
872var File = function (_Store) {
873 (0, _inherits3.default)(File, _Store);
874
875 function File() {
876 var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
877 var pipeline = arguments[1];
878 (0, _classCallCheck3.default)(this, File);
879
880 var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this));
881
882 _this.pipeline = pipeline;
883
884 _this.log = new _logger2.default(_this, opts.filename || "unknown");
885 _this.opts = _this.initOptions(opts);
886
887 _this.parserOpts = {
888 sourceType: _this.opts.sourceType,
889 sourceFileName: _this.opts.filename,
890 plugins: []
891 };
892
893 _this.pluginVisitors = [];
894 _this.pluginPasses = [];
895
896 _this.buildPluginsForOptions(_this.opts);
897
898 if (_this.opts.passPerPreset) {
899 _this.perPresetOpts = [];
900 _this.opts.presets.forEach(function (presetOpts) {
901 var perPresetOpts = (0, _assign2.default)((0, _create2.default)(_this.opts), presetOpts);
902 _this.perPresetOpts.push(perPresetOpts);
903 _this.buildPluginsForOptions(perPresetOpts);
904 });
905 }
906
907 _this.metadata = {
908 usedHelpers: [],
909 marked: [],
910 modules: {
911 imports: [],
912 exports: {
913 exported: [],
914 specifiers: []
915 }
916 }
917 };
918
919 _this.dynamicImportTypes = {};
920 _this.dynamicImportIds = {};
921 _this.dynamicImports = [];
922 _this.declarations = {};
923 _this.usedHelpers = {};
924
925 _this.path = null;
926 _this.ast = {};
927
928 _this.code = "";
929 _this.shebang = "";
930
931 _this.hub = new _babelTraverse.Hub(_this);
932 return _this;
933 }
934
935 File.prototype.getMetadata = function getMetadata() {
936 var has = false;
937 for (var _iterator = this.ast.program.body, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
938 var _ref;
939
940 if (_isArray) {
941 if (_i >= _iterator.length) break;
942 _ref = _iterator[_i++];
943 } else {
944 _i = _iterator.next();
945 if (_i.done) break;
946 _ref = _i.value;
947 }
948
949 var node = _ref;
950
951 if (t.isModuleDeclaration(node)) {
952 has = true;
953 break;
954 }
955 }
956 if (has) {
957 this.path.traverse(metadataVisitor, this);
958 }
959 };
960
961 File.prototype.initOptions = function initOptions(opts) {
962 opts = new _optionManager2.default(this.log, this.pipeline).init(opts);
963
964 if (opts.inputSourceMap) {
965 opts.sourceMaps = true;
966 }
967
968 if (opts.moduleId) {
969 opts.moduleIds = true;
970 }
971
972 opts.basename = _path2.default.basename(opts.filename, _path2.default.extname(opts.filename));
973
974 opts.ignore = util.arrayify(opts.ignore, util.regexify);
975
976 if (opts.only) opts.only = util.arrayify(opts.only, util.regexify);
977
978 (0, _defaults2.default)(opts, {
979 moduleRoot: opts.sourceRoot
980 });
981
982 (0, _defaults2.default)(opts, {
983 sourceRoot: opts.moduleRoot
984 });
985
986 (0, _defaults2.default)(opts, {
987 filenameRelative: opts.filename
988 });
989
990 var basenameRelative = _path2.default.basename(opts.filenameRelative);
991
992 (0, _defaults2.default)(opts, {
993 sourceFileName: basenameRelative,
994 sourceMapTarget: basenameRelative
995 });
996
997 return opts;
998 };
999
1000 File.prototype.buildPluginsForOptions = function buildPluginsForOptions(opts) {
1001 if (!Array.isArray(opts.plugins)) {
1002 return;
1003 }
1004
1005 var plugins = opts.plugins.concat(INTERNAL_PLUGINS);
1006 var currentPluginVisitors = [];
1007 var currentPluginPasses = [];
1008
1009 for (var _iterator2 = plugins, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
1010 var _ref2;
1011
1012 if (_isArray2) {
1013 if (_i2 >= _iterator2.length) break;
1014 _ref2 = _iterator2[_i2++];
1015 } else {
1016 _i2 = _iterator2.next();
1017 if (_i2.done) break;
1018 _ref2 = _i2.value;
1019 }
1020
1021 var ref = _ref2;
1022 var plugin = ref[0],
1023 pluginOpts = ref[1];
1024
1025
1026 currentPluginVisitors.push(plugin.visitor);
1027 currentPluginPasses.push(new _pluginPass2.default(this, plugin, pluginOpts));
1028
1029 if (plugin.manipulateOptions) {
1030 plugin.manipulateOptions(opts, this.parserOpts, this);
1031 }
1032 }
1033
1034 this.pluginVisitors.push(currentPluginVisitors);
1035 this.pluginPasses.push(currentPluginPasses);
1036 };
1037
1038 File.prototype.getModuleName = function getModuleName() {
1039 var opts = this.opts;
1040 if (!opts.moduleIds) {
1041 return null;
1042 }
1043
1044 if (opts.moduleId != null && !opts.getModuleId) {
1045 return opts.moduleId;
1046 }
1047
1048 var filenameRelative = opts.filenameRelative;
1049 var moduleName = "";
1050
1051 if (opts.moduleRoot != null) {
1052 moduleName = opts.moduleRoot + "/";
1053 }
1054
1055 if (!opts.filenameRelative) {
1056 return moduleName + opts.filename.replace(/^\//, "");
1057 }
1058
1059 if (opts.sourceRoot != null) {
1060 var sourceRootRegEx = new RegExp("^" + opts.sourceRoot + "\/?");
1061 filenameRelative = filenameRelative.replace(sourceRootRegEx, "");
1062 }
1063
1064 filenameRelative = filenameRelative.replace(/\.(\w*?)$/, "");
1065
1066 moduleName += filenameRelative;
1067
1068 moduleName = moduleName.replace(/\\/g, "/");
1069
1070 if (opts.getModuleId) {
1071 return opts.getModuleId(moduleName) || moduleName;
1072 } else {
1073 return moduleName;
1074 }
1075 };
1076
1077 File.prototype.resolveModuleSource = function resolveModuleSource(source) {
1078 var resolveModuleSource = this.opts.resolveModuleSource;
1079 if (resolveModuleSource) source = resolveModuleSource(source, this.opts.filename);
1080 return source;
1081 };
1082
1083 File.prototype.addImport = function addImport(source, imported) {
1084 var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : imported;
1085
1086 var alias = source + ":" + imported;
1087 var id = this.dynamicImportIds[alias];
1088
1089 if (!id) {
1090 source = this.resolveModuleSource(source);
1091 id = this.dynamicImportIds[alias] = this.scope.generateUidIdentifier(name);
1092
1093 var specifiers = [];
1094
1095 if (imported === "*") {
1096 specifiers.push(t.importNamespaceSpecifier(id));
1097 } else if (imported === "default") {
1098 specifiers.push(t.importDefaultSpecifier(id));
1099 } else {
1100 specifiers.push(t.importSpecifier(id, t.identifier(imported)));
1101 }
1102
1103 var declar = t.importDeclaration(specifiers, t.stringLiteral(source));
1104 declar._blockHoist = 3;
1105
1106 this.path.unshiftContainer("body", declar);
1107 }
1108
1109 return id;
1110 };
1111
1112 File.prototype.addHelper = function addHelper(name) {
1113 var declar = this.declarations[name];
1114 if (declar) return declar;
1115
1116 if (!this.usedHelpers[name]) {
1117 this.metadata.usedHelpers.push(name);
1118 this.usedHelpers[name] = true;
1119 }
1120
1121 var generator = this.get("helperGenerator");
1122 var runtime = this.get("helpersNamespace");
1123 if (generator) {
1124 var res = generator(name);
1125 if (res) return res;
1126 } else if (runtime) {
1127 return t.memberExpression(runtime, t.identifier(name));
1128 }
1129
1130 var ref = (0, _babelHelpers2.default)(name);
1131 var uid = this.declarations[name] = this.scope.generateUidIdentifier(name);
1132
1133 if (t.isFunctionExpression(ref) && !ref.id) {
1134 ref.body._compact = true;
1135 ref._generated = true;
1136 ref.id = uid;
1137 ref.type = "FunctionDeclaration";
1138 this.path.unshiftContainer("body", ref);
1139 } else {
1140 ref._compact = true;
1141 this.scope.push({
1142 id: uid,
1143 init: ref,
1144 unique: true
1145 });
1146 }
1147
1148 return uid;
1149 };
1150
1151 File.prototype.addTemplateObject = function addTemplateObject(helperName, strings, raw) {
1152 var stringIds = raw.elements.map(function (string) {
1153 return string.value;
1154 });
1155 var name = helperName + "_" + raw.elements.length + "_" + stringIds.join(",");
1156
1157 var declar = this.declarations[name];
1158 if (declar) return declar;
1159
1160 var uid = this.declarations[name] = this.scope.generateUidIdentifier("templateObject");
1161
1162 var helperId = this.addHelper(helperName);
1163 var init = t.callExpression(helperId, [strings, raw]);
1164 init._compact = true;
1165 this.scope.push({
1166 id: uid,
1167 init: init,
1168 _blockHoist: 1.9 });
1169 return uid;
1170 };
1171
1172 File.prototype.buildCodeFrameError = function buildCodeFrameError(node, msg) {
1173 var Error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : SyntaxError;
1174
1175 var loc = node && (node.loc || node._loc);
1176
1177 var err = new Error(msg);
1178
1179 if (loc) {
1180 err.loc = loc.start;
1181 } else {
1182 (0, _babelTraverse2.default)(node, errorVisitor, this.scope, err);
1183
1184 err.message += " (This is an error on an internal node. Probably an internal error";
1185
1186 if (err.loc) {
1187 err.message += ". Location has been estimated.";
1188 }
1189
1190 err.message += ")";
1191 }
1192
1193 return err;
1194 };
1195
1196 File.prototype.mergeSourceMap = function mergeSourceMap(map) {
1197 var inputMap = this.opts.inputSourceMap;
1198
1199 if (inputMap) {
1200 var _ret = function () {
1201 var inputMapConsumer = new _sourceMap2.default.SourceMapConsumer(inputMap);
1202 var outputMapConsumer = new _sourceMap2.default.SourceMapConsumer(map);
1203
1204 var mergedGenerator = new _sourceMap2.default.SourceMapGenerator({
1205 file: inputMapConsumer.file,
1206 sourceRoot: inputMapConsumer.sourceRoot
1207 });
1208
1209 var source = outputMapConsumer.sources[0];
1210
1211 inputMapConsumer.eachMapping(function (mapping) {
1212 var generatedPosition = outputMapConsumer.generatedPositionFor({
1213 line: mapping.generatedLine,
1214 column: mapping.generatedColumn,
1215 source: source
1216 });
1217 if (generatedPosition.column != null) {
1218 mergedGenerator.addMapping({
1219 source: mapping.source,
1220
1221 original: mapping.source == null ? null : {
1222 line: mapping.originalLine,
1223 column: mapping.originalColumn
1224 },
1225
1226 generated: generatedPosition
1227 });
1228 }
1229 });
1230
1231 var mergedMap = mergedGenerator.toJSON();
1232 inputMap.mappings = mergedMap.mappings;
1233 return {
1234 v: inputMap
1235 };
1236 }();
1237
1238 if ((typeof _ret === "undefined" ? "undefined" : (0, _typeof3.default)(_ret)) === "object") return _ret.v;
1239 } else {
1240 return map;
1241 }
1242 };
1243
1244 File.prototype.parse = function parse(code) {
1245 var parseCode = _babylon.parse;
1246 var parserOpts = this.opts.parserOpts;
1247
1248 if (parserOpts) {
1249 parserOpts = (0, _assign2.default)({}, this.parserOpts, parserOpts);
1250
1251 if (parserOpts.parser) {
1252 if (typeof parserOpts.parser === "string") {
1253 var dirname = _path2.default.dirname(this.opts.filename) || process.cwd();
1254 var parser = (0, _resolve2.default)(parserOpts.parser, dirname);
1255 if (parser) {
1256 parseCode = require(parser).parse;
1257 } else {
1258 throw new Error("Couldn't find parser " + parserOpts.parser + " with \"parse\" method " + ("relative to directory " + dirname));
1259 }
1260 } else {
1261 parseCode = parserOpts.parser;
1262 }
1263
1264 parserOpts.parser = {
1265 parse: function parse(source) {
1266 return (0, _babylon.parse)(source, parserOpts);
1267 }
1268 };
1269 }
1270 }
1271
1272 this.log.debug("Parse start");
1273 var ast = parseCode(code, parserOpts || this.parserOpts);
1274 this.log.debug("Parse stop");
1275 return ast;
1276 };
1277
1278 File.prototype._addAst = function _addAst(ast) {
1279 this.path = _babelTraverse.NodePath.get({
1280 hub: this.hub,
1281 parentPath: null,
1282 parent: ast,
1283 container: ast,
1284 key: "program"
1285 }).setContext();
1286 this.scope = this.path.scope;
1287 this.ast = ast;
1288 this.getMetadata();
1289 };
1290
1291 File.prototype.addAst = function addAst(ast) {
1292 this.log.debug("Start set AST");
1293 this._addAst(ast);
1294 this.log.debug("End set AST");
1295 };
1296
1297 File.prototype.transform = function transform() {
1298 for (var i = 0; i < this.pluginPasses.length; i++) {
1299 var pluginPasses = this.pluginPasses[i];
1300 this.call("pre", pluginPasses);
1301 this.log.debug("Start transform traverse");
1302
1303 var visitor = _babelTraverse2.default.visitors.merge(this.pluginVisitors[i], pluginPasses, this.opts.wrapPluginVisitorMethod);
1304 (0, _babelTraverse2.default)(this.ast, visitor, this.scope);
1305
1306 this.log.debug("End transform traverse");
1307 this.call("post", pluginPasses);
1308 }
1309
1310 return this.generate();
1311 };
1312
1313 File.prototype.wrap = function wrap(code, callback) {
1314 code = code + "";
1315
1316 try {
1317 if (this.shouldIgnore()) {
1318 return this.makeResult({ code: code, ignored: true });
1319 } else {
1320 return callback();
1321 }
1322 } catch (err) {
1323 if (err._babel) {
1324 throw err;
1325 } else {
1326 err._babel = true;
1327 }
1328
1329 var message = err.message = this.opts.filename + ": " + err.message;
1330
1331 var loc = err.loc;
1332 if (loc) {
1333 err.codeFrame = (0, _babelCodeFrame2.default)(code, loc.line, loc.column + 1, this.opts);
1334 message += "\n" + err.codeFrame;
1335 }
1336
1337 if (process.browser) {
1338 err.message = message;
1339 }
1340
1341 if (err.stack) {
1342 var newStack = err.stack.replace(err.message, message);
1343 err.stack = newStack;
1344 }
1345
1346 throw err;
1347 }
1348 };
1349
1350 File.prototype.addCode = function addCode(code) {
1351 code = (code || "") + "";
1352 code = this.parseInputSourceMap(code);
1353 this.code = code;
1354 };
1355
1356 File.prototype.parseCode = function parseCode() {
1357 this.parseShebang();
1358 var ast = this.parse(this.code);
1359 this.addAst(ast);
1360 };
1361
1362 File.prototype.shouldIgnore = function shouldIgnore() {
1363 var opts = this.opts;
1364 return util.shouldIgnore(opts.filename, opts.ignore, opts.only);
1365 };
1366
1367 File.prototype.call = function call(key, pluginPasses) {
1368 for (var _iterator3 = pluginPasses, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
1369 var _ref3;
1370
1371 if (_isArray3) {
1372 if (_i3 >= _iterator3.length) break;
1373 _ref3 = _iterator3[_i3++];
1374 } else {
1375 _i3 = _iterator3.next();
1376 if (_i3.done) break;
1377 _ref3 = _i3.value;
1378 }
1379
1380 var pass = _ref3;
1381
1382 var plugin = pass.plugin;
1383 var fn = plugin[key];
1384 if (fn) fn.call(pass, this);
1385 }
1386 };
1387
1388 File.prototype.parseInputSourceMap = function parseInputSourceMap(code) {
1389 var opts = this.opts;
1390
1391 if (opts.inputSourceMap !== false) {
1392 var inputMap = _convertSourceMap2.default.fromSource(code);
1393 if (inputMap) {
1394 opts.inputSourceMap = inputMap.toObject();
1395 code = _convertSourceMap2.default.removeComments(code);
1396 }
1397 }
1398
1399 return code;
1400 };
1401
1402 File.prototype.parseShebang = function parseShebang() {
1403 var shebangMatch = shebangRegex.exec(this.code);
1404 if (shebangMatch) {
1405 this.shebang = shebangMatch[0];
1406 this.code = this.code.replace(shebangRegex, "");
1407 }
1408 };
1409
1410 File.prototype.makeResult = function makeResult(_ref4) {
1411 var code = _ref4.code,
1412 map = _ref4.map,
1413 ast = _ref4.ast,
1414 ignored = _ref4.ignored;
1415
1416 var result = {
1417 metadata: null,
1418 options: this.opts,
1419 ignored: !!ignored,
1420 code: null,
1421 ast: null,
1422 map: map || null
1423 };
1424
1425 if (this.opts.code) {
1426 result.code = code;
1427 }
1428
1429 if (this.opts.ast) {
1430 result.ast = ast;
1431 }
1432
1433 if (this.opts.metadata) {
1434 result.metadata = this.metadata;
1435 }
1436
1437 return result;
1438 };
1439
1440 File.prototype.generate = function generate() {
1441 var opts = this.opts;
1442 var ast = this.ast;
1443
1444 var result = { ast: ast };
1445 if (!opts.code) return this.makeResult(result);
1446
1447 var gen = _babelGenerator2.default;
1448 if (opts.generatorOpts.generator) {
1449 gen = opts.generatorOpts.generator;
1450
1451 if (typeof gen === "string") {
1452 var dirname = _path2.default.dirname(this.opts.filename) || process.cwd();
1453 var generator = (0, _resolve2.default)(gen, dirname);
1454 if (generator) {
1455 gen = require(generator).print;
1456 } else {
1457 throw new Error("Couldn't find generator " + gen + " with \"print\" method relative " + ("to directory " + dirname));
1458 }
1459 }
1460 }
1461
1462 this.log.debug("Generation start");
1463
1464 var _result = gen(ast, opts.generatorOpts ? (0, _assign2.default)(opts, opts.generatorOpts) : opts, this.code);
1465 result.code = _result.code;
1466 result.map = _result.map;
1467
1468 this.log.debug("Generation end");
1469
1470 if (this.shebang) {
1471 result.code = this.shebang + "\n" + result.code;
1472 }
1473
1474 if (result.map) {
1475 result.map = this.mergeSourceMap(result.map);
1476 }
1477
1478 if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") {
1479 result.code += "\n" + _convertSourceMap2.default.fromObject(result.map).toComment();
1480 }
1481
1482 if (opts.sourceMaps === "inline") {
1483 result.map = null;
1484 }
1485
1486 return this.makeResult(result);
1487 };
1488
1489 return File;
1490}(_store2.default);
1491
1492exports.default = File;
1493exports.File = File;
1494}).call(this,require('_process'))
1495},{"../../helpers/resolve":13,"../../store":14,"../../util":30,"../internal-plugins/block-hoist":25,"../internal-plugins/shadow-functions":26,"../plugin-pass":28,"./logger":17,"./metadata":18,"./options/option-manager":22,"_process":471,"babel-code-frame":3,"babel-generator":43,"babel-helpers":52,"babel-runtime/core-js/get-iterator":56,"babel-runtime/core-js/object/assign":60,"babel-runtime/core-js/object/create":61,"babel-runtime/helpers/classCallCheck":70,"babel-runtime/helpers/inherits":71,"babel-runtime/helpers/possibleConstructorReturn":73,"babel-runtime/helpers/typeof":74,"babel-traverse":79,"babel-types":112,"babylon":116,"convert-source-map":124,"lodash/defaults":420,"path":469,"source-map":484}],17:[function(require,module,exports){
1496"use strict";
1497
1498exports.__esModule = true;
1499
1500var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
1501
1502var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
1503
1504var _node = require("debug/node");
1505
1506var _node2 = _interopRequireDefault(_node);
1507
1508function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1509
1510var verboseDebug = (0, _node2.default)("babel:verbose");
1511var generalDebug = (0, _node2.default)("babel");
1512
1513var seenDeprecatedMessages = [];
1514
1515var Logger = function () {
1516 function Logger(file, filename) {
1517 (0, _classCallCheck3.default)(this, Logger);
1518
1519 this.filename = filename;
1520 this.file = file;
1521 }
1522
1523 Logger.prototype._buildMessage = function _buildMessage(msg) {
1524 var parts = "[BABEL] " + this.filename;
1525 if (msg) parts += ": " + msg;
1526 return parts;
1527 };
1528
1529 Logger.prototype.warn = function warn(msg) {
1530 console.warn(this._buildMessage(msg));
1531 };
1532
1533 Logger.prototype.error = function error(msg) {
1534 var Constructor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Error;
1535
1536 throw new Constructor(this._buildMessage(msg));
1537 };
1538
1539 Logger.prototype.deprecate = function deprecate(msg) {
1540 if (this.file.opts && this.file.opts.suppressDeprecationMessages) return;
1541
1542 msg = this._buildMessage(msg);
1543
1544 if (seenDeprecatedMessages.indexOf(msg) >= 0) return;
1545
1546 seenDeprecatedMessages.push(msg);
1547
1548 console.error(msg);
1549 };
1550
1551 Logger.prototype.verbose = function verbose(msg) {
1552 if (verboseDebug.enabled) verboseDebug(this._buildMessage(msg));
1553 };
1554
1555 Logger.prototype.debug = function debug(msg) {
1556 if (generalDebug.enabled) generalDebug(this._buildMessage(msg));
1557 };
1558
1559 Logger.prototype.deopt = function deopt(node, msg) {
1560 this.debug(msg);
1561 };
1562
1563 return Logger;
1564}();
1565
1566exports.default = Logger;
1567module.exports = exports["default"];
1568},{"babel-runtime/helpers/classCallCheck":70,"debug/node":231}],18:[function(require,module,exports){
1569"use strict";
1570
1571exports.__esModule = true;
1572exports.ImportDeclaration = exports.ModuleDeclaration = undefined;
1573
1574var _getIterator2 = require("babel-runtime/core-js/get-iterator");
1575
1576var _getIterator3 = _interopRequireDefault(_getIterator2);
1577
1578exports.ExportDeclaration = ExportDeclaration;
1579exports.Scope = Scope;
1580
1581var _babelTypes = require("babel-types");
1582
1583var t = _interopRequireWildcard(_babelTypes);
1584
1585function _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; } }
1586
1587function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1588
1589var ModuleDeclaration = exports.ModuleDeclaration = {
1590 enter: function enter(path, file) {
1591 var node = path.node;
1592
1593 if (node.source) {
1594 node.source.value = file.resolveModuleSource(node.source.value);
1595 }
1596 }
1597};
1598
1599var ImportDeclaration = exports.ImportDeclaration = {
1600 exit: function exit(path, file) {
1601 var node = path.node;
1602
1603
1604 var specifiers = [];
1605 var imported = [];
1606 file.metadata.modules.imports.push({
1607 source: node.source.value,
1608 imported: imported,
1609 specifiers: specifiers
1610 });
1611
1612 for (var _iterator = path.get("specifiers"), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
1613 var _ref;
1614
1615 if (_isArray) {
1616 if (_i >= _iterator.length) break;
1617 _ref = _iterator[_i++];
1618 } else {
1619 _i = _iterator.next();
1620 if (_i.done) break;
1621 _ref = _i.value;
1622 }
1623
1624 var specifier = _ref;
1625
1626 var local = specifier.node.local.name;
1627
1628 if (specifier.isImportDefaultSpecifier()) {
1629 imported.push("default");
1630 specifiers.push({
1631 kind: "named",
1632 imported: "default",
1633 local: local
1634 });
1635 }
1636
1637 if (specifier.isImportSpecifier()) {
1638 var importedName = specifier.node.imported.name;
1639 imported.push(importedName);
1640 specifiers.push({
1641 kind: "named",
1642 imported: importedName,
1643 local: local
1644 });
1645 }
1646
1647 if (specifier.isImportNamespaceSpecifier()) {
1648 imported.push("*");
1649 specifiers.push({
1650 kind: "namespace",
1651 local: local
1652 });
1653 }
1654 }
1655 }
1656};
1657
1658function ExportDeclaration(path, file) {
1659 var node = path.node;
1660
1661
1662 var source = node.source ? node.source.value : null;
1663 var exports = file.metadata.modules.exports;
1664
1665 var declar = path.get("declaration");
1666 if (declar.isStatement()) {
1667 var bindings = declar.getBindingIdentifiers();
1668
1669 for (var name in bindings) {
1670 exports.exported.push(name);
1671 exports.specifiers.push({
1672 kind: "local",
1673 local: name,
1674 exported: path.isExportDefaultDeclaration() ? "default" : name
1675 });
1676 }
1677 }
1678
1679 if (path.isExportNamedDeclaration() && node.specifiers) {
1680 for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
1681 var _ref2;
1682
1683 if (_isArray2) {
1684 if (_i2 >= _iterator2.length) break;
1685 _ref2 = _iterator2[_i2++];
1686 } else {
1687 _i2 = _iterator2.next();
1688 if (_i2.done) break;
1689 _ref2 = _i2.value;
1690 }
1691
1692 var specifier = _ref2;
1693
1694 var exported = specifier.exported.name;
1695 exports.exported.push(exported);
1696
1697 if (t.isExportDefaultSpecifier(specifier)) {
1698 exports.specifiers.push({
1699 kind: "external",
1700 local: exported,
1701 exported: exported,
1702 source: source
1703 });
1704 }
1705
1706 if (t.isExportNamespaceSpecifier(specifier)) {
1707 exports.specifiers.push({
1708 kind: "external-namespace",
1709 exported: exported,
1710 source: source
1711 });
1712 }
1713
1714 var local = specifier.local;
1715 if (!local) continue;
1716
1717 if (source) {
1718 exports.specifiers.push({
1719 kind: "external",
1720 local: local.name,
1721 exported: exported,
1722 source: source
1723 });
1724 }
1725
1726 if (!source) {
1727 exports.specifiers.push({
1728 kind: "local",
1729 local: local.name,
1730 exported: exported
1731 });
1732 }
1733 }
1734 }
1735
1736 if (path.isExportAllDeclaration()) {
1737 exports.specifiers.push({
1738 kind: "external-all",
1739 source: source
1740 });
1741 }
1742}
1743
1744function Scope(path) {
1745 path.skip();
1746}
1747},{"babel-runtime/core-js/get-iterator":56,"babel-types":112}],19:[function(require,module,exports){
1748(function (process){
1749"use strict";
1750
1751exports.__esModule = true;
1752
1753var _assign = require("babel-runtime/core-js/object/assign");
1754
1755var _assign2 = _interopRequireDefault(_assign);
1756
1757var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
1758
1759var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
1760
1761exports.default = buildConfigChain;
1762
1763var _resolve = require("../../../helpers/resolve");
1764
1765var _resolve2 = _interopRequireDefault(_resolve);
1766
1767var _json = require("json5");
1768
1769var _json2 = _interopRequireDefault(_json);
1770
1771var _pathIsAbsolute = require("path-is-absolute");
1772
1773var _pathIsAbsolute2 = _interopRequireDefault(_pathIsAbsolute);
1774
1775var _path = require("path");
1776
1777var _path2 = _interopRequireDefault(_path);
1778
1779var _fs = require("fs");
1780
1781var _fs2 = _interopRequireDefault(_fs);
1782
1783function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1784
1785var existsCache = {};
1786var jsonCache = {};
1787
1788var BABELIGNORE_FILENAME = ".babelignore";
1789var BABELRC_FILENAME = ".babelrc";
1790var PACKAGE_FILENAME = "package.json";
1791
1792function exists(filename) {
1793 var cached = existsCache[filename];
1794 if (cached == null) {
1795 return existsCache[filename] = _fs2.default.existsSync(filename);
1796 } else {
1797 return cached;
1798 }
1799}
1800
1801function buildConfigChain() {
1802 var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1803 var log = arguments[1];
1804
1805 var filename = opts.filename;
1806 var builder = new ConfigChainBuilder(log);
1807
1808 if (opts.babelrc !== false) {
1809 builder.findConfigs(filename);
1810 }
1811
1812 builder.mergeConfig({
1813 options: opts,
1814 alias: "base",
1815 dirname: filename && _path2.default.dirname(filename)
1816 });
1817
1818 return builder.configs;
1819}
1820
1821var ConfigChainBuilder = function () {
1822 function ConfigChainBuilder(log) {
1823 (0, _classCallCheck3.default)(this, ConfigChainBuilder);
1824
1825 this.resolvedConfigs = [];
1826 this.configs = [];
1827 this.log = log;
1828 }
1829
1830 ConfigChainBuilder.prototype.findConfigs = function findConfigs(loc) {
1831 if (!loc) return;
1832
1833 if (!(0, _pathIsAbsolute2.default)(loc)) {
1834 loc = _path2.default.join(process.cwd(), loc);
1835 }
1836
1837 var foundConfig = false;
1838 var foundIgnore = false;
1839
1840 while (loc !== (loc = _path2.default.dirname(loc))) {
1841 if (!foundConfig) {
1842 var configLoc = _path2.default.join(loc, BABELRC_FILENAME);
1843 if (exists(configLoc)) {
1844 this.addConfig(configLoc);
1845 foundConfig = true;
1846 }
1847
1848 var pkgLoc = _path2.default.join(loc, PACKAGE_FILENAME);
1849 if (!foundConfig && exists(pkgLoc)) {
1850 foundConfig = this.addConfig(pkgLoc, "babel", JSON);
1851 }
1852 }
1853
1854 if (!foundIgnore) {
1855 var ignoreLoc = _path2.default.join(loc, BABELIGNORE_FILENAME);
1856 if (exists(ignoreLoc)) {
1857 this.addIgnoreConfig(ignoreLoc);
1858 foundIgnore = true;
1859 }
1860 }
1861
1862 if (foundIgnore && foundConfig) return;
1863 }
1864 };
1865
1866 ConfigChainBuilder.prototype.addIgnoreConfig = function addIgnoreConfig(loc) {
1867 var file = _fs2.default.readFileSync(loc, "utf8");
1868 var lines = file.split("\n");
1869
1870 lines = lines.map(function (line) {
1871 return line.replace(/#(.*?)$/, "").trim();
1872 }).filter(function (line) {
1873 return !!line;
1874 });
1875
1876 if (lines.length) {
1877 this.mergeConfig({
1878 options: { ignore: lines },
1879 alias: loc,
1880 dirname: _path2.default.dirname(loc)
1881 });
1882 }
1883 };
1884
1885 ConfigChainBuilder.prototype.addConfig = function addConfig(loc, key) {
1886 var json = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _json2.default;
1887
1888 if (this.resolvedConfigs.indexOf(loc) >= 0) {
1889 return false;
1890 }
1891
1892 this.resolvedConfigs.push(loc);
1893
1894 var content = _fs2.default.readFileSync(loc, "utf8");
1895 var options = void 0;
1896
1897 try {
1898 options = jsonCache[content] = jsonCache[content] || json.parse(content);
1899 if (key) options = options[key];
1900 } catch (err) {
1901 err.message = loc + ": Error while parsing JSON - " + err.message;
1902 throw err;
1903 }
1904
1905 this.mergeConfig({
1906 options: options,
1907 alias: loc,
1908 dirname: _path2.default.dirname(loc)
1909 });
1910
1911 return !!options;
1912 };
1913
1914 ConfigChainBuilder.prototype.mergeConfig = function mergeConfig(_ref) {
1915 var options = _ref.options,
1916 alias = _ref.alias,
1917 loc = _ref.loc,
1918 dirname = _ref.dirname;
1919
1920 if (!options) {
1921 return false;
1922 }
1923
1924 options = (0, _assign2.default)({}, options);
1925
1926 dirname = dirname || process.cwd();
1927 loc = loc || alias;
1928
1929 if (options.extends) {
1930 var extendsLoc = (0, _resolve2.default)(options.extends, dirname);
1931 if (extendsLoc) {
1932 this.addConfig(extendsLoc);
1933 } else {
1934 if (this.log) this.log.error("Couldn't resolve extends clause of " + options.extends + " in " + alias);
1935 }
1936 delete options.extends;
1937 }
1938
1939 this.configs.push({
1940 options: options,
1941 alias: alias,
1942 loc: loc,
1943 dirname: dirname
1944 });
1945
1946 var envOpts = void 0;
1947 var envKey = process.env.BABEL_ENV || process.env.NODE_ENV || "development";
1948 if (options.env) {
1949 envOpts = options.env[envKey];
1950 delete options.env;
1951 }
1952
1953 this.mergeConfig({
1954 options: envOpts,
1955 alias: alias + ".env." + envKey,
1956 dirname: dirname
1957 });
1958 };
1959
1960 return ConfigChainBuilder;
1961}();
1962
1963module.exports = exports["default"];
1964}).call(this,require('_process'))
1965},{"../../../helpers/resolve":13,"_process":471,"babel-runtime/core-js/object/assign":60,"babel-runtime/helpers/classCallCheck":70,"fs":120,"json5":250,"path":469,"path-is-absolute":470}],20:[function(require,module,exports){
1966"use strict";
1967
1968module.exports = {
1969 filename: {
1970 type: "filename",
1971 description: "filename to use when reading from stdin - this will be used in source-maps, errors etc",
1972 default: "unknown",
1973 shorthand: "f"
1974 },
1975
1976 filenameRelative: {
1977 hidden: true,
1978 type: "string"
1979 },
1980
1981 inputSourceMap: {
1982 hidden: true
1983 },
1984
1985 env: {
1986 hidden: true,
1987 default: {}
1988 },
1989
1990 mode: {
1991 description: "",
1992 hidden: true
1993 },
1994
1995 retainLines: {
1996 type: "boolean",
1997 default: false,
1998 description: "retain line numbers - will result in really ugly code"
1999 },
2000
2001 highlightCode: {
2002 description: "enable/disable ANSI syntax highlighting of code frames (on by default)",
2003 type: "boolean",
2004 default: true
2005 },
2006
2007 suppressDeprecationMessages: {
2008 type: "boolean",
2009 default: false,
2010 hidden: true
2011 },
2012
2013 presets: {
2014 type: "list",
2015 description: "",
2016 default: []
2017 },
2018
2019 plugins: {
2020 type: "list",
2021 default: [],
2022 description: ""
2023 },
2024
2025 ignore: {
2026 type: "list",
2027 description: "list of glob paths to **not** compile",
2028 default: []
2029 },
2030
2031 only: {
2032 type: "list",
2033 description: "list of glob paths to **only** compile"
2034 },
2035
2036 code: {
2037 hidden: true,
2038 default: true,
2039 type: "boolean"
2040 },
2041
2042 metadata: {
2043 hidden: true,
2044 default: true,
2045 type: "boolean"
2046 },
2047
2048 ast: {
2049 hidden: true,
2050 default: true,
2051 type: "boolean"
2052 },
2053
2054 extends: {
2055 type: "string",
2056 hidden: true
2057 },
2058
2059 comments: {
2060 type: "boolean",
2061 default: true,
2062 description: "write comments to generated output (true by default)"
2063 },
2064
2065 shouldPrintComment: {
2066 hidden: true,
2067 description: "optional callback to control whether a comment should be inserted, when this is used the comments option is ignored"
2068 },
2069
2070 wrapPluginVisitorMethod: {
2071 hidden: true,
2072 description: "optional callback to wrap all visitor methods"
2073 },
2074
2075 compact: {
2076 type: "booleanString",
2077 default: "auto",
2078 description: "do not include superfluous whitespace characters and line terminators [true|false|auto]"
2079 },
2080
2081 minified: {
2082 type: "boolean",
2083 default: false,
2084 description: "save as much bytes when printing [true|false]"
2085 },
2086
2087 sourceMap: {
2088 alias: "sourceMaps",
2089 hidden: true
2090 },
2091
2092 sourceMaps: {
2093 type: "booleanString",
2094 description: "[true|false|inline]",
2095 default: false,
2096 shorthand: "s"
2097 },
2098
2099 sourceMapTarget: {
2100 type: "string",
2101 description: "set `file` on returned source map"
2102 },
2103
2104 sourceFileName: {
2105 type: "string",
2106 description: "set `sources[0]` on returned source map"
2107 },
2108
2109 sourceRoot: {
2110 type: "filename",
2111 description: "the root from which all sources are relative"
2112 },
2113
2114 babelrc: {
2115 description: "Whether or not to look up .babelrc and .babelignore files",
2116 type: "boolean",
2117 default: true
2118 },
2119
2120 sourceType: {
2121 description: "",
2122 default: "module"
2123 },
2124
2125 auxiliaryCommentBefore: {
2126 type: "string",
2127 description: "print a comment before any injected non-user code"
2128 },
2129
2130 auxiliaryCommentAfter: {
2131 type: "string",
2132 description: "print a comment after any injected non-user code"
2133 },
2134
2135 resolveModuleSource: {
2136 hidden: true
2137 },
2138
2139 getModuleId: {
2140 hidden: true
2141 },
2142
2143 moduleRoot: {
2144 type: "filename",
2145 description: "optional prefix for the AMD module formatter that will be prepend to the filename on module definitions"
2146 },
2147
2148 moduleIds: {
2149 type: "boolean",
2150 default: false,
2151 shorthand: "M",
2152 description: "insert an explicit id for modules"
2153 },
2154
2155 moduleId: {
2156 description: "specify a custom name for module ids",
2157 type: "string"
2158 },
2159
2160 passPerPreset: {
2161 description: "Whether to spawn a traversal pass per a preset. By default all presets are merged.",
2162 type: "boolean",
2163 default: false,
2164 hidden: true
2165 },
2166
2167 parserOpts: {
2168 description: "Options to pass into the parser, or to change parsers (parserOpts.parser)",
2169 default: false
2170 },
2171
2172 generatorOpts: {
2173 description: "Options to pass into the generator, or to change generators (generatorOpts.generator)",
2174 default: false
2175 }
2176};
2177},{}],21:[function(require,module,exports){
2178"use strict";
2179
2180exports.__esModule = true;
2181exports.config = undefined;
2182exports.normaliseOptions = normaliseOptions;
2183
2184var _parsers = require("./parsers");
2185
2186var parsers = _interopRequireWildcard(_parsers);
2187
2188var _config = require("./config");
2189
2190var _config2 = _interopRequireDefault(_config);
2191
2192function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2193
2194function _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; } }
2195
2196exports.config = _config2.default;
2197function normaliseOptions() {
2198 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2199
2200 for (var key in options) {
2201 var val = options[key];
2202 if (val == null) continue;
2203
2204 var opt = _config2.default[key];
2205 if (opt && opt.alias) opt = _config2.default[opt.alias];
2206 if (!opt) continue;
2207
2208 var parser = parsers[opt.type];
2209 if (parser) val = parser(val);
2210
2211 options[key] = val;
2212 }
2213
2214 return options;
2215}
2216},{"./config":20,"./parsers":23}],22:[function(require,module,exports){
2217(function (process){
2218"use strict";
2219
2220exports.__esModule = true;
2221
2222var _objectWithoutProperties2 = require("babel-runtime/helpers/objectWithoutProperties");
2223
2224var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
2225
2226var _stringify = require("babel-runtime/core-js/json/stringify");
2227
2228var _stringify2 = _interopRequireDefault(_stringify);
2229
2230var _assign = require("babel-runtime/core-js/object/assign");
2231
2232var _assign2 = _interopRequireDefault(_assign);
2233
2234var _getIterator2 = require("babel-runtime/core-js/get-iterator");
2235
2236var _getIterator3 = _interopRequireDefault(_getIterator2);
2237
2238var _typeof2 = require("babel-runtime/helpers/typeof");
2239
2240var _typeof3 = _interopRequireDefault(_typeof2);
2241
2242var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
2243
2244var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
2245
2246var _node = require("../../../api/node");
2247
2248var context = _interopRequireWildcard(_node);
2249
2250var _plugin2 = require("../../plugin");
2251
2252var _plugin3 = _interopRequireDefault(_plugin2);
2253
2254var _babelMessages = require("babel-messages");
2255
2256var messages = _interopRequireWildcard(_babelMessages);
2257
2258var _index = require("./index");
2259
2260var _resolvePlugin = require("../../../helpers/resolve-plugin");
2261
2262var _resolvePlugin2 = _interopRequireDefault(_resolvePlugin);
2263
2264var _resolvePreset = require("../../../helpers/resolve-preset");
2265
2266var _resolvePreset2 = _interopRequireDefault(_resolvePreset);
2267
2268var _cloneDeepWith = require("lodash/cloneDeepWith");
2269
2270var _cloneDeepWith2 = _interopRequireDefault(_cloneDeepWith);
2271
2272var _clone = require("lodash/clone");
2273
2274var _clone2 = _interopRequireDefault(_clone);
2275
2276var _merge = require("../../../helpers/merge");
2277
2278var _merge2 = _interopRequireDefault(_merge);
2279
2280var _config2 = require("./config");
2281
2282var _config3 = _interopRequireDefault(_config2);
2283
2284var _removed = require("./removed");
2285
2286var _removed2 = _interopRequireDefault(_removed);
2287
2288var _buildConfigChain = require("./build-config-chain");
2289
2290var _buildConfigChain2 = _interopRequireDefault(_buildConfigChain);
2291
2292var _path = require("path");
2293
2294var _path2 = _interopRequireDefault(_path);
2295
2296function _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; } }
2297
2298function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2299
2300var OptionManager = function () {
2301 function OptionManager(log) {
2302 (0, _classCallCheck3.default)(this, OptionManager);
2303
2304 this.resolvedConfigs = [];
2305 this.options = OptionManager.createBareOptions();
2306 this.log = log;
2307 }
2308
2309 OptionManager.memoisePluginContainer = function memoisePluginContainer(fn, loc, i, alias) {
2310 for (var _iterator = OptionManager.memoisedPlugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
2311 var _ref;
2312
2313 if (_isArray) {
2314 if (_i >= _iterator.length) break;
2315 _ref = _iterator[_i++];
2316 } else {
2317 _i = _iterator.next();
2318 if (_i.done) break;
2319 _ref = _i.value;
2320 }
2321
2322 var cache = _ref;
2323
2324 if (cache.container === fn) return cache.plugin;
2325 }
2326
2327 var obj = void 0;
2328
2329 if (typeof fn === "function") {
2330 obj = fn(context);
2331 } else {
2332 obj = fn;
2333 }
2334
2335 if ((typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) === "object") {
2336 var _plugin = new _plugin3.default(obj, alias);
2337 OptionManager.memoisedPlugins.push({
2338 container: fn,
2339 plugin: _plugin
2340 });
2341 return _plugin;
2342 } else {
2343 throw new TypeError(messages.get("pluginNotObject", loc, i, typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) + loc + i);
2344 }
2345 };
2346
2347 OptionManager.createBareOptions = function createBareOptions() {
2348 var opts = {};
2349
2350 for (var _key in _config3.default) {
2351 var opt = _config3.default[_key];
2352 opts[_key] = (0, _clone2.default)(opt.default);
2353 }
2354
2355 return opts;
2356 };
2357
2358 OptionManager.normalisePlugin = function normalisePlugin(plugin, loc, i, alias) {
2359 plugin = plugin.__esModule ? plugin.default : plugin;
2360
2361 if (!(plugin instanceof _plugin3.default)) {
2362 if (typeof plugin === "function" || (typeof plugin === "undefined" ? "undefined" : (0, _typeof3.default)(plugin)) === "object") {
2363 plugin = OptionManager.memoisePluginContainer(plugin, loc, i, alias);
2364 } else {
2365 throw new TypeError(messages.get("pluginNotFunction", loc, i, typeof plugin === "undefined" ? "undefined" : (0, _typeof3.default)(plugin)));
2366 }
2367 }
2368
2369 plugin.init(loc, i);
2370
2371 return plugin;
2372 };
2373
2374 OptionManager.normalisePlugins = function normalisePlugins(loc, dirname, plugins) {
2375 return plugins.map(function (val, i) {
2376 var plugin = void 0,
2377 options = void 0;
2378
2379 if (!val) {
2380 throw new TypeError("Falsy value found in plugins");
2381 }
2382
2383 if (Array.isArray(val)) {
2384 plugin = val[0];
2385 options = val[1];
2386 } else {
2387 plugin = val;
2388 }
2389
2390 var alias = typeof plugin === "string" ? plugin : loc + "$" + i;
2391
2392 if (typeof plugin === "string") {
2393 var pluginLoc = (0, _resolvePlugin2.default)(plugin, dirname);
2394 if (pluginLoc) {
2395 plugin = require(pluginLoc);
2396 } else {
2397 throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i, dirname));
2398 }
2399 }
2400
2401 plugin = OptionManager.normalisePlugin(plugin, loc, i, alias);
2402
2403 return [plugin, options];
2404 });
2405 };
2406
2407 OptionManager.prototype.mergeOptions = function mergeOptions(_ref2) {
2408 var _this = this;
2409
2410 var rawOpts = _ref2.options,
2411 extendingOpts = _ref2.extending,
2412 alias = _ref2.alias,
2413 loc = _ref2.loc,
2414 dirname = _ref2.dirname;
2415
2416 alias = alias || "foreign";
2417 if (!rawOpts) return;
2418
2419 if ((typeof rawOpts === "undefined" ? "undefined" : (0, _typeof3.default)(rawOpts)) !== "object" || Array.isArray(rawOpts)) {
2420 this.log.error("Invalid options type for " + alias, TypeError);
2421 }
2422
2423 var opts = (0, _cloneDeepWith2.default)(rawOpts, function (val) {
2424 if (val instanceof _plugin3.default) {
2425 return val;
2426 }
2427 });
2428
2429 dirname = dirname || process.cwd();
2430 loc = loc || alias;
2431
2432 for (var _key2 in opts) {
2433 var option = _config3.default[_key2];
2434
2435 if (!option && this.log) {
2436 if (_removed2.default[_key2]) {
2437 this.log.error("Using removed Babel 5 option: " + alias + "." + _key2 + " - " + _removed2.default[_key2].message, ReferenceError);
2438 } else {
2439 var unknownOptErr = "Unknown option: " + alias + "." + _key2 + ". Check out http://babeljs.io/docs/usage/options/ for more information about options.";
2440 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.";
2441
2442
2443 this.log.error(unknownOptErr + "\n\n" + presetConfigErr, ReferenceError);
2444 }
2445 }
2446 }
2447
2448 (0, _index.normaliseOptions)(opts);
2449
2450 if (opts.plugins) {
2451 opts.plugins = OptionManager.normalisePlugins(loc, dirname, opts.plugins);
2452 }
2453
2454 if (opts.presets) {
2455 if (opts.passPerPreset) {
2456 opts.presets = this.resolvePresets(opts.presets, dirname, function (preset, presetLoc) {
2457 _this.mergeOptions({
2458 options: preset,
2459 extending: preset,
2460 alias: presetLoc,
2461 loc: presetLoc,
2462 dirname: dirname
2463 });
2464 });
2465 } else {
2466 this.mergePresets(opts.presets, dirname);
2467 delete opts.presets;
2468 }
2469 }
2470
2471 if (rawOpts === extendingOpts) {
2472 (0, _assign2.default)(extendingOpts, opts);
2473 } else {
2474 (0, _merge2.default)(extendingOpts || this.options, opts);
2475 }
2476 };
2477
2478 OptionManager.prototype.mergePresets = function mergePresets(presets, dirname) {
2479 var _this2 = this;
2480
2481 this.resolvePresets(presets, dirname, function (presetOpts, presetLoc) {
2482 _this2.mergeOptions({
2483 options: presetOpts,
2484 alias: presetLoc,
2485 loc: presetLoc,
2486 dirname: _path2.default.dirname(presetLoc || "")
2487 });
2488 });
2489 };
2490
2491 OptionManager.prototype.resolvePresets = function resolvePresets(presets, dirname, onResolve) {
2492 return presets.map(function (val) {
2493 var options = void 0;
2494 if (Array.isArray(val)) {
2495 if (val.length > 2) {
2496 throw new Error("Unexpected extra options " + (0, _stringify2.default)(val.slice(2)) + " passed to preset.");
2497 }
2498
2499 var _val = val;
2500 val = _val[0];
2501 options = _val[1];
2502 }
2503
2504 var presetLoc = void 0;
2505 try {
2506 if (typeof val === "string") {
2507 presetLoc = (0, _resolvePreset2.default)(val, dirname);
2508
2509 if (!presetLoc) {
2510 throw new Error("Couldn't find preset " + (0, _stringify2.default)(val) + " relative to directory " + (0, _stringify2.default)(dirname));
2511 }
2512
2513 val = require(presetLoc);
2514 }
2515
2516 if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object" && val.__esModule) {
2517 if (val.default) {
2518 val = val.default;
2519 } else {
2520 var _val2 = val,
2521 __esModule = _val2.__esModule,
2522 rest = (0, _objectWithoutProperties3.default)(_val2, ["__esModule"]);
2523
2524 val = rest;
2525 }
2526 }
2527
2528 if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object" && val.buildPreset) val = val.buildPreset;
2529
2530 if (typeof val !== "function" && options !== undefined) {
2531 throw new Error("Options " + (0, _stringify2.default)(options) + " passed to " + (presetLoc || "a preset") + " which does not accept options.");
2532 }
2533
2534 if (typeof val === "function") val = val(context, options);
2535
2536 if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) !== "object") {
2537 throw new Error("Unsupported preset format: " + val + ".");
2538 }
2539
2540 onResolve && onResolve(val, presetLoc);
2541 } catch (e) {
2542 if (presetLoc) {
2543 e.message += " (While processing preset: " + (0, _stringify2.default)(presetLoc) + ")";
2544 }
2545 throw e;
2546 }
2547 return val;
2548 });
2549 };
2550
2551 OptionManager.prototype.normaliseOptions = function normaliseOptions() {
2552 var opts = this.options;
2553
2554 for (var _key3 in _config3.default) {
2555 var option = _config3.default[_key3];
2556 var val = opts[_key3];
2557
2558 if (!val && option.optional) continue;
2559
2560 if (option.alias) {
2561 opts[option.alias] = opts[option.alias] || val;
2562 } else {
2563 opts[_key3] = val;
2564 }
2565 }
2566 };
2567
2568 OptionManager.prototype.init = function init() {
2569 var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2570
2571 for (var _iterator2 = (0, _buildConfigChain2.default)(opts, this.log), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
2572 var _ref3;
2573
2574 if (_isArray2) {
2575 if (_i2 >= _iterator2.length) break;
2576 _ref3 = _iterator2[_i2++];
2577 } else {
2578 _i2 = _iterator2.next();
2579 if (_i2.done) break;
2580 _ref3 = _i2.value;
2581 }
2582
2583 var _config = _ref3;
2584
2585 this.mergeOptions(_config);
2586 }
2587
2588 this.normaliseOptions(opts);
2589
2590 return this.options;
2591 };
2592
2593 return OptionManager;
2594}();
2595
2596exports.default = OptionManager;
2597
2598
2599OptionManager.memoisedPlugins = [];
2600module.exports = exports["default"];
2601}).call(this,require('_process'))
2602},{"../../../api/node":5,"../../../helpers/merge":8,"../../../helpers/resolve-plugin":11,"../../../helpers/resolve-preset":12,"../../plugin":29,"./build-config-chain":19,"./config":20,"./index":21,"./removed":24,"_process":471,"babel-messages":53,"babel-runtime/core-js/get-iterator":56,"babel-runtime/core-js/json/stringify":57,"babel-runtime/core-js/object/assign":60,"babel-runtime/helpers/classCallCheck":70,"babel-runtime/helpers/objectWithoutProperties":72,"babel-runtime/helpers/typeof":74,"lodash/clone":416,"lodash/cloneDeepWith":418,"path":469}],23:[function(require,module,exports){
2603"use strict";
2604
2605exports.__esModule = true;
2606exports.filename = undefined;
2607exports.boolean = boolean;
2608exports.booleanString = booleanString;
2609exports.list = list;
2610
2611var _slash = require("slash");
2612
2613var _slash2 = _interopRequireDefault(_slash);
2614
2615var _util = require("../../../util");
2616
2617var util = _interopRequireWildcard(_util);
2618
2619function _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; } }
2620
2621function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2622
2623var filename = exports.filename = _slash2.default;
2624
2625function boolean(val) {
2626 return !!val;
2627}
2628
2629function booleanString(val) {
2630 return util.booleanify(val);
2631}
2632
2633function list(val) {
2634 return util.list(val);
2635}
2636},{"../../../util":30,"slash":473}],24:[function(require,module,exports){
2637"use strict";
2638
2639module.exports = {
2640 "auxiliaryComment": {
2641 "message": "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`"
2642 },
2643 "blacklist": {
2644 "message": "Put the specific transforms you want in the `plugins` option"
2645 },
2646 "breakConfig": {
2647 "message": "This is not a necessary option in Babel 6"
2648 },
2649 "experimental": {
2650 "message": "Put the specific transforms you want in the `plugins` option"
2651 },
2652 "externalHelpers": {
2653 "message": "Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/"
2654 },
2655 "extra": {
2656 "message": ""
2657 },
2658 "jsxPragma": {
2659 "message": "use the `pragma` option in the `react-jsx` plugin . Check out http://babeljs.io/docs/plugins/transform-react-jsx/"
2660 },
2661
2662 "loose": {
2663 "message": "Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option."
2664 },
2665 "metadataUsedHelpers": {
2666 "message": "Not required anymore as this is enabled by default"
2667 },
2668 "modules": {
2669 "message": "Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules"
2670 },
2671 "nonStandard": {
2672 "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/"
2673 },
2674 "optional": {
2675 "message": "Put the specific transforms you want in the `plugins` option"
2676 },
2677 "sourceMapName": {
2678 "message": "Use the `sourceMapTarget` option"
2679 },
2680 "stage": {
2681 "message": "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets"
2682 },
2683 "whitelist": {
2684 "message": "Put the specific transforms you want in the `plugins` option"
2685 }
2686};
2687},{}],25:[function(require,module,exports){
2688"use strict";
2689
2690exports.__esModule = true;
2691
2692var _plugin = require("../plugin");
2693
2694var _plugin2 = _interopRequireDefault(_plugin);
2695
2696var _sortBy = require("lodash/sortBy");
2697
2698var _sortBy2 = _interopRequireDefault(_sortBy);
2699
2700function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2701
2702exports.default = new _plugin2.default({
2703
2704 name: "internal.blockHoist",
2705
2706 visitor: {
2707 Block: {
2708 exit: function exit(_ref) {
2709 var node = _ref.node;
2710
2711 var hasChange = false;
2712 for (var i = 0; i < node.body.length; i++) {
2713 var bodyNode = node.body[i];
2714 if (bodyNode && bodyNode._blockHoist != null) {
2715 hasChange = true;
2716 break;
2717 }
2718 }
2719 if (!hasChange) return;
2720
2721 node.body = (0, _sortBy2.default)(node.body, function (bodyNode) {
2722 var priority = bodyNode && bodyNode._blockHoist;
2723 if (priority == null) priority = 1;
2724 if (priority === true) priority = 2;
2725
2726 return -1 * priority;
2727 });
2728 }
2729 }
2730 }
2731});
2732module.exports = exports["default"];
2733},{"../plugin":29,"lodash/sortBy":455}],26:[function(require,module,exports){
2734"use strict";
2735
2736exports.__esModule = true;
2737
2738var _symbol = require("babel-runtime/core-js/symbol");
2739
2740var _symbol2 = _interopRequireDefault(_symbol);
2741
2742var _plugin = require("../plugin");
2743
2744var _plugin2 = _interopRequireDefault(_plugin);
2745
2746var _babelTypes = require("babel-types");
2747
2748var t = _interopRequireWildcard(_babelTypes);
2749
2750function _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; } }
2751
2752function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2753
2754var SUPER_THIS_BOUND = (0, _symbol2.default)("super this bound");
2755
2756var superVisitor = {
2757 CallExpression: function CallExpression(path) {
2758 if (!path.get("callee").isSuper()) return;
2759
2760 var node = path.node;
2761
2762 if (node[SUPER_THIS_BOUND]) return;
2763 node[SUPER_THIS_BOUND] = true;
2764
2765 path.replaceWith(t.assignmentExpression("=", this.id, node));
2766 }
2767};
2768
2769exports.default = new _plugin2.default({
2770 name: "internal.shadowFunctions",
2771
2772 visitor: {
2773 ThisExpression: function ThisExpression(path) {
2774 remap(path, "this");
2775 },
2776 ReferencedIdentifier: function ReferencedIdentifier(path) {
2777 if (path.node.name === "arguments") {
2778 remap(path, "arguments");
2779 }
2780 }
2781 }
2782});
2783
2784
2785function shouldShadow(path, shadowPath) {
2786 if (path.is("_forceShadow")) {
2787 return true;
2788 } else {
2789 return shadowPath;
2790 }
2791}
2792
2793function remap(path, key) {
2794 var shadowPath = path.inShadow(key);
2795 if (!shouldShadow(path, shadowPath)) return;
2796
2797 var shadowFunction = path.node._shadowedFunctionLiteral;
2798
2799 var currentFunction = void 0;
2800 var passedShadowFunction = false;
2801
2802 var fnPath = path.find(function (innerPath) {
2803 if (innerPath.parentPath && innerPath.parentPath.isClassProperty() && innerPath.key === "value") {
2804 return true;
2805 }
2806 if (path === innerPath) return false;
2807 if (innerPath.isProgram() || innerPath.isFunction()) {
2808 currentFunction = currentFunction || innerPath;
2809 }
2810
2811 if (innerPath.isProgram()) {
2812 passedShadowFunction = true;
2813
2814 return true;
2815 } else if (innerPath.isFunction() && !innerPath.isArrowFunctionExpression()) {
2816 if (shadowFunction) {
2817 if (innerPath === shadowFunction || innerPath.node === shadowFunction.node) return true;
2818 } else {
2819 if (!innerPath.is("shadow")) return true;
2820 }
2821
2822 passedShadowFunction = true;
2823 return false;
2824 }
2825
2826 return false;
2827 });
2828
2829 if (shadowFunction && fnPath.isProgram() && !shadowFunction.isProgram()) {
2830 fnPath = path.findParent(function (p) {
2831 return p.isProgram() || p.isFunction();
2832 });
2833 }
2834
2835 if (fnPath === currentFunction) return;
2836
2837 if (!passedShadowFunction) return;
2838
2839 var cached = fnPath.getData(key);
2840 if (cached) return path.replaceWith(cached);
2841
2842 var id = path.scope.generateUidIdentifier(key);
2843
2844 fnPath.setData(key, id);
2845
2846 var classPath = fnPath.findParent(function (p) {
2847 return p.isClass();
2848 });
2849 var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
2850
2851 if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
2852 fnPath.scope.push({ id: id });
2853
2854 fnPath.traverse(superVisitor, { id: id });
2855 } else {
2856 var init = key === "this" ? t.thisExpression() : t.identifier(key);
2857
2858 if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction;
2859
2860 fnPath.scope.push({ id: id, init: init });
2861 }
2862
2863 return path.replaceWith(id);
2864}
2865module.exports = exports["default"];
2866},{"../plugin":29,"babel-runtime/core-js/symbol":65,"babel-types":112}],27:[function(require,module,exports){
2867"use strict";
2868
2869exports.__esModule = true;
2870
2871var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
2872
2873var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
2874
2875var _normalizeAst = require("../helpers/normalize-ast");
2876
2877var _normalizeAst2 = _interopRequireDefault(_normalizeAst);
2878
2879var _plugin = require("./plugin");
2880
2881var _plugin2 = _interopRequireDefault(_plugin);
2882
2883var _file = require("./file");
2884
2885var _file2 = _interopRequireDefault(_file);
2886
2887function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2888
2889var Pipeline = function () {
2890 function Pipeline() {
2891 (0, _classCallCheck3.default)(this, Pipeline);
2892 }
2893
2894 Pipeline.prototype.lint = function lint(code) {
2895 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2896
2897 opts.code = false;
2898 opts.mode = "lint";
2899 return this.transform(code, opts);
2900 };
2901
2902 Pipeline.prototype.pretransform = function pretransform(code, opts) {
2903 var file = new _file2.default(opts, this);
2904 return file.wrap(code, function () {
2905 file.addCode(code);
2906 file.parseCode(code);
2907 return file;
2908 });
2909 };
2910
2911 Pipeline.prototype.transform = function transform(code, opts) {
2912 var file = new _file2.default(opts, this);
2913 return file.wrap(code, function () {
2914 file.addCode(code);
2915 file.parseCode(code);
2916 return file.transform();
2917 });
2918 };
2919
2920 Pipeline.prototype.analyse = function analyse(code) {
2921 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2922 var visitor = arguments[2];
2923
2924 opts.code = false;
2925 if (visitor) {
2926 opts.plugins = opts.plugins || [];
2927 opts.plugins.push(new _plugin2.default({ visitor: visitor }));
2928 }
2929 return this.transform(code, opts).metadata;
2930 };
2931
2932 Pipeline.prototype.transformFromAst = function transformFromAst(ast, code, opts) {
2933 ast = (0, _normalizeAst2.default)(ast);
2934
2935 var file = new _file2.default(opts, this);
2936 return file.wrap(code, function () {
2937 file.addCode(code);
2938 file.addAst(ast);
2939 return file.transform();
2940 });
2941 };
2942
2943 return Pipeline;
2944}();
2945
2946exports.default = Pipeline;
2947module.exports = exports["default"];
2948},{"../helpers/normalize-ast":9,"./file":16,"./plugin":29,"babel-runtime/helpers/classCallCheck":70}],28:[function(require,module,exports){
2949"use strict";
2950
2951exports.__esModule = true;
2952
2953var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
2954
2955var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
2956
2957var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn");
2958
2959var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
2960
2961var _inherits2 = require("babel-runtime/helpers/inherits");
2962
2963var _inherits3 = _interopRequireDefault(_inherits2);
2964
2965var _store = require("../store");
2966
2967var _store2 = _interopRequireDefault(_store);
2968
2969var _file5 = require("./file");
2970
2971var _file6 = _interopRequireDefault(_file5);
2972
2973function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2974
2975var PluginPass = function (_Store) {
2976 (0, _inherits3.default)(PluginPass, _Store);
2977
2978 function PluginPass(file, plugin) {
2979 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2980 (0, _classCallCheck3.default)(this, PluginPass);
2981
2982 var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this));
2983
2984 _this.plugin = plugin;
2985 _this.key = plugin.key;
2986 _this.file = file;
2987 _this.opts = options;
2988 return _this;
2989 }
2990
2991 PluginPass.prototype.addHelper = function addHelper() {
2992 var _file;
2993
2994 return (_file = this.file).addHelper.apply(_file, arguments);
2995 };
2996
2997 PluginPass.prototype.addImport = function addImport() {
2998 var _file2;
2999
3000 return (_file2 = this.file).addImport.apply(_file2, arguments);
3001 };
3002
3003 PluginPass.prototype.getModuleName = function getModuleName() {
3004 var _file3;
3005
3006 return (_file3 = this.file).getModuleName.apply(_file3, arguments);
3007 };
3008
3009 PluginPass.prototype.buildCodeFrameError = function buildCodeFrameError() {
3010 var _file4;
3011
3012 return (_file4 = this.file).buildCodeFrameError.apply(_file4, arguments);
3013 };
3014
3015 return PluginPass;
3016}(_store2.default);
3017
3018exports.default = PluginPass;
3019module.exports = exports["default"];
3020},{"../store":14,"./file":16,"babel-runtime/helpers/classCallCheck":70,"babel-runtime/helpers/inherits":71,"babel-runtime/helpers/possibleConstructorReturn":73}],29:[function(require,module,exports){
3021"use strict";
3022
3023exports.__esModule = true;
3024
3025var _getIterator2 = require("babel-runtime/core-js/get-iterator");
3026
3027var _getIterator3 = _interopRequireDefault(_getIterator2);
3028
3029var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
3030
3031var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
3032
3033var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn");
3034
3035var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
3036
3037var _inherits2 = require("babel-runtime/helpers/inherits");
3038
3039var _inherits3 = _interopRequireDefault(_inherits2);
3040
3041var _optionManager = require("./file/options/option-manager");
3042
3043var _optionManager2 = _interopRequireDefault(_optionManager);
3044
3045var _babelMessages = require("babel-messages");
3046
3047var messages = _interopRequireWildcard(_babelMessages);
3048
3049var _store = require("../store");
3050
3051var _store2 = _interopRequireDefault(_store);
3052
3053var _babelTraverse = require("babel-traverse");
3054
3055var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
3056
3057var _assign = require("lodash/assign");
3058
3059var _assign2 = _interopRequireDefault(_assign);
3060
3061var _clone = require("lodash/clone");
3062
3063var _clone2 = _interopRequireDefault(_clone);
3064
3065function _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; } }
3066
3067function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3068
3069var GLOBAL_VISITOR_PROPS = ["enter", "exit"];
3070
3071var Plugin = function (_Store) {
3072 (0, _inherits3.default)(Plugin, _Store);
3073
3074 function Plugin(plugin, key) {
3075 (0, _classCallCheck3.default)(this, Plugin);
3076
3077 var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this));
3078
3079 _this.initialized = false;
3080 _this.raw = (0, _assign2.default)({}, plugin);
3081 _this.key = _this.take("name") || key;
3082
3083 _this.manipulateOptions = _this.take("manipulateOptions");
3084 _this.post = _this.take("post");
3085 _this.pre = _this.take("pre");
3086 _this.visitor = _this.normaliseVisitor((0, _clone2.default)(_this.take("visitor")) || {});
3087 return _this;
3088 }
3089
3090 Plugin.prototype.take = function take(key) {
3091 var val = this.raw[key];
3092 delete this.raw[key];
3093 return val;
3094 };
3095
3096 Plugin.prototype.chain = function chain(target, key) {
3097 if (!target[key]) return this[key];
3098 if (!this[key]) return target[key];
3099
3100 var fns = [target[key], this[key]];
3101
3102 return function () {
3103 var val = void 0;
3104
3105 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
3106 args[_key] = arguments[_key];
3107 }
3108
3109 for (var _iterator = fns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
3110 var _ref;
3111
3112 if (_isArray) {
3113 if (_i >= _iterator.length) break;
3114 _ref = _iterator[_i++];
3115 } else {
3116 _i = _iterator.next();
3117 if (_i.done) break;
3118 _ref = _i.value;
3119 }
3120
3121 var fn = _ref;
3122
3123 if (fn) {
3124 var ret = fn.apply(this, args);
3125 if (ret != null) val = ret;
3126 }
3127 }
3128 return val;
3129 };
3130 };
3131
3132 Plugin.prototype.maybeInherit = function maybeInherit(loc) {
3133 var inherits = this.take("inherits");
3134 if (!inherits) return;
3135
3136 inherits = _optionManager2.default.normalisePlugin(inherits, loc, "inherits");
3137
3138 this.manipulateOptions = this.chain(inherits, "manipulateOptions");
3139 this.post = this.chain(inherits, "post");
3140 this.pre = this.chain(inherits, "pre");
3141 this.visitor = _babelTraverse2.default.visitors.merge([inherits.visitor, this.visitor]);
3142 };
3143
3144 Plugin.prototype.init = function init(loc, i) {
3145 if (this.initialized) return;
3146 this.initialized = true;
3147
3148 this.maybeInherit(loc);
3149
3150 for (var key in this.raw) {
3151 throw new Error(messages.get("pluginInvalidProperty", loc, i, key));
3152 }
3153 };
3154
3155 Plugin.prototype.normaliseVisitor = function normaliseVisitor(visitor) {
3156 for (var _iterator2 = GLOBAL_VISITOR_PROPS, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
3157 var _ref2;
3158
3159 if (_isArray2) {
3160 if (_i2 >= _iterator2.length) break;
3161 _ref2 = _iterator2[_i2++];
3162 } else {
3163 _i2 = _iterator2.next();
3164 if (_i2.done) break;
3165 _ref2 = _i2.value;
3166 }
3167
3168 var key = _ref2;
3169
3170 if (visitor[key]) {
3171 throw new Error("Plugins aren't allowed to specify catch-all enter/exit handlers. " + "Please target individual nodes.");
3172 }
3173 }
3174
3175 _babelTraverse2.default.explode(visitor);
3176 return visitor;
3177 };
3178
3179 return Plugin;
3180}(_store2.default);
3181
3182exports.default = Plugin;
3183module.exports = exports["default"];
3184},{"../store":14,"./file/options/option-manager":22,"babel-messages":53,"babel-runtime/core-js/get-iterator":56,"babel-runtime/helpers/classCallCheck":70,"babel-runtime/helpers/inherits":71,"babel-runtime/helpers/possibleConstructorReturn":73,"babel-traverse":79,"lodash/assign":414,"lodash/clone":416}],30:[function(require,module,exports){
3185"use strict";
3186
3187exports.__esModule = true;
3188exports.inspect = exports.inherits = undefined;
3189
3190var _getIterator2 = require("babel-runtime/core-js/get-iterator");
3191
3192var _getIterator3 = _interopRequireDefault(_getIterator2);
3193
3194var _util = require("util");
3195
3196Object.defineProperty(exports, "inherits", {
3197 enumerable: true,
3198 get: function get() {
3199 return _util.inherits;
3200 }
3201});
3202Object.defineProperty(exports, "inspect", {
3203 enumerable: true,
3204 get: function get() {
3205 return _util.inspect;
3206 }
3207});
3208exports.canCompile = canCompile;
3209exports.list = list;
3210exports.regexify = regexify;
3211exports.arrayify = arrayify;
3212exports.booleanify = booleanify;
3213exports.shouldIgnore = shouldIgnore;
3214
3215var _escapeRegExp = require("lodash/escapeRegExp");
3216
3217var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp);
3218
3219var _startsWith = require("lodash/startsWith");
3220
3221var _startsWith2 = _interopRequireDefault(_startsWith);
3222
3223var _minimatch = require("minimatch");
3224
3225var _minimatch2 = _interopRequireDefault(_minimatch);
3226
3227var _includes = require("lodash/includes");
3228
3229var _includes2 = _interopRequireDefault(_includes);
3230
3231var _isRegExp = require("lodash/isRegExp");
3232
3233var _isRegExp2 = _interopRequireDefault(_isRegExp);
3234
3235var _path = require("path");
3236
3237var _path2 = _interopRequireDefault(_path);
3238
3239var _slash = require("slash");
3240
3241var _slash2 = _interopRequireDefault(_slash);
3242
3243function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3244
3245function canCompile(filename, altExts) {
3246 var exts = altExts || canCompile.EXTENSIONS;
3247 var ext = _path2.default.extname(filename);
3248 return (0, _includes2.default)(exts, ext);
3249}
3250
3251canCompile.EXTENSIONS = [".js", ".jsx", ".es6", ".es"];
3252
3253function list(val) {
3254 if (!val) {
3255 return [];
3256 } else if (Array.isArray(val)) {
3257 return val;
3258 } else if (typeof val === "string") {
3259 return val.split(",");
3260 } else {
3261 return [val];
3262 }
3263}
3264
3265function regexify(val) {
3266 if (!val) {
3267 return new RegExp(/.^/);
3268 }
3269
3270 if (Array.isArray(val)) {
3271 val = new RegExp(val.map(_escapeRegExp2.default).join("|"), "i");
3272 }
3273
3274 if (typeof val === "string") {
3275 val = (0, _slash2.default)(val);
3276
3277 if ((0, _startsWith2.default)(val, "./") || (0, _startsWith2.default)(val, "*/")) val = val.slice(2);
3278 if ((0, _startsWith2.default)(val, "**/")) val = val.slice(3);
3279
3280 var regex = _minimatch2.default.makeRe(val, { nocase: true });
3281 return new RegExp(regex.source.slice(1, -1), "i");
3282 }
3283
3284 if ((0, _isRegExp2.default)(val)) {
3285 return val;
3286 }
3287
3288 throw new TypeError("illegal type for regexify");
3289}
3290
3291function arrayify(val, mapFn) {
3292 if (!val) return [];
3293 if (typeof val === "boolean") return arrayify([val], mapFn);
3294 if (typeof val === "string") return arrayify(list(val), mapFn);
3295
3296 if (Array.isArray(val)) {
3297 if (mapFn) val = val.map(mapFn);
3298 return val;
3299 }
3300
3301 return [val];
3302}
3303
3304function booleanify(val) {
3305 if (val === "true" || val == 1) {
3306 return true;
3307 }
3308
3309 if (val === "false" || val == 0 || !val) {
3310 return false;
3311 }
3312
3313 return val;
3314}
3315
3316function shouldIgnore(filename) {
3317 var ignore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
3318 var only = arguments[2];
3319
3320 filename = filename.replace(/\\/g, "/");
3321
3322 if (only) {
3323 for (var _iterator = only, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
3324 var _ref;
3325
3326 if (_isArray) {
3327 if (_i >= _iterator.length) break;
3328 _ref = _iterator[_i++];
3329 } else {
3330 _i = _iterator.next();
3331 if (_i.done) break;
3332 _ref = _i.value;
3333 }
3334
3335 var pattern = _ref;
3336
3337 if (_shouldIgnore(pattern, filename)) return false;
3338 }
3339 return true;
3340 } else if (ignore.length) {
3341 for (var _iterator2 = ignore, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
3342 var _ref2;
3343
3344 if (_isArray2) {
3345 if (_i2 >= _iterator2.length) break;
3346 _ref2 = _iterator2[_i2++];
3347 } else {
3348 _i2 = _iterator2.next();
3349 if (_i2.done) break;
3350 _ref2 = _i2.value;
3351 }
3352
3353 var _pattern = _ref2;
3354
3355 if (_shouldIgnore(_pattern, filename)) return true;
3356 }
3357 }
3358
3359 return false;
3360}
3361
3362function _shouldIgnore(pattern, filename) {
3363 if (typeof pattern === "function") {
3364 return pattern(filename);
3365 } else {
3366 return pattern.test(filename);
3367 }
3368}
3369},{"babel-runtime/core-js/get-iterator":56,"lodash/escapeRegExp":422,"lodash/includes":431,"lodash/isRegExp":443,"lodash/startsWith":456,"minimatch":466,"path":469,"slash":473,"util":492}],31:[function(require,module,exports){
3370module.exports={
3371 "_args": [
3372 [
3373 {
3374 "raw": "babel-core@^6.22.1",
3375 "scope": null,
3376 "escapedName": "babel-core",
3377 "name": "babel-core",
3378 "rawSpec": "^6.22.1",
3379 "spec": ">=6.22.1 <7.0.0",
3380 "type": "range"
3381 },
3382 "/home/directxman12/dev/noVNC"
3383 ]
3384 ],
3385 "_from": "babel-core@>=6.22.1 <7.0.0",
3386 "_id": "babel-core@6.23.1",
3387 "_inCache": true,
3388 "_location": "/babel-core",
3389 "_nodeVersion": "6.9.1",
3390 "_npmOperationalInternal": {
3391 "host": "packages-12-west.internal.npmjs.com",
3392 "tmp": "tmp/babel-core-6.23.1.tgz_1487038699717_0.8698694983031601"
3393 },
3394 "_npmUser": {
3395 "name": "loganfsmyth",
3396 "email": "loganfsmyth@gmail.com"
3397 },
3398 "_npmVersion": "3.10.8",
3399 "_phantomChildren": {},
3400 "_requested": {
3401 "raw": "babel-core@^6.22.1",
3402 "scope": null,
3403 "escapedName": "babel-core",
3404 "name": "babel-core",
3405 "rawSpec": "^6.22.1",
3406 "spec": ">=6.22.1 <7.0.0",
3407 "type": "range"
3408 },
3409 "_requiredBy": [
3410 "#DEV:/",
3411 "/babel-register",
3412 "/babelify",
3413 "/karma-babel-preprocessor"
3414 ],
3415 "_resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.23.1.tgz",
3416 "_shasum": "c143cb621bb2f621710c220c5d579d15b8a442df",
3417 "_shrinkwrap": null,
3418 "_spec": "babel-core@^6.22.1",
3419 "_where": "/home/directxman12/dev/noVNC",
3420 "author": {
3421 "name": "Sebastian McKenzie",
3422 "email": "sebmck@gmail.com"
3423 },
3424 "dependencies": {
3425 "babel-code-frame": "^6.22.0",
3426 "babel-generator": "^6.23.0",
3427 "babel-helpers": "^6.23.0",
3428 "babel-messages": "^6.23.0",
3429 "babel-register": "^6.23.0",
3430 "babel-runtime": "^6.22.0",
3431 "babel-template": "^6.23.0",
3432 "babel-traverse": "^6.23.1",
3433 "babel-types": "^6.23.0",
3434 "babylon": "^6.11.0",
3435 "convert-source-map": "^1.1.0",
3436 "debug": "^2.1.1",
3437 "json5": "^0.5.0",
3438 "lodash": "^4.2.0",
3439 "minimatch": "^3.0.2",
3440 "path-is-absolute": "^1.0.0",
3441 "private": "^0.1.6",
3442 "slash": "^1.0.0",
3443 "source-map": "^0.5.0"
3444 },
3445 "description": "Babel compiler core.",
3446 "devDependencies": {
3447 "babel-helper-fixtures": "^6.22.0",
3448 "babel-helper-transform-fixture-test-runner": "^6.23.0",
3449 "babel-polyfill": "^6.23.0"
3450 },
3451 "directories": {},
3452 "dist": {
3453 "shasum": "c143cb621bb2f621710c220c5d579d15b8a442df",
3454 "tarball": "https://registry.npmjs.org/babel-core/-/babel-core-6.23.1.tgz"
3455 },
3456 "homepage": "https://babeljs.io/",
3457 "keywords": [
3458 "6to5",
3459 "babel",
3460 "classes",
3461 "const",
3462 "es6",
3463 "harmony",
3464 "let",
3465 "modules",
3466 "transpile",
3467 "transpiler",
3468 "var",
3469 "babel-core",
3470 "compiler"
3471 ],
3472 "license": "MIT",
3473 "maintainers": [
3474 {
3475 "name": "amasad",
3476 "email": "amjad.masad@gmail.com"
3477 },
3478 {
3479 "name": "hzoo",
3480 "email": "hi@henryzoo.com"
3481 },
3482 {
3483 "name": "jmm",
3484 "email": "npm-public@jessemccarthy.net"
3485 },
3486 {
3487 "name": "loganfsmyth",
3488 "email": "loganfsmyth@gmail.com"
3489 },
3490 {
3491 "name": "sebmck",
3492 "email": "sebmck@gmail.com"
3493 },
3494 {
3495 "name": "thejameskyle",
3496 "email": "me@thejameskyle.com"
3497 }
3498 ],
3499 "name": "babel-core",
3500 "optionalDependencies": {},
3501 "readme": "ERROR: No README data found!",
3502 "repository": {
3503 "type": "git",
3504 "url": "https://github.com/babel/babel/tree/master/packages/babel-core"
3505 },
3506 "scripts": {
3507 "bench": "make bench",
3508 "test": "make test"
3509 },
3510 "version": "6.23.1"
3511}
3512
3513},{}],32:[function(require,module,exports){
3514"use strict";
3515
3516exports.__esModule = true;
3517
3518var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
3519
3520var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
3521
3522var _trimRight = require("trim-right");
3523
3524var _trimRight2 = _interopRequireDefault(_trimRight);
3525
3526function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3527
3528var SPACES_RE = /^[ \t]+$/;
3529
3530var Buffer = function () {
3531 function Buffer(map) {
3532 (0, _classCallCheck3.default)(this, Buffer);
3533 this._map = null;
3534 this._buf = [];
3535 this._last = "";
3536 this._queue = [];
3537 this._position = {
3538 line: 1,
3539 column: 0
3540 };
3541 this._sourcePosition = {
3542 identifierName: null,
3543 line: null,
3544 column: null,
3545 filename: null
3546 };
3547
3548 this._map = map;
3549 }
3550
3551 Buffer.prototype.get = function get() {
3552 this._flush();
3553
3554 var map = this._map;
3555 var result = {
3556 code: (0, _trimRight2.default)(this._buf.join("")),
3557 map: null,
3558 rawMappings: map && map.getRawMappings()
3559 };
3560
3561 if (map) {
3562 Object.defineProperty(result, "map", {
3563 configurable: true,
3564 enumerable: true,
3565 get: function get() {
3566 return this.map = map.get();
3567 },
3568 set: function set(value) {
3569 Object.defineProperty(this, "map", { value: value, writable: true });
3570 }
3571 });
3572 }
3573
3574 return result;
3575 };
3576
3577 Buffer.prototype.append = function append(str) {
3578 this._flush();
3579 var _sourcePosition = this._sourcePosition,
3580 line = _sourcePosition.line,
3581 column = _sourcePosition.column,
3582 filename = _sourcePosition.filename,
3583 identifierName = _sourcePosition.identifierName;
3584
3585 this._append(str, line, column, identifierName, filename);
3586 };
3587
3588 Buffer.prototype.queue = function queue(str) {
3589 if (str === "\n") while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) {
3590 this._queue.shift();
3591 }var _sourcePosition2 = this._sourcePosition,
3592 line = _sourcePosition2.line,
3593 column = _sourcePosition2.column,
3594 filename = _sourcePosition2.filename,
3595 identifierName = _sourcePosition2.identifierName;
3596
3597 this._queue.unshift([str, line, column, identifierName, filename]);
3598 };
3599
3600 Buffer.prototype._flush = function _flush() {
3601 var item = void 0;
3602 while (item = this._queue.pop()) {
3603 this._append.apply(this, item);
3604 }
3605 };
3606
3607 Buffer.prototype._append = function _append(str, line, column, identifierName, filename) {
3608 if (this._map && str[0] !== "\n") {
3609 this._map.mark(this._position.line, this._position.column, line, column, identifierName, filename);
3610 }
3611
3612 this._buf.push(str);
3613 this._last = str[str.length - 1];
3614
3615 for (var i = 0; i < str.length; i++) {
3616 if (str[i] === "\n") {
3617 this._position.line++;
3618 this._position.column = 0;
3619 } else {
3620 this._position.column++;
3621 }
3622 }
3623 };
3624
3625 Buffer.prototype.removeTrailingNewline = function removeTrailingNewline() {
3626 if (this._queue.length > 0 && this._queue[0][0] === "\n") this._queue.shift();
3627 };
3628
3629 Buffer.prototype.removeLastSemicolon = function removeLastSemicolon() {
3630 if (this._queue.length > 0 && this._queue[0][0] === ";") this._queue.shift();
3631 };
3632
3633 Buffer.prototype.endsWith = function endsWith(suffix) {
3634 if (suffix.length === 1) {
3635 var last = void 0;
3636 if (this._queue.length > 0) {
3637 var str = this._queue[0][0];
3638 last = str[str.length - 1];
3639 } else {
3640 last = this._last;
3641 }
3642
3643 return last === suffix;
3644 }
3645
3646 var end = this._last + this._queue.reduce(function (acc, item) {
3647 return item[0] + acc;
3648 }, "");
3649 if (suffix.length <= end.length) {
3650 return end.slice(-suffix.length) === suffix;
3651 }
3652
3653 return false;
3654 };
3655
3656 Buffer.prototype.hasContent = function hasContent() {
3657 return this._queue.length > 0 || !!this._last;
3658 };
3659
3660 Buffer.prototype.source = function source(prop, loc) {
3661 if (prop && !loc) return;
3662
3663 var pos = loc ? loc[prop] : null;
3664
3665 this._sourcePosition.identifierName = loc && loc.identifierName || null;
3666 this._sourcePosition.line = pos ? pos.line : null;
3667 this._sourcePosition.column = pos ? pos.column : null;
3668 this._sourcePosition.filename = loc && loc.filename || null;
3669 };
3670
3671 Buffer.prototype.withSource = function withSource(prop, loc, cb) {
3672 if (!this._map) return cb();
3673
3674 var originalLine = this._sourcePosition.line;
3675 var originalColumn = this._sourcePosition.column;
3676 var originalFilename = this._sourcePosition.filename;
3677 var originalIdentifierName = this._sourcePosition.identifierName;
3678
3679 this.source(prop, loc);
3680
3681 cb();
3682
3683 this._sourcePosition.line = originalLine;
3684 this._sourcePosition.column = originalColumn;
3685 this._sourcePosition.filename = originalFilename;
3686 this._sourcePosition.identifierName = originalIdentifierName;
3687 };
3688
3689 Buffer.prototype.getCurrentColumn = function getCurrentColumn() {
3690 var extra = this._queue.reduce(function (acc, item) {
3691 return item[0] + acc;
3692 }, "");
3693 var lastIndex = extra.lastIndexOf("\n");
3694
3695 return lastIndex === -1 ? this._position.column + extra.length : extra.length - 1 - lastIndex;
3696 };
3697
3698 Buffer.prototype.getCurrentLine = function getCurrentLine() {
3699 var extra = this._queue.reduce(function (acc, item) {
3700 return item[0] + acc;
3701 }, "");
3702
3703 var count = 0;
3704 for (var i = 0; i < extra.length; i++) {
3705 if (extra[i] === "\n") count++;
3706 }
3707
3708 return this._position.line + count;
3709 };
3710
3711 return Buffer;
3712}();
3713
3714exports.default = Buffer;
3715module.exports = exports["default"];
3716},{"babel-runtime/helpers/classCallCheck":70,"trim-right":488}],33:[function(require,module,exports){
3717"use strict";
3718
3719exports.__esModule = true;
3720exports.File = File;
3721exports.Program = Program;
3722exports.BlockStatement = BlockStatement;
3723exports.Noop = Noop;
3724exports.Directive = Directive;
3725
3726var _types = require("./types");
3727
3728Object.defineProperty(exports, "DirectiveLiteral", {
3729 enumerable: true,
3730 get: function get() {
3731 return _types.StringLiteral;
3732 }
3733});
3734function File(node) {
3735 this.print(node.program, node);
3736}
3737
3738function Program(node) {
3739 this.printInnerComments(node, false);
3740
3741 this.printSequence(node.directives, node);
3742 if (node.directives && node.directives.length) this.newline();
3743
3744 this.printSequence(node.body, node);
3745}
3746
3747function BlockStatement(node) {
3748 this.token("{");
3749 this.printInnerComments(node);
3750
3751 var hasDirectives = node.directives && node.directives.length;
3752
3753 if (node.body.length || hasDirectives) {
3754 this.newline();
3755
3756 this.printSequence(node.directives, node, { indent: true });
3757 if (hasDirectives) this.newline();
3758
3759 this.printSequence(node.body, node, { indent: true });
3760 this.removeTrailingNewline();
3761
3762 this.source("end", node.loc);
3763
3764 if (!this.endsWith("\n")) this.newline();
3765
3766 this.rightBrace();
3767 } else {
3768 this.source("end", node.loc);
3769 this.token("}");
3770 }
3771}
3772
3773function Noop() {}
3774
3775function Directive(node) {
3776 this.print(node.value, node);
3777 this.semicolon();
3778}
3779},{"./types":42}],34:[function(require,module,exports){
3780"use strict";
3781
3782exports.__esModule = true;
3783exports.ClassDeclaration = ClassDeclaration;
3784exports.ClassBody = ClassBody;
3785exports.ClassProperty = ClassProperty;
3786exports.ClassMethod = ClassMethod;
3787function ClassDeclaration(node) {
3788 this.printJoin(node.decorators, node);
3789 this.word("class");
3790
3791 if (node.id) {
3792 this.space();
3793 this.print(node.id, node);
3794 }
3795
3796 this.print(node.typeParameters, node);
3797
3798 if (node.superClass) {
3799 this.space();
3800 this.word("extends");
3801 this.space();
3802 this.print(node.superClass, node);
3803 this.print(node.superTypeParameters, node);
3804 }
3805
3806 if (node.implements) {
3807 this.space();
3808 this.word("implements");
3809 this.space();
3810 this.printList(node.implements, node);
3811 }
3812
3813 this.space();
3814 this.print(node.body, node);
3815}
3816
3817exports.ClassExpression = ClassDeclaration;
3818function ClassBody(node) {
3819 this.token("{");
3820 this.printInnerComments(node);
3821 if (node.body.length === 0) {
3822 this.token("}");
3823 } else {
3824 this.newline();
3825
3826 this.indent();
3827 this.printSequence(node.body, node);
3828 this.dedent();
3829
3830 if (!this.endsWith("\n")) this.newline();
3831
3832 this.rightBrace();
3833 }
3834}
3835
3836function ClassProperty(node) {
3837 this.printJoin(node.decorators, node);
3838
3839 if (node.static) {
3840 this.word("static");
3841 this.space();
3842 }
3843 if (node.computed) {
3844 this.token("[");
3845 this.print(node.key, node);
3846 this.token("]");
3847 } else {
3848 this._variance(node);
3849 this.print(node.key, node);
3850 }
3851 this.print(node.typeAnnotation, node);
3852 if (node.value) {
3853 this.space();
3854 this.token("=");
3855 this.space();
3856 this.print(node.value, node);
3857 }
3858 this.semicolon();
3859}
3860
3861function ClassMethod(node) {
3862 this.printJoin(node.decorators, node);
3863
3864 if (node.static) {
3865 this.word("static");
3866 this.space();
3867 }
3868
3869 if (node.kind === "constructorCall") {
3870 this.word("call");
3871 this.space();
3872 }
3873
3874 this._method(node);
3875}
3876},{}],35:[function(require,module,exports){
3877"use strict";
3878
3879exports.__esModule = true;
3880exports.LogicalExpression = exports.BinaryExpression = exports.AwaitExpression = exports.YieldExpression = undefined;
3881exports.UnaryExpression = UnaryExpression;
3882exports.DoExpression = DoExpression;
3883exports.ParenthesizedExpression = ParenthesizedExpression;
3884exports.UpdateExpression = UpdateExpression;
3885exports.ConditionalExpression = ConditionalExpression;
3886exports.NewExpression = NewExpression;
3887exports.SequenceExpression = SequenceExpression;
3888exports.ThisExpression = ThisExpression;
3889exports.Super = Super;
3890exports.Decorator = Decorator;
3891exports.CallExpression = CallExpression;
3892exports.Import = Import;
3893exports.EmptyStatement = EmptyStatement;
3894exports.ExpressionStatement = ExpressionStatement;
3895exports.AssignmentPattern = AssignmentPattern;
3896exports.AssignmentExpression = AssignmentExpression;
3897exports.BindExpression = BindExpression;
3898exports.MemberExpression = MemberExpression;
3899exports.MetaProperty = MetaProperty;
3900
3901var _babelTypes = require("babel-types");
3902
3903var t = _interopRequireWildcard(_babelTypes);
3904
3905var _node = require("../node");
3906
3907var n = _interopRequireWildcard(_node);
3908
3909function _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; } }
3910
3911function UnaryExpression(node) {
3912 if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof") {
3913 this.word(node.operator);
3914 this.space();
3915 } else {
3916 this.token(node.operator);
3917 }
3918
3919 this.print(node.argument, node);
3920}
3921
3922function DoExpression(node) {
3923 this.word("do");
3924 this.space();
3925 this.print(node.body, node);
3926}
3927
3928function ParenthesizedExpression(node) {
3929 this.token("(");
3930 this.print(node.expression, node);
3931 this.token(")");
3932}
3933
3934function UpdateExpression(node) {
3935 if (node.prefix) {
3936 this.token(node.operator);
3937 this.print(node.argument, node);
3938 } else {
3939 this.print(node.argument, node);
3940 this.token(node.operator);
3941 }
3942}
3943
3944function ConditionalExpression(node) {
3945 this.print(node.test, node);
3946 this.space();
3947 this.token("?");
3948 this.space();
3949 this.print(node.consequent, node);
3950 this.space();
3951 this.token(":");
3952 this.space();
3953 this.print(node.alternate, node);
3954}
3955
3956function NewExpression(node, parent) {
3957 this.word("new");
3958 this.space();
3959 this.print(node.callee, node);
3960 if (node.arguments.length === 0 && this.format.minified && !t.isCallExpression(parent, { callee: node }) && !t.isMemberExpression(parent) && !t.isNewExpression(parent)) return;
3961
3962 this.token("(");
3963 this.printList(node.arguments, node);
3964 this.token(")");
3965}
3966
3967function SequenceExpression(node) {
3968 this.printList(node.expressions, node);
3969}
3970
3971function ThisExpression() {
3972 this.word("this");
3973}
3974
3975function Super() {
3976 this.word("super");
3977}
3978
3979function Decorator(node) {
3980 this.token("@");
3981 this.print(node.expression, node);
3982 this.newline();
3983}
3984
3985function commaSeparatorNewline() {
3986 this.token(",");
3987 this.newline();
3988
3989 if (!this.endsWith("\n")) this.space();
3990}
3991
3992function CallExpression(node) {
3993 this.print(node.callee, node);
3994
3995 this.token("(");
3996
3997 var isPrettyCall = node._prettyCall;
3998
3999 var separator = void 0;
4000 if (isPrettyCall) {
4001 separator = commaSeparatorNewline;
4002 this.newline();
4003 this.indent();
4004 }
4005
4006 this.printList(node.arguments, node, { separator: separator });
4007
4008 if (isPrettyCall) {
4009 this.newline();
4010 this.dedent();
4011 }
4012
4013 this.token(")");
4014}
4015
4016function Import() {
4017 this.word("import");
4018}
4019
4020function buildYieldAwait(keyword) {
4021 return function (node) {
4022 this.word(keyword);
4023
4024 if (node.delegate) {
4025 this.token("*");
4026 }
4027
4028 if (node.argument) {
4029 this.space();
4030 var terminatorState = this.startTerminatorless();
4031 this.print(node.argument, node);
4032 this.endTerminatorless(terminatorState);
4033 }
4034 };
4035}
4036
4037var YieldExpression = exports.YieldExpression = buildYieldAwait("yield");
4038var AwaitExpression = exports.AwaitExpression = buildYieldAwait("await");
4039
4040function EmptyStatement() {
4041 this.semicolon(true);
4042}
4043
4044function ExpressionStatement(node) {
4045 this.print(node.expression, node);
4046 this.semicolon();
4047}
4048
4049function AssignmentPattern(node) {
4050 this.print(node.left, node);
4051 if (node.left.optional) this.token("?");
4052 this.print(node.left.typeAnnotation, node);
4053 this.space();
4054 this.token("=");
4055 this.space();
4056 this.print(node.right, node);
4057}
4058
4059function AssignmentExpression(node, parent) {
4060 var parens = this.inForStatementInitCounter && node.operator === "in" && !n.needsParens(node, parent);
4061
4062 if (parens) {
4063 this.token("(");
4064 }
4065
4066 this.print(node.left, node);
4067
4068 this.space();
4069 if (node.operator === "in" || node.operator === "instanceof") {
4070 this.word(node.operator);
4071 } else {
4072 this.token(node.operator);
4073 }
4074 this.space();
4075
4076 this.print(node.right, node);
4077
4078 if (parens) {
4079 this.token(")");
4080 }
4081}
4082
4083function BindExpression(node) {
4084 this.print(node.object, node);
4085 this.token("::");
4086 this.print(node.callee, node);
4087}
4088
4089exports.BinaryExpression = AssignmentExpression;
4090exports.LogicalExpression = AssignmentExpression;
4091function MemberExpression(node) {
4092 this.print(node.object, node);
4093
4094 if (!node.computed && t.isMemberExpression(node.property)) {
4095 throw new TypeError("Got a MemberExpression for MemberExpression property");
4096 }
4097
4098 var computed = node.computed;
4099 if (t.isLiteral(node.property) && typeof node.property.value === "number") {
4100 computed = true;
4101 }
4102
4103 if (computed) {
4104 this.token("[");
4105 this.print(node.property, node);
4106 this.token("]");
4107 } else {
4108 this.token(".");
4109 this.print(node.property, node);
4110 }
4111}
4112
4113function MetaProperty(node) {
4114 this.print(node.meta, node);
4115 this.token(".");
4116 this.print(node.property, node);
4117}
4118},{"../node":44,"babel-types":112}],36:[function(require,module,exports){
4119"use strict";
4120
4121exports.__esModule = true;
4122exports.AnyTypeAnnotation = AnyTypeAnnotation;
4123exports.ArrayTypeAnnotation = ArrayTypeAnnotation;
4124exports.BooleanTypeAnnotation = BooleanTypeAnnotation;
4125exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
4126exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
4127exports.DeclareClass = DeclareClass;
4128exports.DeclareFunction = DeclareFunction;
4129exports.DeclareInterface = DeclareInterface;
4130exports.DeclareModule = DeclareModule;
4131exports.DeclareModuleExports = DeclareModuleExports;
4132exports.DeclareTypeAlias = DeclareTypeAlias;
4133exports.DeclareVariable = DeclareVariable;
4134exports.ExistentialTypeParam = ExistentialTypeParam;
4135exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
4136exports.FunctionTypeParam = FunctionTypeParam;
4137exports.InterfaceExtends = InterfaceExtends;
4138exports._interfaceish = _interfaceish;
4139exports._variance = _variance;
4140exports.InterfaceDeclaration = InterfaceDeclaration;
4141exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
4142exports.MixedTypeAnnotation = MixedTypeAnnotation;
4143exports.EmptyTypeAnnotation = EmptyTypeAnnotation;
4144exports.NullableTypeAnnotation = NullableTypeAnnotation;
4145
4146var _types = require("./types");
4147
4148Object.defineProperty(exports, "NumericLiteralTypeAnnotation", {
4149 enumerable: true,
4150 get: function get() {
4151 return _types.NumericLiteral;
4152 }
4153});
4154Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
4155 enumerable: true,
4156 get: function get() {
4157 return _types.StringLiteral;
4158 }
4159});
4160exports.NumberTypeAnnotation = NumberTypeAnnotation;
4161exports.StringTypeAnnotation = StringTypeAnnotation;
4162exports.ThisTypeAnnotation = ThisTypeAnnotation;
4163exports.TupleTypeAnnotation = TupleTypeAnnotation;
4164exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
4165exports.TypeAlias = TypeAlias;
4166exports.TypeAnnotation = TypeAnnotation;
4167exports.TypeParameter = TypeParameter;
4168exports.TypeParameterInstantiation = TypeParameterInstantiation;
4169exports.ObjectTypeAnnotation = ObjectTypeAnnotation;
4170exports.ObjectTypeCallProperty = ObjectTypeCallProperty;
4171exports.ObjectTypeIndexer = ObjectTypeIndexer;
4172exports.ObjectTypeProperty = ObjectTypeProperty;
4173exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
4174exports.UnionTypeAnnotation = UnionTypeAnnotation;
4175exports.TypeCastExpression = TypeCastExpression;
4176exports.VoidTypeAnnotation = VoidTypeAnnotation;
4177function AnyTypeAnnotation() {
4178 this.word("any");
4179}
4180
4181function ArrayTypeAnnotation(node) {
4182 this.print(node.elementType, node);
4183 this.token("[");
4184 this.token("]");
4185}
4186
4187function BooleanTypeAnnotation() {
4188 this.word("boolean");
4189}
4190
4191function BooleanLiteralTypeAnnotation(node) {
4192 this.word(node.value ? "true" : "false");
4193}
4194
4195function NullLiteralTypeAnnotation() {
4196 this.word("null");
4197}
4198
4199function DeclareClass(node) {
4200 this.word("declare");
4201 this.space();
4202 this.word("class");
4203 this.space();
4204 this._interfaceish(node);
4205}
4206
4207function DeclareFunction(node) {
4208 this.word("declare");
4209 this.space();
4210 this.word("function");
4211 this.space();
4212 this.print(node.id, node);
4213 this.print(node.id.typeAnnotation.typeAnnotation, node);
4214 this.semicolon();
4215}
4216
4217function DeclareInterface(node) {
4218 this.word("declare");
4219 this.space();
4220 this.InterfaceDeclaration(node);
4221}
4222
4223function DeclareModule(node) {
4224 this.word("declare");
4225 this.space();
4226 this.word("module");
4227 this.space();
4228 this.print(node.id, node);
4229 this.space();
4230 this.print(node.body, node);
4231}
4232
4233function DeclareModuleExports(node) {
4234 this.word("declare");
4235 this.space();
4236 this.word("module");
4237 this.token(".");
4238 this.word("exports");
4239 this.print(node.typeAnnotation, node);
4240}
4241
4242function DeclareTypeAlias(node) {
4243 this.word("declare");
4244 this.space();
4245 this.TypeAlias(node);
4246}
4247
4248function DeclareVariable(node) {
4249 this.word("declare");
4250 this.space();
4251 this.word("var");
4252 this.space();
4253 this.print(node.id, node);
4254 this.print(node.id.typeAnnotation, node);
4255 this.semicolon();
4256}
4257
4258function ExistentialTypeParam() {
4259 this.token("*");
4260}
4261
4262function FunctionTypeAnnotation(node, parent) {
4263 this.print(node.typeParameters, node);
4264 this.token("(");
4265 this.printList(node.params, node);
4266
4267 if (node.rest) {
4268 if (node.params.length) {
4269 this.token(",");
4270 this.space();
4271 }
4272 this.token("...");
4273 this.print(node.rest, node);
4274 }
4275
4276 this.token(")");
4277
4278 if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction") {
4279 this.token(":");
4280 } else {
4281 this.space();
4282 this.token("=>");
4283 }
4284
4285 this.space();
4286 this.print(node.returnType, node);
4287}
4288
4289function FunctionTypeParam(node) {
4290 this.print(node.name, node);
4291 if (node.optional) this.token("?");
4292 this.token(":");
4293 this.space();
4294 this.print(node.typeAnnotation, node);
4295}
4296
4297function InterfaceExtends(node) {
4298 this.print(node.id, node);
4299 this.print(node.typeParameters, node);
4300}
4301
4302exports.ClassImplements = InterfaceExtends;
4303exports.GenericTypeAnnotation = InterfaceExtends;
4304function _interfaceish(node) {
4305 this.print(node.id, node);
4306 this.print(node.typeParameters, node);
4307 if (node.extends.length) {
4308 this.space();
4309 this.word("extends");
4310 this.space();
4311 this.printList(node.extends, node);
4312 }
4313 if (node.mixins && node.mixins.length) {
4314 this.space();
4315 this.word("mixins");
4316 this.space();
4317 this.printList(node.mixins, node);
4318 }
4319 this.space();
4320 this.print(node.body, node);
4321}
4322
4323function _variance(node) {
4324 if (node.variance === "plus") {
4325 this.token("+");
4326 } else if (node.variance === "minus") {
4327 this.token("-");
4328 }
4329}
4330
4331function InterfaceDeclaration(node) {
4332 this.word("interface");
4333 this.space();
4334 this._interfaceish(node);
4335}
4336
4337function andSeparator() {
4338 this.space();
4339 this.token("&");
4340 this.space();
4341}
4342
4343function IntersectionTypeAnnotation(node) {
4344 this.printJoin(node.types, node, { separator: andSeparator });
4345}
4346
4347function MixedTypeAnnotation() {
4348 this.word("mixed");
4349}
4350
4351function EmptyTypeAnnotation() {
4352 this.word("empty");
4353}
4354
4355function NullableTypeAnnotation(node) {
4356 this.token("?");
4357 this.print(node.typeAnnotation, node);
4358}
4359
4360function NumberTypeAnnotation() {
4361 this.word("number");
4362}
4363
4364function StringTypeAnnotation() {
4365 this.word("string");
4366}
4367
4368function ThisTypeAnnotation() {
4369 this.word("this");
4370}
4371
4372function TupleTypeAnnotation(node) {
4373 this.token("[");
4374 this.printList(node.types, node);
4375 this.token("]");
4376}
4377
4378function TypeofTypeAnnotation(node) {
4379 this.word("typeof");
4380 this.space();
4381 this.print(node.argument, node);
4382}
4383
4384function TypeAlias(node) {
4385 this.word("type");
4386 this.space();
4387 this.print(node.id, node);
4388 this.print(node.typeParameters, node);
4389 this.space();
4390 this.token("=");
4391 this.space();
4392 this.print(node.right, node);
4393 this.semicolon();
4394}
4395
4396function TypeAnnotation(node) {
4397 this.token(":");
4398 this.space();
4399 if (node.optional) this.token("?");
4400 this.print(node.typeAnnotation, node);
4401}
4402
4403function TypeParameter(node) {
4404 this._variance(node);
4405
4406 this.word(node.name);
4407
4408 if (node.bound) {
4409 this.print(node.bound, node);
4410 }
4411
4412 if (node.default) {
4413 this.space();
4414 this.token("=");
4415 this.space();
4416 this.print(node.default, node);
4417 }
4418}
4419
4420function TypeParameterInstantiation(node) {
4421 this.token("<");
4422 this.printList(node.params, node, {});
4423 this.token(">");
4424}
4425
4426exports.TypeParameterDeclaration = TypeParameterInstantiation;
4427function ObjectTypeAnnotation(node) {
4428 var _this = this;
4429
4430 if (node.exact) {
4431 this.token("{|");
4432 } else {
4433 this.token("{");
4434 }
4435
4436 var props = node.properties.concat(node.callProperties, node.indexers);
4437
4438 if (props.length) {
4439 this.space();
4440
4441 this.printJoin(props, node, {
4442 addNewlines: function addNewlines(leading) {
4443 if (leading && !props[0]) return 1;
4444 },
4445
4446 indent: true,
4447 statement: true,
4448 iterator: function iterator() {
4449 if (props.length !== 1) {
4450 if (_this.format.flowCommaSeparator) {
4451 _this.token(",");
4452 } else {
4453 _this.semicolon();
4454 }
4455 _this.space();
4456 }
4457 }
4458 });
4459
4460 this.space();
4461 }
4462
4463 if (node.exact) {
4464 this.token("|}");
4465 } else {
4466 this.token("}");
4467 }
4468}
4469
4470function ObjectTypeCallProperty(node) {
4471 if (node.static) {
4472 this.word("static");
4473 this.space();
4474 }
4475 this.print(node.value, node);
4476}
4477
4478function ObjectTypeIndexer(node) {
4479 if (node.static) {
4480 this.word("static");
4481 this.space();
4482 }
4483 this._variance(node);
4484 this.token("[");
4485 this.print(node.id, node);
4486 this.token(":");
4487 this.space();
4488 this.print(node.key, node);
4489 this.token("]");
4490 this.token(":");
4491 this.space();
4492 this.print(node.value, node);
4493}
4494
4495function ObjectTypeProperty(node) {
4496 if (node.static) {
4497 this.word("static");
4498 this.space();
4499 }
4500 this._variance(node);
4501 this.print(node.key, node);
4502 if (node.optional) this.token("?");
4503 this.token(":");
4504 this.space();
4505 this.print(node.value, node);
4506}
4507
4508function QualifiedTypeIdentifier(node) {
4509 this.print(node.qualification, node);
4510 this.token(".");
4511 this.print(node.id, node);
4512}
4513
4514function orSeparator() {
4515 this.space();
4516 this.token("|");
4517 this.space();
4518}
4519
4520function UnionTypeAnnotation(node) {
4521 this.printJoin(node.types, node, { separator: orSeparator });
4522}
4523
4524function TypeCastExpression(node) {
4525 this.token("(");
4526 this.print(node.expression, node);
4527 this.print(node.typeAnnotation, node);
4528 this.token(")");
4529}
4530
4531function VoidTypeAnnotation() {
4532 this.word("void");
4533}
4534},{"./types":42}],37:[function(require,module,exports){
4535"use strict";
4536
4537exports.__esModule = true;
4538
4539var _getIterator2 = require("babel-runtime/core-js/get-iterator");
4540
4541var _getIterator3 = _interopRequireDefault(_getIterator2);
4542
4543exports.JSXAttribute = JSXAttribute;
4544exports.JSXIdentifier = JSXIdentifier;
4545exports.JSXNamespacedName = JSXNamespacedName;
4546exports.JSXMemberExpression = JSXMemberExpression;
4547exports.JSXSpreadAttribute = JSXSpreadAttribute;
4548exports.JSXExpressionContainer = JSXExpressionContainer;
4549exports.JSXSpreadChild = JSXSpreadChild;
4550exports.JSXText = JSXText;
4551exports.JSXElement = JSXElement;
4552exports.JSXOpeningElement = JSXOpeningElement;
4553exports.JSXClosingElement = JSXClosingElement;
4554exports.JSXEmptyExpression = JSXEmptyExpression;
4555
4556function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4557
4558function JSXAttribute(node) {
4559 this.print(node.name, node);
4560 if (node.value) {
4561 this.token("=");
4562 this.print(node.value, node);
4563 }
4564}
4565
4566function JSXIdentifier(node) {
4567 this.word(node.name);
4568}
4569
4570function JSXNamespacedName(node) {
4571 this.print(node.namespace, node);
4572 this.token(":");
4573 this.print(node.name, node);
4574}
4575
4576function JSXMemberExpression(node) {
4577 this.print(node.object, node);
4578 this.token(".");
4579 this.print(node.property, node);
4580}
4581
4582function JSXSpreadAttribute(node) {
4583 this.token("{");
4584 this.token("...");
4585 this.print(node.argument, node);
4586 this.token("}");
4587}
4588
4589function JSXExpressionContainer(node) {
4590 this.token("{");
4591 this.print(node.expression, node);
4592 this.token("}");
4593}
4594
4595function JSXSpreadChild(node) {
4596 this.token("{");
4597 this.token("...");
4598 this.print(node.expression, node);
4599 this.token("}");
4600}
4601
4602function JSXText(node) {
4603 this.token(node.value);
4604}
4605
4606function JSXElement(node) {
4607 var open = node.openingElement;
4608 this.print(open, node);
4609 if (open.selfClosing) return;
4610
4611 this.indent();
4612 for (var _iterator = node.children, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
4613 var _ref;
4614
4615 if (_isArray) {
4616 if (_i >= _iterator.length) break;
4617 _ref = _iterator[_i++];
4618 } else {
4619 _i = _iterator.next();
4620 if (_i.done) break;
4621 _ref = _i.value;
4622 }
4623
4624 var child = _ref;
4625
4626 this.print(child, node);
4627 }
4628 this.dedent();
4629
4630 this.print(node.closingElement, node);
4631}
4632
4633function spaceSeparator() {
4634 this.space();
4635}
4636
4637function JSXOpeningElement(node) {
4638 this.token("<");
4639 this.print(node.name, node);
4640 if (node.attributes.length > 0) {
4641 this.space();
4642 this.printJoin(node.attributes, node, { separator: spaceSeparator });
4643 }
4644 if (node.selfClosing) {
4645 this.space();
4646 this.token("/>");
4647 } else {
4648 this.token(">");
4649 }
4650}
4651
4652function JSXClosingElement(node) {
4653 this.token("</");
4654 this.print(node.name, node);
4655 this.token(">");
4656}
4657
4658function JSXEmptyExpression() {}
4659},{"babel-runtime/core-js/get-iterator":56}],38:[function(require,module,exports){
4660"use strict";
4661
4662exports.__esModule = true;
4663exports.FunctionDeclaration = undefined;
4664exports._params = _params;
4665exports._method = _method;
4666exports.FunctionExpression = FunctionExpression;
4667exports.ArrowFunctionExpression = ArrowFunctionExpression;
4668
4669var _babelTypes = require("babel-types");
4670
4671var t = _interopRequireWildcard(_babelTypes);
4672
4673function _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; } }
4674
4675function _params(node) {
4676 var _this = this;
4677
4678 this.print(node.typeParameters, node);
4679 this.token("(");
4680 this.printList(node.params, node, {
4681 iterator: function iterator(node) {
4682 if (node.optional) _this.token("?");
4683 _this.print(node.typeAnnotation, node);
4684 }
4685 });
4686 this.token(")");
4687
4688 if (node.returnType) {
4689 this.print(node.returnType, node);
4690 }
4691}
4692
4693function _method(node) {
4694 var kind = node.kind;
4695 var key = node.key;
4696
4697 if (kind === "method" || kind === "init") {
4698 if (node.generator) {
4699 this.token("*");
4700 }
4701 }
4702
4703 if (kind === "get" || kind === "set") {
4704 this.word(kind);
4705 this.space();
4706 }
4707
4708 if (node.async) {
4709 this.word("async");
4710 this.space();
4711 }
4712
4713 if (node.computed) {
4714 this.token("[");
4715 this.print(key, node);
4716 this.token("]");
4717 } else {
4718 this.print(key, node);
4719 }
4720
4721 this._params(node);
4722 this.space();
4723 this.print(node.body, node);
4724}
4725
4726function FunctionExpression(node) {
4727 if (node.async) {
4728 this.word("async");
4729 this.space();
4730 }
4731 this.word("function");
4732 if (node.generator) this.token("*");
4733
4734 if (node.id) {
4735 this.space();
4736 this.print(node.id, node);
4737 } else {
4738 this.space();
4739 }
4740
4741 this._params(node);
4742 this.space();
4743 this.print(node.body, node);
4744}
4745
4746exports.FunctionDeclaration = FunctionExpression;
4747function ArrowFunctionExpression(node) {
4748 if (node.async) {
4749 this.word("async");
4750 this.space();
4751 }
4752
4753 var firstParam = node.params[0];
4754
4755 if (node.params.length === 1 && t.isIdentifier(firstParam) && !hasTypes(node, firstParam)) {
4756 this.print(firstParam, node);
4757 } else {
4758 this._params(node);
4759 }
4760
4761 this.space();
4762 this.token("=>");
4763 this.space();
4764
4765 this.print(node.body, node);
4766}
4767
4768function hasTypes(node, param) {
4769 return node.typeParameters || node.returnType || param.typeAnnotation || param.optional || param.trailingComments;
4770}
4771},{"babel-types":112}],39:[function(require,module,exports){
4772"use strict";
4773
4774exports.__esModule = true;
4775exports.ImportSpecifier = ImportSpecifier;
4776exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
4777exports.ExportDefaultSpecifier = ExportDefaultSpecifier;
4778exports.ExportSpecifier = ExportSpecifier;
4779exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier;
4780exports.ExportAllDeclaration = ExportAllDeclaration;
4781exports.ExportNamedDeclaration = ExportNamedDeclaration;
4782exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
4783exports.ImportDeclaration = ImportDeclaration;
4784exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
4785
4786var _babelTypes = require("babel-types");
4787
4788var t = _interopRequireWildcard(_babelTypes);
4789
4790function _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; } }
4791
4792function ImportSpecifier(node) {
4793 if (node.importKind === "type" || node.importKind === "typeof") {
4794 this.word(node.importKind);
4795 this.space();
4796 }
4797
4798 this.print(node.imported, node);
4799 if (node.local && node.local.name !== node.imported.name) {
4800 this.space();
4801 this.word("as");
4802 this.space();
4803 this.print(node.local, node);
4804 }
4805}
4806
4807function ImportDefaultSpecifier(node) {
4808 this.print(node.local, node);
4809}
4810
4811function ExportDefaultSpecifier(node) {
4812 this.print(node.exported, node);
4813}
4814
4815function ExportSpecifier(node) {
4816 this.print(node.local, node);
4817 if (node.exported && node.local.name !== node.exported.name) {
4818 this.space();
4819 this.word("as");
4820 this.space();
4821 this.print(node.exported, node);
4822 }
4823}
4824
4825function ExportNamespaceSpecifier(node) {
4826 this.token("*");
4827 this.space();
4828 this.word("as");
4829 this.space();
4830 this.print(node.exported, node);
4831}
4832
4833function ExportAllDeclaration(node) {
4834 this.word("export");
4835 this.space();
4836 this.token("*");
4837 if (node.exported) {
4838 this.space();
4839 this.word("as");
4840 this.space();
4841 this.print(node.exported, node);
4842 }
4843 this.space();
4844 this.word("from");
4845 this.space();
4846 this.print(node.source, node);
4847 this.semicolon();
4848}
4849
4850function ExportNamedDeclaration() {
4851 this.word("export");
4852 this.space();
4853 ExportDeclaration.apply(this, arguments);
4854}
4855
4856function ExportDefaultDeclaration() {
4857 this.word("export");
4858 this.space();
4859 this.word("default");
4860 this.space();
4861 ExportDeclaration.apply(this, arguments);
4862}
4863
4864function ExportDeclaration(node) {
4865 if (node.declaration) {
4866 var declar = node.declaration;
4867 this.print(declar, node);
4868 if (!t.isStatement(declar)) this.semicolon();
4869 } else {
4870 if (node.exportKind === "type") {
4871 this.word("type");
4872 this.space();
4873 }
4874
4875 var specifiers = node.specifiers.slice(0);
4876
4877 var hasSpecial = false;
4878 while (true) {
4879 var first = specifiers[0];
4880 if (t.isExportDefaultSpecifier(first) || t.isExportNamespaceSpecifier(first)) {
4881 hasSpecial = true;
4882 this.print(specifiers.shift(), node);
4883 if (specifiers.length) {
4884 this.token(",");
4885 this.space();
4886 }
4887 } else {
4888 break;
4889 }
4890 }
4891
4892 if (specifiers.length || !specifiers.length && !hasSpecial) {
4893 this.token("{");
4894 if (specifiers.length) {
4895 this.space();
4896 this.printList(specifiers, node);
4897 this.space();
4898 }
4899 this.token("}");
4900 }
4901
4902 if (node.source) {
4903 this.space();
4904 this.word("from");
4905 this.space();
4906 this.print(node.source, node);
4907 }
4908
4909 this.semicolon();
4910 }
4911}
4912
4913function ImportDeclaration(node) {
4914 this.word("import");
4915 this.space();
4916
4917 if (node.importKind === "type" || node.importKind === "typeof") {
4918 this.word(node.importKind);
4919 this.space();
4920 }
4921
4922 var specifiers = node.specifiers.slice(0);
4923 if (specifiers && specifiers.length) {
4924 while (true) {
4925 var first = specifiers[0];
4926 if (t.isImportDefaultSpecifier(first) || t.isImportNamespaceSpecifier(first)) {
4927 this.print(specifiers.shift(), node);
4928 if (specifiers.length) {
4929 this.token(",");
4930 this.space();
4931 }
4932 } else {
4933 break;
4934 }
4935 }
4936
4937 if (specifiers.length) {
4938 this.token("{");
4939 this.space();
4940 this.printList(specifiers, node);
4941 this.space();
4942 this.token("}");
4943 }
4944
4945 this.space();
4946 this.word("from");
4947 this.space();
4948 }
4949
4950 this.print(node.source, node);
4951 this.semicolon();
4952}
4953
4954function ImportNamespaceSpecifier(node) {
4955 this.token("*");
4956 this.space();
4957 this.word("as");
4958 this.space();
4959 this.print(node.local, node);
4960}
4961},{"babel-types":112}],40:[function(require,module,exports){
4962"use strict";
4963
4964exports.__esModule = true;
4965exports.ThrowStatement = exports.BreakStatement = exports.ReturnStatement = exports.ContinueStatement = exports.ForAwaitStatement = exports.ForOfStatement = exports.ForInStatement = undefined;
4966
4967var _getIterator2 = require("babel-runtime/core-js/get-iterator");
4968
4969var _getIterator3 = _interopRequireDefault(_getIterator2);
4970
4971exports.WithStatement = WithStatement;
4972exports.IfStatement = IfStatement;
4973exports.ForStatement = ForStatement;
4974exports.WhileStatement = WhileStatement;
4975exports.DoWhileStatement = DoWhileStatement;
4976exports.LabeledStatement = LabeledStatement;
4977exports.TryStatement = TryStatement;
4978exports.CatchClause = CatchClause;
4979exports.SwitchStatement = SwitchStatement;
4980exports.SwitchCase = SwitchCase;
4981exports.DebuggerStatement = DebuggerStatement;
4982exports.VariableDeclaration = VariableDeclaration;
4983exports.VariableDeclarator = VariableDeclarator;
4984
4985var _babelTypes = require("babel-types");
4986
4987var t = _interopRequireWildcard(_babelTypes);
4988
4989function _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; } }
4990
4991function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4992
4993function WithStatement(node) {
4994 this.word("with");
4995 this.space();
4996 this.token("(");
4997 this.print(node.object, node);
4998 this.token(")");
4999 this.printBlock(node);
5000}
5001
5002function IfStatement(node) {
5003 this.word("if");
5004 this.space();
5005 this.token("(");
5006 this.print(node.test, node);
5007 this.token(")");
5008 this.space();
5009
5010 var needsBlock = node.alternate && t.isIfStatement(getLastStatement(node.consequent));
5011 if (needsBlock) {
5012 this.token("{");
5013 this.newline();
5014 this.indent();
5015 }
5016
5017 this.printAndIndentOnComments(node.consequent, node);
5018
5019 if (needsBlock) {
5020 this.dedent();
5021 this.newline();
5022 this.token("}");
5023 }
5024
5025 if (node.alternate) {
5026 if (this.endsWith("}")) this.space();
5027 this.word("else");
5028 this.space();
5029 this.printAndIndentOnComments(node.alternate, node);
5030 }
5031}
5032
5033function getLastStatement(statement) {
5034 if (!t.isStatement(statement.body)) return statement;
5035 return getLastStatement(statement.body);
5036}
5037
5038function ForStatement(node) {
5039 this.word("for");
5040 this.space();
5041 this.token("(");
5042
5043 this.inForStatementInitCounter++;
5044 this.print(node.init, node);
5045 this.inForStatementInitCounter--;
5046 this.token(";");
5047
5048 if (node.test) {
5049 this.space();
5050 this.print(node.test, node);
5051 }
5052 this.token(";");
5053
5054 if (node.update) {
5055 this.space();
5056 this.print(node.update, node);
5057 }
5058
5059 this.token(")");
5060 this.printBlock(node);
5061}
5062
5063function WhileStatement(node) {
5064 this.word("while");
5065 this.space();
5066 this.token("(");
5067 this.print(node.test, node);
5068 this.token(")");
5069 this.printBlock(node);
5070}
5071
5072var buildForXStatement = function buildForXStatement(op) {
5073 return function (node) {
5074 this.word("for");
5075 this.space();
5076 if (op === "await") {
5077 this.word("await");
5078 this.space();
5079 op = "of";
5080 }
5081 this.token("(");
5082
5083 this.print(node.left, node);
5084 this.space();
5085 this.word(op);
5086 this.space();
5087 this.print(node.right, node);
5088 this.token(")");
5089 this.printBlock(node);
5090 };
5091};
5092
5093var ForInStatement = exports.ForInStatement = buildForXStatement("in");
5094var ForOfStatement = exports.ForOfStatement = buildForXStatement("of");
5095var ForAwaitStatement = exports.ForAwaitStatement = buildForXStatement("await");
5096
5097function DoWhileStatement(node) {
5098 this.word("do");
5099 this.space();
5100 this.print(node.body, node);
5101 this.space();
5102 this.word("while");
5103 this.space();
5104 this.token("(");
5105 this.print(node.test, node);
5106 this.token(")");
5107 this.semicolon();
5108}
5109
5110function buildLabelStatement(prefix) {
5111 var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "label";
5112
5113 return function (node) {
5114 this.word(prefix);
5115
5116 var label = node[key];
5117 if (label) {
5118 this.space();
5119
5120 var terminatorState = this.startTerminatorless();
5121 this.print(label, node);
5122 this.endTerminatorless(terminatorState);
5123 }
5124
5125 this.semicolon();
5126 };
5127}
5128
5129var ContinueStatement = exports.ContinueStatement = buildLabelStatement("continue");
5130var ReturnStatement = exports.ReturnStatement = buildLabelStatement("return", "argument");
5131var BreakStatement = exports.BreakStatement = buildLabelStatement("break");
5132var ThrowStatement = exports.ThrowStatement = buildLabelStatement("throw", "argument");
5133
5134function LabeledStatement(node) {
5135 this.print(node.label, node);
5136 this.token(":");
5137 this.space();
5138 this.print(node.body, node);
5139}
5140
5141function TryStatement(node) {
5142 this.word("try");
5143 this.space();
5144 this.print(node.block, node);
5145 this.space();
5146
5147 if (node.handlers) {
5148 this.print(node.handlers[0], node);
5149 } else {
5150 this.print(node.handler, node);
5151 }
5152
5153 if (node.finalizer) {
5154 this.space();
5155 this.word("finally");
5156 this.space();
5157 this.print(node.finalizer, node);
5158 }
5159}
5160
5161function CatchClause(node) {
5162 this.word("catch");
5163 this.space();
5164 this.token("(");
5165 this.print(node.param, node);
5166 this.token(")");
5167 this.space();
5168 this.print(node.body, node);
5169}
5170
5171function SwitchStatement(node) {
5172 this.word("switch");
5173 this.space();
5174 this.token("(");
5175 this.print(node.discriminant, node);
5176 this.token(")");
5177 this.space();
5178 this.token("{");
5179
5180 this.printSequence(node.cases, node, {
5181 indent: true,
5182 addNewlines: function addNewlines(leading, cas) {
5183 if (!leading && node.cases[node.cases.length - 1] === cas) return -1;
5184 }
5185 });
5186
5187 this.token("}");
5188}
5189
5190function SwitchCase(node) {
5191 if (node.test) {
5192 this.word("case");
5193 this.space();
5194 this.print(node.test, node);
5195 this.token(":");
5196 } else {
5197 this.word("default");
5198 this.token(":");
5199 }
5200
5201 if (node.consequent.length) {
5202 this.newline();
5203 this.printSequence(node.consequent, node, { indent: true });
5204 }
5205}
5206
5207function DebuggerStatement() {
5208 this.word("debugger");
5209 this.semicolon();
5210}
5211
5212function variableDeclarationIdent() {
5213 this.token(",");
5214 this.newline();
5215 if (this.endsWith("\n")) for (var i = 0; i < 4; i++) {
5216 this.space(true);
5217 }
5218}
5219
5220function constDeclarationIdent() {
5221 this.token(",");
5222 this.newline();
5223 if (this.endsWith("\n")) for (var i = 0; i < 6; i++) {
5224 this.space(true);
5225 }
5226}
5227
5228function VariableDeclaration(node, parent) {
5229 this.word(node.kind);
5230 this.space();
5231
5232 var hasInits = false;
5233
5234 if (!t.isFor(parent)) {
5235 for (var _iterator = node.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
5236 var _ref;
5237
5238 if (_isArray) {
5239 if (_i >= _iterator.length) break;
5240 _ref = _iterator[_i++];
5241 } else {
5242 _i = _iterator.next();
5243 if (_i.done) break;
5244 _ref = _i.value;
5245 }
5246
5247 var declar = _ref;
5248
5249 if (declar.init) {
5250 hasInits = true;
5251 }
5252 }
5253 }
5254
5255 var separator = void 0;
5256 if (hasInits) {
5257 separator = node.kind === "const" ? constDeclarationIdent : variableDeclarationIdent;
5258 }
5259
5260 this.printList(node.declarations, node, { separator: separator });
5261
5262 if (t.isFor(parent)) {
5263 if (parent.left === node || parent.init === node) return;
5264 }
5265
5266 this.semicolon();
5267}
5268
5269function VariableDeclarator(node) {
5270 this.print(node.id, node);
5271 this.print(node.id.typeAnnotation, node);
5272 if (node.init) {
5273 this.space();
5274 this.token("=");
5275 this.space();
5276 this.print(node.init, node);
5277 }
5278}
5279},{"babel-runtime/core-js/get-iterator":56,"babel-types":112}],41:[function(require,module,exports){
5280"use strict";
5281
5282exports.__esModule = true;
5283exports.TaggedTemplateExpression = TaggedTemplateExpression;
5284exports.TemplateElement = TemplateElement;
5285exports.TemplateLiteral = TemplateLiteral;
5286function TaggedTemplateExpression(node) {
5287 this.print(node.tag, node);
5288 this.print(node.quasi, node);
5289}
5290
5291function TemplateElement(node, parent) {
5292 var isFirst = parent.quasis[0] === node;
5293 var isLast = parent.quasis[parent.quasis.length - 1] === node;
5294
5295 var value = (isFirst ? "`" : "}") + node.value.raw + (isLast ? "`" : "${");
5296
5297 this.token(value);
5298}
5299
5300function TemplateLiteral(node) {
5301 var quasis = node.quasis;
5302
5303 for (var i = 0; i < quasis.length; i++) {
5304 this.print(quasis[i], node);
5305
5306 if (i + 1 < quasis.length) {
5307 this.print(node.expressions[i], node);
5308 }
5309 }
5310}
5311},{}],42:[function(require,module,exports){
5312"use strict";
5313
5314exports.__esModule = true;
5315exports.ArrayPattern = exports.ObjectPattern = exports.RestProperty = exports.SpreadProperty = exports.SpreadElement = undefined;
5316exports.Identifier = Identifier;
5317exports.RestElement = RestElement;
5318exports.ObjectExpression = ObjectExpression;
5319exports.ObjectMethod = ObjectMethod;
5320exports.ObjectProperty = ObjectProperty;
5321exports.ArrayExpression = ArrayExpression;
5322exports.RegExpLiteral = RegExpLiteral;
5323exports.BooleanLiteral = BooleanLiteral;
5324exports.NullLiteral = NullLiteral;
5325exports.NumericLiteral = NumericLiteral;
5326exports.StringLiteral = StringLiteral;
5327
5328var _babelTypes = require("babel-types");
5329
5330var t = _interopRequireWildcard(_babelTypes);
5331
5332var _jsesc = require("jsesc");
5333
5334var _jsesc2 = _interopRequireDefault(_jsesc);
5335
5336function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5337
5338function _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; } }
5339
5340function Identifier(node) {
5341 if (node.variance) {
5342 if (node.variance === "plus") {
5343 this.token("+");
5344 } else if (node.variance === "minus") {
5345 this.token("-");
5346 }
5347 }
5348
5349 this.word(node.name);
5350}
5351
5352function RestElement(node) {
5353 this.token("...");
5354 this.print(node.argument, node);
5355}
5356
5357exports.SpreadElement = RestElement;
5358exports.SpreadProperty = RestElement;
5359exports.RestProperty = RestElement;
5360function ObjectExpression(node) {
5361 var props = node.properties;
5362
5363 this.token("{");
5364 this.printInnerComments(node);
5365
5366 if (props.length) {
5367 this.space();
5368 this.printList(props, node, { indent: true, statement: true });
5369 this.space();
5370 }
5371
5372 this.token("}");
5373}
5374
5375exports.ObjectPattern = ObjectExpression;
5376function ObjectMethod(node) {
5377 this.printJoin(node.decorators, node);
5378 this._method(node);
5379}
5380
5381function ObjectProperty(node) {
5382 this.printJoin(node.decorators, node);
5383
5384 if (node.computed) {
5385 this.token("[");
5386 this.print(node.key, node);
5387 this.token("]");
5388 } else {
5389 if (t.isAssignmentPattern(node.value) && t.isIdentifier(node.key) && node.key.name === node.value.left.name) {
5390 this.print(node.value, node);
5391 return;
5392 }
5393
5394 this.print(node.key, node);
5395
5396 if (node.shorthand && t.isIdentifier(node.key) && t.isIdentifier(node.value) && node.key.name === node.value.name) {
5397 return;
5398 }
5399 }
5400
5401 this.token(":");
5402 this.space();
5403 this.print(node.value, node);
5404}
5405
5406function ArrayExpression(node) {
5407 var elems = node.elements;
5408 var len = elems.length;
5409
5410 this.token("[");
5411 this.printInnerComments(node);
5412
5413 for (var i = 0; i < elems.length; i++) {
5414 var elem = elems[i];
5415 if (elem) {
5416 if (i > 0) this.space();
5417 this.print(elem, node);
5418 if (i < len - 1) this.token(",");
5419 } else {
5420 this.token(",");
5421 }
5422 }
5423
5424 this.token("]");
5425}
5426
5427exports.ArrayPattern = ArrayExpression;
5428function RegExpLiteral(node) {
5429 this.word("/" + node.pattern + "/" + node.flags);
5430}
5431
5432function BooleanLiteral(node) {
5433 this.word(node.value ? "true" : "false");
5434}
5435
5436function NullLiteral() {
5437 this.word("null");
5438}
5439
5440function NumericLiteral(node) {
5441 var raw = this.getPossibleRaw(node);
5442 var value = node.value + "";
5443 if (raw == null) {
5444 this.number(value);
5445 } else if (this.format.minified) {
5446 this.number(raw.length < value.length ? raw : value);
5447 } else {
5448 this.number(raw);
5449 }
5450}
5451
5452function StringLiteral(node, parent) {
5453 var raw = this.getPossibleRaw(node);
5454 if (!this.format.minified && raw != null) {
5455 this.token(raw);
5456 return;
5457 }
5458
5459 var opts = {
5460 quotes: t.isJSX(parent) ? "double" : this.format.quotes,
5461 wrap: true
5462 };
5463 if (this.format.jsonCompatibleStrings) {
5464 opts.json = true;
5465 }
5466 var val = (0, _jsesc2.default)(node.value, opts);
5467
5468 return this.token(val);
5469}
5470},{"babel-types":112,"jsesc":249}],43:[function(require,module,exports){
5471"use strict";
5472
5473exports.__esModule = true;
5474exports.CodeGenerator = undefined;
5475
5476var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
5477
5478var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
5479
5480var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn");
5481
5482var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
5483
5484var _inherits2 = require("babel-runtime/helpers/inherits");
5485
5486var _inherits3 = _interopRequireDefault(_inherits2);
5487
5488exports.default = function (ast, opts, code) {
5489 var gen = new Generator(ast, opts, code);
5490 return gen.generate();
5491};
5492
5493var _detectIndent = require("detect-indent");
5494
5495var _detectIndent2 = _interopRequireDefault(_detectIndent);
5496
5497var _sourceMap = require("./source-map");
5498
5499var _sourceMap2 = _interopRequireDefault(_sourceMap);
5500
5501var _babelMessages = require("babel-messages");
5502
5503var messages = _interopRequireWildcard(_babelMessages);
5504
5505var _printer = require("./printer");
5506
5507var _printer2 = _interopRequireDefault(_printer);
5508
5509function _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; } }
5510
5511function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5512
5513var Generator = function (_Printer) {
5514 (0, _inherits3.default)(Generator, _Printer);
5515
5516 function Generator(ast, opts, code) {
5517 (0, _classCallCheck3.default)(this, Generator);
5518
5519 opts = opts || {};
5520
5521 var tokens = ast.tokens || [];
5522 var format = normalizeOptions(code, opts, tokens);
5523 var map = opts.sourceMaps ? new _sourceMap2.default(opts, code) : null;
5524
5525 var _this = (0, _possibleConstructorReturn3.default)(this, _Printer.call(this, format, map, tokens));
5526
5527 _this.ast = ast;
5528 return _this;
5529 }
5530
5531 Generator.prototype.generate = function generate() {
5532 return _Printer.prototype.generate.call(this, this.ast);
5533 };
5534
5535 return Generator;
5536}(_printer2.default);
5537
5538function normalizeOptions(code, opts, tokens) {
5539 var style = " ";
5540 if (code && typeof code === "string") {
5541 var indent = (0, _detectIndent2.default)(code).indent;
5542 if (indent && indent !== " ") style = indent;
5543 }
5544
5545 var format = {
5546 auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
5547 auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
5548 shouldPrintComment: opts.shouldPrintComment,
5549 retainLines: opts.retainLines,
5550 retainFunctionParens: opts.retainFunctionParens,
5551 comments: opts.comments == null || opts.comments,
5552 compact: opts.compact,
5553 minified: opts.minified,
5554 concise: opts.concise,
5555 quotes: opts.quotes || findCommonStringDelimiter(code, tokens),
5556 jsonCompatibleStrings: opts.jsonCompatibleStrings,
5557 indent: {
5558 adjustMultilineComment: true,
5559 style: style,
5560 base: 0
5561 },
5562 flowCommaSeparator: opts.flowCommaSeparator
5563 };
5564
5565 if (format.minified) {
5566 format.compact = true;
5567
5568 format.shouldPrintComment = format.shouldPrintComment || function () {
5569 return format.comments;
5570 };
5571 } else {
5572 format.shouldPrintComment = format.shouldPrintComment || function (value) {
5573 return format.comments || value.indexOf("@license") >= 0 || value.indexOf("@preserve") >= 0;
5574 };
5575 }
5576
5577 if (format.compact === "auto") {
5578 format.compact = code.length > 500000;
5579
5580 if (format.compact) {
5581 console.error("[BABEL] " + messages.get("codeGeneratorDeopt", opts.filename, "500KB"));
5582 }
5583 }
5584
5585 if (format.compact) {
5586 format.indent.adjustMultilineComment = false;
5587 }
5588
5589 return format;
5590}
5591
5592function findCommonStringDelimiter(code, tokens) {
5593 var DEFAULT_STRING_DELIMITER = "double";
5594 if (!code) {
5595 return DEFAULT_STRING_DELIMITER;
5596 }
5597
5598 var occurences = {
5599 single: 0,
5600 double: 0
5601 };
5602
5603 var checked = 0;
5604
5605 for (var i = 0; i < tokens.length; i++) {
5606 var token = tokens[i];
5607 if (token.type.label !== "string") continue;
5608
5609 var raw = code.slice(token.start, token.end);
5610 if (raw[0] === "'") {
5611 occurences.single++;
5612 } else {
5613 occurences.double++;
5614 }
5615
5616 checked++;
5617 if (checked >= 3) break;
5618 }
5619 if (occurences.single > occurences.double) {
5620 return "single";
5621 } else {
5622 return "double";
5623 }
5624}
5625
5626var CodeGenerator = exports.CodeGenerator = function () {
5627 function CodeGenerator(ast, opts, code) {
5628 (0, _classCallCheck3.default)(this, CodeGenerator);
5629
5630 this._generator = new Generator(ast, opts, code);
5631 }
5632
5633 CodeGenerator.prototype.generate = function generate() {
5634 return this._generator.generate();
5635 };
5636
5637 return CodeGenerator;
5638}();
5639},{"./printer":47,"./source-map":48,"babel-messages":53,"babel-runtime/helpers/classCallCheck":70,"babel-runtime/helpers/inherits":71,"babel-runtime/helpers/possibleConstructorReturn":73,"detect-indent":235}],44:[function(require,module,exports){
5640"use strict";
5641
5642exports.__esModule = true;
5643
5644var _getIterator2 = require("babel-runtime/core-js/get-iterator");
5645
5646var _getIterator3 = _interopRequireDefault(_getIterator2);
5647
5648var _keys = require("babel-runtime/core-js/object/keys");
5649
5650var _keys2 = _interopRequireDefault(_keys);
5651
5652exports.needsWhitespace = needsWhitespace;
5653exports.needsWhitespaceBefore = needsWhitespaceBefore;
5654exports.needsWhitespaceAfter = needsWhitespaceAfter;
5655exports.needsParens = needsParens;
5656
5657var _whitespace = require("./whitespace");
5658
5659var _whitespace2 = _interopRequireDefault(_whitespace);
5660
5661var _parentheses = require("./parentheses");
5662
5663var parens = _interopRequireWildcard(_parentheses);
5664
5665var _babelTypes = require("babel-types");
5666
5667var t = _interopRequireWildcard(_babelTypes);
5668
5669function _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; } }
5670
5671function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5672
5673function expandAliases(obj) {
5674 var newObj = {};
5675
5676 function add(type, func) {
5677 var fn = newObj[type];
5678 newObj[type] = fn ? function (node, parent, stack) {
5679 var result = fn(node, parent, stack);
5680
5681 return result == null ? func(node, parent, stack) : result;
5682 } : func;
5683 }
5684
5685 for (var _iterator = (0, _keys2.default)(obj), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
5686 var _ref;
5687
5688 if (_isArray) {
5689 if (_i >= _iterator.length) break;
5690 _ref = _iterator[_i++];
5691 } else {
5692 _i = _iterator.next();
5693 if (_i.done) break;
5694 _ref = _i.value;
5695 }
5696
5697 var type = _ref;
5698
5699
5700 var aliases = t.FLIPPED_ALIAS_KEYS[type];
5701 if (aliases) {
5702 for (var _iterator2 = aliases, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
5703 var _ref2;
5704
5705 if (_isArray2) {
5706 if (_i2 >= _iterator2.length) break;
5707 _ref2 = _iterator2[_i2++];
5708 } else {
5709 _i2 = _iterator2.next();
5710 if (_i2.done) break;
5711 _ref2 = _i2.value;
5712 }
5713
5714 var alias = _ref2;
5715
5716 add(alias, obj[type]);
5717 }
5718 } else {
5719 add(type, obj[type]);
5720 }
5721 }
5722
5723 return newObj;
5724}
5725
5726var expandedParens = expandAliases(parens);
5727var expandedWhitespaceNodes = expandAliases(_whitespace2.default.nodes);
5728var expandedWhitespaceList = expandAliases(_whitespace2.default.list);
5729
5730function find(obj, node, parent, printStack) {
5731 var fn = obj[node.type];
5732 return fn ? fn(node, parent, printStack) : null;
5733}
5734
5735function isOrHasCallExpression(node) {
5736 if (t.isCallExpression(node)) {
5737 return true;
5738 }
5739
5740 if (t.isMemberExpression(node)) {
5741 return isOrHasCallExpression(node.object) || !node.computed && isOrHasCallExpression(node.property);
5742 } else {
5743 return false;
5744 }
5745}
5746
5747function needsWhitespace(node, parent, type) {
5748 if (!node) return 0;
5749
5750 if (t.isExpressionStatement(node)) {
5751 node = node.expression;
5752 }
5753
5754 var linesInfo = find(expandedWhitespaceNodes, node, parent);
5755
5756 if (!linesInfo) {
5757 var items = find(expandedWhitespaceList, node, parent);
5758 if (items) {
5759 for (var i = 0; i < items.length; i++) {
5760 linesInfo = needsWhitespace(items[i], node, type);
5761 if (linesInfo) break;
5762 }
5763 }
5764 }
5765
5766 return linesInfo && linesInfo[type] || 0;
5767}
5768
5769function needsWhitespaceBefore(node, parent) {
5770 return needsWhitespace(node, parent, "before");
5771}
5772
5773function needsWhitespaceAfter(node, parent) {
5774 return needsWhitespace(node, parent, "after");
5775}
5776
5777function needsParens(node, parent, printStack) {
5778 if (!parent) return false;
5779
5780 if (t.isNewExpression(parent) && parent.callee === node) {
5781 if (isOrHasCallExpression(node)) return true;
5782 }
5783
5784 return find(expandedParens, node, parent, printStack);
5785}
5786},{"./parentheses":45,"./whitespace":46,"babel-runtime/core-js/get-iterator":56,"babel-runtime/core-js/object/keys":63,"babel-types":112}],45:[function(require,module,exports){
5787"use strict";
5788
5789exports.__esModule = true;
5790exports.AwaitExpression = exports.FunctionTypeAnnotation = undefined;
5791exports.NullableTypeAnnotation = NullableTypeAnnotation;
5792exports.UpdateExpression = UpdateExpression;
5793exports.ObjectExpression = ObjectExpression;
5794exports.Binary = Binary;
5795exports.BinaryExpression = BinaryExpression;
5796exports.SequenceExpression = SequenceExpression;
5797exports.YieldExpression = YieldExpression;
5798exports.ClassExpression = ClassExpression;
5799exports.UnaryLike = UnaryLike;
5800exports.FunctionExpression = FunctionExpression;
5801exports.ArrowFunctionExpression = ArrowFunctionExpression;
5802exports.ConditionalExpression = ConditionalExpression;
5803exports.AssignmentExpression = AssignmentExpression;
5804
5805var _babelTypes = require("babel-types");
5806
5807var t = _interopRequireWildcard(_babelTypes);
5808
5809function _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; } }
5810
5811var PRECEDENCE = {
5812 "||": 0,
5813 "&&": 1,
5814 "|": 2,
5815 "^": 3,
5816 "&": 4,
5817 "==": 5,
5818 "===": 5,
5819 "!=": 5,
5820 "!==": 5,
5821 "<": 6,
5822 ">": 6,
5823 "<=": 6,
5824 ">=": 6,
5825 in: 6,
5826 instanceof: 6,
5827 ">>": 7,
5828 "<<": 7,
5829 ">>>": 7,
5830 "+": 8,
5831 "-": 8,
5832 "*": 9,
5833 "/": 9,
5834 "%": 9,
5835 "**": 10
5836};
5837
5838function NullableTypeAnnotation(node, parent) {
5839 return t.isArrayTypeAnnotation(parent);
5840}
5841
5842exports.FunctionTypeAnnotation = NullableTypeAnnotation;
5843function UpdateExpression(node, parent) {
5844 if (t.isMemberExpression(parent) && parent.object === node) {
5845 return true;
5846 }
5847
5848 return false;
5849}
5850
5851function ObjectExpression(node, parent, printStack) {
5852 return isFirstInStatement(printStack, { considerArrow: true });
5853}
5854
5855function Binary(node, parent) {
5856 if ((t.isCallExpression(parent) || t.isNewExpression(parent)) && parent.callee === node) {
5857 return true;
5858 }
5859
5860 if (t.isUnaryLike(parent)) {
5861 return true;
5862 }
5863
5864 if (t.isMemberExpression(parent) && parent.object === node) {
5865 return true;
5866 }
5867
5868 if (t.isBinary(parent)) {
5869 var parentOp = parent.operator;
5870 var parentPos = PRECEDENCE[parentOp];
5871
5872 var nodeOp = node.operator;
5873 var nodePos = PRECEDENCE[nodeOp];
5874
5875 if (parentPos > nodePos) {
5876 return true;
5877 }
5878
5879 if (parentPos === nodePos && parent.right === node && !t.isLogicalExpression(parent)) {
5880 return true;
5881 }
5882 }
5883
5884 return false;
5885}
5886
5887function BinaryExpression(node, parent) {
5888 if (node.operator === "in") {
5889 if (t.isVariableDeclarator(parent)) {
5890 return true;
5891 }
5892
5893 if (t.isFor(parent)) {
5894 return true;
5895 }
5896 }
5897
5898 return false;
5899}
5900
5901function SequenceExpression(node, parent) {
5902 if (t.isForStatement(parent)) {
5903 return false;
5904 }
5905
5906 if (t.isExpressionStatement(parent) && parent.expression === node) {
5907 return false;
5908 }
5909
5910 if (t.isReturnStatement(parent)) {
5911 return false;
5912 }
5913
5914 if (t.isThrowStatement(parent)) {
5915 return false;
5916 }
5917
5918 if (t.isSwitchStatement(parent) && parent.discriminant === node) {
5919 return false;
5920 }
5921
5922 if (t.isWhileStatement(parent) && parent.test === node) {
5923 return false;
5924 }
5925
5926 if (t.isIfStatement(parent) && parent.test === node) {
5927 return false;
5928 }
5929
5930 if (t.isForInStatement(parent) && parent.right === node) {
5931 return false;
5932 }
5933
5934 return true;
5935}
5936
5937function YieldExpression(node, parent) {
5938 return t.isBinary(parent) || t.isUnaryLike(parent) || t.isCallExpression(parent) || t.isMemberExpression(parent) || t.isNewExpression(parent) || t.isConditionalExpression(parent) && node === parent.test;
5939}
5940
5941exports.AwaitExpression = YieldExpression;
5942function ClassExpression(node, parent, printStack) {
5943 return isFirstInStatement(printStack, { considerDefaultExports: true });
5944}
5945
5946function UnaryLike(node, parent) {
5947 if (t.isMemberExpression(parent, { object: node })) {
5948 return true;
5949 }
5950
5951 if (t.isCallExpression(parent, { callee: node }) || t.isNewExpression(parent, { callee: node })) {
5952 return true;
5953 }
5954
5955 return false;
5956}
5957
5958function FunctionExpression(node, parent, printStack) {
5959 return isFirstInStatement(printStack, { considerDefaultExports: true });
5960}
5961
5962function ArrowFunctionExpression(node, parent) {
5963 if (t.isExportDeclaration(parent) || t.isBinaryExpression(parent) || t.isLogicalExpression(parent) || t.isUnaryExpression(parent) || t.isTaggedTemplateExpression(parent)) {
5964 return true;
5965 }
5966
5967 return UnaryLike(node, parent);
5968}
5969
5970function ConditionalExpression(node, parent) {
5971 if (t.isUnaryLike(parent)) {
5972 return true;
5973 }
5974
5975 if (t.isBinary(parent)) {
5976 return true;
5977 }
5978
5979 if (t.isConditionalExpression(parent, { test: node })) {
5980 return true;
5981 }
5982
5983 if (t.isAwaitExpression(parent)) {
5984 return true;
5985 }
5986
5987 return UnaryLike(node, parent);
5988}
5989
5990function AssignmentExpression(node) {
5991 if (t.isObjectPattern(node.left)) {
5992 return true;
5993 } else {
5994 return ConditionalExpression.apply(undefined, arguments);
5995 }
5996}
5997
5998function isFirstInStatement(printStack) {
5999 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
6000 _ref$considerArrow = _ref.considerArrow,
6001 considerArrow = _ref$considerArrow === undefined ? false : _ref$considerArrow,
6002 _ref$considerDefaultE = _ref.considerDefaultExports,
6003 considerDefaultExports = _ref$considerDefaultE === undefined ? false : _ref$considerDefaultE;
6004
6005 var i = printStack.length - 1;
6006 var node = printStack[i];
6007 i--;
6008 var parent = printStack[i];
6009 while (i > 0) {
6010 if (t.isExpressionStatement(parent, { expression: node })) {
6011 return true;
6012 }
6013
6014 if (t.isTaggedTemplateExpression(parent)) {
6015 return true;
6016 }
6017
6018 if (considerDefaultExports && t.isExportDefaultDeclaration(parent, { declaration: node })) {
6019 return true;
6020 }
6021
6022 if (considerArrow && t.isArrowFunctionExpression(parent, { body: node })) {
6023 return true;
6024 }
6025
6026 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 })) {
6027 node = parent;
6028 i--;
6029 parent = printStack[i];
6030 } else {
6031 return false;
6032 }
6033 }
6034
6035 return false;
6036}
6037},{"babel-types":112}],46:[function(require,module,exports){
6038"use strict";
6039
6040var _map = require("lodash/map");
6041
6042var _map2 = _interopRequireDefault(_map);
6043
6044var _babelTypes = require("babel-types");
6045
6046var t = _interopRequireWildcard(_babelTypes);
6047
6048function _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; } }
6049
6050function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6051
6052function crawl(node) {
6053 var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6054
6055 if (t.isMemberExpression(node)) {
6056 crawl(node.object, state);
6057 if (node.computed) crawl(node.property, state);
6058 } else if (t.isBinary(node) || t.isAssignmentExpression(node)) {
6059 crawl(node.left, state);
6060 crawl(node.right, state);
6061 } else if (t.isCallExpression(node)) {
6062 state.hasCall = true;
6063 crawl(node.callee, state);
6064 } else if (t.isFunction(node)) {
6065 state.hasFunction = true;
6066 } else if (t.isIdentifier(node)) {
6067 state.hasHelper = state.hasHelper || isHelper(node.callee);
6068 }
6069
6070 return state;
6071}
6072
6073function isHelper(node) {
6074 if (t.isMemberExpression(node)) {
6075 return isHelper(node.object) || isHelper(node.property);
6076 } else if (t.isIdentifier(node)) {
6077 return node.name === "require" || node.name[0] === "_";
6078 } else if (t.isCallExpression(node)) {
6079 return isHelper(node.callee);
6080 } else if (t.isBinary(node) || t.isAssignmentExpression(node)) {
6081 return t.isIdentifier(node.left) && isHelper(node.left) || isHelper(node.right);
6082 } else {
6083 return false;
6084 }
6085}
6086
6087function isType(node) {
6088 return t.isLiteral(node) || t.isObjectExpression(node) || t.isArrayExpression(node) || t.isIdentifier(node) || t.isMemberExpression(node);
6089}
6090
6091exports.nodes = {
6092 AssignmentExpression: function AssignmentExpression(node) {
6093 var state = crawl(node.right);
6094 if (state.hasCall && state.hasHelper || state.hasFunction) {
6095 return {
6096 before: state.hasFunction,
6097 after: true
6098 };
6099 }
6100 },
6101 SwitchCase: function SwitchCase(node, parent) {
6102 return {
6103 before: node.consequent.length || parent.cases[0] === node
6104 };
6105 },
6106 LogicalExpression: function LogicalExpression(node) {
6107 if (t.isFunction(node.left) || t.isFunction(node.right)) {
6108 return {
6109 after: true
6110 };
6111 }
6112 },
6113 Literal: function Literal(node) {
6114 if (node.value === "use strict") {
6115 return {
6116 after: true
6117 };
6118 }
6119 },
6120 CallExpression: function CallExpression(node) {
6121 if (t.isFunction(node.callee) || isHelper(node)) {
6122 return {
6123 before: true,
6124 after: true
6125 };
6126 }
6127 },
6128 VariableDeclaration: function VariableDeclaration(node) {
6129 for (var i = 0; i < node.declarations.length; i++) {
6130 var declar = node.declarations[i];
6131
6132 var enabled = isHelper(declar.id) && !isType(declar.init);
6133 if (!enabled) {
6134 var state = crawl(declar.init);
6135 enabled = isHelper(declar.init) && state.hasCall || state.hasFunction;
6136 }
6137
6138 if (enabled) {
6139 return {
6140 before: true,
6141 after: true
6142 };
6143 }
6144 }
6145 },
6146 IfStatement: function IfStatement(node) {
6147 if (t.isBlockStatement(node.consequent)) {
6148 return {
6149 before: true,
6150 after: true
6151 };
6152 }
6153 }
6154};
6155
6156exports.nodes.ObjectProperty = exports.nodes.ObjectTypeProperty = exports.nodes.ObjectMethod = exports.nodes.SpreadProperty = function (node, parent) {
6157 if (parent.properties[0] === node) {
6158 return {
6159 before: true
6160 };
6161 }
6162};
6163
6164exports.list = {
6165 VariableDeclaration: function VariableDeclaration(node) {
6166 return (0, _map2.default)(node.declarations, "init");
6167 },
6168 ArrayExpression: function ArrayExpression(node) {
6169 return node.elements;
6170 },
6171 ObjectExpression: function ObjectExpression(node) {
6172 return node.properties;
6173 }
6174};
6175
6176[["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function (_ref) {
6177 var type = _ref[0],
6178 amounts = _ref[1];
6179
6180 if (typeof amounts === "boolean") {
6181 amounts = { after: amounts, before: amounts };
6182 }
6183 [type].concat(t.FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) {
6184 exports.nodes[type] = function () {
6185 return amounts;
6186 };
6187 });
6188});
6189},{"babel-types":112,"lodash/map":449}],47:[function(require,module,exports){
6190"use strict";
6191
6192exports.__esModule = true;
6193
6194var _assign = require("babel-runtime/core-js/object/assign");
6195
6196var _assign2 = _interopRequireDefault(_assign);
6197
6198var _getIterator2 = require("babel-runtime/core-js/get-iterator");
6199
6200var _getIterator3 = _interopRequireDefault(_getIterator2);
6201
6202var _stringify = require("babel-runtime/core-js/json/stringify");
6203
6204var _stringify2 = _interopRequireDefault(_stringify);
6205
6206var _weakSet = require("babel-runtime/core-js/weak-set");
6207
6208var _weakSet2 = _interopRequireDefault(_weakSet);
6209
6210var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
6211
6212var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
6213
6214var _find = require("lodash/find");
6215
6216var _find2 = _interopRequireDefault(_find);
6217
6218var _findLast = require("lodash/findLast");
6219
6220var _findLast2 = _interopRequireDefault(_findLast);
6221
6222var _isInteger = require("lodash/isInteger");
6223
6224var _isInteger2 = _interopRequireDefault(_isInteger);
6225
6226var _repeat = require("lodash/repeat");
6227
6228var _repeat2 = _interopRequireDefault(_repeat);
6229
6230var _buffer = require("./buffer");
6231
6232var _buffer2 = _interopRequireDefault(_buffer);
6233
6234var _node = require("./node");
6235
6236var n = _interopRequireWildcard(_node);
6237
6238var _whitespace = require("./whitespace");
6239
6240var _whitespace2 = _interopRequireDefault(_whitespace);
6241
6242var _babelTypes = require("babel-types");
6243
6244var t = _interopRequireWildcard(_babelTypes);
6245
6246function _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; } }
6247
6248function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6249
6250var SCIENTIFIC_NOTATION = /e/i;
6251var ZERO_DECIMAL_INTEGER = /\.0+$/;
6252var NON_DECIMAL_LITERAL = /^0[box]/;
6253
6254var Printer = function () {
6255 function Printer(format, map, tokens) {
6256 (0, _classCallCheck3.default)(this, Printer);
6257 this.inForStatementInitCounter = 0;
6258 this._printStack = [];
6259 this._indent = 0;
6260 this._insideAux = false;
6261 this._printedCommentStarts = {};
6262 this._parenPushNewlineState = null;
6263 this._printAuxAfterOnNextUserNode = false;
6264 this._printedComments = new _weakSet2.default();
6265 this._endsWithInteger = false;
6266 this._endsWithWord = false;
6267
6268 this.format = format || {};
6269 this._buf = new _buffer2.default(map);
6270 this._whitespace = tokens.length > 0 ? new _whitespace2.default(tokens) : null;
6271 }
6272
6273 Printer.prototype.generate = function generate(ast) {
6274 this.print(ast);
6275 this._maybeAddAuxComment();
6276
6277 return this._buf.get();
6278 };
6279
6280 Printer.prototype.indent = function indent() {
6281 if (this.format.compact || this.format.concise) return;
6282
6283 this._indent++;
6284 };
6285
6286 Printer.prototype.dedent = function dedent() {
6287 if (this.format.compact || this.format.concise) return;
6288
6289 this._indent--;
6290 };
6291
6292 Printer.prototype.semicolon = function semicolon() {
6293 var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
6294
6295 this._maybeAddAuxComment();
6296 this._append(";", !force);
6297 };
6298
6299 Printer.prototype.rightBrace = function rightBrace() {
6300 if (this.format.minified) {
6301 this._buf.removeLastSemicolon();
6302 }
6303 this.token("}");
6304 };
6305
6306 Printer.prototype.space = function space() {
6307 var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
6308
6309 if (this.format.compact) return;
6310
6311 if (this._buf.hasContent() && !this.endsWith(" ") && !this.endsWith("\n") || force) {
6312 this._space();
6313 }
6314 };
6315
6316 Printer.prototype.word = function word(str) {
6317 if (this._endsWithWord) this._space();
6318
6319 this._maybeAddAuxComment();
6320 this._append(str);
6321
6322 this._endsWithWord = true;
6323 };
6324
6325 Printer.prototype.number = function number(str) {
6326 this.word(str);
6327
6328 this._endsWithInteger = (0, _isInteger2.default)(+str) && !NON_DECIMAL_LITERAL.test(str) && !SCIENTIFIC_NOTATION.test(str) && !ZERO_DECIMAL_INTEGER.test(str) && str[str.length - 1] !== ".";
6329 };
6330
6331 Printer.prototype.token = function token(str) {
6332 if (str === "--" && this.endsWith("!") || str[0] === "+" && this.endsWith("+") || str[0] === "-" && this.endsWith("-") || str[0] === "." && this._endsWithInteger) {
6333 this._space();
6334 }
6335
6336 this._maybeAddAuxComment();
6337 this._append(str);
6338 };
6339
6340 Printer.prototype.newline = function newline(i) {
6341 if (this.format.retainLines || this.format.compact) return;
6342
6343 if (this.format.concise) {
6344 this.space();
6345 return;
6346 }
6347
6348 if (this.endsWith("\n\n")) return;
6349
6350 if (typeof i !== "number") i = 1;
6351
6352 i = Math.min(2, i);
6353 if (this.endsWith("{\n") || this.endsWith(":\n")) i--;
6354 if (i <= 0) return;
6355
6356 for (var j = 0; j < i; j++) {
6357 this._newline();
6358 }
6359 };
6360
6361 Printer.prototype.endsWith = function endsWith(str) {
6362 return this._buf.endsWith(str);
6363 };
6364
6365 Printer.prototype.removeTrailingNewline = function removeTrailingNewline() {
6366 this._buf.removeTrailingNewline();
6367 };
6368
6369 Printer.prototype.source = function source(prop, loc) {
6370 this._catchUp(prop, loc);
6371
6372 this._buf.source(prop, loc);
6373 };
6374
6375 Printer.prototype.withSource = function withSource(prop, loc, cb) {
6376 this._catchUp(prop, loc);
6377
6378 this._buf.withSource(prop, loc, cb);
6379 };
6380
6381 Printer.prototype._space = function _space() {
6382 this._append(" ", true);
6383 };
6384
6385 Printer.prototype._newline = function _newline() {
6386 this._append("\n", true);
6387 };
6388
6389 Printer.prototype._append = function _append(str) {
6390 var queue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
6391
6392 this._maybeAddParen(str);
6393 this._maybeIndent(str);
6394
6395 if (queue) this._buf.queue(str);else this._buf.append(str);
6396
6397 this._endsWithWord = false;
6398 this._endsWithInteger = false;
6399 };
6400
6401 Printer.prototype._maybeIndent = function _maybeIndent(str) {
6402 if (this._indent && this.endsWith("\n") && str[0] !== "\n") {
6403 this._buf.queue(this._getIndent());
6404 }
6405 };
6406
6407 Printer.prototype._maybeAddParen = function _maybeAddParen(str) {
6408 var parenPushNewlineState = this._parenPushNewlineState;
6409 if (!parenPushNewlineState) return;
6410 this._parenPushNewlineState = null;
6411
6412 var i = void 0;
6413 for (i = 0; i < str.length && str[i] === " "; i++) {
6414 continue;
6415 }if (i === str.length) return;
6416
6417 var cha = str[i];
6418 if (cha === "\n" || cha === "/") {
6419 this.token("(");
6420 this.indent();
6421 parenPushNewlineState.printed = true;
6422 }
6423 };
6424
6425 Printer.prototype._catchUp = function _catchUp(prop, loc) {
6426 if (!this.format.retainLines) return;
6427
6428 var pos = loc ? loc[prop] : null;
6429 if (pos && pos.line !== null) {
6430 var count = pos.line - this._buf.getCurrentLine();
6431
6432 for (var i = 0; i < count; i++) {
6433 this._newline();
6434 }
6435 }
6436 };
6437
6438 Printer.prototype._getIndent = function _getIndent() {
6439 return (0, _repeat2.default)(this.format.indent.style, this._indent);
6440 };
6441
6442 Printer.prototype.startTerminatorless = function startTerminatorless() {
6443 return this._parenPushNewlineState = {
6444 printed: false
6445 };
6446 };
6447
6448 Printer.prototype.endTerminatorless = function endTerminatorless(state) {
6449 if (state.printed) {
6450 this.dedent();
6451 this.newline();
6452 this.token(")");
6453 }
6454 };
6455
6456 Printer.prototype.print = function print(node, parent) {
6457 var _this = this;
6458
6459 if (!node) return;
6460
6461 var oldConcise = this.format.concise;
6462 if (node._compact) {
6463 this.format.concise = true;
6464 }
6465
6466 var printMethod = this[node.type];
6467 if (!printMethod) {
6468 throw new ReferenceError("unknown node of type " + (0, _stringify2.default)(node.type) + " with constructor " + (0, _stringify2.default)(node && node.constructor.name));
6469 }
6470
6471 this._printStack.push(node);
6472
6473 var oldInAux = this._insideAux;
6474 this._insideAux = !node.loc;
6475 this._maybeAddAuxComment(this._insideAux && !oldInAux);
6476
6477 var needsParens = n.needsParens(node, parent, this._printStack);
6478 if (this.format.retainFunctionParens && node.type === "FunctionExpression" && node.extra && node.extra.parenthesized) {
6479 needsParens = true;
6480 }
6481 if (needsParens) this.token("(");
6482
6483 this._printLeadingComments(node, parent);
6484
6485 var loc = t.isProgram(node) || t.isFile(node) ? null : node.loc;
6486 this.withSource("start", loc, function () {
6487 _this[node.type](node, parent);
6488 });
6489
6490 this._printTrailingComments(node, parent);
6491
6492 if (needsParens) this.token(")");
6493
6494 this._printStack.pop();
6495
6496 this.format.concise = oldConcise;
6497 this._insideAux = oldInAux;
6498 };
6499
6500 Printer.prototype._maybeAddAuxComment = function _maybeAddAuxComment(enteredPositionlessNode) {
6501 if (enteredPositionlessNode) this._printAuxBeforeComment();
6502 if (!this._insideAux) this._printAuxAfterComment();
6503 };
6504
6505 Printer.prototype._printAuxBeforeComment = function _printAuxBeforeComment() {
6506 if (this._printAuxAfterOnNextUserNode) return;
6507 this._printAuxAfterOnNextUserNode = true;
6508
6509 var comment = this.format.auxiliaryCommentBefore;
6510 if (comment) {
6511 this._printComment({
6512 type: "CommentBlock",
6513 value: comment
6514 });
6515 }
6516 };
6517
6518 Printer.prototype._printAuxAfterComment = function _printAuxAfterComment() {
6519 if (!this._printAuxAfterOnNextUserNode) return;
6520 this._printAuxAfterOnNextUserNode = false;
6521
6522 var comment = this.format.auxiliaryCommentAfter;
6523 if (comment) {
6524 this._printComment({
6525 type: "CommentBlock",
6526 value: comment
6527 });
6528 }
6529 };
6530
6531 Printer.prototype.getPossibleRaw = function getPossibleRaw(node) {
6532 var extra = node.extra;
6533 if (extra && extra.raw != null && extra.rawValue != null && node.value === extra.rawValue) {
6534 return extra.raw;
6535 }
6536 };
6537
6538 Printer.prototype.printJoin = function printJoin(nodes, parent) {
6539 var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6540
6541 if (!nodes || !nodes.length) return;
6542
6543 if (opts.indent) this.indent();
6544
6545 var newlineOpts = {
6546 addNewlines: opts.addNewlines
6547 };
6548
6549 for (var i = 0; i < nodes.length; i++) {
6550 var node = nodes[i];
6551 if (!node) continue;
6552
6553 if (opts.statement) this._printNewline(true, node, parent, newlineOpts);
6554
6555 this.print(node, parent);
6556
6557 if (opts.iterator) {
6558 opts.iterator(node, i);
6559 }
6560
6561 if (opts.separator && i < nodes.length - 1) {
6562 opts.separator.call(this);
6563 }
6564
6565 if (opts.statement) this._printNewline(false, node, parent, newlineOpts);
6566 }
6567
6568 if (opts.indent) this.dedent();
6569 };
6570
6571 Printer.prototype.printAndIndentOnComments = function printAndIndentOnComments(node, parent) {
6572 var indent = !!node.leadingComments;
6573 if (indent) this.indent();
6574 this.print(node, parent);
6575 if (indent) this.dedent();
6576 };
6577
6578 Printer.prototype.printBlock = function printBlock(parent) {
6579 var node = parent.body;
6580
6581 if (!t.isEmptyStatement(node)) {
6582 this.space();
6583 }
6584
6585 this.print(node, parent);
6586 };
6587
6588 Printer.prototype._printTrailingComments = function _printTrailingComments(node, parent) {
6589 this._printComments(this._getComments(false, node, parent));
6590 };
6591
6592 Printer.prototype._printLeadingComments = function _printLeadingComments(node, parent) {
6593 this._printComments(this._getComments(true, node, parent));
6594 };
6595
6596 Printer.prototype.printInnerComments = function printInnerComments(node) {
6597 var indent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
6598
6599 if (!node.innerComments) return;
6600 if (indent) this.indent();
6601 this._printComments(node.innerComments);
6602 if (indent) this.dedent();
6603 };
6604
6605 Printer.prototype.printSequence = function printSequence(nodes, parent) {
6606 var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6607
6608 opts.statement = true;
6609 return this.printJoin(nodes, parent, opts);
6610 };
6611
6612 Printer.prototype.printList = function printList(items, parent) {
6613 var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6614
6615 if (opts.separator == null) {
6616 opts.separator = commaSeparator;
6617 }
6618
6619 return this.printJoin(items, parent, opts);
6620 };
6621
6622 Printer.prototype._printNewline = function _printNewline(leading, node, parent, opts) {
6623 var _this2 = this;
6624
6625 if (this.format.retainLines || this.format.compact) return;
6626
6627 if (this.format.concise) {
6628 this.space();
6629 return;
6630 }
6631
6632 var lines = 0;
6633
6634 if (node.start != null && !node._ignoreUserWhitespace && this._whitespace) {
6635 if (leading) {
6636 var _comments = node.leadingComments;
6637 var _comment = _comments && (0, _find2.default)(_comments, function (comment) {
6638 return !!comment.loc && _this2.format.shouldPrintComment(comment.value);
6639 });
6640
6641 lines = this._whitespace.getNewlinesBefore(_comment || node);
6642 } else {
6643 var _comments2 = node.trailingComments;
6644 var _comment2 = _comments2 && (0, _findLast2.default)(_comments2, function (comment) {
6645 return !!comment.loc && _this2.format.shouldPrintComment(comment.value);
6646 });
6647
6648 lines = this._whitespace.getNewlinesAfter(_comment2 || node);
6649 }
6650 } else {
6651 if (!leading) lines++;
6652 if (opts.addNewlines) lines += opts.addNewlines(leading, node) || 0;
6653
6654 var needs = n.needsWhitespaceAfter;
6655 if (leading) needs = n.needsWhitespaceBefore;
6656 if (needs(node, parent)) lines++;
6657
6658 if (!this._buf.hasContent()) lines = 0;
6659 }
6660
6661 this.newline(lines);
6662 };
6663
6664 Printer.prototype._getComments = function _getComments(leading, node) {
6665 return node && (leading ? node.leadingComments : node.trailingComments) || [];
6666 };
6667
6668 Printer.prototype._printComment = function _printComment(comment) {
6669 var _this3 = this;
6670
6671 if (!this.format.shouldPrintComment(comment.value)) return;
6672
6673 if (comment.ignore) return;
6674
6675 if (this._printedComments.has(comment)) return;
6676 this._printedComments.add(comment);
6677
6678 if (comment.start != null) {
6679 if (this._printedCommentStarts[comment.start]) return;
6680 this._printedCommentStarts[comment.start] = true;
6681 }
6682
6683 this.newline(this._whitespace ? this._whitespace.getNewlinesBefore(comment) : 0);
6684
6685 if (!this.endsWith("[") && !this.endsWith("{")) this.space();
6686
6687 var val = comment.type === "CommentLine" ? "//" + comment.value + "\n" : "/*" + comment.value + "*/";
6688
6689 if (comment.type === "CommentBlock" && this.format.indent.adjustMultilineComment) {
6690 var offset = comment.loc && comment.loc.start.column;
6691 if (offset) {
6692 var newlineRegex = new RegExp("\\n\\s{1," + offset + "}", "g");
6693 val = val.replace(newlineRegex, "\n");
6694 }
6695
6696 var indentSize = Math.max(this._getIndent().length, this._buf.getCurrentColumn());
6697 val = val.replace(/\n(?!$)/g, "\n" + (0, _repeat2.default)(" ", indentSize));
6698 }
6699
6700 this.withSource("start", comment.loc, function () {
6701 _this3._append(val);
6702 });
6703
6704 this.newline((this._whitespace ? this._whitespace.getNewlinesAfter(comment) : 0) + (comment.type === "CommentLine" ? -1 : 0));
6705 };
6706
6707 Printer.prototype._printComments = function _printComments(comments) {
6708 if (!comments || !comments.length) return;
6709
6710 for (var _iterator = comments, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
6711 var _ref;
6712
6713 if (_isArray) {
6714 if (_i >= _iterator.length) break;
6715 _ref = _iterator[_i++];
6716 } else {
6717 _i = _iterator.next();
6718 if (_i.done) break;
6719 _ref = _i.value;
6720 }
6721
6722 var _comment3 = _ref;
6723
6724 this._printComment(_comment3);
6725 }
6726 };
6727
6728 return Printer;
6729}();
6730
6731exports.default = Printer;
6732
6733
6734function commaSeparator() {
6735 this.token(",");
6736 this.space();
6737}
6738
6739var _arr = [require("./generators/template-literals"), require("./generators/expressions"), require("./generators/statements"), require("./generators/classes"), require("./generators/methods"), require("./generators/modules"), require("./generators/types"), require("./generators/flow"), require("./generators/base"), require("./generators/jsx")];
6740for (var _i2 = 0; _i2 < _arr.length; _i2++) {
6741 var generator = _arr[_i2];
6742 (0, _assign2.default)(Printer.prototype, generator);
6743}
6744module.exports = exports["default"];
6745},{"./buffer":32,"./generators/base":33,"./generators/classes":34,"./generators/expressions":35,"./generators/flow":36,"./generators/jsx":37,"./generators/methods":38,"./generators/modules":39,"./generators/statements":40,"./generators/template-literals":41,"./generators/types":42,"./node":44,"./whitespace":49,"babel-runtime/core-js/get-iterator":56,"babel-runtime/core-js/json/stringify":57,"babel-runtime/core-js/object/assign":60,"babel-runtime/core-js/weak-set":69,"babel-runtime/helpers/classCallCheck":70,"babel-types":112,"lodash/find":423,"lodash/findLast":425,"lodash/isInteger":438,"lodash/repeat":454}],48:[function(require,module,exports){
6746"use strict";
6747
6748exports.__esModule = true;
6749
6750var _keys = require("babel-runtime/core-js/object/keys");
6751
6752var _keys2 = _interopRequireDefault(_keys);
6753
6754var _typeof2 = require("babel-runtime/helpers/typeof");
6755
6756var _typeof3 = _interopRequireDefault(_typeof2);
6757
6758var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
6759
6760var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
6761
6762var _sourceMap = require("source-map");
6763
6764var _sourceMap2 = _interopRequireDefault(_sourceMap);
6765
6766function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6767
6768var SourceMap = function () {
6769 function SourceMap(opts, code) {
6770 (0, _classCallCheck3.default)(this, SourceMap);
6771
6772 this._cachedMap = null;
6773 this._code = code;
6774 this._opts = opts;
6775 this._rawMappings = [];
6776 }
6777
6778 SourceMap.prototype.get = function get() {
6779 var _this = this;
6780
6781 if (!this._cachedMap) {
6782 (function () {
6783 var map = _this._cachedMap = new _sourceMap2.default.SourceMapGenerator({
6784 file: _this._opts.sourceMapTarget,
6785 sourceRoot: _this._opts.sourceRoot
6786 });
6787
6788 var code = _this._code;
6789 if (typeof code === "string") {
6790 map.setSourceContent(_this._opts.sourceFileName, code);
6791 } else if ((typeof code === "undefined" ? "undefined" : (0, _typeof3.default)(code)) === "object") {
6792 (0, _keys2.default)(code).forEach(function (sourceFileName) {
6793 map.setSourceContent(sourceFileName, code[sourceFileName]);
6794 });
6795 }
6796
6797 _this._rawMappings.forEach(map.addMapping, map);
6798 })();
6799 }
6800
6801 return this._cachedMap.toJSON();
6802 };
6803
6804 SourceMap.prototype.getRawMappings = function getRawMappings() {
6805 return this._rawMappings.slice();
6806 };
6807
6808 SourceMap.prototype.mark = function mark(generatedLine, generatedColumn, line, column, identifierName, filename) {
6809 if (this._lastGenLine !== generatedLine && line === null) return;
6810
6811 if (this._lastGenLine === generatedLine && this._lastSourceLine === line && this._lastSourceColumn === column) {
6812 return;
6813 }
6814
6815 this._cachedMap = null;
6816 this._lastGenLine = generatedLine;
6817 this._lastSourceLine = line;
6818 this._lastSourceColumn = column;
6819
6820 this._rawMappings.push({
6821 name: identifierName || undefined,
6822 generated: {
6823 line: generatedLine,
6824 column: generatedColumn
6825 },
6826 source: line == null ? undefined : filename || this._opts.sourceFileName,
6827 original: line == null ? undefined : {
6828 line: line,
6829 column: column
6830 }
6831 });
6832 };
6833
6834 return SourceMap;
6835}();
6836
6837exports.default = SourceMap;
6838module.exports = exports["default"];
6839},{"babel-runtime/core-js/object/keys":63,"babel-runtime/helpers/classCallCheck":70,"babel-runtime/helpers/typeof":74,"source-map":484}],49:[function(require,module,exports){
6840"use strict";
6841
6842exports.__esModule = true;
6843
6844var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
6845
6846var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
6847
6848function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6849
6850var Whitespace = function () {
6851 function Whitespace(tokens) {
6852 (0, _classCallCheck3.default)(this, Whitespace);
6853
6854 this.tokens = tokens;
6855 this.used = {};
6856 }
6857
6858 Whitespace.prototype.getNewlinesBefore = function getNewlinesBefore(node) {
6859 var startToken = void 0;
6860 var endToken = void 0;
6861 var tokens = this.tokens;
6862
6863 var index = this._findToken(function (token) {
6864 return token.start - node.start;
6865 }, 0, tokens.length);
6866 if (index >= 0) {
6867 while (index && node.start === tokens[index - 1].start) {
6868 --index;
6869 }startToken = tokens[index - 1];
6870 endToken = tokens[index];
6871 }
6872
6873 return this._getNewlinesBetween(startToken, endToken);
6874 };
6875
6876 Whitespace.prototype.getNewlinesAfter = function getNewlinesAfter(node) {
6877 var startToken = void 0;
6878 var endToken = void 0;
6879 var tokens = this.tokens;
6880
6881 var index = this._findToken(function (token) {
6882 return token.end - node.end;
6883 }, 0, tokens.length);
6884 if (index >= 0) {
6885 while (index && node.end === tokens[index - 1].end) {
6886 --index;
6887 }startToken = tokens[index];
6888 endToken = tokens[index + 1];
6889 if (endToken.type.label === ",") endToken = tokens[index + 2];
6890 }
6891
6892 if (endToken && endToken.type.label === "eof") {
6893 return 1;
6894 } else {
6895 return this._getNewlinesBetween(startToken, endToken);
6896 }
6897 };
6898
6899 Whitespace.prototype._getNewlinesBetween = function _getNewlinesBetween(startToken, endToken) {
6900 if (!endToken || !endToken.loc) return 0;
6901
6902 var start = startToken ? startToken.loc.end.line : 1;
6903 var end = endToken.loc.start.line;
6904 var lines = 0;
6905
6906 for (var line = start; line < end; line++) {
6907 if (typeof this.used[line] === "undefined") {
6908 this.used[line] = true;
6909 lines++;
6910 }
6911 }
6912
6913 return lines;
6914 };
6915
6916 Whitespace.prototype._findToken = function _findToken(test, start, end) {
6917 if (start >= end) return -1;
6918 var middle = start + end >>> 1;
6919 var match = test(this.tokens[middle]);
6920 if (match < 0) {
6921 return this._findToken(test, middle + 1, end);
6922 } else if (match > 0) {
6923 return this._findToken(test, start, middle);
6924 } else if (match === 0) {
6925 return middle;
6926 }
6927 return -1;
6928 };
6929
6930 return Whitespace;
6931}();
6932
6933exports.default = Whitespace;
6934module.exports = exports["default"];
6935},{"babel-runtime/helpers/classCallCheck":70}],50:[function(require,module,exports){
6936"use strict";
6937
6938exports.__esModule = true;
6939
6940var _getIterator2 = require("babel-runtime/core-js/get-iterator");
6941
6942var _getIterator3 = _interopRequireDefault(_getIterator2);
6943
6944exports.default = function (path, emit) {
6945 var kind = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "var";
6946
6947 path.traverse(visitor, { kind: kind, emit: emit });
6948};
6949
6950var _babelTypes = require("babel-types");
6951
6952var t = _interopRequireWildcard(_babelTypes);
6953
6954function _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; } }
6955
6956function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6957
6958var visitor = {
6959 Scope: function Scope(path, state) {
6960 if (state.kind === "let") path.skip();
6961 },
6962 Function: function Function(path) {
6963 path.skip();
6964 },
6965 VariableDeclaration: function VariableDeclaration(path, state) {
6966 if (state.kind && path.node.kind !== state.kind) return;
6967
6968 var nodes = [];
6969
6970 var declarations = path.get("declarations");
6971 var firstId = void 0;
6972
6973 for (var _iterator = declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
6974 var _ref;
6975
6976 if (_isArray) {
6977 if (_i >= _iterator.length) break;
6978 _ref = _iterator[_i++];
6979 } else {
6980 _i = _iterator.next();
6981 if (_i.done) break;
6982 _ref = _i.value;
6983 }
6984
6985 var declar = _ref;
6986
6987 firstId = declar.node.id;
6988
6989 if (declar.node.init) {
6990 nodes.push(t.expressionStatement(t.assignmentExpression("=", declar.node.id, declar.node.init)));
6991 }
6992
6993 for (var name in declar.getBindingIdentifiers()) {
6994 state.emit(t.identifier(name), name);
6995 }
6996 }
6997
6998 if (path.parentPath.isFor({ left: path.node })) {
6999 path.replaceWith(firstId);
7000 } else {
7001 path.replaceWithMultiple(nodes);
7002 }
7003 }
7004};
7005
7006module.exports = exports["default"];
7007},{"babel-runtime/core-js/get-iterator":56,"babel-types":112}],51:[function(require,module,exports){
7008"use strict";
7009
7010exports.__esModule = true;
7011
7012var _babelTemplate = require("babel-template");
7013
7014var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
7015
7016function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7017
7018var helpers = {};
7019exports.default = helpers;
7020
7021
7022helpers.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");
7023
7024helpers.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");
7025
7026helpers.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");
7027
7028helpers.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");
7029
7030helpers.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");
7031
7032helpers.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");
7033
7034helpers.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");
7035
7036helpers.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");
7037
7038helpers.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");
7039
7040helpers.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");
7041
7042helpers.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");
7043
7044helpers.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");
7045
7046helpers.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");
7047
7048helpers.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");
7049
7050helpers.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");
7051
7052helpers.interopRequireDefault = (0, _babelTemplate2.default)("\n (function (obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n })\n");
7053
7054helpers.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");
7055
7056helpers.newArrowCheck = (0, _babelTemplate2.default)("\n (function (innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError(\"Cannot instantiate an arrow function\");\n }\n });\n");
7057
7058helpers.objectDestructuringEmpty = (0, _babelTemplate2.default)("\n (function (obj) {\n if (obj == null) throw new TypeError(\"Cannot destructure undefined\");\n });\n");
7059
7060helpers.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");
7061
7062helpers.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");
7063
7064helpers.selfGlobal = (0, _babelTemplate2.default)("\n typeof global === \"undefined\" ? self : global\n");
7065
7066helpers.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");
7067
7068helpers.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");
7069
7070helpers.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");
7071
7072helpers.taggedTemplateLiteral = (0, _babelTemplate2.default)("\n (function (strings, raw) {\n return Object.freeze(Object.defineProperties(strings, {\n raw: { value: Object.freeze(raw) }\n }));\n });\n");
7073
7074helpers.taggedTemplateLiteralLoose = (0, _babelTemplate2.default)("\n (function (strings, raw) {\n strings.raw = raw;\n return strings;\n });\n");
7075
7076helpers.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");
7077
7078helpers.temporalUndefined = (0, _babelTemplate2.default)("\n ({})\n");
7079
7080helpers.toArray = (0, _babelTemplate2.default)("\n (function (arr) {\n return Array.isArray(arr) ? arr : Array.from(arr);\n });\n");
7081
7082helpers.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");
7083module.exports = exports["default"];
7084},{"babel-template":75}],52:[function(require,module,exports){
7085"use strict";
7086
7087exports.__esModule = true;
7088exports.list = undefined;
7089
7090var _keys = require("babel-runtime/core-js/object/keys");
7091
7092var _keys2 = _interopRequireDefault(_keys);
7093
7094exports.get = get;
7095
7096var _helpers = require("./helpers");
7097
7098var _helpers2 = _interopRequireDefault(_helpers);
7099
7100function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7101
7102function get(name) {
7103 var fn = _helpers2.default[name];
7104 if (!fn) throw new ReferenceError("Unknown helper " + name);
7105
7106 return fn().expression;
7107}
7108
7109var list = exports.list = (0, _keys2.default)(_helpers2.default).map(function (name) {
7110 return name.replace(/^_/, "");
7111}).filter(function (name) {
7112 return name !== "__esModule";
7113});
7114
7115exports.default = get;
7116},{"./helpers":51,"babel-runtime/core-js/object/keys":63}],53:[function(require,module,exports){
7117"use strict";
7118
7119exports.__esModule = true;
7120exports.MESSAGES = undefined;
7121
7122var _stringify = require("babel-runtime/core-js/json/stringify");
7123
7124var _stringify2 = _interopRequireDefault(_stringify);
7125
7126exports.get = get;
7127exports.parseArgs = parseArgs;
7128
7129var _util = require("util");
7130
7131var util = _interopRequireWildcard(_util);
7132
7133function _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; } }
7134
7135function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7136
7137var MESSAGES = exports.MESSAGES = {
7138 tailCallReassignmentDeopt: "Function reference has been reassigned, so it will probably be dereferenced, therefore we can't optimise this with confidence",
7139 classesIllegalBareSuper: "Illegal use of bare super",
7140 classesIllegalSuperCall: "Direct super call is illegal in non-constructor, use super.$1() instead",
7141 scopeDuplicateDeclaration: "Duplicate declaration $1",
7142 settersNoRest: "Setters aren't allowed to have a rest",
7143 noAssignmentsInForHead: "No assignments allowed in for-in/of head",
7144 expectedMemberExpressionOrIdentifier: "Expected type MemberExpression or Identifier",
7145 invalidParentForThisNode: "We don't know how to handle this node within the current parent - please open an issue",
7146 readOnly: "$1 is read-only",
7147 unknownForHead: "Unknown node type $1 in ForStatement",
7148 didYouMean: "Did you mean $1?",
7149 codeGeneratorDeopt: "Note: The code generator has deoptimised the styling of $1 as it exceeds the max of $2.",
7150 missingTemplatesDirectory: "no templates directory - this is most likely the result of a broken `npm publish`. Please report to https://github.com/babel/babel/issues",
7151 unsupportedOutputType: "Unsupported output type $1",
7152 illegalMethodName: "Illegal method name $1",
7153 lostTrackNodePath: "We lost track of this node's position, likely because the AST was directly manipulated",
7154
7155 modulesIllegalExportName: "Illegal export $1",
7156 modulesDuplicateDeclarations: "Duplicate module declarations with the same source but in different scopes",
7157
7158 undeclaredVariable: "Reference to undeclared variable $1",
7159 undeclaredVariableType: "Referencing a type alias outside of a type annotation",
7160 undeclaredVariableSuggestion: "Reference to undeclared variable $1 - did you mean $2?",
7161
7162 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.",
7163 traverseVerifyRootFunction: "You passed `traverse()` a function when it expected a visitor object, are you sure you didn't mean `{ enter: Function }`?",
7164 traverseVerifyVisitorProperty: "You passed `traverse()` a visitor object with the property $1 that has the invalid property $2",
7165 traverseVerifyNodeType: "You gave us a visitor for the node type $1 but it's not a valid type",
7166
7167 pluginNotObject: "Plugin $2 specified in $1 was expected to return an object when invoked but returned $3",
7168 pluginNotFunction: "Plugin $2 specified in $1 was expected to return a function but returned $3",
7169 pluginUnknown: "Unknown plugin $1 specified in $2 at $3, attempted to resolve relative to $4",
7170 pluginInvalidProperty: "Plugin $2 specified in $1 provided an invalid property of $3"
7171};
7172
7173function get(key) {
7174 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
7175 args[_key - 1] = arguments[_key];
7176 }
7177
7178 var msg = MESSAGES[key];
7179 if (!msg) throw new ReferenceError("Unknown message " + (0, _stringify2.default)(key));
7180
7181 args = parseArgs(args);
7182
7183 return msg.replace(/\$(\d+)/g, function (str, i) {
7184 return args[i - 1];
7185 });
7186}
7187
7188function parseArgs(args) {
7189 return args.map(function (val) {
7190 if (val != null && val.inspect) {
7191 return val.inspect();
7192 } else {
7193 try {
7194 return (0, _stringify2.default)(val) || val + "";
7195 } catch (e) {
7196 return util.inspect(val);
7197 }
7198 }
7199 });
7200}
7201},{"babel-runtime/core-js/json/stringify":57,"util":492}],54:[function(require,module,exports){
7202"use strict";
7203
7204exports.__esModule = true;
7205
7206exports.default = function () {
7207 return {
7208 manipulateOptions: function manipulateOptions(opts, parserOpts) {
7209 parserOpts.plugins.push("dynamicImport");
7210 }
7211 };
7212};
7213
7214module.exports = exports["default"];
7215},{}],55:[function(require,module,exports){
7216"use strict";
7217
7218exports.__esModule = true;
7219
7220var _create = require("babel-runtime/core-js/object/create");
7221
7222var _create2 = _interopRequireDefault(_create);
7223
7224var _getIterator2 = require("babel-runtime/core-js/get-iterator");
7225
7226var _getIterator3 = _interopRequireDefault(_getIterator2);
7227
7228var _symbol = require("babel-runtime/core-js/symbol");
7229
7230var _symbol2 = _interopRequireDefault(_symbol);
7231
7232exports.default = function (_ref) {
7233 var t = _ref.types;
7234
7235 var IGNORE_REASSIGNMENT_SYMBOL = (0, _symbol2.default)();
7236
7237 var reassignmentVisitor = {
7238 "AssignmentExpression|UpdateExpression": function AssignmentExpressionUpdateExpression(path) {
7239 if (path.node[IGNORE_REASSIGNMENT_SYMBOL]) return;
7240 path.node[IGNORE_REASSIGNMENT_SYMBOL] = true;
7241
7242 var arg = path.get(path.isAssignmentExpression() ? "left" : "argument");
7243 if (!arg.isIdentifier()) return;
7244
7245 var name = arg.node.name;
7246
7247 if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return;
7248
7249 var exportedNames = this.exports[name];
7250 if (!exportedNames) return;
7251
7252 var node = path.node;
7253
7254 var isPostUpdateExpression = path.isUpdateExpression() && !node.prefix;
7255 if (isPostUpdateExpression) {
7256 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;
7257 }
7258
7259 for (var _iterator = exportedNames, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
7260 var _ref2;
7261
7262 if (_isArray) {
7263 if (_i >= _iterator.length) break;
7264 _ref2 = _iterator[_i++];
7265 } else {
7266 _i = _iterator.next();
7267 if (_i.done) break;
7268 _ref2 = _i.value;
7269 }
7270
7271 var exportedName = _ref2;
7272
7273 node = this.buildCall(exportedName, node).expression;
7274 }
7275
7276 if (isPostUpdateExpression) node = t.sequenceExpression([node, path.node]);
7277
7278 path.replaceWith(node);
7279 }
7280 };
7281
7282 return {
7283 visitor: {
7284 CallExpression: function CallExpression(path, state) {
7285 if (path.node.callee.type === TYPE_IMPORT) {
7286 var contextIdent = state.contextIdent;
7287 path.replaceWith(t.callExpression(t.memberExpression(contextIdent, t.identifier("import")), path.node.arguments));
7288 }
7289 },
7290 ReferencedIdentifier: function ReferencedIdentifier(path, state) {
7291 if (path.node.name == "__moduleName" && !path.scope.hasBinding("__moduleName")) {
7292 path.replaceWith(t.memberExpression(state.contextIdent, t.identifier("id")));
7293 }
7294 },
7295
7296
7297 Program: {
7298 enter: function enter(path, state) {
7299 state.contextIdent = path.scope.generateUidIdentifier("context");
7300 },
7301 exit: function exit(path, state) {
7302 var exportIdent = path.scope.generateUidIdentifier("export");
7303 var contextIdent = state.contextIdent;
7304
7305 var exportNames = (0, _create2.default)(null);
7306 var modules = [];
7307
7308 var beforeBody = [];
7309 var setters = [];
7310 var sources = [];
7311 var variableIds = [];
7312 var removedPaths = [];
7313
7314 function addExportName(key, val) {
7315 exportNames[key] = exportNames[key] || [];
7316 exportNames[key].push(val);
7317 }
7318
7319 function pushModule(source, key, specifiers) {
7320 var module = void 0;
7321 modules.forEach(function (m) {
7322 if (m.key === source) {
7323 module = m;
7324 }
7325 });
7326 if (!module) {
7327 modules.push(module = { key: source, imports: [], exports: [] });
7328 }
7329 module[key] = module[key].concat(specifiers);
7330 }
7331
7332 function buildExportCall(name, val) {
7333 return t.expressionStatement(t.callExpression(exportIdent, [t.stringLiteral(name), val]));
7334 }
7335
7336 var body = path.get("body");
7337
7338 var canHoist = true;
7339 for (var _iterator2 = body, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
7340 var _ref3;
7341
7342 if (_isArray2) {
7343 if (_i2 >= _iterator2.length) break;
7344 _ref3 = _iterator2[_i2++];
7345 } else {
7346 _i2 = _iterator2.next();
7347 if (_i2.done) break;
7348 _ref3 = _i2.value;
7349 }
7350
7351 var _path = _ref3;
7352
7353 if (_path.isExportDeclaration()) _path = _path.get("declaration");
7354 if (_path.isVariableDeclaration() && _path.node.kind !== "var") {
7355 canHoist = false;
7356 break;
7357 }
7358 }
7359
7360 for (var _iterator3 = body, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
7361 var _ref4;
7362
7363 if (_isArray3) {
7364 if (_i3 >= _iterator3.length) break;
7365 _ref4 = _iterator3[_i3++];
7366 } else {
7367 _i3 = _iterator3.next();
7368 if (_i3.done) break;
7369 _ref4 = _i3.value;
7370 }
7371
7372 var _path2 = _ref4;
7373
7374 if (canHoist && _path2.isFunctionDeclaration()) {
7375 beforeBody.push(_path2.node);
7376 removedPaths.push(_path2);
7377 } else if (_path2.isImportDeclaration()) {
7378 var source = _path2.node.source.value;
7379 pushModule(source, "imports", _path2.node.specifiers);
7380 for (var name in _path2.getBindingIdentifiers()) {
7381 _path2.scope.removeBinding(name);
7382 variableIds.push(t.identifier(name));
7383 }
7384 _path2.remove();
7385 } else if (_path2.isExportAllDeclaration()) {
7386 pushModule(_path2.node.source.value, "exports", _path2.node);
7387 _path2.remove();
7388 } else if (_path2.isExportDefaultDeclaration()) {
7389 var declar = _path2.get("declaration");
7390 if (declar.isClassDeclaration() || declar.isFunctionDeclaration()) {
7391 var id = declar.node.id;
7392 var nodes = [];
7393
7394 if (id) {
7395 nodes.push(declar.node);
7396 nodes.push(buildExportCall("default", id));
7397 addExportName(id.name, "default");
7398 } else {
7399 nodes.push(buildExportCall("default", t.toExpression(declar.node)));
7400 }
7401
7402 if (!canHoist || declar.isClassDeclaration()) {
7403 _path2.replaceWithMultiple(nodes);
7404 } else {
7405 beforeBody = beforeBody.concat(nodes);
7406 removedPaths.push(_path2);
7407 }
7408 } else {
7409 _path2.replaceWith(buildExportCall("default", declar.node));
7410 }
7411 } else if (_path2.isExportNamedDeclaration()) {
7412 var _declar = _path2.get("declaration");
7413
7414 if (_declar.node) {
7415 _path2.replaceWith(_declar);
7416
7417 var _nodes = [];
7418 var bindingIdentifiers = void 0;
7419 if (_path2.isFunction()) {
7420 var node = _declar.node;
7421 var _name = node.id.name;
7422 if (canHoist) {
7423 addExportName(_name, _name);
7424 beforeBody.push(node);
7425 beforeBody.push(buildExportCall(_name, node.id));
7426 removedPaths.push(_path2);
7427 } else {
7428 var _bindingIdentifiers;
7429
7430 bindingIdentifiers = (_bindingIdentifiers = {}, _bindingIdentifiers[_name] = node.id, _bindingIdentifiers);
7431 }
7432 } else {
7433 bindingIdentifiers = _declar.getBindingIdentifiers();
7434 }
7435 for (var _name2 in bindingIdentifiers) {
7436 addExportName(_name2, _name2);
7437 _nodes.push(buildExportCall(_name2, t.identifier(_name2)));
7438 }
7439 _path2.insertAfter(_nodes);
7440 } else {
7441 var specifiers = _path2.node.specifiers;
7442 if (specifiers && specifiers.length) {
7443 if (_path2.node.source) {
7444 pushModule(_path2.node.source.value, "exports", specifiers);
7445 _path2.remove();
7446 } else {
7447 var _nodes2 = [];
7448
7449 for (var _iterator7 = specifiers, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) {
7450 var _ref8;
7451
7452 if (_isArray7) {
7453 if (_i7 >= _iterator7.length) break;
7454 _ref8 = _iterator7[_i7++];
7455 } else {
7456 _i7 = _iterator7.next();
7457 if (_i7.done) break;
7458 _ref8 = _i7.value;
7459 }
7460
7461 var specifier = _ref8;
7462
7463 _nodes2.push(buildExportCall(specifier.exported.name, specifier.local));
7464 addExportName(specifier.local.name, specifier.exported.name);
7465 }
7466
7467 _path2.replaceWithMultiple(_nodes2);
7468 }
7469 }
7470 }
7471 }
7472 }
7473
7474 modules.forEach(function (specifiers) {
7475 var setterBody = [];
7476 var target = path.scope.generateUidIdentifier(specifiers.key);
7477
7478 for (var _iterator4 = specifiers.imports, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
7479 var _ref5;
7480
7481 if (_isArray4) {
7482 if (_i4 >= _iterator4.length) break;
7483 _ref5 = _iterator4[_i4++];
7484 } else {
7485 _i4 = _iterator4.next();
7486 if (_i4.done) break;
7487 _ref5 = _i4.value;
7488 }
7489
7490 var specifier = _ref5;
7491
7492 if (t.isImportNamespaceSpecifier(specifier)) {
7493 setterBody.push(t.expressionStatement(t.assignmentExpression("=", specifier.local, target)));
7494 } else if (t.isImportDefaultSpecifier(specifier)) {
7495 specifier = t.importSpecifier(specifier.local, t.identifier("default"));
7496 }
7497
7498 if (t.isImportSpecifier(specifier)) {
7499 setterBody.push(t.expressionStatement(t.assignmentExpression("=", specifier.local, t.memberExpression(target, specifier.imported))));
7500 }
7501 }
7502
7503 if (specifiers.exports.length) {
7504 var exportObjRef = path.scope.generateUidIdentifier("exportObj");
7505
7506 setterBody.push(t.variableDeclaration("var", [t.variableDeclarator(exportObjRef, t.objectExpression([]))]));
7507
7508 for (var _iterator5 = specifiers.exports, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) {
7509 var _ref6;
7510
7511 if (_isArray5) {
7512 if (_i5 >= _iterator5.length) break;
7513 _ref6 = _iterator5[_i5++];
7514 } else {
7515 _i5 = _iterator5.next();
7516 if (_i5.done) break;
7517 _ref6 = _i5.value;
7518 }
7519
7520 var node = _ref6;
7521
7522 if (t.isExportAllDeclaration(node)) {
7523 setterBody.push(buildExportAll({
7524 KEY: path.scope.generateUidIdentifier("key"),
7525 EXPORT_OBJ: exportObjRef,
7526 TARGET: target
7527 }));
7528 } else if (t.isExportSpecifier(node)) {
7529 setterBody.push(t.expressionStatement(t.assignmentExpression("=", t.memberExpression(exportObjRef, node.exported), t.memberExpression(target, node.local))));
7530 } else {}
7531 }
7532
7533 setterBody.push(t.expressionStatement(t.callExpression(exportIdent, [exportObjRef])));
7534 }
7535
7536 sources.push(t.stringLiteral(specifiers.key));
7537 setters.push(t.functionExpression(null, [target], t.blockStatement(setterBody)));
7538 });
7539
7540 var moduleName = this.getModuleName();
7541 if (moduleName) moduleName = t.stringLiteral(moduleName);
7542
7543 if (canHoist) {
7544 (0, _babelHelperHoistVariables2.default)(path, function (id) {
7545 return variableIds.push(id);
7546 });
7547 }
7548
7549 if (variableIds.length) {
7550 beforeBody.unshift(t.variableDeclaration("var", variableIds.map(function (id) {
7551 return t.variableDeclarator(id);
7552 })));
7553 }
7554
7555 path.traverse(reassignmentVisitor, {
7556 exports: exportNames,
7557 buildCall: buildExportCall,
7558 scope: path.scope
7559 });
7560
7561 for (var _iterator6 = removedPaths, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) {
7562 var _ref7;
7563
7564 if (_isArray6) {
7565 if (_i6 >= _iterator6.length) break;
7566 _ref7 = _iterator6[_i6++];
7567 } else {
7568 _i6 = _iterator6.next();
7569 if (_i6.done) break;
7570 _ref7 = _i6.value;
7571 }
7572
7573 var _path3 = _ref7;
7574
7575 _path3.remove();
7576 }
7577
7578 path.node.body = [buildTemplate({
7579 SYSTEM_REGISTER: t.memberExpression(t.identifier(state.opts.systemGlobal || "System"), t.identifier("register")),
7580 BEFORE_BODY: beforeBody,
7581 MODULE_NAME: moduleName,
7582 SETTERS: setters,
7583 SOURCES: sources,
7584 BODY: path.node.body,
7585 EXPORT_IDENTIFIER: exportIdent,
7586 CONTEXT_IDENTIFIER: contextIdent
7587 })];
7588 }
7589 }
7590 }
7591 };
7592};
7593
7594var _babelHelperHoistVariables = require("babel-helper-hoist-variables");
7595
7596var _babelHelperHoistVariables2 = _interopRequireDefault(_babelHelperHoistVariables);
7597
7598var _babelTemplate = require("babel-template");
7599
7600var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
7601
7602function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7603
7604var 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");
7605
7606var buildExportAll = (0, _babelTemplate2.default)("\n for (var KEY in TARGET) {\n if (KEY !== \"default\" && KEY !== \"__esModule\") EXPORT_OBJ[KEY] = TARGET[KEY];\n }\n");
7607
7608var TYPE_IMPORT = "Import";
7609
7610module.exports = exports["default"];
7611},{"babel-helper-hoist-variables":50,"babel-runtime/core-js/get-iterator":56,"babel-runtime/core-js/object/create":61,"babel-runtime/core-js/symbol":65,"babel-template":75}],56:[function(require,module,exports){
7612module.exports = { "default": require("core-js/library/fn/get-iterator"), __esModule: true };
7613},{"core-js/library/fn/get-iterator":125}],57:[function(require,module,exports){
7614module.exports = { "default": require("core-js/library/fn/json/stringify"), __esModule: true };
7615},{"core-js/library/fn/json/stringify":126}],58:[function(require,module,exports){
7616module.exports = { "default": require("core-js/library/fn/map"), __esModule: true };
7617},{"core-js/library/fn/map":127}],59:[function(require,module,exports){
7618module.exports = { "default": require("core-js/library/fn/number/max-safe-integer"), __esModule: true };
7619},{"core-js/library/fn/number/max-safe-integer":128}],60:[function(require,module,exports){
7620module.exports = { "default": require("core-js/library/fn/object/assign"), __esModule: true };
7621},{"core-js/library/fn/object/assign":129}],61:[function(require,module,exports){
7622module.exports = { "default": require("core-js/library/fn/object/create"), __esModule: true };
7623},{"core-js/library/fn/object/create":130}],62:[function(require,module,exports){
7624module.exports = { "default": require("core-js/library/fn/object/get-own-property-symbols"), __esModule: true };
7625},{"core-js/library/fn/object/get-own-property-symbols":131}],63:[function(require,module,exports){
7626module.exports = { "default": require("core-js/library/fn/object/keys"), __esModule: true };
7627},{"core-js/library/fn/object/keys":132}],64:[function(require,module,exports){
7628module.exports = { "default": require("core-js/library/fn/object/set-prototype-of"), __esModule: true };
7629},{"core-js/library/fn/object/set-prototype-of":133}],65:[function(require,module,exports){
7630module.exports = { "default": require("core-js/library/fn/symbol"), __esModule: true };
7631},{"core-js/library/fn/symbol":135}],66:[function(require,module,exports){
7632module.exports = { "default": require("core-js/library/fn/symbol/for"), __esModule: true };
7633},{"core-js/library/fn/symbol/for":134}],67:[function(require,module,exports){
7634module.exports = { "default": require("core-js/library/fn/symbol/iterator"), __esModule: true };
7635},{"core-js/library/fn/symbol/iterator":136}],68:[function(require,module,exports){
7636module.exports = { "default": require("core-js/library/fn/weak-map"), __esModule: true };
7637},{"core-js/library/fn/weak-map":137}],69:[function(require,module,exports){
7638module.exports = { "default": require("core-js/library/fn/weak-set"), __esModule: true };
7639},{"core-js/library/fn/weak-set":138}],70:[function(require,module,exports){
7640"use strict";
7641
7642exports.__esModule = true;
7643
7644exports.default = function (instance, Constructor) {
7645 if (!(instance instanceof Constructor)) {
7646 throw new TypeError("Cannot call a class as a function");
7647 }
7648};
7649},{}],71:[function(require,module,exports){
7650"use strict";
7651
7652exports.__esModule = true;
7653
7654var _setPrototypeOf = require("../core-js/object/set-prototype-of");
7655
7656var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
7657
7658var _create = require("../core-js/object/create");
7659
7660var _create2 = _interopRequireDefault(_create);
7661
7662var _typeof2 = require("../helpers/typeof");
7663
7664var _typeof3 = _interopRequireDefault(_typeof2);
7665
7666function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7667
7668exports.default = function (subClass, superClass) {
7669 if (typeof superClass !== "function" && superClass !== null) {
7670 throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
7671 }
7672
7673 subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
7674 constructor: {
7675 value: subClass,
7676 enumerable: false,
7677 writable: true,
7678 configurable: true
7679 }
7680 });
7681 if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
7682};
7683},{"../core-js/object/create":61,"../core-js/object/set-prototype-of":64,"../helpers/typeof":74}],72:[function(require,module,exports){
7684"use strict";
7685
7686exports.__esModule = true;
7687
7688exports.default = function (obj, keys) {
7689 var target = {};
7690
7691 for (var i in obj) {
7692 if (keys.indexOf(i) >= 0) continue;
7693 if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
7694 target[i] = obj[i];
7695 }
7696
7697 return target;
7698};
7699},{}],73:[function(require,module,exports){
7700"use strict";
7701
7702exports.__esModule = true;
7703
7704var _typeof2 = require("../helpers/typeof");
7705
7706var _typeof3 = _interopRequireDefault(_typeof2);
7707
7708function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7709
7710exports.default = function (self, call) {
7711 if (!self) {
7712 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
7713 }
7714
7715 return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
7716};
7717},{"../helpers/typeof":74}],74:[function(require,module,exports){
7718"use strict";
7719
7720exports.__esModule = true;
7721
7722var _iterator = require("../core-js/symbol/iterator");
7723
7724var _iterator2 = _interopRequireDefault(_iterator);
7725
7726var _symbol = require("../core-js/symbol");
7727
7728var _symbol2 = _interopRequireDefault(_symbol);
7729
7730var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
7731
7732function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7733
7734exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
7735 return typeof obj === "undefined" ? "undefined" : _typeof(obj);
7736} : function (obj) {
7737 return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
7738};
7739},{"../core-js/symbol":65,"../core-js/symbol/iterator":67}],75:[function(require,module,exports){
7740"use strict";
7741
7742exports.__esModule = true;
7743
7744var _symbol = require("babel-runtime/core-js/symbol");
7745
7746var _symbol2 = _interopRequireDefault(_symbol);
7747
7748exports.default = function (code, opts) {
7749 var stack = void 0;
7750 try {
7751 throw new Error();
7752 } catch (error) {
7753 if (error.stack) {
7754 stack = error.stack.split("\n").slice(1).join("\n");
7755 }
7756 }
7757
7758 opts = (0, _assign2.default)({
7759 allowReturnOutsideFunction: true,
7760 allowSuperOutsideMethod: true,
7761 preserveComments: false
7762 }, opts);
7763
7764 var _getAst = function getAst() {
7765 var ast = void 0;
7766
7767 try {
7768 ast = babylon.parse(code, opts);
7769
7770 ast = _babelTraverse2.default.removeProperties(ast, { preserveComments: opts.preserveComments });
7771
7772 _babelTraverse2.default.cheap(ast, function (node) {
7773 node[FROM_TEMPLATE] = true;
7774 });
7775 } catch (err) {
7776 err.stack = err.stack + "from\n" + stack;
7777 throw err;
7778 }
7779
7780 _getAst = function getAst() {
7781 return ast;
7782 };
7783
7784 return ast;
7785 };
7786
7787 return function () {
7788 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
7789 args[_key] = arguments[_key];
7790 }
7791
7792 return useTemplate(_getAst(), args);
7793 };
7794};
7795
7796var _cloneDeep = require("lodash/cloneDeep");
7797
7798var _cloneDeep2 = _interopRequireDefault(_cloneDeep);
7799
7800var _assign = require("lodash/assign");
7801
7802var _assign2 = _interopRequireDefault(_assign);
7803
7804var _has = require("lodash/has");
7805
7806var _has2 = _interopRequireDefault(_has);
7807
7808var _babelTraverse = require("babel-traverse");
7809
7810var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
7811
7812var _babylon = require("babylon");
7813
7814var babylon = _interopRequireWildcard(_babylon);
7815
7816var _babelTypes = require("babel-types");
7817
7818var t = _interopRequireWildcard(_babelTypes);
7819
7820function _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; } }
7821
7822function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7823
7824var FROM_TEMPLATE = "_fromTemplate";
7825var TEMPLATE_SKIP = (0, _symbol2.default)();
7826
7827function useTemplate(ast, nodes) {
7828 ast = (0, _cloneDeep2.default)(ast);
7829 var _ast = ast,
7830 program = _ast.program;
7831
7832
7833 if (nodes.length) {
7834 (0, _babelTraverse2.default)(ast, templateVisitor, null, nodes);
7835 }
7836
7837 if (program.body.length > 1) {
7838 return program.body;
7839 } else {
7840 return program.body[0];
7841 }
7842}
7843
7844var templateVisitor = {
7845 noScope: true,
7846
7847 enter: function enter(path, args) {
7848 var node = path.node;
7849
7850 if (node[TEMPLATE_SKIP]) return path.skip();
7851
7852 if (t.isExpressionStatement(node)) {
7853 node = node.expression;
7854 }
7855
7856 var replacement = void 0;
7857
7858 if (t.isIdentifier(node) && node[FROM_TEMPLATE]) {
7859 if ((0, _has2.default)(args[0], node.name)) {
7860 replacement = args[0][node.name];
7861 } else if (node.name[0] === "$") {
7862 var i = +node.name.slice(1);
7863 if (args[i]) replacement = args[i];
7864 }
7865 }
7866
7867 if (replacement === null) {
7868 path.remove();
7869 }
7870
7871 if (replacement) {
7872 replacement[TEMPLATE_SKIP] = true;
7873 path.replaceInline(replacement);
7874 }
7875 },
7876 exit: function exit(_ref) {
7877 var node = _ref.node;
7878
7879 if (!node.loc) _babelTraverse2.default.clearNode(node);
7880 }
7881};
7882module.exports = exports["default"];
7883},{"babel-runtime/core-js/symbol":65,"babel-traverse":79,"babel-types":112,"babylon":116,"lodash/assign":414,"lodash/cloneDeep":417,"lodash/has":428}],76:[function(require,module,exports){
7884"use strict";
7885
7886exports.__esModule = true;
7887exports.scope = exports.path = undefined;
7888
7889var _weakMap = require("babel-runtime/core-js/weak-map");
7890
7891var _weakMap2 = _interopRequireDefault(_weakMap);
7892
7893exports.clear = clear;
7894exports.clearPath = clearPath;
7895exports.clearScope = clearScope;
7896
7897function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7898
7899var path = exports.path = new _weakMap2.default();
7900var scope = exports.scope = new _weakMap2.default();
7901
7902function clear() {
7903 clearPath();
7904 clearScope();
7905}
7906
7907function clearPath() {
7908 exports.path = path = new _weakMap2.default();
7909}
7910
7911function clearScope() {
7912 exports.scope = scope = new _weakMap2.default();
7913}
7914},{"babel-runtime/core-js/weak-map":68}],77:[function(require,module,exports){
7915(function (process){
7916"use strict";
7917
7918exports.__esModule = true;
7919
7920var _getIterator2 = require("babel-runtime/core-js/get-iterator");
7921
7922var _getIterator3 = _interopRequireDefault(_getIterator2);
7923
7924var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
7925
7926var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
7927
7928var _path2 = require("./path");
7929
7930var _path3 = _interopRequireDefault(_path2);
7931
7932var _babelTypes = require("babel-types");
7933
7934var t = _interopRequireWildcard(_babelTypes);
7935
7936function _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; } }
7937
7938function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7939
7940var testing = process.env.NODE_ENV === "test";
7941
7942var TraversalContext = function () {
7943 function TraversalContext(scope, opts, state, parentPath) {
7944 (0, _classCallCheck3.default)(this, TraversalContext);
7945 this.queue = null;
7946
7947 this.parentPath = parentPath;
7948 this.scope = scope;
7949 this.state = state;
7950 this.opts = opts;
7951 }
7952
7953 TraversalContext.prototype.shouldVisit = function shouldVisit(node) {
7954 var opts = this.opts;
7955 if (opts.enter || opts.exit) return true;
7956
7957 if (opts[node.type]) return true;
7958
7959 var keys = t.VISITOR_KEYS[node.type];
7960 if (!keys || !keys.length) return false;
7961
7962 for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
7963 var _ref;
7964
7965 if (_isArray) {
7966 if (_i >= _iterator.length) break;
7967 _ref = _iterator[_i++];
7968 } else {
7969 _i = _iterator.next();
7970 if (_i.done) break;
7971 _ref = _i.value;
7972 }
7973
7974 var key = _ref;
7975
7976 if (node[key]) return true;
7977 }
7978
7979 return false;
7980 };
7981
7982 TraversalContext.prototype.create = function create(node, obj, key, listKey) {
7983 return _path3.default.get({
7984 parentPath: this.parentPath,
7985 parent: node,
7986 container: obj,
7987 key: key,
7988 listKey: listKey
7989 });
7990 };
7991
7992 TraversalContext.prototype.maybeQueue = function maybeQueue(path, notPriority) {
7993 if (this.trap) {
7994 throw new Error("Infinite cycle detected");
7995 }
7996
7997 if (this.queue) {
7998 if (notPriority) {
7999 this.queue.push(path);
8000 } else {
8001 this.priorityQueue.push(path);
8002 }
8003 }
8004 };
8005
8006 TraversalContext.prototype.visitMultiple = function visitMultiple(container, parent, listKey) {
8007 if (container.length === 0) return false;
8008
8009 var queue = [];
8010
8011 for (var key = 0; key < container.length; key++) {
8012 var node = container[key];
8013 if (node && this.shouldVisit(node)) {
8014 queue.push(this.create(parent, container, key, listKey));
8015 }
8016 }
8017
8018 return this.visitQueue(queue);
8019 };
8020
8021 TraversalContext.prototype.visitSingle = function visitSingle(node, key) {
8022 if (this.shouldVisit(node[key])) {
8023 return this.visitQueue([this.create(node, node, key)]);
8024 } else {
8025 return false;
8026 }
8027 };
8028
8029 TraversalContext.prototype.visitQueue = function visitQueue(queue) {
8030 this.queue = queue;
8031 this.priorityQueue = [];
8032
8033 var visited = [];
8034 var stop = false;
8035
8036 for (var _iterator2 = queue, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
8037 var _ref2;
8038
8039 if (_isArray2) {
8040 if (_i2 >= _iterator2.length) break;
8041 _ref2 = _iterator2[_i2++];
8042 } else {
8043 _i2 = _iterator2.next();
8044 if (_i2.done) break;
8045 _ref2 = _i2.value;
8046 }
8047
8048 var path = _ref2;
8049
8050 path.resync();
8051
8052 if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) {
8053 path.pushContext(this);
8054 }
8055
8056 if (path.key === null) continue;
8057
8058 if (testing && queue.length >= 10000) {
8059 this.trap = true;
8060 }
8061
8062 if (visited.indexOf(path.node) >= 0) continue;
8063 visited.push(path.node);
8064
8065 if (path.visit()) {
8066 stop = true;
8067 break;
8068 }
8069
8070 if (this.priorityQueue.length) {
8071 stop = this.visitQueue(this.priorityQueue);
8072 this.priorityQueue = [];
8073 this.queue = queue;
8074 if (stop) break;
8075 }
8076 }
8077
8078 for (var _iterator3 = queue, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
8079 var _ref3;
8080
8081 if (_isArray3) {
8082 if (_i3 >= _iterator3.length) break;
8083 _ref3 = _iterator3[_i3++];
8084 } else {
8085 _i3 = _iterator3.next();
8086 if (_i3.done) break;
8087 _ref3 = _i3.value;
8088 }
8089
8090 var _path = _ref3;
8091
8092 _path.popContext();
8093 }
8094
8095 this.queue = null;
8096
8097 return stop;
8098 };
8099
8100 TraversalContext.prototype.visit = function visit(node, key) {
8101 var nodes = node[key];
8102 if (!nodes) return false;
8103
8104 if (Array.isArray(nodes)) {
8105 return this.visitMultiple(nodes, node, key);
8106 } else {
8107 return this.visitSingle(node, key);
8108 }
8109 };
8110
8111 return TraversalContext;
8112}();
8113
8114exports.default = TraversalContext;
8115module.exports = exports["default"];
8116}).call(this,require('_process'))
8117},{"./path":86,"_process":471,"babel-runtime/core-js/get-iterator":56,"babel-runtime/helpers/classCallCheck":70,"babel-types":112}],78:[function(require,module,exports){
8118"use strict";
8119
8120exports.__esModule = true;
8121
8122var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
8123
8124var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
8125
8126function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8127
8128var Hub = function Hub(file, options) {
8129 (0, _classCallCheck3.default)(this, Hub);
8130
8131 this.file = file;
8132 this.options = options;
8133};
8134
8135exports.default = Hub;
8136module.exports = exports["default"];
8137},{"babel-runtime/helpers/classCallCheck":70}],79:[function(require,module,exports){
8138"use strict";
8139
8140exports.__esModule = true;
8141exports.visitors = exports.Hub = exports.Scope = exports.NodePath = undefined;
8142
8143var _getIterator2 = require("babel-runtime/core-js/get-iterator");
8144
8145var _getIterator3 = _interopRequireDefault(_getIterator2);
8146
8147var _path = require("./path");
8148
8149Object.defineProperty(exports, "NodePath", {
8150 enumerable: true,
8151 get: function get() {
8152 return _interopRequireDefault(_path).default;
8153 }
8154});
8155
8156var _scope = require("./scope");
8157
8158Object.defineProperty(exports, "Scope", {
8159 enumerable: true,
8160 get: function get() {
8161 return _interopRequireDefault(_scope).default;
8162 }
8163});
8164
8165var _hub = require("./hub");
8166
8167Object.defineProperty(exports, "Hub", {
8168 enumerable: true,
8169 get: function get() {
8170 return _interopRequireDefault(_hub).default;
8171 }
8172});
8173exports.default = traverse;
8174
8175var _context = require("./context");
8176
8177var _context2 = _interopRequireDefault(_context);
8178
8179var _visitors = require("./visitors");
8180
8181var visitors = _interopRequireWildcard(_visitors);
8182
8183var _babelMessages = require("babel-messages");
8184
8185var messages = _interopRequireWildcard(_babelMessages);
8186
8187var _includes = require("lodash/includes");
8188
8189var _includes2 = _interopRequireDefault(_includes);
8190
8191var _babelTypes = require("babel-types");
8192
8193var t = _interopRequireWildcard(_babelTypes);
8194
8195var _cache = require("./cache");
8196
8197var cache = _interopRequireWildcard(_cache);
8198
8199function _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; } }
8200
8201function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8202
8203exports.visitors = visitors;
8204function traverse(parent, opts, scope, state, parentPath) {
8205 if (!parent) return;
8206 if (!opts) opts = {};
8207
8208 if (!opts.noScope && !scope) {
8209 if (parent.type !== "Program" && parent.type !== "File") {
8210 throw new Error(messages.get("traverseNeedsParent", parent.type));
8211 }
8212 }
8213
8214 visitors.explode(opts);
8215
8216 traverse.node(parent, opts, scope, state, parentPath);
8217}
8218
8219traverse.visitors = visitors;
8220traverse.verify = visitors.verify;
8221traverse.explode = visitors.explode;
8222
8223traverse.NodePath = require("./path");
8224traverse.Scope = require("./scope");
8225traverse.Hub = require("./hub");
8226
8227traverse.cheap = function (node, enter) {
8228 return t.traverseFast(node, enter);
8229};
8230
8231traverse.node = function (node, opts, scope, state, parentPath, skipKeys) {
8232 var keys = t.VISITOR_KEYS[node.type];
8233 if (!keys) return;
8234
8235 var context = new _context2.default(scope, opts, state, parentPath);
8236 for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
8237 var _ref;
8238
8239 if (_isArray) {
8240 if (_i >= _iterator.length) break;
8241 _ref = _iterator[_i++];
8242 } else {
8243 _i = _iterator.next();
8244 if (_i.done) break;
8245 _ref = _i.value;
8246 }
8247
8248 var key = _ref;
8249
8250 if (skipKeys && skipKeys[key]) continue;
8251 if (context.visit(node, key)) return;
8252 }
8253};
8254
8255traverse.clearNode = function (node, opts) {
8256 t.removeProperties(node, opts);
8257
8258 cache.path.delete(node);
8259};
8260
8261traverse.removeProperties = function (tree, opts) {
8262 t.traverseFast(tree, traverse.clearNode, opts);
8263 return tree;
8264};
8265
8266function hasBlacklistedType(path, state) {
8267 if (path.node.type === state.type) {
8268 state.has = true;
8269 path.stop();
8270 }
8271}
8272
8273traverse.hasType = function (tree, scope, type, blacklistTypes) {
8274 if ((0, _includes2.default)(blacklistTypes, tree.type)) return false;
8275
8276 if (tree.type === type) return true;
8277
8278 var state = {
8279 has: false,
8280 type: type
8281 };
8282
8283 traverse(tree, {
8284 blacklist: blacklistTypes,
8285 enter: hasBlacklistedType
8286 }, scope, state);
8287
8288 return state.has;
8289};
8290
8291traverse.clearCache = function () {
8292 cache.clear();
8293};
8294
8295traverse.clearCache.clearPath = cache.clearPath;
8296traverse.clearCache.clearScope = cache.clearScope;
8297
8298traverse.copyCache = function (source, destination) {
8299 if (cache.path.has(source)) {
8300 cache.path.set(destination, cache.path.get(source));
8301 }
8302};
8303},{"./cache":76,"./context":77,"./hub":78,"./path":86,"./scope":98,"./visitors":100,"babel-messages":53,"babel-runtime/core-js/get-iterator":56,"babel-types":112,"lodash/includes":431}],80:[function(require,module,exports){
8304"use strict";
8305
8306exports.__esModule = true;
8307
8308var _getIterator2 = require("babel-runtime/core-js/get-iterator");
8309
8310var _getIterator3 = _interopRequireDefault(_getIterator2);
8311
8312exports.findParent = findParent;
8313exports.find = find;
8314exports.getFunctionParent = getFunctionParent;
8315exports.getStatementParent = getStatementParent;
8316exports.getEarliestCommonAncestorFrom = getEarliestCommonAncestorFrom;
8317exports.getDeepestCommonAncestorFrom = getDeepestCommonAncestorFrom;
8318exports.getAncestry = getAncestry;
8319exports.isAncestor = isAncestor;
8320exports.isDescendant = isDescendant;
8321exports.inType = inType;
8322exports.inShadow = inShadow;
8323
8324var _babelTypes = require("babel-types");
8325
8326var t = _interopRequireWildcard(_babelTypes);
8327
8328var _index = require("./index");
8329
8330var _index2 = _interopRequireDefault(_index);
8331
8332function _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; } }
8333
8334function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8335
8336function findParent(callback) {
8337 var path = this;
8338 while (path = path.parentPath) {
8339 if (callback(path)) return path;
8340 }
8341 return null;
8342}
8343
8344function find(callback) {
8345 var path = this;
8346 do {
8347 if (callback(path)) return path;
8348 } while (path = path.parentPath);
8349 return null;
8350}
8351
8352function getFunctionParent() {
8353 return this.findParent(function (path) {
8354 return path.isFunction() || path.isProgram();
8355 });
8356}
8357
8358function getStatementParent() {
8359 var path = this;
8360 do {
8361 if (Array.isArray(path.container)) {
8362 return path;
8363 }
8364 } while (path = path.parentPath);
8365}
8366
8367function getEarliestCommonAncestorFrom(paths) {
8368 return this.getDeepestCommonAncestorFrom(paths, function (deepest, i, ancestries) {
8369 var earliest = void 0;
8370 var keys = t.VISITOR_KEYS[deepest.type];
8371
8372 for (var _iterator = ancestries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
8373 var _ref;
8374
8375 if (_isArray) {
8376 if (_i >= _iterator.length) break;
8377 _ref = _iterator[_i++];
8378 } else {
8379 _i = _iterator.next();
8380 if (_i.done) break;
8381 _ref = _i.value;
8382 }
8383
8384 var ancestry = _ref;
8385
8386 var path = ancestry[i + 1];
8387
8388 if (!earliest) {
8389 earliest = path;
8390 continue;
8391 }
8392
8393 if (path.listKey && earliest.listKey === path.listKey) {
8394 if (path.key < earliest.key) {
8395 earliest = path;
8396 continue;
8397 }
8398 }
8399
8400 var earliestKeyIndex = keys.indexOf(earliest.parentKey);
8401 var currentKeyIndex = keys.indexOf(path.parentKey);
8402 if (earliestKeyIndex > currentKeyIndex) {
8403 earliest = path;
8404 }
8405 }
8406
8407 return earliest;
8408 });
8409}
8410
8411function getDeepestCommonAncestorFrom(paths, filter) {
8412 var _this = this;
8413
8414 if (!paths.length) {
8415 return this;
8416 }
8417
8418 if (paths.length === 1) {
8419 return paths[0];
8420 }
8421
8422 var minDepth = Infinity;
8423
8424 var lastCommonIndex = void 0,
8425 lastCommon = void 0;
8426
8427 var ancestries = paths.map(function (path) {
8428 var ancestry = [];
8429
8430 do {
8431 ancestry.unshift(path);
8432 } while ((path = path.parentPath) && path !== _this);
8433
8434 if (ancestry.length < minDepth) {
8435 minDepth = ancestry.length;
8436 }
8437
8438 return ancestry;
8439 });
8440
8441 var first = ancestries[0];
8442
8443 depthLoop: for (var i = 0; i < minDepth; i++) {
8444 var shouldMatch = first[i];
8445
8446 for (var _iterator2 = ancestries, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
8447 var _ref2;
8448
8449 if (_isArray2) {
8450 if (_i2 >= _iterator2.length) break;
8451 _ref2 = _iterator2[_i2++];
8452 } else {
8453 _i2 = _iterator2.next();
8454 if (_i2.done) break;
8455 _ref2 = _i2.value;
8456 }
8457
8458 var ancestry = _ref2;
8459
8460 if (ancestry[i] !== shouldMatch) {
8461 break depthLoop;
8462 }
8463 }
8464
8465 lastCommonIndex = i;
8466 lastCommon = shouldMatch;
8467 }
8468
8469 if (lastCommon) {
8470 if (filter) {
8471 return filter(lastCommon, lastCommonIndex, ancestries);
8472 } else {
8473 return lastCommon;
8474 }
8475 } else {
8476 throw new Error("Couldn't find intersection");
8477 }
8478}
8479
8480function getAncestry() {
8481 var path = this;
8482 var paths = [];
8483 do {
8484 paths.push(path);
8485 } while (path = path.parentPath);
8486 return paths;
8487}
8488
8489function isAncestor(maybeDescendant) {
8490 return maybeDescendant.isDescendant(this);
8491}
8492
8493function isDescendant(maybeAncestor) {
8494 return !!this.findParent(function (parent) {
8495 return parent === maybeAncestor;
8496 });
8497}
8498
8499function inType() {
8500 var path = this;
8501 while (path) {
8502 for (var _iterator3 = arguments, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
8503 var _ref3;
8504
8505 if (_isArray3) {
8506 if (_i3 >= _iterator3.length) break;
8507 _ref3 = _iterator3[_i3++];
8508 } else {
8509 _i3 = _iterator3.next();
8510 if (_i3.done) break;
8511 _ref3 = _i3.value;
8512 }
8513
8514 var type = _ref3;
8515
8516 if (path.node.type === type) return true;
8517 }
8518 path = path.parentPath;
8519 }
8520
8521 return false;
8522}
8523
8524function inShadow(key) {
8525 var parentFn = this.isFunction() ? this : this.findParent(function (p) {
8526 return p.isFunction();
8527 });
8528 if (!parentFn) return;
8529
8530 if (parentFn.isFunctionExpression() || parentFn.isFunctionDeclaration()) {
8531 var shadow = parentFn.node.shadow;
8532
8533 if (shadow && (!key || shadow[key] !== false)) {
8534 return parentFn;
8535 }
8536 } else if (parentFn.isArrowFunctionExpression()) {
8537 return parentFn;
8538 }
8539
8540 return null;
8541}
8542},{"./index":86,"babel-runtime/core-js/get-iterator":56,"babel-types":112}],81:[function(require,module,exports){
8543"use strict";
8544
8545exports.__esModule = true;
8546exports.shareCommentsWithSiblings = shareCommentsWithSiblings;
8547exports.addComment = addComment;
8548exports.addComments = addComments;
8549function shareCommentsWithSiblings() {
8550 if (typeof this.key === "string") return;
8551
8552 var node = this.node;
8553 if (!node) return;
8554
8555 var trailing = node.trailingComments;
8556 var leading = node.leadingComments;
8557 if (!trailing && !leading) return;
8558
8559 var prev = this.getSibling(this.key - 1);
8560 var next = this.getSibling(this.key + 1);
8561
8562 if (!prev.node) prev = next;
8563 if (!next.node) next = prev;
8564
8565 prev.addComments("trailing", leading);
8566 next.addComments("leading", trailing);
8567}
8568
8569function addComment(type, content, line) {
8570 this.addComments(type, [{
8571 type: line ? "CommentLine" : "CommentBlock",
8572 value: content
8573 }]);
8574}
8575
8576function addComments(type, comments) {
8577 if (!comments) return;
8578
8579 var node = this.node;
8580 if (!node) return;
8581
8582 var key = type + "Comments";
8583
8584 if (node[key]) {
8585 node[key] = node[key].concat(comments);
8586 } else {
8587 node[key] = comments;
8588 }
8589}
8590},{}],82:[function(require,module,exports){
8591"use strict";
8592
8593exports.__esModule = true;
8594
8595var _getIterator2 = require("babel-runtime/core-js/get-iterator");
8596
8597var _getIterator3 = _interopRequireDefault(_getIterator2);
8598
8599exports.call = call;
8600exports._call = _call;
8601exports.isBlacklisted = isBlacklisted;
8602exports.visit = visit;
8603exports.skip = skip;
8604exports.skipKey = skipKey;
8605exports.stop = stop;
8606exports.setScope = setScope;
8607exports.setContext = setContext;
8608exports.resync = resync;
8609exports._resyncParent = _resyncParent;
8610exports._resyncKey = _resyncKey;
8611exports._resyncList = _resyncList;
8612exports._resyncRemoved = _resyncRemoved;
8613exports.popContext = popContext;
8614exports.pushContext = pushContext;
8615exports.setup = setup;
8616exports.setKey = setKey;
8617exports.requeue = requeue;
8618exports._getQueueContexts = _getQueueContexts;
8619
8620var _index = require("../index");
8621
8622var _index2 = _interopRequireDefault(_index);
8623
8624function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8625
8626function call(key) {
8627 var opts = this.opts;
8628
8629 this.debug(function () {
8630 return key;
8631 });
8632
8633 if (this.node) {
8634 if (this._call(opts[key])) return true;
8635 }
8636
8637 if (this.node) {
8638 return this._call(opts[this.node.type] && opts[this.node.type][key]);
8639 }
8640
8641 return false;
8642}
8643
8644function _call(fns) {
8645 if (!fns) return false;
8646
8647 for (var _iterator = fns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
8648 var _ref;
8649
8650 if (_isArray) {
8651 if (_i >= _iterator.length) break;
8652 _ref = _iterator[_i++];
8653 } else {
8654 _i = _iterator.next();
8655 if (_i.done) break;
8656 _ref = _i.value;
8657 }
8658
8659 var fn = _ref;
8660
8661 if (!fn) continue;
8662
8663 var node = this.node;
8664 if (!node) return true;
8665
8666 var ret = fn.call(this.state, this, this.state);
8667 if (ret) throw new Error("Unexpected return value from visitor method " + fn);
8668
8669 if (this.node !== node) return true;
8670
8671 if (this.shouldStop || this.shouldSkip || this.removed) return true;
8672 }
8673
8674 return false;
8675}
8676
8677function isBlacklisted() {
8678 var blacklist = this.opts.blacklist;
8679 return blacklist && blacklist.indexOf(this.node.type) > -1;
8680}
8681
8682function visit() {
8683 if (!this.node) {
8684 return false;
8685 }
8686
8687 if (this.isBlacklisted()) {
8688 return false;
8689 }
8690
8691 if (this.opts.shouldSkip && this.opts.shouldSkip(this)) {
8692 return false;
8693 }
8694
8695 if (this.call("enter") || this.shouldSkip) {
8696 this.debug(function () {
8697 return "Skip...";
8698 });
8699 return this.shouldStop;
8700 }
8701
8702 this.debug(function () {
8703 return "Recursing into...";
8704 });
8705 _index2.default.node(this.node, this.opts, this.scope, this.state, this, this.skipKeys);
8706
8707 this.call("exit");
8708
8709 return this.shouldStop;
8710}
8711
8712function skip() {
8713 this.shouldSkip = true;
8714}
8715
8716function skipKey(key) {
8717 this.skipKeys[key] = true;
8718}
8719
8720function stop() {
8721 this.shouldStop = true;
8722 this.shouldSkip = true;
8723}
8724
8725function setScope() {
8726 if (this.opts && this.opts.noScope) return;
8727
8728 var target = this.context && this.context.scope;
8729
8730 if (!target) {
8731 var path = this.parentPath;
8732 while (path && !target) {
8733 if (path.opts && path.opts.noScope) return;
8734
8735 target = path.scope;
8736 path = path.parentPath;
8737 }
8738 }
8739
8740 this.scope = this.getScope(target);
8741 if (this.scope) this.scope.init();
8742}
8743
8744function setContext(context) {
8745 this.shouldSkip = false;
8746 this.shouldStop = false;
8747 this.removed = false;
8748 this.skipKeys = {};
8749
8750 if (context) {
8751 this.context = context;
8752 this.state = context.state;
8753 this.opts = context.opts;
8754 }
8755
8756 this.setScope();
8757
8758 return this;
8759}
8760
8761function resync() {
8762 if (this.removed) return;
8763
8764 this._resyncParent();
8765 this._resyncList();
8766 this._resyncKey();
8767}
8768
8769function _resyncParent() {
8770 if (this.parentPath) {
8771 this.parent = this.parentPath.node;
8772 }
8773}
8774
8775function _resyncKey() {
8776 if (!this.container) return;
8777
8778 if (this.node === this.container[this.key]) return;
8779
8780 if (Array.isArray(this.container)) {
8781 for (var i = 0; i < this.container.length; i++) {
8782 if (this.container[i] === this.node) {
8783 return this.setKey(i);
8784 }
8785 }
8786 } else {
8787 for (var key in this.container) {
8788 if (this.container[key] === this.node) {
8789 return this.setKey(key);
8790 }
8791 }
8792 }
8793
8794 this.key = null;
8795}
8796
8797function _resyncList() {
8798 if (!this.parent || !this.inList) return;
8799
8800 var newContainer = this.parent[this.listKey];
8801 if (this.container === newContainer) return;
8802
8803 this.container = newContainer || null;
8804}
8805
8806function _resyncRemoved() {
8807 if (this.key == null || !this.container || this.container[this.key] !== this.node) {
8808 this._markRemoved();
8809 }
8810}
8811
8812function popContext() {
8813 this.contexts.pop();
8814 this.setContext(this.contexts[this.contexts.length - 1]);
8815}
8816
8817function pushContext(context) {
8818 this.contexts.push(context);
8819 this.setContext(context);
8820}
8821
8822function setup(parentPath, container, listKey, key) {
8823 this.inList = !!listKey;
8824 this.listKey = listKey;
8825 this.parentKey = listKey || key;
8826 this.container = container;
8827
8828 this.parentPath = parentPath || this.parentPath;
8829 this.setKey(key);
8830}
8831
8832function setKey(key) {
8833 this.key = key;
8834 this.node = this.container[this.key];
8835 this.type = this.node && this.node.type;
8836}
8837
8838function requeue() {
8839 var pathToQueue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this;
8840
8841 if (pathToQueue.removed) return;
8842
8843 var contexts = this.contexts;
8844
8845 for (var _iterator2 = contexts, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
8846 var _ref2;
8847
8848 if (_isArray2) {
8849 if (_i2 >= _iterator2.length) break;
8850 _ref2 = _iterator2[_i2++];
8851 } else {
8852 _i2 = _iterator2.next();
8853 if (_i2.done) break;
8854 _ref2 = _i2.value;
8855 }
8856
8857 var context = _ref2;
8858
8859 context.maybeQueue(pathToQueue);
8860 }
8861}
8862
8863function _getQueueContexts() {
8864 var path = this;
8865 var contexts = this.contexts;
8866 while (!contexts.length) {
8867 path = path.parentPath;
8868 contexts = path.contexts;
8869 }
8870 return contexts;
8871}
8872},{"../index":79,"babel-runtime/core-js/get-iterator":56}],83:[function(require,module,exports){
8873"use strict";
8874
8875exports.__esModule = true;
8876exports.toComputedKey = toComputedKey;
8877exports.ensureBlock = ensureBlock;
8878exports.arrowFunctionToShadowed = arrowFunctionToShadowed;
8879
8880var _babelTypes = require("babel-types");
8881
8882var t = _interopRequireWildcard(_babelTypes);
8883
8884function _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; } }
8885
8886function toComputedKey() {
8887 var node = this.node;
8888
8889 var key = void 0;
8890 if (this.isMemberExpression()) {
8891 key = node.property;
8892 } else if (this.isProperty() || this.isMethod()) {
8893 key = node.key;
8894 } else {
8895 throw new ReferenceError("todo");
8896 }
8897
8898 if (!node.computed) {
8899 if (t.isIdentifier(key)) key = t.stringLiteral(key.name);
8900 }
8901
8902 return key;
8903}
8904
8905function ensureBlock() {
8906 return t.ensureBlock(this.node);
8907}
8908
8909function arrowFunctionToShadowed() {
8910 if (!this.isArrowFunctionExpression()) return;
8911
8912 this.ensureBlock();
8913
8914 var node = this.node;
8915
8916 node.expression = false;
8917 node.type = "FunctionExpression";
8918 node.shadow = node.shadow || true;
8919}
8920},{"babel-types":112}],84:[function(require,module,exports){
8921(function (global){
8922"use strict";
8923
8924exports.__esModule = true;
8925
8926var _typeof2 = require("babel-runtime/helpers/typeof");
8927
8928var _typeof3 = _interopRequireDefault(_typeof2);
8929
8930var _getIterator2 = require("babel-runtime/core-js/get-iterator");
8931
8932var _getIterator3 = _interopRequireDefault(_getIterator2);
8933
8934var _map = require("babel-runtime/core-js/map");
8935
8936var _map2 = _interopRequireDefault(_map);
8937
8938exports.evaluateTruthy = evaluateTruthy;
8939exports.evaluate = evaluate;
8940
8941function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8942
8943var VALID_CALLEES = ["String", "Number", "Math"];
8944var INVALID_METHODS = ["random"];
8945
8946function evaluateTruthy() {
8947 var res = this.evaluate();
8948 if (res.confident) return !!res.value;
8949}
8950
8951function evaluate() {
8952 var confident = true;
8953 var deoptPath = void 0;
8954 var seen = new _map2.default();
8955
8956 function deopt(path) {
8957 if (!confident) return;
8958 deoptPath = path;
8959 confident = false;
8960 }
8961
8962 var value = evaluate(this);
8963 if (!confident) value = undefined;
8964 return {
8965 confident: confident,
8966 deopt: deoptPath,
8967 value: value
8968 };
8969
8970 function evaluate(path) {
8971 var node = path.node;
8972
8973
8974 if (seen.has(node)) {
8975 var existing = seen.get(node);
8976 if (existing.resolved) {
8977 return existing.value;
8978 } else {
8979 deopt(path);
8980 return;
8981 }
8982 } else {
8983 var item = { resolved: false };
8984 seen.set(node, item);
8985
8986 var val = _evaluate(path);
8987 if (confident) {
8988 item.resolved = true;
8989 item.value = val;
8990 }
8991 return val;
8992 }
8993 }
8994
8995 function _evaluate(path) {
8996 if (!confident) return;
8997
8998 var node = path.node;
8999
9000
9001 if (path.isSequenceExpression()) {
9002 var exprs = path.get("expressions");
9003 return evaluate(exprs[exprs.length - 1]);
9004 }
9005
9006 if (path.isStringLiteral() || path.isNumericLiteral() || path.isBooleanLiteral()) {
9007 return node.value;
9008 }
9009
9010 if (path.isNullLiteral()) {
9011 return null;
9012 }
9013
9014 if (path.isTemplateLiteral()) {
9015 var str = "";
9016
9017 var i = 0;
9018 var _exprs = path.get("expressions");
9019
9020 for (var _iterator = node.quasis, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
9021 var _ref;
9022
9023 if (_isArray) {
9024 if (_i >= _iterator.length) break;
9025 _ref = _iterator[_i++];
9026 } else {
9027 _i = _iterator.next();
9028 if (_i.done) break;
9029 _ref = _i.value;
9030 }
9031
9032 var elem = _ref;
9033
9034 if (!confident) break;
9035
9036 str += elem.value.cooked;
9037
9038 var expr = _exprs[i++];
9039 if (expr) str += String(evaluate(expr));
9040 }
9041
9042 if (!confident) return;
9043 return str;
9044 }
9045
9046 if (path.isConditionalExpression()) {
9047 var testResult = evaluate(path.get("test"));
9048 if (!confident) return;
9049 if (testResult) {
9050 return evaluate(path.get("consequent"));
9051 } else {
9052 return evaluate(path.get("alternate"));
9053 }
9054 }
9055
9056 if (path.isExpressionWrapper()) {
9057 return evaluate(path.get("expression"));
9058 }
9059
9060 if (path.isMemberExpression() && !path.parentPath.isCallExpression({ callee: node })) {
9061 var property = path.get("property");
9062 var object = path.get("object");
9063
9064 if (object.isLiteral() && property.isIdentifier()) {
9065 var _value = object.node.value;
9066 var type = typeof _value === "undefined" ? "undefined" : (0, _typeof3.default)(_value);
9067 if (type === "number" || type === "string") {
9068 return _value[property.node.name];
9069 }
9070 }
9071 }
9072
9073 if (path.isReferencedIdentifier()) {
9074 var binding = path.scope.getBinding(node.name);
9075
9076 if (binding && binding.constantViolations.length > 0) {
9077 return deopt(binding.path);
9078 }
9079
9080 if (binding && path.node.start < binding.path.node.end) {
9081 return deopt(binding.path);
9082 }
9083
9084 if (binding && binding.hasValue) {
9085 return binding.value;
9086 } else {
9087 if (node.name === "undefined") {
9088 return binding ? deopt(binding.path) : undefined;
9089 } else if (node.name === "Infinity") {
9090 return binding ? deopt(binding.path) : Infinity;
9091 } else if (node.name === "NaN") {
9092 return binding ? deopt(binding.path) : NaN;
9093 }
9094
9095 var resolved = path.resolve();
9096 if (resolved === path) {
9097 return deopt(path);
9098 } else {
9099 return evaluate(resolved);
9100 }
9101 }
9102 }
9103
9104 if (path.isUnaryExpression({ prefix: true })) {
9105 if (node.operator === "void") {
9106 return undefined;
9107 }
9108
9109 var argument = path.get("argument");
9110 if (node.operator === "typeof" && (argument.isFunction() || argument.isClass())) {
9111 return "function";
9112 }
9113
9114 var arg = evaluate(argument);
9115 if (!confident) return;
9116 switch (node.operator) {
9117 case "!":
9118 return !arg;
9119 case "+":
9120 return +arg;
9121 case "-":
9122 return -arg;
9123 case "~":
9124 return ~arg;
9125 case "typeof":
9126 return typeof arg === "undefined" ? "undefined" : (0, _typeof3.default)(arg);
9127 }
9128 }
9129
9130 if (path.isArrayExpression()) {
9131 var arr = [];
9132 var elems = path.get("elements");
9133 for (var _iterator2 = elems, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
9134 var _ref2;
9135
9136 if (_isArray2) {
9137 if (_i2 >= _iterator2.length) break;
9138 _ref2 = _iterator2[_i2++];
9139 } else {
9140 _i2 = _iterator2.next();
9141 if (_i2.done) break;
9142 _ref2 = _i2.value;
9143 }
9144
9145 var _elem = _ref2;
9146
9147 _elem = _elem.evaluate();
9148
9149 if (_elem.confident) {
9150 arr.push(_elem.value);
9151 } else {
9152 return deopt(_elem);
9153 }
9154 }
9155 return arr;
9156 }
9157
9158 if (path.isObjectExpression()) {
9159 var obj = {};
9160 var props = path.get("properties");
9161 for (var _iterator3 = props, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
9162 var _ref3;
9163
9164 if (_isArray3) {
9165 if (_i3 >= _iterator3.length) break;
9166 _ref3 = _iterator3[_i3++];
9167 } else {
9168 _i3 = _iterator3.next();
9169 if (_i3.done) break;
9170 _ref3 = _i3.value;
9171 }
9172
9173 var prop = _ref3;
9174
9175 if (prop.isObjectMethod() || prop.isSpreadProperty()) {
9176 return deopt(prop);
9177 }
9178 var keyPath = prop.get("key");
9179 var key = keyPath;
9180 if (prop.node.computed) {
9181 key = key.evaluate();
9182 if (!key.confident) {
9183 return deopt(keyPath);
9184 }
9185 key = key.value;
9186 } else if (key.isIdentifier()) {
9187 key = key.node.name;
9188 } else {
9189 key = key.node.value;
9190 }
9191 var valuePath = prop.get("value");
9192 var _value2 = valuePath.evaluate();
9193 if (!_value2.confident) {
9194 return deopt(valuePath);
9195 }
9196 _value2 = _value2.value;
9197 obj[key] = _value2;
9198 }
9199 return obj;
9200 }
9201
9202 if (path.isLogicalExpression()) {
9203 var wasConfident = confident;
9204 var left = evaluate(path.get("left"));
9205 var leftConfident = confident;
9206 confident = wasConfident;
9207 var right = evaluate(path.get("right"));
9208 var rightConfident = confident;
9209 confident = leftConfident && rightConfident;
9210
9211 switch (node.operator) {
9212 case "||":
9213 if (left && leftConfident) {
9214 confident = true;
9215 return left;
9216 }
9217
9218 if (!confident) return;
9219
9220 return left || right;
9221 case "&&":
9222 if (!left && leftConfident || !right && rightConfident) {
9223 confident = true;
9224 }
9225
9226 if (!confident) return;
9227
9228 return left && right;
9229 }
9230 }
9231
9232 if (path.isBinaryExpression()) {
9233 var _left = evaluate(path.get("left"));
9234 if (!confident) return;
9235 var _right = evaluate(path.get("right"));
9236 if (!confident) return;
9237
9238 switch (node.operator) {
9239 case "-":
9240 return _left - _right;
9241 case "+":
9242 return _left + _right;
9243 case "/":
9244 return _left / _right;
9245 case "*":
9246 return _left * _right;
9247 case "%":
9248 return _left % _right;
9249 case "**":
9250 return Math.pow(_left, _right);
9251 case "<":
9252 return _left < _right;
9253 case ">":
9254 return _left > _right;
9255 case "<=":
9256 return _left <= _right;
9257 case ">=":
9258 return _left >= _right;
9259 case "==":
9260 return _left == _right;
9261 case "!=":
9262 return _left != _right;
9263 case "===":
9264 return _left === _right;
9265 case "!==":
9266 return _left !== _right;
9267 case "|":
9268 return _left | _right;
9269 case "&":
9270 return _left & _right;
9271 case "^":
9272 return _left ^ _right;
9273 case "<<":
9274 return _left << _right;
9275 case ">>":
9276 return _left >> _right;
9277 case ">>>":
9278 return _left >>> _right;
9279 }
9280 }
9281
9282 if (path.isCallExpression()) {
9283 var callee = path.get("callee");
9284 var context = void 0;
9285 var func = void 0;
9286
9287 if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name, true) && VALID_CALLEES.indexOf(callee.node.name) >= 0) {
9288 func = global[node.callee.name];
9289 }
9290
9291 if (callee.isMemberExpression()) {
9292 var _object = callee.get("object");
9293 var _property = callee.get("property");
9294
9295 if (_object.isIdentifier() && _property.isIdentifier() && VALID_CALLEES.indexOf(_object.node.name) >= 0 && INVALID_METHODS.indexOf(_property.node.name) < 0) {
9296 context = global[_object.node.name];
9297 func = context[_property.node.name];
9298 }
9299
9300 if (_object.isLiteral() && _property.isIdentifier()) {
9301 var _type = (0, _typeof3.default)(_object.node.value);
9302 if (_type === "string" || _type === "number") {
9303 context = _object.node.value;
9304 func = context[_property.node.name];
9305 }
9306 }
9307 }
9308
9309 if (func) {
9310 var args = path.get("arguments").map(evaluate);
9311 if (!confident) return;
9312
9313 return func.apply(context, args);
9314 }
9315 }
9316
9317 deopt(path);
9318 }
9319}
9320}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
9321},{"babel-runtime/core-js/get-iterator":56,"babel-runtime/core-js/map":58,"babel-runtime/helpers/typeof":74}],85:[function(require,module,exports){
9322"use strict";
9323
9324exports.__esModule = true;
9325
9326var _create = require("babel-runtime/core-js/object/create");
9327
9328var _create2 = _interopRequireDefault(_create);
9329
9330var _getIterator2 = require("babel-runtime/core-js/get-iterator");
9331
9332var _getIterator3 = _interopRequireDefault(_getIterator2);
9333
9334exports.getStatementParent = getStatementParent;
9335exports.getOpposite = getOpposite;
9336exports.getCompletionRecords = getCompletionRecords;
9337exports.getSibling = getSibling;
9338exports.getPrevSibling = getPrevSibling;
9339exports.getNextSibling = getNextSibling;
9340exports.getAllNextSiblings = getAllNextSiblings;
9341exports.getAllPrevSiblings = getAllPrevSiblings;
9342exports.get = get;
9343exports._getKey = _getKey;
9344exports._getPattern = _getPattern;
9345exports.getBindingIdentifiers = getBindingIdentifiers;
9346exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers;
9347exports.getBindingIdentifierPaths = getBindingIdentifierPaths;
9348exports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths;
9349
9350var _index = require("./index");
9351
9352var _index2 = _interopRequireDefault(_index);
9353
9354var _babelTypes = require("babel-types");
9355
9356var t = _interopRequireWildcard(_babelTypes);
9357
9358function _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; } }
9359
9360function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9361
9362function getStatementParent() {
9363 var path = this;
9364
9365 do {
9366 if (!path.parentPath || Array.isArray(path.container) && path.isStatement()) {
9367 break;
9368 } else {
9369 path = path.parentPath;
9370 }
9371 } while (path);
9372
9373 if (path && (path.isProgram() || path.isFile())) {
9374 throw new Error("File/Program node, we can't possibly find a statement parent to this");
9375 }
9376
9377 return path;
9378}
9379
9380function getOpposite() {
9381 if (this.key === "left") {
9382 return this.getSibling("right");
9383 } else if (this.key === "right") {
9384 return this.getSibling("left");
9385 }
9386}
9387
9388function getCompletionRecords() {
9389 var paths = [];
9390
9391 var add = function add(path) {
9392 if (path) paths = paths.concat(path.getCompletionRecords());
9393 };
9394
9395 if (this.isIfStatement()) {
9396 add(this.get("consequent"));
9397 add(this.get("alternate"));
9398 } else if (this.isDoExpression() || this.isFor() || this.isWhile()) {
9399 add(this.get("body"));
9400 } else if (this.isProgram() || this.isBlockStatement()) {
9401 add(this.get("body").pop());
9402 } else if (this.isFunction()) {
9403 return this.get("body").getCompletionRecords();
9404 } else if (this.isTryStatement()) {
9405 add(this.get("block"));
9406 add(this.get("handler"));
9407 add(this.get("finalizer"));
9408 } else {
9409 paths.push(this);
9410 }
9411
9412 return paths;
9413}
9414
9415function getSibling(key) {
9416 return _index2.default.get({
9417 parentPath: this.parentPath,
9418 parent: this.parent,
9419 container: this.container,
9420 listKey: this.listKey,
9421 key: key
9422 });
9423}
9424
9425function getPrevSibling() {
9426 return this.getSibling(this.key - 1);
9427}
9428
9429function getNextSibling() {
9430 return this.getSibling(this.key + 1);
9431}
9432
9433function getAllNextSiblings() {
9434 var _key = this.key;
9435 var sibling = this.getSibling(++_key);
9436 var siblings = [];
9437 while (sibling.node) {
9438 siblings.push(sibling);
9439 sibling = this.getSibling(++_key);
9440 }
9441 return siblings;
9442}
9443
9444function getAllPrevSiblings() {
9445 var _key = this.key;
9446 var sibling = this.getSibling(--_key);
9447 var siblings = [];
9448 while (sibling.node) {
9449 siblings.push(sibling);
9450 sibling = this.getSibling(--_key);
9451 }
9452 return siblings;
9453}
9454
9455function get(key, context) {
9456 if (context === true) context = this.context;
9457 var parts = key.split(".");
9458 if (parts.length === 1) {
9459 return this._getKey(key, context);
9460 } else {
9461 return this._getPattern(parts, context);
9462 }
9463}
9464
9465function _getKey(key, context) {
9466 var _this = this;
9467
9468 var node = this.node;
9469 var container = node[key];
9470
9471 if (Array.isArray(container)) {
9472 return container.map(function (_, i) {
9473 return _index2.default.get({
9474 listKey: key,
9475 parentPath: _this,
9476 parent: node,
9477 container: container,
9478 key: i
9479 }).setContext(context);
9480 });
9481 } else {
9482 return _index2.default.get({
9483 parentPath: this,
9484 parent: node,
9485 container: node,
9486 key: key
9487 }).setContext(context);
9488 }
9489}
9490
9491function _getPattern(parts, context) {
9492 var path = this;
9493 for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
9494 var _ref;
9495
9496 if (_isArray) {
9497 if (_i >= _iterator.length) break;
9498 _ref = _iterator[_i++];
9499 } else {
9500 _i = _iterator.next();
9501 if (_i.done) break;
9502 _ref = _i.value;
9503 }
9504
9505 var part = _ref;
9506
9507 if (part === ".") {
9508 path = path.parentPath;
9509 } else {
9510 if (Array.isArray(path)) {
9511 path = path[part];
9512 } else {
9513 path = path.get(part, context);
9514 }
9515 }
9516 }
9517 return path;
9518}
9519
9520function getBindingIdentifiers(duplicates) {
9521 return t.getBindingIdentifiers(this.node, duplicates);
9522}
9523
9524function getOuterBindingIdentifiers(duplicates) {
9525 return t.getOuterBindingIdentifiers(this.node, duplicates);
9526}
9527
9528function getBindingIdentifierPaths() {
9529 var duplicates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
9530 var outerOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
9531
9532 var path = this;
9533 var search = [].concat(path);
9534 var ids = (0, _create2.default)(null);
9535
9536 while (search.length) {
9537 var id = search.shift();
9538 if (!id) continue;
9539 if (!id.node) continue;
9540
9541 var keys = t.getBindingIdentifiers.keys[id.node.type];
9542
9543 if (id.isIdentifier()) {
9544 if (duplicates) {
9545 var _ids = ids[id.node.name] = ids[id.node.name] || [];
9546 _ids.push(id);
9547 } else {
9548 ids[id.node.name] = id;
9549 }
9550 continue;
9551 }
9552
9553 if (id.isExportDeclaration()) {
9554 var declaration = id.get("declaration");
9555 if (declaration.isDeclaration()) {
9556 search.push(declaration);
9557 }
9558 continue;
9559 }
9560
9561 if (outerOnly) {
9562 if (id.isFunctionDeclaration()) {
9563 search.push(id.get("id"));
9564 continue;
9565 }
9566 if (id.isFunctionExpression()) {
9567 continue;
9568 }
9569 }
9570
9571 if (keys) {
9572 for (var i = 0; i < keys.length; i++) {
9573 var key = keys[i];
9574 var child = id.get(key);
9575 if (Array.isArray(child) || child.node) {
9576 search = search.concat(child);
9577 }
9578 }
9579 }
9580 }
9581
9582 return ids;
9583}
9584
9585function getOuterBindingIdentifierPaths(duplicates) {
9586 return this.getBindingIdentifierPaths(duplicates, true);
9587}
9588},{"./index":86,"babel-runtime/core-js/get-iterator":56,"babel-runtime/core-js/object/create":61,"babel-types":112}],86:[function(require,module,exports){
9589"use strict";
9590
9591exports.__esModule = true;
9592
9593var _getIterator2 = require("babel-runtime/core-js/get-iterator");
9594
9595var _getIterator3 = _interopRequireDefault(_getIterator2);
9596
9597var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
9598
9599var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
9600
9601var _virtualTypes = require("./lib/virtual-types");
9602
9603var virtualTypes = _interopRequireWildcard(_virtualTypes);
9604
9605var _debug2 = require("debug");
9606
9607var _debug3 = _interopRequireDefault(_debug2);
9608
9609var _invariant = require("invariant");
9610
9611var _invariant2 = _interopRequireDefault(_invariant);
9612
9613var _index = require("../index");
9614
9615var _index2 = _interopRequireDefault(_index);
9616
9617var _assign = require("lodash/assign");
9618
9619var _assign2 = _interopRequireDefault(_assign);
9620
9621var _scope = require("../scope");
9622
9623var _scope2 = _interopRequireDefault(_scope);
9624
9625var _babelTypes = require("babel-types");
9626
9627var t = _interopRequireWildcard(_babelTypes);
9628
9629var _cache = require("../cache");
9630
9631function _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; } }
9632
9633function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9634
9635var _debug = (0, _debug3.default)("babel");
9636
9637var NodePath = function () {
9638 function NodePath(hub, parent) {
9639 (0, _classCallCheck3.default)(this, NodePath);
9640
9641 this.parent = parent;
9642 this.hub = hub;
9643 this.contexts = [];
9644 this.data = {};
9645 this.shouldSkip = false;
9646 this.shouldStop = false;
9647 this.removed = false;
9648 this.state = null;
9649 this.opts = null;
9650 this.skipKeys = null;
9651 this.parentPath = null;
9652 this.context = null;
9653 this.container = null;
9654 this.listKey = null;
9655 this.inList = false;
9656 this.parentKey = null;
9657 this.key = null;
9658 this.node = null;
9659 this.scope = null;
9660 this.type = null;
9661 this.typeAnnotation = null;
9662 }
9663
9664 NodePath.get = function get(_ref) {
9665 var hub = _ref.hub,
9666 parentPath = _ref.parentPath,
9667 parent = _ref.parent,
9668 container = _ref.container,
9669 listKey = _ref.listKey,
9670 key = _ref.key;
9671
9672 if (!hub && parentPath) {
9673 hub = parentPath.hub;
9674 }
9675
9676 (0, _invariant2.default)(parent, "To get a node path the parent needs to exist");
9677
9678 var targetNode = container[key];
9679
9680 var paths = _cache.path.get(parent) || [];
9681 if (!_cache.path.has(parent)) {
9682 _cache.path.set(parent, paths);
9683 }
9684
9685 var path = void 0;
9686
9687 for (var i = 0; i < paths.length; i++) {
9688 var pathCheck = paths[i];
9689 if (pathCheck.node === targetNode) {
9690 path = pathCheck;
9691 break;
9692 }
9693 }
9694
9695 if (!path) {
9696 path = new NodePath(hub, parent);
9697 paths.push(path);
9698 }
9699
9700 path.setup(parentPath, container, listKey, key);
9701
9702 return path;
9703 };
9704
9705 NodePath.prototype.getScope = function getScope(scope) {
9706 var ourScope = scope;
9707
9708 if (this.isScope()) {
9709 ourScope = new _scope2.default(this, scope);
9710 }
9711
9712 return ourScope;
9713 };
9714
9715 NodePath.prototype.setData = function setData(key, val) {
9716 return this.data[key] = val;
9717 };
9718
9719 NodePath.prototype.getData = function getData(key, def) {
9720 var val = this.data[key];
9721 if (!val && def) val = this.data[key] = def;
9722 return val;
9723 };
9724
9725 NodePath.prototype.buildCodeFrameError = function buildCodeFrameError(msg) {
9726 var Error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SyntaxError;
9727
9728 return this.hub.file.buildCodeFrameError(this.node, msg, Error);
9729 };
9730
9731 NodePath.prototype.traverse = function traverse(visitor, state) {
9732 (0, _index2.default)(this.node, visitor, this.scope, state, this);
9733 };
9734
9735 NodePath.prototype.mark = function mark(type, message) {
9736 this.hub.file.metadata.marked.push({
9737 type: type,
9738 message: message,
9739 loc: this.node.loc
9740 });
9741 };
9742
9743 NodePath.prototype.set = function set(key, node) {
9744 t.validate(this.node, key, node);
9745 this.node[key] = node;
9746 };
9747
9748 NodePath.prototype.getPathLocation = function getPathLocation() {
9749 var parts = [];
9750 var path = this;
9751 do {
9752 var key = path.key;
9753 if (path.inList) key = path.listKey + "[" + key + "]";
9754 parts.unshift(key);
9755 } while (path = path.parentPath);
9756 return parts.join(".");
9757 };
9758
9759 NodePath.prototype.debug = function debug(buildMessage) {
9760 if (!_debug.enabled) return;
9761 _debug(this.getPathLocation() + " " + this.type + ": " + buildMessage());
9762 };
9763
9764 return NodePath;
9765}();
9766
9767exports.default = NodePath;
9768
9769
9770(0, _assign2.default)(NodePath.prototype, require("./ancestry"));
9771(0, _assign2.default)(NodePath.prototype, require("./inference"));
9772(0, _assign2.default)(NodePath.prototype, require("./replacement"));
9773(0, _assign2.default)(NodePath.prototype, require("./evaluation"));
9774(0, _assign2.default)(NodePath.prototype, require("./conversion"));
9775(0, _assign2.default)(NodePath.prototype, require("./introspection"));
9776(0, _assign2.default)(NodePath.prototype, require("./context"));
9777(0, _assign2.default)(NodePath.prototype, require("./removal"));
9778(0, _assign2.default)(NodePath.prototype, require("./modification"));
9779(0, _assign2.default)(NodePath.prototype, require("./family"));
9780(0, _assign2.default)(NodePath.prototype, require("./comments"));
9781
9782var _loop2 = function _loop2() {
9783 if (_isArray) {
9784 if (_i >= _iterator.length) return "break";
9785 _ref2 = _iterator[_i++];
9786 } else {
9787 _i = _iterator.next();
9788 if (_i.done) return "break";
9789 _ref2 = _i.value;
9790 }
9791
9792 var type = _ref2;
9793
9794 var typeKey = "is" + type;
9795 NodePath.prototype[typeKey] = function (opts) {
9796 return t[typeKey](this.node, opts);
9797 };
9798
9799 NodePath.prototype["assert" + type] = function (opts) {
9800 if (!this[typeKey](opts)) {
9801 throw new TypeError("Expected node path of type " + type);
9802 }
9803 };
9804};
9805
9806for (var _iterator = t.TYPES, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
9807 var _ref2;
9808
9809 var _ret2 = _loop2();
9810
9811 if (_ret2 === "break") break;
9812}
9813
9814var _loop = function _loop(type) {
9815 if (type[0] === "_") return "continue";
9816 if (t.TYPES.indexOf(type) < 0) t.TYPES.push(type);
9817
9818 var virtualType = virtualTypes[type];
9819
9820 NodePath.prototype["is" + type] = function (opts) {
9821 return virtualType.checkPath(this, opts);
9822 };
9823};
9824
9825for (var type in virtualTypes) {
9826 var _ret = _loop(type);
9827
9828 if (_ret === "continue") continue;
9829}
9830module.exports = exports["default"];
9831},{"../cache":76,"../index":79,"../scope":98,"./ancestry":80,"./comments":81,"./context":82,"./conversion":83,"./evaluation":84,"./family":85,"./inference":87,"./introspection":90,"./lib/virtual-types":93,"./modification":94,"./removal":95,"./replacement":96,"babel-runtime/core-js/get-iterator":56,"babel-runtime/helpers/classCallCheck":70,"babel-types":112,"debug":232,"invariant":245,"lodash/assign":414}],87:[function(require,module,exports){
9832"use strict";
9833
9834exports.__esModule = true;
9835
9836var _getIterator2 = require("babel-runtime/core-js/get-iterator");
9837
9838var _getIterator3 = _interopRequireDefault(_getIterator2);
9839
9840exports.getTypeAnnotation = getTypeAnnotation;
9841exports._getTypeAnnotation = _getTypeAnnotation;
9842exports.isBaseType = isBaseType;
9843exports.couldBeBaseType = couldBeBaseType;
9844exports.baseTypeStrictlyMatches = baseTypeStrictlyMatches;
9845exports.isGenericType = isGenericType;
9846
9847var _inferers = require("./inferers");
9848
9849var inferers = _interopRequireWildcard(_inferers);
9850
9851var _babelTypes = require("babel-types");
9852
9853var t = _interopRequireWildcard(_babelTypes);
9854
9855function _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; } }
9856
9857function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9858
9859function getTypeAnnotation() {
9860 if (this.typeAnnotation) return this.typeAnnotation;
9861
9862 var type = this._getTypeAnnotation() || t.anyTypeAnnotation();
9863 if (t.isTypeAnnotation(type)) type = type.typeAnnotation;
9864 return this.typeAnnotation = type;
9865}
9866
9867function _getTypeAnnotation() {
9868 var node = this.node;
9869
9870 if (!node) {
9871 if (this.key === "init" && this.parentPath.isVariableDeclarator()) {
9872 var declar = this.parentPath.parentPath;
9873 var declarParent = declar.parentPath;
9874
9875 if (declar.key === "left" && declarParent.isForInStatement()) {
9876 return t.stringTypeAnnotation();
9877 }
9878
9879 if (declar.key === "left" && declarParent.isForOfStatement()) {
9880 return t.anyTypeAnnotation();
9881 }
9882
9883 return t.voidTypeAnnotation();
9884 } else {
9885 return;
9886 }
9887 }
9888
9889 if (node.typeAnnotation) {
9890 return node.typeAnnotation;
9891 }
9892
9893 var inferer = inferers[node.type];
9894 if (inferer) {
9895 return inferer.call(this, node);
9896 }
9897
9898 inferer = inferers[this.parentPath.type];
9899 if (inferer && inferer.validParent) {
9900 return this.parentPath.getTypeAnnotation();
9901 }
9902}
9903
9904function isBaseType(baseName, soft) {
9905 return _isBaseType(baseName, this.getTypeAnnotation(), soft);
9906}
9907
9908function _isBaseType(baseName, type, soft) {
9909 if (baseName === "string") {
9910 return t.isStringTypeAnnotation(type);
9911 } else if (baseName === "number") {
9912 return t.isNumberTypeAnnotation(type);
9913 } else if (baseName === "boolean") {
9914 return t.isBooleanTypeAnnotation(type);
9915 } else if (baseName === "any") {
9916 return t.isAnyTypeAnnotation(type);
9917 } else if (baseName === "mixed") {
9918 return t.isMixedTypeAnnotation(type);
9919 } else if (baseName === "empty") {
9920 return t.isEmptyTypeAnnotation(type);
9921 } else if (baseName === "void") {
9922 return t.isVoidTypeAnnotation(type);
9923 } else {
9924 if (soft) {
9925 return false;
9926 } else {
9927 throw new Error("Unknown base type " + baseName);
9928 }
9929 }
9930}
9931
9932function couldBeBaseType(name) {
9933 var type = this.getTypeAnnotation();
9934 if (t.isAnyTypeAnnotation(type)) return true;
9935
9936 if (t.isUnionTypeAnnotation(type)) {
9937 for (var _iterator = type.types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
9938 var _ref;
9939
9940 if (_isArray) {
9941 if (_i >= _iterator.length) break;
9942 _ref = _iterator[_i++];
9943 } else {
9944 _i = _iterator.next();
9945 if (_i.done) break;
9946 _ref = _i.value;
9947 }
9948
9949 var type2 = _ref;
9950
9951 if (t.isAnyTypeAnnotation(type2) || _isBaseType(name, type2, true)) {
9952 return true;
9953 }
9954 }
9955 return false;
9956 } else {
9957 return _isBaseType(name, type, true);
9958 }
9959}
9960
9961function baseTypeStrictlyMatches(right) {
9962 var left = this.getTypeAnnotation();
9963 right = right.getTypeAnnotation();
9964
9965 if (!t.isAnyTypeAnnotation(left) && t.isFlowBaseAnnotation(left)) {
9966 return right.type === left.type;
9967 }
9968}
9969
9970function isGenericType(genericName) {
9971 var type = this.getTypeAnnotation();
9972 return t.isGenericTypeAnnotation(type) && t.isIdentifier(type.id, { name: genericName });
9973}
9974},{"./inferers":89,"babel-runtime/core-js/get-iterator":56,"babel-types":112}],88:[function(require,module,exports){
9975"use strict";
9976
9977exports.__esModule = true;
9978
9979var _getIterator2 = require("babel-runtime/core-js/get-iterator");
9980
9981var _getIterator3 = _interopRequireDefault(_getIterator2);
9982
9983exports.default = function (node) {
9984 if (!this.isReferenced()) return;
9985
9986 var binding = this.scope.getBinding(node.name);
9987 if (binding) {
9988 if (binding.identifier.typeAnnotation) {
9989 return binding.identifier.typeAnnotation;
9990 } else {
9991 return getTypeAnnotationBindingConstantViolations(this, node.name);
9992 }
9993 }
9994
9995 if (node.name === "undefined") {
9996 return t.voidTypeAnnotation();
9997 } else if (node.name === "NaN" || node.name === "Infinity") {
9998 return t.numberTypeAnnotation();
9999 } else if (node.name === "arguments") {}
10000};
10001
10002var _babelTypes = require("babel-types");
10003
10004var t = _interopRequireWildcard(_babelTypes);
10005
10006function _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; } }
10007
10008function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10009
10010function getTypeAnnotationBindingConstantViolations(path, name) {
10011 var binding = path.scope.getBinding(name);
10012
10013 var types = [];
10014 path.typeAnnotation = t.unionTypeAnnotation(types);
10015
10016 var functionConstantViolations = [];
10017 var constantViolations = getConstantViolationsBefore(binding, path, functionConstantViolations);
10018
10019 var testType = getConditionalAnnotation(path, name);
10020 if (testType) {
10021 (function () {
10022 var testConstantViolations = getConstantViolationsBefore(binding, testType.ifStatement);
10023
10024 constantViolations = constantViolations.filter(function (path) {
10025 return testConstantViolations.indexOf(path) < 0;
10026 });
10027
10028 types.push(testType.typeAnnotation);
10029 })();
10030 }
10031
10032 if (constantViolations.length) {
10033 constantViolations = constantViolations.concat(functionConstantViolations);
10034
10035 for (var _iterator = constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
10036 var _ref;
10037
10038 if (_isArray) {
10039 if (_i >= _iterator.length) break;
10040 _ref = _iterator[_i++];
10041 } else {
10042 _i = _iterator.next();
10043 if (_i.done) break;
10044 _ref = _i.value;
10045 }
10046
10047 var violation = _ref;
10048
10049 types.push(violation.getTypeAnnotation());
10050 }
10051 }
10052
10053 if (types.length) {
10054 return t.createUnionTypeAnnotation(types);
10055 }
10056}
10057
10058function getConstantViolationsBefore(binding, path, functions) {
10059 var violations = binding.constantViolations.slice();
10060 violations.unshift(binding.path);
10061 return violations.filter(function (violation) {
10062 violation = violation.resolve();
10063 var status = violation._guessExecutionStatusRelativeTo(path);
10064 if (functions && status === "function") functions.push(violation);
10065 return status === "before";
10066 });
10067}
10068
10069function inferAnnotationFromBinaryExpression(name, path) {
10070 var operator = path.node.operator;
10071
10072 var right = path.get("right").resolve();
10073 var left = path.get("left").resolve();
10074
10075 var target = void 0;
10076 if (left.isIdentifier({ name: name })) {
10077 target = right;
10078 } else if (right.isIdentifier({ name: name })) {
10079 target = left;
10080 }
10081 if (target) {
10082 if (operator === "===") {
10083 return target.getTypeAnnotation();
10084 } else if (t.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {
10085 return t.numberTypeAnnotation();
10086 } else {
10087 return;
10088 }
10089 } else {
10090 if (operator !== "===") return;
10091 }
10092
10093 var typeofPath = void 0;
10094 var typePath = void 0;
10095 if (left.isUnaryExpression({ operator: "typeof" })) {
10096 typeofPath = left;
10097 typePath = right;
10098 } else if (right.isUnaryExpression({ operator: "typeof" })) {
10099 typeofPath = right;
10100 typePath = left;
10101 }
10102 if (!typePath && !typeofPath) return;
10103
10104 typePath = typePath.resolve();
10105 if (!typePath.isLiteral()) return;
10106
10107 var typeValue = typePath.node.value;
10108 if (typeof typeValue !== "string") return;
10109
10110 if (!typeofPath.get("argument").isIdentifier({ name: name })) return;
10111
10112 return t.createTypeAnnotationBasedOnTypeof(typePath.node.value);
10113}
10114
10115function getParentConditionalPath(path) {
10116 var parentPath = void 0;
10117 while (parentPath = path.parentPath) {
10118 if (parentPath.isIfStatement() || parentPath.isConditionalExpression()) {
10119 if (path.key === "test") {
10120 return;
10121 } else {
10122 return parentPath;
10123 }
10124 } else {
10125 path = parentPath;
10126 }
10127 }
10128}
10129
10130function getConditionalAnnotation(path, name) {
10131 var ifStatement = getParentConditionalPath(path);
10132 if (!ifStatement) return;
10133
10134 var test = ifStatement.get("test");
10135 var paths = [test];
10136 var types = [];
10137
10138 do {
10139 var _path = paths.shift().resolve();
10140
10141 if (_path.isLogicalExpression()) {
10142 paths.push(_path.get("left"));
10143 paths.push(_path.get("right"));
10144 }
10145
10146 if (_path.isBinaryExpression()) {
10147 var type = inferAnnotationFromBinaryExpression(name, _path);
10148 if (type) types.push(type);
10149 }
10150 } while (paths.length);
10151
10152 if (types.length) {
10153 return {
10154 typeAnnotation: t.createUnionTypeAnnotation(types),
10155 ifStatement: ifStatement
10156 };
10157 } else {
10158 return getConditionalAnnotation(ifStatement, name);
10159 }
10160}
10161module.exports = exports["default"];
10162},{"babel-runtime/core-js/get-iterator":56,"babel-types":112}],89:[function(require,module,exports){
10163"use strict";
10164
10165exports.__esModule = true;
10166exports.ClassDeclaration = exports.ClassExpression = exports.FunctionDeclaration = exports.ArrowFunctionExpression = exports.FunctionExpression = exports.Identifier = undefined;
10167
10168var _infererReference = require("./inferer-reference");
10169
10170Object.defineProperty(exports, "Identifier", {
10171 enumerable: true,
10172 get: function get() {
10173 return _interopRequireDefault(_infererReference).default;
10174 }
10175});
10176exports.VariableDeclarator = VariableDeclarator;
10177exports.TypeCastExpression = TypeCastExpression;
10178exports.NewExpression = NewExpression;
10179exports.TemplateLiteral = TemplateLiteral;
10180exports.UnaryExpression = UnaryExpression;
10181exports.BinaryExpression = BinaryExpression;
10182exports.LogicalExpression = LogicalExpression;
10183exports.ConditionalExpression = ConditionalExpression;
10184exports.SequenceExpression = SequenceExpression;
10185exports.AssignmentExpression = AssignmentExpression;
10186exports.UpdateExpression = UpdateExpression;
10187exports.StringLiteral = StringLiteral;
10188exports.NumericLiteral = NumericLiteral;
10189exports.BooleanLiteral = BooleanLiteral;
10190exports.NullLiteral = NullLiteral;
10191exports.RegExpLiteral = RegExpLiteral;
10192exports.ObjectExpression = ObjectExpression;
10193exports.ArrayExpression = ArrayExpression;
10194exports.RestElement = RestElement;
10195exports.CallExpression = CallExpression;
10196exports.TaggedTemplateExpression = TaggedTemplateExpression;
10197
10198var _babelTypes = require("babel-types");
10199
10200var t = _interopRequireWildcard(_babelTypes);
10201
10202function _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; } }
10203
10204function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10205
10206function VariableDeclarator() {
10207 var id = this.get("id");
10208
10209 if (id.isIdentifier()) {
10210 return this.get("init").getTypeAnnotation();
10211 } else {
10212 return;
10213 }
10214}
10215
10216function TypeCastExpression(node) {
10217 return node.typeAnnotation;
10218}
10219
10220TypeCastExpression.validParent = true;
10221
10222function NewExpression(node) {
10223 if (this.get("callee").isIdentifier()) {
10224 return t.genericTypeAnnotation(node.callee);
10225 }
10226}
10227
10228function TemplateLiteral() {
10229 return t.stringTypeAnnotation();
10230}
10231
10232function UnaryExpression(node) {
10233 var operator = node.operator;
10234
10235 if (operator === "void") {
10236 return t.voidTypeAnnotation();
10237 } else if (t.NUMBER_UNARY_OPERATORS.indexOf(operator) >= 0) {
10238 return t.numberTypeAnnotation();
10239 } else if (t.STRING_UNARY_OPERATORS.indexOf(operator) >= 0) {
10240 return t.stringTypeAnnotation();
10241 } else if (t.BOOLEAN_UNARY_OPERATORS.indexOf(operator) >= 0) {
10242 return t.booleanTypeAnnotation();
10243 }
10244}
10245
10246function BinaryExpression(node) {
10247 var operator = node.operator;
10248
10249 if (t.NUMBER_BINARY_OPERATORS.indexOf(operator) >= 0) {
10250 return t.numberTypeAnnotation();
10251 } else if (t.BOOLEAN_BINARY_OPERATORS.indexOf(operator) >= 0) {
10252 return t.booleanTypeAnnotation();
10253 } else if (operator === "+") {
10254 var right = this.get("right");
10255 var left = this.get("left");
10256
10257 if (left.isBaseType("number") && right.isBaseType("number")) {
10258 return t.numberTypeAnnotation();
10259 } else if (left.isBaseType("string") || right.isBaseType("string")) {
10260 return t.stringTypeAnnotation();
10261 }
10262
10263 return t.unionTypeAnnotation([t.stringTypeAnnotation(), t.numberTypeAnnotation()]);
10264 }
10265}
10266
10267function LogicalExpression() {
10268 return t.createUnionTypeAnnotation([this.get("left").getTypeAnnotation(), this.get("right").getTypeAnnotation()]);
10269}
10270
10271function ConditionalExpression() {
10272 return t.createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(), this.get("alternate").getTypeAnnotation()]);
10273}
10274
10275function SequenceExpression() {
10276 return this.get("expressions").pop().getTypeAnnotation();
10277}
10278
10279function AssignmentExpression() {
10280 return this.get("right").getTypeAnnotation();
10281}
10282
10283function UpdateExpression(node) {
10284 var operator = node.operator;
10285 if (operator === "++" || operator === "--") {
10286 return t.numberTypeAnnotation();
10287 }
10288}
10289
10290function StringLiteral() {
10291 return t.stringTypeAnnotation();
10292}
10293
10294function NumericLiteral() {
10295 return t.numberTypeAnnotation();
10296}
10297
10298function BooleanLiteral() {
10299 return t.booleanTypeAnnotation();
10300}
10301
10302function NullLiteral() {
10303 return t.nullLiteralTypeAnnotation();
10304}
10305
10306function RegExpLiteral() {
10307 return t.genericTypeAnnotation(t.identifier("RegExp"));
10308}
10309
10310function ObjectExpression() {
10311 return t.genericTypeAnnotation(t.identifier("Object"));
10312}
10313
10314function ArrayExpression() {
10315 return t.genericTypeAnnotation(t.identifier("Array"));
10316}
10317
10318function RestElement() {
10319 return ArrayExpression();
10320}
10321
10322RestElement.validParent = true;
10323
10324function Func() {
10325 return t.genericTypeAnnotation(t.identifier("Function"));
10326}
10327
10328exports.FunctionExpression = Func;
10329exports.ArrowFunctionExpression = Func;
10330exports.FunctionDeclaration = Func;
10331exports.ClassExpression = Func;
10332exports.ClassDeclaration = Func;
10333function CallExpression() {
10334 return resolveCall(this.get("callee"));
10335}
10336
10337function TaggedTemplateExpression() {
10338 return resolveCall(this.get("tag"));
10339}
10340
10341function resolveCall(callee) {
10342 callee = callee.resolve();
10343
10344 if (callee.isFunction()) {
10345 if (callee.is("async")) {
10346 if (callee.is("generator")) {
10347 return t.genericTypeAnnotation(t.identifier("AsyncIterator"));
10348 } else {
10349 return t.genericTypeAnnotation(t.identifier("Promise"));
10350 }
10351 } else {
10352 if (callee.node.returnType) {
10353 return callee.node.returnType;
10354 } else {}
10355 }
10356 }
10357}
10358},{"./inferer-reference":88,"babel-types":112}],90:[function(require,module,exports){
10359"use strict";
10360
10361exports.__esModule = true;
10362exports.is = undefined;
10363
10364var _typeof2 = require("babel-runtime/helpers/typeof");
10365
10366var _typeof3 = _interopRequireDefault(_typeof2);
10367
10368var _getIterator2 = require("babel-runtime/core-js/get-iterator");
10369
10370var _getIterator3 = _interopRequireDefault(_getIterator2);
10371
10372exports.matchesPattern = matchesPattern;
10373exports.has = has;
10374exports.isStatic = isStatic;
10375exports.isnt = isnt;
10376exports.equals = equals;
10377exports.isNodeType = isNodeType;
10378exports.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression;
10379exports.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement;
10380exports.isCompletionRecord = isCompletionRecord;
10381exports.isStatementOrBlock = isStatementOrBlock;
10382exports.referencesImport = referencesImport;
10383exports.getSource = getSource;
10384exports.willIMaybeExecuteBefore = willIMaybeExecuteBefore;
10385exports._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo;
10386exports._guessExecutionStatusRelativeToDifferentFunctions = _guessExecutionStatusRelativeToDifferentFunctions;
10387exports.resolve = resolve;
10388exports._resolve = _resolve;
10389
10390var _includes = require("lodash/includes");
10391
10392var _includes2 = _interopRequireDefault(_includes);
10393
10394var _babelTypes = require("babel-types");
10395
10396var t = _interopRequireWildcard(_babelTypes);
10397
10398function _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; } }
10399
10400function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10401
10402function matchesPattern(pattern, allowPartial) {
10403 if (!this.isMemberExpression()) return false;
10404
10405 var parts = pattern.split(".");
10406 var search = [this.node];
10407 var i = 0;
10408
10409 function matches(name) {
10410 var part = parts[i];
10411 return part === "*" || name === part;
10412 }
10413
10414 while (search.length) {
10415 var node = search.shift();
10416
10417 if (allowPartial && i === parts.length) {
10418 return true;
10419 }
10420
10421 if (t.isIdentifier(node)) {
10422 if (!matches(node.name)) return false;
10423 } else if (t.isLiteral(node)) {
10424 if (!matches(node.value)) return false;
10425 } else if (t.isMemberExpression(node)) {
10426 if (node.computed && !t.isLiteral(node.property)) {
10427 return false;
10428 } else {
10429 search.unshift(node.property);
10430 search.unshift(node.object);
10431 continue;
10432 }
10433 } else if (t.isThisExpression(node)) {
10434 if (!matches("this")) return false;
10435 } else {
10436 return false;
10437 }
10438
10439 if (++i > parts.length) {
10440 return false;
10441 }
10442 }
10443
10444 return i === parts.length;
10445}
10446
10447function has(key) {
10448 var val = this.node && this.node[key];
10449 if (val && Array.isArray(val)) {
10450 return !!val.length;
10451 } else {
10452 return !!val;
10453 }
10454}
10455
10456function isStatic() {
10457 return this.scope.isStatic(this.node);
10458}
10459
10460var is = exports.is = has;
10461
10462function isnt(key) {
10463 return !this.has(key);
10464}
10465
10466function equals(key, value) {
10467 return this.node[key] === value;
10468}
10469
10470function isNodeType(type) {
10471 return t.isType(this.type, type);
10472}
10473
10474function canHaveVariableDeclarationOrExpression() {
10475 return (this.key === "init" || this.key === "left") && this.parentPath.isFor();
10476}
10477
10478function canSwapBetweenExpressionAndStatement(replacement) {
10479 if (this.key !== "body" || !this.parentPath.isArrowFunctionExpression()) {
10480 return false;
10481 }
10482
10483 if (this.isExpression()) {
10484 return t.isBlockStatement(replacement);
10485 } else if (this.isBlockStatement()) {
10486 return t.isExpression(replacement);
10487 }
10488
10489 return false;
10490}
10491
10492function isCompletionRecord(allowInsideFunction) {
10493 var path = this;
10494 var first = true;
10495
10496 do {
10497 var container = path.container;
10498
10499 if (path.isFunction() && !first) {
10500 return !!allowInsideFunction;
10501 }
10502
10503 first = false;
10504
10505 if (Array.isArray(container) && path.key !== container.length - 1) {
10506 return false;
10507 }
10508 } while ((path = path.parentPath) && !path.isProgram());
10509
10510 return true;
10511}
10512
10513function isStatementOrBlock() {
10514 if (this.parentPath.isLabeledStatement() || t.isBlockStatement(this.container)) {
10515 return false;
10516 } else {
10517 return (0, _includes2.default)(t.STATEMENT_OR_BLOCK_KEYS, this.key);
10518 }
10519}
10520
10521function referencesImport(moduleSource, importName) {
10522 if (!this.isReferencedIdentifier()) return false;
10523
10524 var binding = this.scope.getBinding(this.node.name);
10525 if (!binding || binding.kind !== "module") return false;
10526
10527 var path = binding.path;
10528 var parent = path.parentPath;
10529 if (!parent.isImportDeclaration()) return false;
10530
10531 if (parent.node.source.value === moduleSource) {
10532 if (!importName) return true;
10533 } else {
10534 return false;
10535 }
10536
10537 if (path.isImportDefaultSpecifier() && importName === "default") {
10538 return true;
10539 }
10540
10541 if (path.isImportNamespaceSpecifier() && importName === "*") {
10542 return true;
10543 }
10544
10545 if (path.isImportSpecifier() && path.node.imported.name === importName) {
10546 return true;
10547 }
10548
10549 return false;
10550}
10551
10552function getSource() {
10553 var node = this.node;
10554 if (node.end) {
10555 return this.hub.file.code.slice(node.start, node.end);
10556 } else {
10557 return "";
10558 }
10559}
10560
10561function willIMaybeExecuteBefore(target) {
10562 return this._guessExecutionStatusRelativeTo(target) !== "after";
10563}
10564
10565function _guessExecutionStatusRelativeTo(target) {
10566 var targetFuncParent = target.scope.getFunctionParent();
10567 var selfFuncParent = this.scope.getFunctionParent();
10568
10569 if (targetFuncParent.node !== selfFuncParent.node) {
10570 var status = this._guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent);
10571 if (status) {
10572 return status;
10573 } else {
10574 target = targetFuncParent.path;
10575 }
10576 }
10577
10578 var targetPaths = target.getAncestry();
10579 if (targetPaths.indexOf(this) >= 0) return "after";
10580
10581 var selfPaths = this.getAncestry();
10582
10583 var commonPath = void 0;
10584 var targetIndex = void 0;
10585 var selfIndex = void 0;
10586 for (selfIndex = 0; selfIndex < selfPaths.length; selfIndex++) {
10587 var selfPath = selfPaths[selfIndex];
10588 targetIndex = targetPaths.indexOf(selfPath);
10589 if (targetIndex >= 0) {
10590 commonPath = selfPath;
10591 break;
10592 }
10593 }
10594 if (!commonPath) {
10595 return "before";
10596 }
10597
10598 var targetRelationship = targetPaths[targetIndex - 1];
10599 var selfRelationship = selfPaths[selfIndex - 1];
10600 if (!targetRelationship || !selfRelationship) {
10601 return "before";
10602 }
10603
10604 if (targetRelationship.listKey && targetRelationship.container === selfRelationship.container) {
10605 return targetRelationship.key > selfRelationship.key ? "before" : "after";
10606 }
10607
10608 var targetKeyPosition = t.VISITOR_KEYS[targetRelationship.type].indexOf(targetRelationship.key);
10609 var selfKeyPosition = t.VISITOR_KEYS[selfRelationship.type].indexOf(selfRelationship.key);
10610 return targetKeyPosition > selfKeyPosition ? "before" : "after";
10611}
10612
10613function _guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent) {
10614 var targetFuncPath = targetFuncParent.path;
10615 if (!targetFuncPath.isFunctionDeclaration()) return;
10616
10617 var binding = targetFuncPath.scope.getBinding(targetFuncPath.node.id.name);
10618
10619 if (!binding.references) return "before";
10620
10621 var referencePaths = binding.referencePaths;
10622
10623 for (var _iterator = referencePaths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
10624 var _ref;
10625
10626 if (_isArray) {
10627 if (_i >= _iterator.length) break;
10628 _ref = _iterator[_i++];
10629 } else {
10630 _i = _iterator.next();
10631 if (_i.done) break;
10632 _ref = _i.value;
10633 }
10634
10635 var path = _ref;
10636
10637 if (path.key !== "callee" || !path.parentPath.isCallExpression()) {
10638 return;
10639 }
10640 }
10641
10642 var allStatus = void 0;
10643
10644 for (var _iterator2 = referencePaths, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
10645 var _ref2;
10646
10647 if (_isArray2) {
10648 if (_i2 >= _iterator2.length) break;
10649 _ref2 = _iterator2[_i2++];
10650 } else {
10651 _i2 = _iterator2.next();
10652 if (_i2.done) break;
10653 _ref2 = _i2.value;
10654 }
10655
10656 var _path = _ref2;
10657
10658 var childOfFunction = !!_path.find(function (path) {
10659 return path.node === targetFuncPath.node;
10660 });
10661 if (childOfFunction) continue;
10662
10663 var status = this._guessExecutionStatusRelativeTo(_path);
10664
10665 if (allStatus) {
10666 if (allStatus !== status) return;
10667 } else {
10668 allStatus = status;
10669 }
10670 }
10671
10672 return allStatus;
10673}
10674
10675function resolve(dangerous, resolved) {
10676 return this._resolve(dangerous, resolved) || this;
10677}
10678
10679function _resolve(dangerous, resolved) {
10680 var _this = this;
10681
10682 if (resolved && resolved.indexOf(this) >= 0) return;
10683
10684 resolved = resolved || [];
10685 resolved.push(this);
10686
10687 if (this.isVariableDeclarator()) {
10688 if (this.get("id").isIdentifier()) {
10689 return this.get("init").resolve(dangerous, resolved);
10690 } else {}
10691 } else if (this.isReferencedIdentifier()) {
10692 var binding = this.scope.getBinding(this.node.name);
10693 if (!binding) return;
10694
10695 if (!binding.constant) return;
10696
10697 if (binding.kind === "module") return;
10698
10699 if (binding.path !== this) {
10700 var _ret = function () {
10701 var ret = binding.path.resolve(dangerous, resolved);
10702
10703 if (_this.find(function (parent) {
10704 return parent.node === ret.node;
10705 })) return {
10706 v: void 0
10707 };
10708 return {
10709 v: ret
10710 };
10711 }();
10712
10713 if ((typeof _ret === "undefined" ? "undefined" : (0, _typeof3.default)(_ret)) === "object") return _ret.v;
10714 }
10715 } else if (this.isTypeCastExpression()) {
10716 return this.get("expression").resolve(dangerous, resolved);
10717 } else if (dangerous && this.isMemberExpression()) {
10718
10719 var targetKey = this.toComputedKey();
10720 if (!t.isLiteral(targetKey)) return;
10721
10722 var targetName = targetKey.value;
10723
10724 var target = this.get("object").resolve(dangerous, resolved);
10725
10726 if (target.isObjectExpression()) {
10727 var props = target.get("properties");
10728 for (var _iterator3 = props, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
10729 var _ref3;
10730
10731 if (_isArray3) {
10732 if (_i3 >= _iterator3.length) break;
10733 _ref3 = _iterator3[_i3++];
10734 } else {
10735 _i3 = _iterator3.next();
10736 if (_i3.done) break;
10737 _ref3 = _i3.value;
10738 }
10739
10740 var prop = _ref3;
10741
10742 if (!prop.isProperty()) continue;
10743
10744 var key = prop.get("key");
10745
10746 var match = prop.isnt("computed") && key.isIdentifier({ name: targetName });
10747
10748 match = match || key.isLiteral({ value: targetName });
10749
10750 if (match) return prop.get("value").resolve(dangerous, resolved);
10751 }
10752 } else if (target.isArrayExpression() && !isNaN(+targetName)) {
10753 var elems = target.get("elements");
10754 var elem = elems[targetName];
10755 if (elem) return elem.resolve(dangerous, resolved);
10756 }
10757 }
10758}
10759},{"babel-runtime/core-js/get-iterator":56,"babel-runtime/helpers/typeof":74,"babel-types":112,"lodash/includes":431}],91:[function(require,module,exports){
10760"use strict";
10761
10762exports.__esModule = true;
10763
10764var _getIterator2 = require("babel-runtime/core-js/get-iterator");
10765
10766var _getIterator3 = _interopRequireDefault(_getIterator2);
10767
10768var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
10769
10770var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
10771
10772var _babelTypes = require("babel-types");
10773
10774var t = _interopRequireWildcard(_babelTypes);
10775
10776function _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; } }
10777
10778function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10779
10780var referenceVisitor = {
10781 ReferencedIdentifier: function ReferencedIdentifier(path, state) {
10782 if (path.isJSXIdentifier() && _babelTypes.react.isCompatTag(path.node.name) && !path.parentPath.isJSXMemberExpression()) {
10783 return;
10784 }
10785
10786 if (path.node.name === "this") {
10787 var scope = path.scope;
10788 do {
10789 if (scope.path.isFunction() && !scope.path.isArrowFunctionExpression()) break;
10790 } while (scope = scope.parent);
10791 if (scope) state.breakOnScopePaths.push(scope.path);
10792 }
10793
10794 var binding = path.scope.getBinding(path.node.name);
10795 if (!binding) return;
10796
10797 if (binding !== state.scope.getBinding(path.node.name)) return;
10798
10799 state.bindings[path.node.name] = binding;
10800 }
10801};
10802
10803var PathHoister = function () {
10804 function PathHoister(path, scope) {
10805 (0, _classCallCheck3.default)(this, PathHoister);
10806
10807 this.breakOnScopePaths = [];
10808
10809 this.bindings = {};
10810
10811 this.scopes = [];
10812
10813 this.scope = scope;
10814 this.path = path;
10815
10816 this.attachAfter = false;
10817 }
10818
10819 PathHoister.prototype.isCompatibleScope = function isCompatibleScope(scope) {
10820 for (var key in this.bindings) {
10821 var binding = this.bindings[key];
10822 if (!scope.bindingIdentifierEquals(key, binding.identifier)) {
10823 return false;
10824 }
10825 }
10826
10827 return true;
10828 };
10829
10830 PathHoister.prototype.getCompatibleScopes = function getCompatibleScopes() {
10831 var scope = this.path.scope;
10832 do {
10833 if (this.isCompatibleScope(scope)) {
10834 this.scopes.push(scope);
10835 } else {
10836 break;
10837 }
10838
10839 if (this.breakOnScopePaths.indexOf(scope.path) >= 0) {
10840 break;
10841 }
10842 } while (scope = scope.parent);
10843 };
10844
10845 PathHoister.prototype.getAttachmentPath = function getAttachmentPath() {
10846 var path = this._getAttachmentPath();
10847 if (!path) return;
10848
10849 var targetScope = path.scope;
10850
10851 if (targetScope.path === path) {
10852 targetScope = path.scope.parent;
10853 }
10854
10855 if (targetScope.path.isProgram() || targetScope.path.isFunction()) {
10856 for (var name in this.bindings) {
10857 if (!targetScope.hasOwnBinding(name)) continue;
10858
10859 var binding = this.bindings[name];
10860
10861 if (binding.kind === "param") continue;
10862
10863 if (this.getAttachmentParentForPath(binding.path).key > path.key) {
10864 this.attachAfter = true;
10865 path = binding.path;
10866
10867 for (var _iterator = binding.constantViolations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
10868 var _ref;
10869
10870 if (_isArray) {
10871 if (_i >= _iterator.length) break;
10872 _ref = _iterator[_i++];
10873 } else {
10874 _i = _iterator.next();
10875 if (_i.done) break;
10876 _ref = _i.value;
10877 }
10878
10879 var violationPath = _ref;
10880
10881 if (this.getAttachmentParentForPath(violationPath).key > path.key) {
10882 path = violationPath;
10883 }
10884 }
10885 }
10886 }
10887 }
10888
10889 return path;
10890 };
10891
10892 PathHoister.prototype._getAttachmentPath = function _getAttachmentPath() {
10893 var scopes = this.scopes;
10894
10895 var scope = scopes.pop();
10896
10897 if (!scope) return;
10898
10899 if (scope.path.isFunction()) {
10900 if (this.hasOwnParamBindings(scope)) {
10901 if (this.scope === scope) return;
10902
10903 return scope.path.get("body").get("body")[0];
10904 } else {
10905 return this.getNextScopeAttachmentParent();
10906 }
10907 } else if (scope.path.isProgram()) {
10908 return this.getNextScopeAttachmentParent();
10909 }
10910 };
10911
10912 PathHoister.prototype.getNextScopeAttachmentParent = function getNextScopeAttachmentParent() {
10913 var scope = this.scopes.pop();
10914 if (scope) return this.getAttachmentParentForPath(scope.path);
10915 };
10916
10917 PathHoister.prototype.getAttachmentParentForPath = function getAttachmentParentForPath(path) {
10918 do {
10919 if (!path.parentPath || Array.isArray(path.container) && path.isStatement() || path.isVariableDeclarator() && path.parentPath.node !== null && path.parentPath.node.declarations.length > 1) return path;
10920 } while (path = path.parentPath);
10921 };
10922
10923 PathHoister.prototype.hasOwnParamBindings = function hasOwnParamBindings(scope) {
10924 for (var name in this.bindings) {
10925 if (!scope.hasOwnBinding(name)) continue;
10926
10927 var binding = this.bindings[name];
10928
10929 if (binding.kind === "param" && binding.constant) return true;
10930 }
10931 return false;
10932 };
10933
10934 PathHoister.prototype.run = function run() {
10935 var node = this.path.node;
10936 if (node._hoisted) return;
10937 node._hoisted = true;
10938
10939 this.path.traverse(referenceVisitor, this);
10940
10941 this.getCompatibleScopes();
10942
10943 var attachTo = this.getAttachmentPath();
10944 if (!attachTo) return;
10945
10946 if (attachTo.getFunctionParent() === this.path.getFunctionParent()) return;
10947
10948 var uid = attachTo.scope.generateUidIdentifier("ref");
10949 var declarator = t.variableDeclarator(uid, this.path.node);
10950
10951 var insertFn = this.attachAfter ? "insertAfter" : "insertBefore";
10952 attachTo[insertFn]([attachTo.isVariableDeclarator() ? declarator : t.variableDeclaration("var", [declarator])]);
10953
10954 var parent = this.path.parentPath;
10955 if (parent.isJSXElement() && this.path.container === parent.node.children) {
10956 uid = t.JSXExpressionContainer(uid);
10957 }
10958
10959 this.path.replaceWith(uid);
10960 };
10961
10962 return PathHoister;
10963}();
10964
10965exports.default = PathHoister;
10966module.exports = exports["default"];
10967},{"babel-runtime/core-js/get-iterator":56,"babel-runtime/helpers/classCallCheck":70,"babel-types":112}],92:[function(require,module,exports){
10968"use strict";
10969
10970exports.__esModule = true;
10971var hooks = exports.hooks = [function (self, parent) {
10972 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();
10973
10974 if (removeParent) {
10975 parent.remove();
10976 return true;
10977 }
10978}, function (self, parent) {
10979 if (parent.isSequenceExpression() && parent.node.expressions.length === 1) {
10980 parent.replaceWith(parent.node.expressions[0]);
10981 return true;
10982 }
10983}, function (self, parent) {
10984 if (parent.isBinary()) {
10985 if (self.key === "left") {
10986 parent.replaceWith(parent.node.right);
10987 } else {
10988 parent.replaceWith(parent.node.left);
10989 }
10990 return true;
10991 }
10992}, function (self, parent) {
10993 if (parent.isIfStatement() && (self.key === "consequent" || self.key === "alternate") || self.key === "body" && (parent.isLoop() || parent.isArrowFunctionExpression())) {
10994 self.replaceWith({
10995 type: "BlockStatement",
10996 body: []
10997 });
10998 return true;
10999 }
11000}];
11001},{}],93:[function(require,module,exports){
11002"use strict";
11003
11004exports.__esModule = true;
11005exports.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;
11006
11007var _babelTypes = require("babel-types");
11008
11009var t = _interopRequireWildcard(_babelTypes);
11010
11011function _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; } }
11012
11013var ReferencedIdentifier = exports.ReferencedIdentifier = {
11014 types: ["Identifier", "JSXIdentifier"],
11015 checkPath: function checkPath(_ref, opts) {
11016 var node = _ref.node,
11017 parent = _ref.parent;
11018
11019 if (!t.isIdentifier(node, opts) && !t.isJSXMemberExpression(parent, opts)) {
11020 if (t.isJSXIdentifier(node, opts)) {
11021 if (_babelTypes.react.isCompatTag(node.name)) return false;
11022 } else {
11023 return false;
11024 }
11025 }
11026
11027 return t.isReferenced(node, parent);
11028 }
11029};
11030
11031var ReferencedMemberExpression = exports.ReferencedMemberExpression = {
11032 types: ["MemberExpression"],
11033 checkPath: function checkPath(_ref2) {
11034 var node = _ref2.node,
11035 parent = _ref2.parent;
11036
11037 return t.isMemberExpression(node) && t.isReferenced(node, parent);
11038 }
11039};
11040
11041var BindingIdentifier = exports.BindingIdentifier = {
11042 types: ["Identifier"],
11043 checkPath: function checkPath(_ref3) {
11044 var node = _ref3.node,
11045 parent = _ref3.parent;
11046
11047 return t.isIdentifier(node) && t.isBinding(node, parent);
11048 }
11049};
11050
11051var Statement = exports.Statement = {
11052 types: ["Statement"],
11053 checkPath: function checkPath(_ref4) {
11054 var node = _ref4.node,
11055 parent = _ref4.parent;
11056
11057 if (t.isStatement(node)) {
11058 if (t.isVariableDeclaration(node)) {
11059 if (t.isForXStatement(parent, { left: node })) return false;
11060 if (t.isForStatement(parent, { init: node })) return false;
11061 }
11062
11063 return true;
11064 } else {
11065 return false;
11066 }
11067 }
11068};
11069
11070var Expression = exports.Expression = {
11071 types: ["Expression"],
11072 checkPath: function checkPath(path) {
11073 if (path.isIdentifier()) {
11074 return path.isReferencedIdentifier();
11075 } else {
11076 return t.isExpression(path.node);
11077 }
11078 }
11079};
11080
11081var Scope = exports.Scope = {
11082 types: ["Scopable"],
11083 checkPath: function checkPath(path) {
11084 return t.isScope(path.node, path.parent);
11085 }
11086};
11087
11088var Referenced = exports.Referenced = {
11089 checkPath: function checkPath(path) {
11090 return t.isReferenced(path.node, path.parent);
11091 }
11092};
11093
11094var BlockScoped = exports.BlockScoped = {
11095 checkPath: function checkPath(path) {
11096 return t.isBlockScoped(path.node);
11097 }
11098};
11099
11100var Var = exports.Var = {
11101 types: ["VariableDeclaration"],
11102 checkPath: function checkPath(path) {
11103 return t.isVar(path.node);
11104 }
11105};
11106
11107var User = exports.User = {
11108 checkPath: function checkPath(path) {
11109 return path.node && !!path.node.loc;
11110 }
11111};
11112
11113var Generated = exports.Generated = {
11114 checkPath: function checkPath(path) {
11115 return !path.isUser();
11116 }
11117};
11118
11119var Pure = exports.Pure = {
11120 checkPath: function checkPath(path, opts) {
11121 return path.scope.isPure(path.node, opts);
11122 }
11123};
11124
11125var Flow = exports.Flow = {
11126 types: ["Flow", "ImportDeclaration", "ExportDeclaration", "ImportSpecifier"],
11127 checkPath: function checkPath(_ref5) {
11128 var node = _ref5.node;
11129
11130 if (t.isFlow(node)) {
11131 return true;
11132 } else if (t.isImportDeclaration(node)) {
11133 return node.importKind === "type" || node.importKind === "typeof";
11134 } else if (t.isExportDeclaration(node)) {
11135 return node.exportKind === "type";
11136 } else if (t.isImportSpecifier(node)) {
11137 return node.importKind === "type" || node.importKind === "typeof";
11138 } else {
11139 return false;
11140 }
11141 }
11142};
11143},{"babel-types":112}],94:[function(require,module,exports){
11144"use strict";
11145
11146exports.__esModule = true;
11147
11148var _typeof2 = require("babel-runtime/helpers/typeof");
11149
11150var _typeof3 = _interopRequireDefault(_typeof2);
11151
11152var _getIterator2 = require("babel-runtime/core-js/get-iterator");
11153
11154var _getIterator3 = _interopRequireDefault(_getIterator2);
11155
11156exports.insertBefore = insertBefore;
11157exports._containerInsert = _containerInsert;
11158exports._containerInsertBefore = _containerInsertBefore;
11159exports._containerInsertAfter = _containerInsertAfter;
11160exports._maybePopFromStatements = _maybePopFromStatements;
11161exports.insertAfter = insertAfter;
11162exports.updateSiblingKeys = updateSiblingKeys;
11163exports._verifyNodeList = _verifyNodeList;
11164exports.unshiftContainer = unshiftContainer;
11165exports.pushContainer = pushContainer;
11166exports.hoist = hoist;
11167
11168var _cache = require("../cache");
11169
11170var _hoister = require("./lib/hoister");
11171
11172var _hoister2 = _interopRequireDefault(_hoister);
11173
11174var _index = require("./index");
11175
11176var _index2 = _interopRequireDefault(_index);
11177
11178var _babelTypes = require("babel-types");
11179
11180var t = _interopRequireWildcard(_babelTypes);
11181
11182function _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; } }
11183
11184function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11185
11186function insertBefore(nodes) {
11187 this._assertUnremoved();
11188
11189 nodes = this._verifyNodeList(nodes);
11190
11191 if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) {
11192 return this.parentPath.insertBefore(nodes);
11193 } else if (this.isNodeType("Expression") || this.parentPath.isForStatement() && this.key === "init") {
11194 if (this.node) nodes.push(this.node);
11195 this.replaceExpressionWithStatements(nodes);
11196 } else {
11197 this._maybePopFromStatements(nodes);
11198 if (Array.isArray(this.container)) {
11199 return this._containerInsertBefore(nodes);
11200 } else if (this.isStatementOrBlock()) {
11201 if (this.node) nodes.push(this.node);
11202 this._replaceWith(t.blockStatement(nodes));
11203 } else {
11204 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?");
11205 }
11206 }
11207
11208 return [this];
11209}
11210
11211function _containerInsert(from, nodes) {
11212 this.updateSiblingKeys(from, nodes.length);
11213
11214 var paths = [];
11215
11216 for (var i = 0; i < nodes.length; i++) {
11217 var to = from + i;
11218 var node = nodes[i];
11219 this.container.splice(to, 0, node);
11220
11221 if (this.context) {
11222 var path = this.context.create(this.parent, this.container, to, this.listKey);
11223
11224 if (this.context.queue) path.pushContext(this.context);
11225 paths.push(path);
11226 } else {
11227 paths.push(_index2.default.get({
11228 parentPath: this.parentPath,
11229 parent: this.parent,
11230 container: this.container,
11231 listKey: this.listKey,
11232 key: to
11233 }));
11234 }
11235 }
11236
11237 var contexts = this._getQueueContexts();
11238
11239 for (var _iterator = paths, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
11240 var _ref;
11241
11242 if (_isArray) {
11243 if (_i >= _iterator.length) break;
11244 _ref = _iterator[_i++];
11245 } else {
11246 _i = _iterator.next();
11247 if (_i.done) break;
11248 _ref = _i.value;
11249 }
11250
11251 var _path = _ref;
11252
11253 _path.setScope();
11254 _path.debug(function () {
11255 return "Inserted.";
11256 });
11257
11258 for (var _iterator2 = contexts, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
11259 var _ref2;
11260
11261 if (_isArray2) {
11262 if (_i2 >= _iterator2.length) break;
11263 _ref2 = _iterator2[_i2++];
11264 } else {
11265 _i2 = _iterator2.next();
11266 if (_i2.done) break;
11267 _ref2 = _i2.value;
11268 }
11269
11270 var context = _ref2;
11271
11272 context.maybeQueue(_path, true);
11273 }
11274 }
11275
11276 return paths;
11277}
11278
11279function _containerInsertBefore(nodes) {
11280 return this._containerInsert(this.key, nodes);
11281}
11282
11283function _containerInsertAfter(nodes) {
11284 return this._containerInsert(this.key + 1, nodes);
11285}
11286
11287function _maybePopFromStatements(nodes) {
11288 var last = nodes[nodes.length - 1];
11289 var isIdentifier = t.isIdentifier(last) || t.isExpressionStatement(last) && t.isIdentifier(last.expression);
11290
11291 if (isIdentifier && !this.isCompletionRecord()) {
11292 nodes.pop();
11293 }
11294}
11295
11296function insertAfter(nodes) {
11297 this._assertUnremoved();
11298
11299 nodes = this._verifyNodeList(nodes);
11300
11301 if (this.parentPath.isExpressionStatement() || this.parentPath.isLabeledStatement()) {
11302 return this.parentPath.insertAfter(nodes);
11303 } else if (this.isNodeType("Expression") || this.parentPath.isForStatement() && this.key === "init") {
11304 if (this.node) {
11305 var temp = this.scope.generateDeclaredUidIdentifier();
11306 nodes.unshift(t.expressionStatement(t.assignmentExpression("=", temp, this.node)));
11307 nodes.push(t.expressionStatement(temp));
11308 }
11309 this.replaceExpressionWithStatements(nodes);
11310 } else {
11311 this._maybePopFromStatements(nodes);
11312 if (Array.isArray(this.container)) {
11313 return this._containerInsertAfter(nodes);
11314 } else if (this.isStatementOrBlock()) {
11315 if (this.node) nodes.unshift(this.node);
11316 this._replaceWith(t.blockStatement(nodes));
11317 } else {
11318 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?");
11319 }
11320 }
11321
11322 return [this];
11323}
11324
11325function updateSiblingKeys(fromIndex, incrementBy) {
11326 if (!this.parent) return;
11327
11328 var paths = _cache.path.get(this.parent);
11329 for (var i = 0; i < paths.length; i++) {
11330 var path = paths[i];
11331 if (path.key >= fromIndex) {
11332 path.key += incrementBy;
11333 }
11334 }
11335}
11336
11337function _verifyNodeList(nodes) {
11338 if (!nodes) {
11339 return [];
11340 }
11341
11342 if (nodes.constructor !== Array) {
11343 nodes = [nodes];
11344 }
11345
11346 for (var i = 0; i < nodes.length; i++) {
11347 var node = nodes[i];
11348 var msg = void 0;
11349
11350 if (!node) {
11351 msg = "has falsy node";
11352 } else if ((typeof node === "undefined" ? "undefined" : (0, _typeof3.default)(node)) !== "object") {
11353 msg = "contains a non-object node";
11354 } else if (!node.type) {
11355 msg = "without a type";
11356 } else if (node instanceof _index2.default) {
11357 msg = "has a NodePath when it expected a raw object";
11358 }
11359
11360 if (msg) {
11361 var type = Array.isArray(node) ? "array" : typeof node === "undefined" ? "undefined" : (0, _typeof3.default)(node);
11362 throw new Error("Node list " + msg + " with the index of " + i + " and type of " + type);
11363 }
11364 }
11365
11366 return nodes;
11367}
11368
11369function unshiftContainer(listKey, nodes) {
11370 this._assertUnremoved();
11371
11372 nodes = this._verifyNodeList(nodes);
11373
11374 var path = _index2.default.get({
11375 parentPath: this,
11376 parent: this.node,
11377 container: this.node[listKey],
11378 listKey: listKey,
11379 key: 0
11380 });
11381
11382 return path.insertBefore(nodes);
11383}
11384
11385function pushContainer(listKey, nodes) {
11386 this._assertUnremoved();
11387
11388 nodes = this._verifyNodeList(nodes);
11389
11390 var container = this.node[listKey];
11391 var path = _index2.default.get({
11392 parentPath: this,
11393 parent: this.node,
11394 container: container,
11395 listKey: listKey,
11396 key: container.length
11397 });
11398
11399 return path.replaceWithMultiple(nodes);
11400}
11401
11402function hoist() {
11403 var scope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.scope;
11404
11405 var hoister = new _hoister2.default(this, scope);
11406 return hoister.run();
11407}
11408},{"../cache":76,"./index":86,"./lib/hoister":91,"babel-runtime/core-js/get-iterator":56,"babel-runtime/helpers/typeof":74,"babel-types":112}],95:[function(require,module,exports){
11409"use strict";
11410
11411exports.__esModule = true;
11412
11413var _getIterator2 = require("babel-runtime/core-js/get-iterator");
11414
11415var _getIterator3 = _interopRequireDefault(_getIterator2);
11416
11417exports.remove = remove;
11418exports._callRemovalHooks = _callRemovalHooks;
11419exports._remove = _remove;
11420exports._markRemoved = _markRemoved;
11421exports._assertUnremoved = _assertUnremoved;
11422
11423var _removalHooks = require("./lib/removal-hooks");
11424
11425function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11426
11427function remove() {
11428 this._assertUnremoved();
11429
11430 this.resync();
11431
11432 if (this._callRemovalHooks()) {
11433 this._markRemoved();
11434 return;
11435 }
11436
11437 this.shareCommentsWithSiblings();
11438 this._remove();
11439 this._markRemoved();
11440}
11441
11442function _callRemovalHooks() {
11443 for (var _iterator = _removalHooks.hooks, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
11444 var _ref;
11445
11446 if (_isArray) {
11447 if (_i >= _iterator.length) break;
11448 _ref = _iterator[_i++];
11449 } else {
11450 _i = _iterator.next();
11451 if (_i.done) break;
11452 _ref = _i.value;
11453 }
11454
11455 var fn = _ref;
11456
11457 if (fn(this, this.parentPath)) return true;
11458 }
11459}
11460
11461function _remove() {
11462 if (Array.isArray(this.container)) {
11463 this.container.splice(this.key, 1);
11464 this.updateSiblingKeys(this.key, -1);
11465 } else {
11466 this._replaceWith(null);
11467 }
11468}
11469
11470function _markRemoved() {
11471 this.shouldSkip = true;
11472 this.removed = true;
11473 this.node = null;
11474}
11475
11476function _assertUnremoved() {
11477 if (this.removed) {
11478 throw this.buildCodeFrameError("NodePath has been removed so is read-only.");
11479 }
11480}
11481},{"./lib/removal-hooks":92,"babel-runtime/core-js/get-iterator":56}],96:[function(require,module,exports){
11482"use strict";
11483
11484exports.__esModule = true;
11485
11486var _getIterator2 = require("babel-runtime/core-js/get-iterator");
11487
11488var _getIterator3 = _interopRequireDefault(_getIterator2);
11489
11490exports.replaceWithMultiple = replaceWithMultiple;
11491exports.replaceWithSourceString = replaceWithSourceString;
11492exports.replaceWith = replaceWith;
11493exports._replaceWith = _replaceWith;
11494exports.replaceExpressionWithStatements = replaceExpressionWithStatements;
11495exports.replaceInline = replaceInline;
11496
11497var _babelCodeFrame = require("babel-code-frame");
11498
11499var _babelCodeFrame2 = _interopRequireDefault(_babelCodeFrame);
11500
11501var _index = require("../index");
11502
11503var _index2 = _interopRequireDefault(_index);
11504
11505var _index3 = require("./index");
11506
11507var _index4 = _interopRequireDefault(_index3);
11508
11509var _babylon = require("babylon");
11510
11511var _babelTypes = require("babel-types");
11512
11513var t = _interopRequireWildcard(_babelTypes);
11514
11515function _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; } }
11516
11517function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11518
11519var hoistVariablesVisitor = {
11520 Function: function Function(path) {
11521 path.skip();
11522 },
11523 VariableDeclaration: function VariableDeclaration(path) {
11524 if (path.node.kind !== "var") return;
11525
11526 var bindings = path.getBindingIdentifiers();
11527 for (var key in bindings) {
11528 path.scope.push({ id: bindings[key] });
11529 }
11530
11531 var exprs = [];
11532
11533 for (var _iterator = path.node.declarations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
11534 var _ref;
11535
11536 if (_isArray) {
11537 if (_i >= _iterator.length) break;
11538 _ref = _iterator[_i++];
11539 } else {
11540 _i = _iterator.next();
11541 if (_i.done) break;
11542 _ref = _i.value;
11543 }
11544
11545 var declar = _ref;
11546
11547 if (declar.init) {
11548 exprs.push(t.expressionStatement(t.assignmentExpression("=", declar.id, declar.init)));
11549 }
11550 }
11551
11552 path.replaceWithMultiple(exprs);
11553 }
11554};
11555
11556function replaceWithMultiple(nodes) {
11557 this.resync();
11558
11559 nodes = this._verifyNodeList(nodes);
11560 t.inheritLeadingComments(nodes[0], this.node);
11561 t.inheritTrailingComments(nodes[nodes.length - 1], this.node);
11562 this.node = this.container[this.key] = null;
11563 this.insertAfter(nodes);
11564
11565 if (this.node) {
11566 this.requeue();
11567 } else {
11568 this.remove();
11569 }
11570}
11571
11572function replaceWithSourceString(replacement) {
11573 this.resync();
11574
11575 try {
11576 replacement = "(" + replacement + ")";
11577 replacement = (0, _babylon.parse)(replacement);
11578 } catch (err) {
11579 var loc = err.loc;
11580 if (loc) {
11581 err.message += " - make sure this is an expression.";
11582 err.message += "\n" + (0, _babelCodeFrame2.default)(replacement, loc.line, loc.column + 1);
11583 }
11584 throw err;
11585 }
11586
11587 replacement = replacement.program.body[0].expression;
11588 _index2.default.removeProperties(replacement);
11589 return this.replaceWith(replacement);
11590}
11591
11592function replaceWith(replacement) {
11593 this.resync();
11594
11595 if (this.removed) {
11596 throw new Error("You can't replace this node, we've already removed it");
11597 }
11598
11599 if (replacement instanceof _index4.default) {
11600 replacement = replacement.node;
11601 }
11602
11603 if (!replacement) {
11604 throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead");
11605 }
11606
11607 if (this.node === replacement) {
11608 return;
11609 }
11610
11611 if (this.isProgram() && !t.isProgram(replacement)) {
11612 throw new Error("You can only replace a Program root node with another Program node");
11613 }
11614
11615 if (Array.isArray(replacement)) {
11616 throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`");
11617 }
11618
11619 if (typeof replacement === "string") {
11620 throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`");
11621 }
11622
11623 if (this.isNodeType("Statement") && t.isExpression(replacement)) {
11624 if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) {
11625 replacement = t.expressionStatement(replacement);
11626 }
11627 }
11628
11629 if (this.isNodeType("Expression") && t.isStatement(replacement)) {
11630 if (!this.canHaveVariableDeclarationOrExpression() && !this.canSwapBetweenExpressionAndStatement(replacement)) {
11631 return this.replaceExpressionWithStatements([replacement]);
11632 }
11633 }
11634
11635 var oldNode = this.node;
11636 if (oldNode) {
11637 t.inheritsComments(replacement, oldNode);
11638 t.removeComments(oldNode);
11639 }
11640
11641 this._replaceWith(replacement);
11642 this.type = replacement.type;
11643
11644 this.setScope();
11645
11646 this.requeue();
11647}
11648
11649function _replaceWith(node) {
11650 if (!this.container) {
11651 throw new ReferenceError("Container is falsy");
11652 }
11653
11654 if (this.inList) {
11655 t.validate(this.parent, this.key, [node]);
11656 } else {
11657 t.validate(this.parent, this.key, node);
11658 }
11659
11660 this.debug(function () {
11661 return "Replace with " + (node && node.type);
11662 });
11663
11664 this.node = this.container[this.key] = node;
11665}
11666
11667function replaceExpressionWithStatements(nodes) {
11668 this.resync();
11669
11670 var toSequenceExpression = t.toSequenceExpression(nodes, this.scope);
11671
11672 if (t.isSequenceExpression(toSequenceExpression)) {
11673 var exprs = toSequenceExpression.expressions;
11674
11675 if (exprs.length >= 2 && this.parentPath.isExpressionStatement()) {
11676 this._maybePopFromStatements(exprs);
11677 }
11678
11679 if (exprs.length === 1) {
11680 this.replaceWith(exprs[0]);
11681 } else {
11682 this.replaceWith(toSequenceExpression);
11683 }
11684 } else if (toSequenceExpression) {
11685 this.replaceWith(toSequenceExpression);
11686 } else {
11687 var container = t.functionExpression(null, [], t.blockStatement(nodes));
11688 container.shadow = true;
11689
11690 this.replaceWith(t.callExpression(container, []));
11691 this.traverse(hoistVariablesVisitor);
11692
11693 var completionRecords = this.get("callee").getCompletionRecords();
11694 for (var _iterator2 = completionRecords, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
11695 var _ref2;
11696
11697 if (_isArray2) {
11698 if (_i2 >= _iterator2.length) break;
11699 _ref2 = _iterator2[_i2++];
11700 } else {
11701 _i2 = _iterator2.next();
11702 if (_i2.done) break;
11703 _ref2 = _i2.value;
11704 }
11705
11706 var path = _ref2;
11707
11708 if (!path.isExpressionStatement()) continue;
11709
11710 var loop = path.findParent(function (path) {
11711 return path.isLoop();
11712 });
11713 if (loop) {
11714 var uid = loop.getData("expressionReplacementReturnUid");
11715
11716 if (!uid) {
11717 var callee = this.get("callee");
11718 uid = callee.scope.generateDeclaredUidIdentifier("ret");
11719 callee.get("body").pushContainer("body", t.returnStatement(uid));
11720 loop.setData("expressionReplacementReturnUid", uid);
11721 } else {
11722 uid = t.identifier(uid.name);
11723 }
11724
11725 path.get("expression").replaceWith(t.assignmentExpression("=", uid, path.node.expression));
11726 } else {
11727 path.replaceWith(t.returnStatement(path.node.expression));
11728 }
11729 }
11730
11731 return this.node;
11732 }
11733}
11734
11735function replaceInline(nodes) {
11736 this.resync();
11737
11738 if (Array.isArray(nodes)) {
11739 if (Array.isArray(this.container)) {
11740 nodes = this._verifyNodeList(nodes);
11741 this._containerInsertAfter(nodes);
11742 return this.remove();
11743 } else {
11744 return this.replaceWithMultiple(nodes);
11745 }
11746 } else {
11747 return this.replaceWith(nodes);
11748 }
11749}
11750},{"../index":79,"./index":86,"babel-code-frame":3,"babel-runtime/core-js/get-iterator":56,"babel-types":112,"babylon":116}],97:[function(require,module,exports){
11751"use strict";
11752
11753exports.__esModule = true;
11754
11755var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
11756
11757var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
11758
11759function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11760
11761var Binding = function () {
11762 function Binding(_ref) {
11763 var existing = _ref.existing,
11764 identifier = _ref.identifier,
11765 scope = _ref.scope,
11766 path = _ref.path,
11767 kind = _ref.kind;
11768 (0, _classCallCheck3.default)(this, Binding);
11769
11770 this.identifier = identifier;
11771 this.scope = scope;
11772 this.path = path;
11773 this.kind = kind;
11774
11775 this.constantViolations = [];
11776 this.constant = true;
11777
11778 this.referencePaths = [];
11779 this.referenced = false;
11780 this.references = 0;
11781
11782 this.clearValue();
11783
11784 if (existing) {
11785 this.constantViolations = [].concat(existing.path, existing.constantViolations, this.constantViolations);
11786 }
11787 }
11788
11789 Binding.prototype.deoptValue = function deoptValue() {
11790 this.clearValue();
11791 this.hasDeoptedValue = true;
11792 };
11793
11794 Binding.prototype.setValue = function setValue(value) {
11795 if (this.hasDeoptedValue) return;
11796 this.hasValue = true;
11797 this.value = value;
11798 };
11799
11800 Binding.prototype.clearValue = function clearValue() {
11801 this.hasDeoptedValue = false;
11802 this.hasValue = false;
11803 this.value = null;
11804 };
11805
11806 Binding.prototype.reassign = function reassign(path) {
11807 this.constant = false;
11808 if (this.constantViolations.indexOf(path) !== -1) {
11809 return;
11810 }
11811 this.constantViolations.push(path);
11812 };
11813
11814 Binding.prototype.reference = function reference(path) {
11815 if (this.referencePaths.indexOf(path) !== -1) {
11816 return;
11817 }
11818 this.referenced = true;
11819 this.references++;
11820 this.referencePaths.push(path);
11821 };
11822
11823 Binding.prototype.dereference = function dereference() {
11824 this.references--;
11825 this.referenced = !!this.references;
11826 };
11827
11828 return Binding;
11829}();
11830
11831exports.default = Binding;
11832module.exports = exports["default"];
11833},{"babel-runtime/helpers/classCallCheck":70}],98:[function(require,module,exports){
11834"use strict";
11835
11836exports.__esModule = true;
11837
11838var _keys = require("babel-runtime/core-js/object/keys");
11839
11840var _keys2 = _interopRequireDefault(_keys);
11841
11842var _create = require("babel-runtime/core-js/object/create");
11843
11844var _create2 = _interopRequireDefault(_create);
11845
11846var _map = require("babel-runtime/core-js/map");
11847
11848var _map2 = _interopRequireDefault(_map);
11849
11850var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
11851
11852var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
11853
11854var _getIterator2 = require("babel-runtime/core-js/get-iterator");
11855
11856var _getIterator3 = _interopRequireDefault(_getIterator2);
11857
11858var _includes = require("lodash/includes");
11859
11860var _includes2 = _interopRequireDefault(_includes);
11861
11862var _repeat = require("lodash/repeat");
11863
11864var _repeat2 = _interopRequireDefault(_repeat);
11865
11866var _renamer = require("./lib/renamer");
11867
11868var _renamer2 = _interopRequireDefault(_renamer);
11869
11870var _index = require("../index");
11871
11872var _index2 = _interopRequireDefault(_index);
11873
11874var _defaults = require("lodash/defaults");
11875
11876var _defaults2 = _interopRequireDefault(_defaults);
11877
11878var _babelMessages = require("babel-messages");
11879
11880var messages = _interopRequireWildcard(_babelMessages);
11881
11882var _binding2 = require("./binding");
11883
11884var _binding3 = _interopRequireDefault(_binding2);
11885
11886var _globals = require("globals");
11887
11888var _globals2 = _interopRequireDefault(_globals);
11889
11890var _babelTypes = require("babel-types");
11891
11892var t = _interopRequireWildcard(_babelTypes);
11893
11894var _cache = require("../cache");
11895
11896function _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; } }
11897
11898function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11899
11900var _crawlCallsCount = 0;
11901
11902function getCache(path, parentScope, self) {
11903 var scopes = _cache.scope.get(path.node) || [];
11904
11905 for (var _iterator = scopes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
11906 var _ref;
11907
11908 if (_isArray) {
11909 if (_i >= _iterator.length) break;
11910 _ref = _iterator[_i++];
11911 } else {
11912 _i = _iterator.next();
11913 if (_i.done) break;
11914 _ref = _i.value;
11915 }
11916
11917 var scope = _ref;
11918
11919 if (scope.parent === parentScope && scope.path === path) return scope;
11920 }
11921
11922 scopes.push(self);
11923
11924 if (!_cache.scope.has(path.node)) {
11925 _cache.scope.set(path.node, scopes);
11926 }
11927}
11928
11929function gatherNodeParts(node, parts) {
11930 if (t.isModuleDeclaration(node)) {
11931 if (node.source) {
11932 gatherNodeParts(node.source, parts);
11933 } else if (node.specifiers && node.specifiers.length) {
11934 for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
11935 var _ref2;
11936
11937 if (_isArray2) {
11938 if (_i2 >= _iterator2.length) break;
11939 _ref2 = _iterator2[_i2++];
11940 } else {
11941 _i2 = _iterator2.next();
11942 if (_i2.done) break;
11943 _ref2 = _i2.value;
11944 }
11945
11946 var specifier = _ref2;
11947
11948 gatherNodeParts(specifier, parts);
11949 }
11950 } else if (node.declaration) {
11951 gatherNodeParts(node.declaration, parts);
11952 }
11953 } else if (t.isModuleSpecifier(node)) {
11954 gatherNodeParts(node.local, parts);
11955 } else if (t.isMemberExpression(node)) {
11956 gatherNodeParts(node.object, parts);
11957 gatherNodeParts(node.property, parts);
11958 } else if (t.isIdentifier(node)) {
11959 parts.push(node.name);
11960 } else if (t.isLiteral(node)) {
11961 parts.push(node.value);
11962 } else if (t.isCallExpression(node)) {
11963 gatherNodeParts(node.callee, parts);
11964 } else if (t.isObjectExpression(node) || t.isObjectPattern(node)) {
11965 for (var _iterator3 = node.properties, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
11966 var _ref3;
11967
11968 if (_isArray3) {
11969 if (_i3 >= _iterator3.length) break;
11970 _ref3 = _iterator3[_i3++];
11971 } else {
11972 _i3 = _iterator3.next();
11973 if (_i3.done) break;
11974 _ref3 = _i3.value;
11975 }
11976
11977 var prop = _ref3;
11978
11979 gatherNodeParts(prop.key || prop.argument, parts);
11980 }
11981 }
11982}
11983
11984var collectorVisitor = {
11985 For: function For(path) {
11986 for (var _iterator4 = t.FOR_INIT_KEYS, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
11987 var _ref4;
11988
11989 if (_isArray4) {
11990 if (_i4 >= _iterator4.length) break;
11991 _ref4 = _iterator4[_i4++];
11992 } else {
11993 _i4 = _iterator4.next();
11994 if (_i4.done) break;
11995 _ref4 = _i4.value;
11996 }
11997
11998 var key = _ref4;
11999
12000 var declar = path.get(key);
12001 if (declar.isVar()) path.scope.getFunctionParent().registerBinding("var", declar);
12002 }
12003 },
12004 Declaration: function Declaration(path) {
12005 if (path.isBlockScoped()) return;
12006
12007 if (path.isExportDeclaration() && path.get("declaration").isDeclaration()) return;
12008
12009 path.scope.getFunctionParent().registerDeclaration(path);
12010 },
12011 ReferencedIdentifier: function ReferencedIdentifier(path, state) {
12012 state.references.push(path);
12013 },
12014 ForXStatement: function ForXStatement(path, state) {
12015 var left = path.get("left");
12016 if (left.isPattern() || left.isIdentifier()) {
12017 state.constantViolations.push(left);
12018 }
12019 },
12020
12021
12022 ExportDeclaration: {
12023 exit: function exit(path) {
12024 var node = path.node,
12025 scope = path.scope;
12026
12027 var declar = node.declaration;
12028 if (t.isClassDeclaration(declar) || t.isFunctionDeclaration(declar)) {
12029 var _id = declar.id;
12030 if (!_id) return;
12031
12032 var binding = scope.getBinding(_id.name);
12033 if (binding) binding.reference(path);
12034 } else if (t.isVariableDeclaration(declar)) {
12035 for (var _iterator5 = declar.declarations, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) {
12036 var _ref5;
12037
12038 if (_isArray5) {
12039 if (_i5 >= _iterator5.length) break;
12040 _ref5 = _iterator5[_i5++];
12041 } else {
12042 _i5 = _iterator5.next();
12043 if (_i5.done) break;
12044 _ref5 = _i5.value;
12045 }
12046
12047 var decl = _ref5;
12048
12049 var ids = t.getBindingIdentifiers(decl);
12050 for (var name in ids) {
12051 var _binding = scope.getBinding(name);
12052 if (_binding) _binding.reference(path);
12053 }
12054 }
12055 }
12056 }
12057 },
12058
12059 LabeledStatement: function LabeledStatement(path) {
12060 path.scope.getProgramParent().addGlobal(path.node);
12061 path.scope.getBlockParent().registerDeclaration(path);
12062 },
12063 AssignmentExpression: function AssignmentExpression(path, state) {
12064 state.assignments.push(path);
12065 },
12066 UpdateExpression: function UpdateExpression(path, state) {
12067 state.constantViolations.push(path.get("argument"));
12068 },
12069 UnaryExpression: function UnaryExpression(path, state) {
12070 if (path.node.operator === "delete") {
12071 state.constantViolations.push(path.get("argument"));
12072 }
12073 },
12074 BlockScoped: function BlockScoped(path) {
12075 var scope = path.scope;
12076 if (scope.path === path) scope = scope.parent;
12077 scope.getBlockParent().registerDeclaration(path);
12078 },
12079 ClassDeclaration: function ClassDeclaration(path) {
12080 var id = path.node.id;
12081 if (!id) return;
12082
12083 var name = id.name;
12084 path.scope.bindings[name] = path.scope.getBinding(name);
12085 },
12086 Block: function Block(path) {
12087 var paths = path.get("body");
12088 for (var _iterator6 = paths, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) {
12089 var _ref6;
12090
12091 if (_isArray6) {
12092 if (_i6 >= _iterator6.length) break;
12093 _ref6 = _iterator6[_i6++];
12094 } else {
12095 _i6 = _iterator6.next();
12096 if (_i6.done) break;
12097 _ref6 = _i6.value;
12098 }
12099
12100 var bodyPath = _ref6;
12101
12102 if (bodyPath.isFunctionDeclaration()) {
12103 path.scope.getBlockParent().registerDeclaration(bodyPath);
12104 }
12105 }
12106 }
12107};
12108
12109var uid = 0;
12110
12111var Scope = function () {
12112 function Scope(path, parentScope) {
12113 (0, _classCallCheck3.default)(this, Scope);
12114
12115 if (parentScope && parentScope.block === path.node) {
12116 return parentScope;
12117 }
12118
12119 var cached = getCache(path, parentScope, this);
12120 if (cached) return cached;
12121
12122 this.uid = uid++;
12123 this.parent = parentScope;
12124 this.hub = path.hub;
12125
12126 this.parentBlock = path.parent;
12127 this.block = path.node;
12128 this.path = path;
12129
12130 this.labels = new _map2.default();
12131 }
12132
12133 Scope.prototype.traverse = function traverse(node, opts, state) {
12134 (0, _index2.default)(node, opts, this, state, this.path);
12135 };
12136
12137 Scope.prototype.generateDeclaredUidIdentifier = function generateDeclaredUidIdentifier() {
12138 var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp";
12139
12140 var id = this.generateUidIdentifier(name);
12141 this.push({ id: id });
12142 return id;
12143 };
12144
12145 Scope.prototype.generateUidIdentifier = function generateUidIdentifier() {
12146 var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp";
12147
12148 return t.identifier(this.generateUid(name));
12149 };
12150
12151 Scope.prototype.generateUid = function generateUid() {
12152 var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "temp";
12153
12154 name = t.toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, "");
12155
12156 var uid = void 0;
12157 var i = 0;
12158 do {
12159 uid = this._generateUid(name, i);
12160 i++;
12161 } while (this.hasLabel(uid) || this.hasBinding(uid) || this.hasGlobal(uid) || this.hasReference(uid));
12162
12163 var program = this.getProgramParent();
12164 program.references[uid] = true;
12165 program.uids[uid] = true;
12166
12167 return uid;
12168 };
12169
12170 Scope.prototype._generateUid = function _generateUid(name, i) {
12171 var id = name;
12172 if (i > 1) id += i;
12173 return "_" + id;
12174 };
12175
12176 Scope.prototype.generateUidIdentifierBasedOnNode = function generateUidIdentifierBasedOnNode(parent, defaultName) {
12177 var node = parent;
12178
12179 if (t.isAssignmentExpression(parent)) {
12180 node = parent.left;
12181 } else if (t.isVariableDeclarator(parent)) {
12182 node = parent.id;
12183 } else if (t.isObjectProperty(node) || t.isObjectMethod(node)) {
12184 node = node.key;
12185 }
12186
12187 var parts = [];
12188 gatherNodeParts(node, parts);
12189
12190 var id = parts.join("$");
12191 id = id.replace(/^_/, "") || defaultName || "ref";
12192
12193 return this.generateUidIdentifier(id.slice(0, 20));
12194 };
12195
12196 Scope.prototype.isStatic = function isStatic(node) {
12197 if (t.isThisExpression(node) || t.isSuper(node)) {
12198 return true;
12199 }
12200
12201 if (t.isIdentifier(node)) {
12202 var binding = this.getBinding(node.name);
12203 if (binding) {
12204 return binding.constant;
12205 } else {
12206 return this.hasBinding(node.name);
12207 }
12208 }
12209
12210 return false;
12211 };
12212
12213 Scope.prototype.maybeGenerateMemoised = function maybeGenerateMemoised(node, dontPush) {
12214 if (this.isStatic(node)) {
12215 return null;
12216 } else {
12217 var _id2 = this.generateUidIdentifierBasedOnNode(node);
12218 if (!dontPush) this.push({ id: _id2 });
12219 return _id2;
12220 }
12221 };
12222
12223 Scope.prototype.checkBlockScopedCollisions = function checkBlockScopedCollisions(local, kind, name, id) {
12224 if (kind === "param") return;
12225
12226 if (kind === "hoisted" && local.kind === "let") return;
12227
12228 var duplicate = kind === "let" || local.kind === "let" || local.kind === "const" || local.kind === "module" || local.kind === "param" && (kind === "let" || kind === "const");
12229
12230 if (duplicate) {
12231 throw this.hub.file.buildCodeFrameError(id, messages.get("scopeDuplicateDeclaration", name), TypeError);
12232 }
12233 };
12234
12235 Scope.prototype.rename = function rename(oldName, newName, block) {
12236 var binding = this.getBinding(oldName);
12237 if (binding) {
12238 newName = newName || this.generateUidIdentifier(oldName).name;
12239 return new _renamer2.default(binding, oldName, newName).rename(block);
12240 }
12241 };
12242
12243 Scope.prototype._renameFromMap = function _renameFromMap(map, oldName, newName, value) {
12244 if (map[oldName]) {
12245 map[newName] = value;
12246 map[oldName] = null;
12247 }
12248 };
12249
12250 Scope.prototype.dump = function dump() {
12251 var sep = (0, _repeat2.default)("-", 60);
12252 console.log(sep);
12253 var scope = this;
12254 do {
12255 console.log("#", scope.block.type);
12256 for (var name in scope.bindings) {
12257 var binding = scope.bindings[name];
12258 console.log(" -", name, {
12259 constant: binding.constant,
12260 references: binding.references,
12261 violations: binding.constantViolations.length,
12262 kind: binding.kind
12263 });
12264 }
12265 } while (scope = scope.parent);
12266 console.log(sep);
12267 };
12268
12269 Scope.prototype.toArray = function toArray(node, i) {
12270 var file = this.hub.file;
12271
12272 if (t.isIdentifier(node)) {
12273 var binding = this.getBinding(node.name);
12274 if (binding && binding.constant && binding.path.isGenericType("Array")) return node;
12275 }
12276
12277 if (t.isArrayExpression(node)) {
12278 return node;
12279 }
12280
12281 if (t.isIdentifier(node, { name: "arguments" })) {
12282 return t.callExpression(t.memberExpression(t.memberExpression(t.memberExpression(t.identifier("Array"), t.identifier("prototype")), t.identifier("slice")), t.identifier("call")), [node]);
12283 }
12284
12285 var helperName = "toArray";
12286 var args = [node];
12287 if (i === true) {
12288 helperName = "toConsumableArray";
12289 } else if (i) {
12290 args.push(t.numericLiteral(i));
12291 helperName = "slicedToArray";
12292 }
12293 return t.callExpression(file.addHelper(helperName), args);
12294 };
12295
12296 Scope.prototype.hasLabel = function hasLabel(name) {
12297 return !!this.getLabel(name);
12298 };
12299
12300 Scope.prototype.getLabel = function getLabel(name) {
12301 return this.labels.get(name);
12302 };
12303
12304 Scope.prototype.registerLabel = function registerLabel(path) {
12305 this.labels.set(path.node.label.name, path);
12306 };
12307
12308 Scope.prototype.registerDeclaration = function registerDeclaration(path) {
12309 if (path.isLabeledStatement()) {
12310 this.registerLabel(path);
12311 } else if (path.isFunctionDeclaration()) {
12312 this.registerBinding("hoisted", path.get("id"), path);
12313 } else if (path.isVariableDeclaration()) {
12314 var declarations = path.get("declarations");
12315 for (var _iterator7 = declarations, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) {
12316 var _ref7;
12317
12318 if (_isArray7) {
12319 if (_i7 >= _iterator7.length) break;
12320 _ref7 = _iterator7[_i7++];
12321 } else {
12322 _i7 = _iterator7.next();
12323 if (_i7.done) break;
12324 _ref7 = _i7.value;
12325 }
12326
12327 var declar = _ref7;
12328
12329 this.registerBinding(path.node.kind, declar);
12330 }
12331 } else if (path.isClassDeclaration()) {
12332 this.registerBinding("let", path);
12333 } else if (path.isImportDeclaration()) {
12334 var specifiers = path.get("specifiers");
12335 for (var _iterator8 = specifiers, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3.default)(_iterator8);;) {
12336 var _ref8;
12337
12338 if (_isArray8) {
12339 if (_i8 >= _iterator8.length) break;
12340 _ref8 = _iterator8[_i8++];
12341 } else {
12342 _i8 = _iterator8.next();
12343 if (_i8.done) break;
12344 _ref8 = _i8.value;
12345 }
12346
12347 var specifier = _ref8;
12348
12349 this.registerBinding("module", specifier);
12350 }
12351 } else if (path.isExportDeclaration()) {
12352 var _declar = path.get("declaration");
12353 if (_declar.isClassDeclaration() || _declar.isFunctionDeclaration() || _declar.isVariableDeclaration()) {
12354 this.registerDeclaration(_declar);
12355 }
12356 } else {
12357 this.registerBinding("unknown", path);
12358 }
12359 };
12360
12361 Scope.prototype.buildUndefinedNode = function buildUndefinedNode() {
12362 if (this.hasBinding("undefined")) {
12363 return t.unaryExpression("void", t.numericLiteral(0), true);
12364 } else {
12365 return t.identifier("undefined");
12366 }
12367 };
12368
12369 Scope.prototype.registerConstantViolation = function registerConstantViolation(path) {
12370 var ids = path.getBindingIdentifiers();
12371 for (var name in ids) {
12372 var binding = this.getBinding(name);
12373 if (binding) binding.reassign(path);
12374 }
12375 };
12376
12377 Scope.prototype.registerBinding = function registerBinding(kind, path) {
12378 var bindingPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : path;
12379
12380 if (!kind) throw new ReferenceError("no `kind`");
12381
12382 if (path.isVariableDeclaration()) {
12383 var declarators = path.get("declarations");
12384 for (var _iterator9 = declarators, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3.default)(_iterator9);;) {
12385 var _ref9;
12386
12387 if (_isArray9) {
12388 if (_i9 >= _iterator9.length) break;
12389 _ref9 = _iterator9[_i9++];
12390 } else {
12391 _i9 = _iterator9.next();
12392 if (_i9.done) break;
12393 _ref9 = _i9.value;
12394 }
12395
12396 var declar = _ref9;
12397
12398 this.registerBinding(kind, declar);
12399 }
12400 return;
12401 }
12402
12403 var parent = this.getProgramParent();
12404 var ids = path.getBindingIdentifiers(true);
12405
12406 for (var name in ids) {
12407 for (var _iterator10 = ids[name], _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, _getIterator3.default)(_iterator10);;) {
12408 var _ref10;
12409
12410 if (_isArray10) {
12411 if (_i10 >= _iterator10.length) break;
12412 _ref10 = _iterator10[_i10++];
12413 } else {
12414 _i10 = _iterator10.next();
12415 if (_i10.done) break;
12416 _ref10 = _i10.value;
12417 }
12418
12419 var _id3 = _ref10;
12420
12421 var local = this.getOwnBinding(name);
12422 if (local) {
12423 if (local.identifier === _id3) continue;
12424
12425 this.checkBlockScopedCollisions(local, kind, name, _id3);
12426 }
12427
12428 if (local && local.path.isFlow()) local = null;
12429
12430 parent.references[name] = true;
12431
12432 this.bindings[name] = new _binding3.default({
12433 identifier: _id3,
12434 existing: local,
12435 scope: this,
12436 path: bindingPath,
12437 kind: kind
12438 });
12439 }
12440 }
12441 };
12442
12443 Scope.prototype.addGlobal = function addGlobal(node) {
12444 this.globals[node.name] = node;
12445 };
12446
12447 Scope.prototype.hasUid = function hasUid(name) {
12448 var scope = this;
12449
12450 do {
12451 if (scope.uids[name]) return true;
12452 } while (scope = scope.parent);
12453
12454 return false;
12455 };
12456
12457 Scope.prototype.hasGlobal = function hasGlobal(name) {
12458 var scope = this;
12459
12460 do {
12461 if (scope.globals[name]) return true;
12462 } while (scope = scope.parent);
12463
12464 return false;
12465 };
12466
12467 Scope.prototype.hasReference = function hasReference(name) {
12468 var scope = this;
12469
12470 do {
12471 if (scope.references[name]) return true;
12472 } while (scope = scope.parent);
12473
12474 return false;
12475 };
12476
12477 Scope.prototype.isPure = function isPure(node, constantsOnly) {
12478 if (t.isIdentifier(node)) {
12479 var binding = this.getBinding(node.name);
12480 if (!binding) return false;
12481 if (constantsOnly) return binding.constant;
12482 return true;
12483 } else if (t.isClass(node)) {
12484 if (node.superClass && !this.isPure(node.superClass, constantsOnly)) return false;
12485 return this.isPure(node.body, constantsOnly);
12486 } else if (t.isClassBody(node)) {
12487 for (var _iterator11 = node.body, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, _getIterator3.default)(_iterator11);;) {
12488 var _ref11;
12489
12490 if (_isArray11) {
12491 if (_i11 >= _iterator11.length) break;
12492 _ref11 = _iterator11[_i11++];
12493 } else {
12494 _i11 = _iterator11.next();
12495 if (_i11.done) break;
12496 _ref11 = _i11.value;
12497 }
12498
12499 var method = _ref11;
12500
12501 if (!this.isPure(method, constantsOnly)) return false;
12502 }
12503 return true;
12504 } else if (t.isBinary(node)) {
12505 return this.isPure(node.left, constantsOnly) && this.isPure(node.right, constantsOnly);
12506 } else if (t.isArrayExpression(node)) {
12507 for (var _iterator12 = node.elements, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, _getIterator3.default)(_iterator12);;) {
12508 var _ref12;
12509
12510 if (_isArray12) {
12511 if (_i12 >= _iterator12.length) break;
12512 _ref12 = _iterator12[_i12++];
12513 } else {
12514 _i12 = _iterator12.next();
12515 if (_i12.done) break;
12516 _ref12 = _i12.value;
12517 }
12518
12519 var elem = _ref12;
12520
12521 if (!this.isPure(elem, constantsOnly)) return false;
12522 }
12523 return true;
12524 } else if (t.isObjectExpression(node)) {
12525 for (var _iterator13 = node.properties, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, _getIterator3.default)(_iterator13);;) {
12526 var _ref13;
12527
12528 if (_isArray13) {
12529 if (_i13 >= _iterator13.length) break;
12530 _ref13 = _iterator13[_i13++];
12531 } else {
12532 _i13 = _iterator13.next();
12533 if (_i13.done) break;
12534 _ref13 = _i13.value;
12535 }
12536
12537 var prop = _ref13;
12538
12539 if (!this.isPure(prop, constantsOnly)) return false;
12540 }
12541 return true;
12542 } else if (t.isClassMethod(node)) {
12543 if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
12544 if (node.kind === "get" || node.kind === "set") return false;
12545 return true;
12546 } else if (t.isClassProperty(node) || t.isObjectProperty(node)) {
12547 if (node.computed && !this.isPure(node.key, constantsOnly)) return false;
12548 return this.isPure(node.value, constantsOnly);
12549 } else if (t.isUnaryExpression(node)) {
12550 return this.isPure(node.argument, constantsOnly);
12551 } else {
12552 return t.isPureish(node);
12553 }
12554 };
12555
12556 Scope.prototype.setData = function setData(key, val) {
12557 return this.data[key] = val;
12558 };
12559
12560 Scope.prototype.getData = function getData(key) {
12561 var scope = this;
12562 do {
12563 var data = scope.data[key];
12564 if (data != null) return data;
12565 } while (scope = scope.parent);
12566 };
12567
12568 Scope.prototype.removeData = function removeData(key) {
12569 var scope = this;
12570 do {
12571 var data = scope.data[key];
12572 if (data != null) scope.data[key] = null;
12573 } while (scope = scope.parent);
12574 };
12575
12576 Scope.prototype.init = function init() {
12577 if (!this.references) this.crawl();
12578 };
12579
12580 Scope.prototype.crawl = function crawl() {
12581 _crawlCallsCount++;
12582 this._crawl();
12583 _crawlCallsCount--;
12584 };
12585
12586 Scope.prototype._crawl = function _crawl() {
12587 var path = this.path;
12588
12589 this.references = (0, _create2.default)(null);
12590 this.bindings = (0, _create2.default)(null);
12591 this.globals = (0, _create2.default)(null);
12592 this.uids = (0, _create2.default)(null);
12593 this.data = (0, _create2.default)(null);
12594
12595 if (path.isLoop()) {
12596 for (var _iterator14 = t.FOR_INIT_KEYS, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, _getIterator3.default)(_iterator14);;) {
12597 var _ref14;
12598
12599 if (_isArray14) {
12600 if (_i14 >= _iterator14.length) break;
12601 _ref14 = _iterator14[_i14++];
12602 } else {
12603 _i14 = _iterator14.next();
12604 if (_i14.done) break;
12605 _ref14 = _i14.value;
12606 }
12607
12608 var key = _ref14;
12609
12610 var node = path.get(key);
12611 if (node.isBlockScoped()) this.registerBinding(node.node.kind, node);
12612 }
12613 }
12614
12615 if (path.isFunctionExpression() && path.has("id")) {
12616 if (!path.get("id").node[t.NOT_LOCAL_BINDING]) {
12617 this.registerBinding("local", path.get("id"), path);
12618 }
12619 }
12620
12621 if (path.isClassExpression() && path.has("id")) {
12622 if (!path.get("id").node[t.NOT_LOCAL_BINDING]) {
12623 this.registerBinding("local", path);
12624 }
12625 }
12626
12627 if (path.isFunction()) {
12628 var params = path.get("params");
12629 for (var _iterator15 = params, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, _getIterator3.default)(_iterator15);;) {
12630 var _ref15;
12631
12632 if (_isArray15) {
12633 if (_i15 >= _iterator15.length) break;
12634 _ref15 = _iterator15[_i15++];
12635 } else {
12636 _i15 = _iterator15.next();
12637 if (_i15.done) break;
12638 _ref15 = _i15.value;
12639 }
12640
12641 var param = _ref15;
12642
12643 this.registerBinding("param", param);
12644 }
12645 }
12646
12647 if (path.isCatchClause()) {
12648 this.registerBinding("let", path);
12649 }
12650
12651 var parent = this.getProgramParent();
12652 if (parent.crawling) return;
12653
12654 var state = {
12655 references: [],
12656 constantViolations: [],
12657 assignments: []
12658 };
12659
12660 this.crawling = true;
12661 path.traverse(collectorVisitor, state);
12662 this.crawling = false;
12663
12664 for (var _iterator16 = state.assignments, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, _getIterator3.default)(_iterator16);;) {
12665 var _ref16;
12666
12667 if (_isArray16) {
12668 if (_i16 >= _iterator16.length) break;
12669 _ref16 = _iterator16[_i16++];
12670 } else {
12671 _i16 = _iterator16.next();
12672 if (_i16.done) break;
12673 _ref16 = _i16.value;
12674 }
12675
12676 var _path = _ref16;
12677
12678 var ids = _path.getBindingIdentifiers();
12679 var programParent = void 0;
12680 for (var name in ids) {
12681 if (_path.scope.getBinding(name)) continue;
12682
12683 programParent = programParent || _path.scope.getProgramParent();
12684 programParent.addGlobal(ids[name]);
12685 }
12686
12687 _path.scope.registerConstantViolation(_path);
12688 }
12689
12690 for (var _iterator17 = state.references, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : (0, _getIterator3.default)(_iterator17);;) {
12691 var _ref17;
12692
12693 if (_isArray17) {
12694 if (_i17 >= _iterator17.length) break;
12695 _ref17 = _iterator17[_i17++];
12696 } else {
12697 _i17 = _iterator17.next();
12698 if (_i17.done) break;
12699 _ref17 = _i17.value;
12700 }
12701
12702 var ref = _ref17;
12703
12704 var binding = ref.scope.getBinding(ref.node.name);
12705 if (binding) {
12706 binding.reference(ref);
12707 } else {
12708 ref.scope.getProgramParent().addGlobal(ref.node);
12709 }
12710 }
12711
12712 for (var _iterator18 = state.constantViolations, _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : (0, _getIterator3.default)(_iterator18);;) {
12713 var _ref18;
12714
12715 if (_isArray18) {
12716 if (_i18 >= _iterator18.length) break;
12717 _ref18 = _iterator18[_i18++];
12718 } else {
12719 _i18 = _iterator18.next();
12720 if (_i18.done) break;
12721 _ref18 = _i18.value;
12722 }
12723
12724 var _path2 = _ref18;
12725
12726 _path2.scope.registerConstantViolation(_path2);
12727 }
12728 };
12729
12730 Scope.prototype.push = function push(opts) {
12731 var path = this.path;
12732
12733 if (!path.isBlockStatement() && !path.isProgram()) {
12734 path = this.getBlockParent().path;
12735 }
12736
12737 if (path.isSwitchStatement()) {
12738 path = this.getFunctionParent().path;
12739 }
12740
12741 if (path.isLoop() || path.isCatchClause() || path.isFunction()) {
12742 t.ensureBlock(path.node);
12743 path = path.get("body");
12744 }
12745
12746 var unique = opts.unique;
12747 var kind = opts.kind || "var";
12748 var blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist;
12749
12750 var dataKey = "declaration:" + kind + ":" + blockHoist;
12751 var declarPath = !unique && path.getData(dataKey);
12752
12753 if (!declarPath) {
12754 var declar = t.variableDeclaration(kind, []);
12755 declar._generated = true;
12756 declar._blockHoist = blockHoist;
12757
12758 var _path$unshiftContaine = path.unshiftContainer("body", [declar]);
12759
12760 declarPath = _path$unshiftContaine[0];
12761
12762 if (!unique) path.setData(dataKey, declarPath);
12763 }
12764
12765 var declarator = t.variableDeclarator(opts.id, opts.init);
12766 declarPath.node.declarations.push(declarator);
12767 this.registerBinding(kind, declarPath.get("declarations").pop());
12768 };
12769
12770 Scope.prototype.getProgramParent = function getProgramParent() {
12771 var scope = this;
12772 do {
12773 if (scope.path.isProgram()) {
12774 return scope;
12775 }
12776 } while (scope = scope.parent);
12777 throw new Error("We couldn't find a Function or Program...");
12778 };
12779
12780 Scope.prototype.getFunctionParent = function getFunctionParent() {
12781 var scope = this;
12782 do {
12783 if (scope.path.isFunctionParent()) {
12784 return scope;
12785 }
12786 } while (scope = scope.parent);
12787 throw new Error("We couldn't find a Function or Program...");
12788 };
12789
12790 Scope.prototype.getBlockParent = function getBlockParent() {
12791 var scope = this;
12792 do {
12793 if (scope.path.isBlockParent()) {
12794 return scope;
12795 }
12796 } while (scope = scope.parent);
12797 throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...");
12798 };
12799
12800 Scope.prototype.getAllBindings = function getAllBindings() {
12801 var ids = (0, _create2.default)(null);
12802
12803 var scope = this;
12804 do {
12805 (0, _defaults2.default)(ids, scope.bindings);
12806 scope = scope.parent;
12807 } while (scope);
12808
12809 return ids;
12810 };
12811
12812 Scope.prototype.getAllBindingsOfKind = function getAllBindingsOfKind() {
12813 var ids = (0, _create2.default)(null);
12814
12815 for (var _iterator19 = arguments, _isArray19 = Array.isArray(_iterator19), _i19 = 0, _iterator19 = _isArray19 ? _iterator19 : (0, _getIterator3.default)(_iterator19);;) {
12816 var _ref19;
12817
12818 if (_isArray19) {
12819 if (_i19 >= _iterator19.length) break;
12820 _ref19 = _iterator19[_i19++];
12821 } else {
12822 _i19 = _iterator19.next();
12823 if (_i19.done) break;
12824 _ref19 = _i19.value;
12825 }
12826
12827 var kind = _ref19;
12828
12829 var scope = this;
12830 do {
12831 for (var name in scope.bindings) {
12832 var binding = scope.bindings[name];
12833 if (binding.kind === kind) ids[name] = binding;
12834 }
12835 scope = scope.parent;
12836 } while (scope);
12837 }
12838
12839 return ids;
12840 };
12841
12842 Scope.prototype.bindingIdentifierEquals = function bindingIdentifierEquals(name, node) {
12843 return this.getBindingIdentifier(name) === node;
12844 };
12845
12846 Scope.prototype.warnOnFlowBinding = function warnOnFlowBinding(binding) {
12847 if (_crawlCallsCount === 0 && binding && binding.path.isFlow()) {
12848 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 6.8. To find out the caller, grep for this\n message and change it to a `console.trace()`.\n ");
12849 }
12850 return binding;
12851 };
12852
12853 Scope.prototype.getBinding = function getBinding(name) {
12854 var scope = this;
12855
12856 do {
12857 var binding = scope.getOwnBinding(name);
12858 if (binding) return this.warnOnFlowBinding(binding);
12859 } while (scope = scope.parent);
12860 };
12861
12862 Scope.prototype.getOwnBinding = function getOwnBinding(name) {
12863 return this.warnOnFlowBinding(this.bindings[name]);
12864 };
12865
12866 Scope.prototype.getBindingIdentifier = function getBindingIdentifier(name) {
12867 var info = this.getBinding(name);
12868 return info && info.identifier;
12869 };
12870
12871 Scope.prototype.getOwnBindingIdentifier = function getOwnBindingIdentifier(name) {
12872 var binding = this.bindings[name];
12873 return binding && binding.identifier;
12874 };
12875
12876 Scope.prototype.hasOwnBinding = function hasOwnBinding(name) {
12877 return !!this.getOwnBinding(name);
12878 };
12879
12880 Scope.prototype.hasBinding = function hasBinding(name, noGlobals) {
12881 if (!name) return false;
12882 if (this.hasOwnBinding(name)) return true;
12883 if (this.parentHasBinding(name, noGlobals)) return true;
12884 if (this.hasUid(name)) return true;
12885 if (!noGlobals && (0, _includes2.default)(Scope.globals, name)) return true;
12886 if (!noGlobals && (0, _includes2.default)(Scope.contextVariables, name)) return true;
12887 return false;
12888 };
12889
12890 Scope.prototype.parentHasBinding = function parentHasBinding(name, noGlobals) {
12891 return this.parent && this.parent.hasBinding(name, noGlobals);
12892 };
12893
12894 Scope.prototype.moveBindingTo = function moveBindingTo(name, scope) {
12895 var info = this.getBinding(name);
12896 if (info) {
12897 info.scope.removeOwnBinding(name);
12898 info.scope = scope;
12899 scope.bindings[name] = info;
12900 }
12901 };
12902
12903 Scope.prototype.removeOwnBinding = function removeOwnBinding(name) {
12904 delete this.bindings[name];
12905 };
12906
12907 Scope.prototype.removeBinding = function removeBinding(name) {
12908 var info = this.getBinding(name);
12909 if (info) {
12910 info.scope.removeOwnBinding(name);
12911 }
12912
12913 var scope = this;
12914 do {
12915 if (scope.uids[name]) {
12916 scope.uids[name] = false;
12917 }
12918 } while (scope = scope.parent);
12919 };
12920
12921 return Scope;
12922}();
12923
12924Scope.globals = (0, _keys2.default)(_globals2.default.builtin);
12925Scope.contextVariables = ["arguments", "undefined", "Infinity", "NaN"];
12926exports.default = Scope;
12927module.exports = exports["default"];
12928},{"../cache":76,"../index":79,"./binding":97,"./lib/renamer":99,"babel-messages":53,"babel-runtime/core-js/get-iterator":56,"babel-runtime/core-js/map":58,"babel-runtime/core-js/object/create":61,"babel-runtime/core-js/object/keys":63,"babel-runtime/helpers/classCallCheck":70,"babel-types":112,"globals":242,"lodash/defaults":420,"lodash/includes":431,"lodash/repeat":454}],99:[function(require,module,exports){
12929"use strict";
12930
12931exports.__esModule = true;
12932
12933var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
12934
12935var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
12936
12937var _binding = require("../binding");
12938
12939var _binding2 = _interopRequireDefault(_binding);
12940
12941var _babelTypes = require("babel-types");
12942
12943var t = _interopRequireWildcard(_babelTypes);
12944
12945function _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; } }
12946
12947function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12948
12949var renameVisitor = {
12950 ReferencedIdentifier: function ReferencedIdentifier(_ref, state) {
12951 var node = _ref.node;
12952
12953 if (node.name === state.oldName) {
12954 node.name = state.newName;
12955 }
12956 },
12957 Scope: function Scope(path, state) {
12958 if (!path.scope.bindingIdentifierEquals(state.oldName, state.binding.identifier)) {
12959 path.skip();
12960 }
12961 },
12962 "AssignmentExpression|Declaration": function AssignmentExpressionDeclaration(path, state) {
12963 var ids = path.getOuterBindingIdentifiers();
12964
12965 for (var name in ids) {
12966 if (name === state.oldName) ids[name].name = state.newName;
12967 }
12968 }
12969};
12970
12971var Renamer = function () {
12972 function Renamer(binding, oldName, newName) {
12973 (0, _classCallCheck3.default)(this, Renamer);
12974
12975 this.newName = newName;
12976 this.oldName = oldName;
12977 this.binding = binding;
12978 }
12979
12980 Renamer.prototype.maybeConvertFromExportDeclaration = function maybeConvertFromExportDeclaration(parentDeclar) {
12981 var exportDeclar = parentDeclar.parentPath.isExportDeclaration() && parentDeclar.parentPath;
12982 if (!exportDeclar) return;
12983
12984 var isDefault = exportDeclar.isExportDefaultDeclaration();
12985
12986 if (isDefault && (parentDeclar.isFunctionDeclaration() || parentDeclar.isClassDeclaration()) && !parentDeclar.node.id) {
12987 parentDeclar.node.id = parentDeclar.scope.generateUidIdentifier("default");
12988 }
12989
12990 var bindingIdentifiers = parentDeclar.getOuterBindingIdentifiers();
12991 var specifiers = [];
12992
12993 for (var name in bindingIdentifiers) {
12994 var localName = name === this.oldName ? this.newName : name;
12995 var exportedName = isDefault ? "default" : name;
12996 specifiers.push(t.exportSpecifier(t.identifier(localName), t.identifier(exportedName)));
12997 }
12998
12999 if (specifiers.length) {
13000 var aliasDeclar = t.exportNamedDeclaration(null, specifiers);
13001
13002 if (parentDeclar.isFunctionDeclaration()) {
13003 aliasDeclar._blockHoist = 3;
13004 }
13005
13006 exportDeclar.insertAfter(aliasDeclar);
13007 exportDeclar.replaceWith(parentDeclar.node);
13008 }
13009 };
13010
13011 Renamer.prototype.maybeConvertFromClassFunctionDeclaration = function maybeConvertFromClassFunctionDeclaration(path) {
13012 return;
13013
13014 if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return;
13015 if (this.binding.kind !== "hoisted") return;
13016
13017 path.node.id = t.identifier(this.oldName);
13018 path.node._blockHoist = 3;
13019
13020 path.replaceWith(t.variableDeclaration("let", [t.variableDeclarator(t.identifier(this.newName), t.toExpression(path.node))]));
13021 };
13022
13023 Renamer.prototype.maybeConvertFromClassFunctionExpression = function maybeConvertFromClassFunctionExpression(path) {
13024 return;
13025
13026 if (!path.isFunctionExpression() && !path.isClassExpression()) return;
13027 if (this.binding.kind !== "local") return;
13028
13029 path.node.id = t.identifier(this.oldName);
13030
13031 this.binding.scope.parent.push({
13032 id: t.identifier(this.newName)
13033 });
13034
13035 path.replaceWith(t.assignmentExpression("=", t.identifier(this.newName), path.node));
13036 };
13037
13038 Renamer.prototype.rename = function rename(block) {
13039 var binding = this.binding,
13040 oldName = this.oldName,
13041 newName = this.newName;
13042 var scope = binding.scope,
13043 path = binding.path;
13044
13045
13046 var parentDeclar = path.find(function (path) {
13047 return path.isDeclaration() || path.isFunctionExpression();
13048 });
13049 if (parentDeclar) {
13050 this.maybeConvertFromExportDeclaration(parentDeclar);
13051 }
13052
13053 scope.traverse(block || scope.block, renameVisitor, this);
13054
13055 if (!block) {
13056 scope.removeOwnBinding(oldName);
13057 scope.bindings[newName] = binding;
13058 this.binding.identifier.name = newName;
13059 }
13060
13061 if (binding.type === "hoisted") {}
13062
13063 if (parentDeclar) {
13064 this.maybeConvertFromClassFunctionDeclaration(parentDeclar);
13065 this.maybeConvertFromClassFunctionExpression(parentDeclar);
13066 }
13067 };
13068
13069 return Renamer;
13070}();
13071
13072exports.default = Renamer;
13073module.exports = exports["default"];
13074},{"../binding":97,"babel-runtime/helpers/classCallCheck":70,"babel-types":112}],100:[function(require,module,exports){
13075"use strict";
13076
13077exports.__esModule = true;
13078
13079var _typeof2 = require("babel-runtime/helpers/typeof");
13080
13081var _typeof3 = _interopRequireDefault(_typeof2);
13082
13083var _keys = require("babel-runtime/core-js/object/keys");
13084
13085var _keys2 = _interopRequireDefault(_keys);
13086
13087var _getIterator2 = require("babel-runtime/core-js/get-iterator");
13088
13089var _getIterator3 = _interopRequireDefault(_getIterator2);
13090
13091exports.explode = explode;
13092exports.verify = verify;
13093exports.merge = merge;
13094
13095var _virtualTypes = require("./path/lib/virtual-types");
13096
13097var virtualTypes = _interopRequireWildcard(_virtualTypes);
13098
13099var _babelMessages = require("babel-messages");
13100
13101var messages = _interopRequireWildcard(_babelMessages);
13102
13103var _babelTypes = require("babel-types");
13104
13105var t = _interopRequireWildcard(_babelTypes);
13106
13107var _clone = require("lodash/clone");
13108
13109var _clone2 = _interopRequireDefault(_clone);
13110
13111function _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; } }
13112
13113function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13114
13115function explode(visitor) {
13116 if (visitor._exploded) return visitor;
13117 visitor._exploded = true;
13118
13119 for (var nodeType in visitor) {
13120 if (shouldIgnoreKey(nodeType)) continue;
13121
13122 var parts = nodeType.split("|");
13123 if (parts.length === 1) continue;
13124
13125 var fns = visitor[nodeType];
13126 delete visitor[nodeType];
13127
13128 for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
13129 var _ref;
13130
13131 if (_isArray) {
13132 if (_i >= _iterator.length) break;
13133 _ref = _iterator[_i++];
13134 } else {
13135 _i = _iterator.next();
13136 if (_i.done) break;
13137 _ref = _i.value;
13138 }
13139
13140 var part = _ref;
13141
13142 visitor[part] = fns;
13143 }
13144 }
13145
13146 verify(visitor);
13147
13148 delete visitor.__esModule;
13149
13150 ensureEntranceObjects(visitor);
13151
13152 ensureCallbackArrays(visitor);
13153
13154 for (var _iterator2 = (0, _keys2.default)(visitor), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
13155 var _ref2;
13156
13157 if (_isArray2) {
13158 if (_i2 >= _iterator2.length) break;
13159 _ref2 = _iterator2[_i2++];
13160 } else {
13161 _i2 = _iterator2.next();
13162 if (_i2.done) break;
13163 _ref2 = _i2.value;
13164 }
13165
13166 var _nodeType3 = _ref2;
13167
13168 if (shouldIgnoreKey(_nodeType3)) continue;
13169
13170 var wrapper = virtualTypes[_nodeType3];
13171 if (!wrapper) continue;
13172
13173 var _fns2 = visitor[_nodeType3];
13174 for (var type in _fns2) {
13175 _fns2[type] = wrapCheck(wrapper, _fns2[type]);
13176 }
13177
13178 delete visitor[_nodeType3];
13179
13180 if (wrapper.types) {
13181 for (var _iterator4 = wrapper.types, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
13182 var _ref4;
13183
13184 if (_isArray4) {
13185 if (_i4 >= _iterator4.length) break;
13186 _ref4 = _iterator4[_i4++];
13187 } else {
13188 _i4 = _iterator4.next();
13189 if (_i4.done) break;
13190 _ref4 = _i4.value;
13191 }
13192
13193 var _type = _ref4;
13194
13195 if (visitor[_type]) {
13196 mergePair(visitor[_type], _fns2);
13197 } else {
13198 visitor[_type] = _fns2;
13199 }
13200 }
13201 } else {
13202 mergePair(visitor, _fns2);
13203 }
13204 }
13205
13206 for (var _nodeType in visitor) {
13207 if (shouldIgnoreKey(_nodeType)) continue;
13208
13209 var _fns = visitor[_nodeType];
13210
13211 var aliases = t.FLIPPED_ALIAS_KEYS[_nodeType];
13212
13213 var deprecratedKey = t.DEPRECATED_KEYS[_nodeType];
13214 if (deprecratedKey) {
13215 console.trace("Visitor defined for " + _nodeType + " but it has been renamed to " + deprecratedKey);
13216 aliases = [deprecratedKey];
13217 }
13218
13219 if (!aliases) continue;
13220
13221 delete visitor[_nodeType];
13222
13223 for (var _iterator3 = aliases, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
13224 var _ref3;
13225
13226 if (_isArray3) {
13227 if (_i3 >= _iterator3.length) break;
13228 _ref3 = _iterator3[_i3++];
13229 } else {
13230 _i3 = _iterator3.next();
13231 if (_i3.done) break;
13232 _ref3 = _i3.value;
13233 }
13234
13235 var alias = _ref3;
13236
13237 var existing = visitor[alias];
13238 if (existing) {
13239 mergePair(existing, _fns);
13240 } else {
13241 visitor[alias] = (0, _clone2.default)(_fns);
13242 }
13243 }
13244 }
13245
13246 for (var _nodeType2 in visitor) {
13247 if (shouldIgnoreKey(_nodeType2)) continue;
13248
13249 ensureCallbackArrays(visitor[_nodeType2]);
13250 }
13251
13252 return visitor;
13253}
13254
13255function verify(visitor) {
13256 if (visitor._verified) return;
13257
13258 if (typeof visitor === "function") {
13259 throw new Error(messages.get("traverseVerifyRootFunction"));
13260 }
13261
13262 for (var nodeType in visitor) {
13263 if (nodeType === "enter" || nodeType === "exit") {
13264 validateVisitorMethods(nodeType, visitor[nodeType]);
13265 }
13266
13267 if (shouldIgnoreKey(nodeType)) continue;
13268
13269 if (t.TYPES.indexOf(nodeType) < 0) {
13270 throw new Error(messages.get("traverseVerifyNodeType", nodeType));
13271 }
13272
13273 var visitors = visitor[nodeType];
13274 if ((typeof visitors === "undefined" ? "undefined" : (0, _typeof3.default)(visitors)) === "object") {
13275 for (var visitorKey in visitors) {
13276 if (visitorKey === "enter" || visitorKey === "exit") {
13277 validateVisitorMethods(nodeType + "." + visitorKey, visitors[visitorKey]);
13278 } else {
13279 throw new Error(messages.get("traverseVerifyVisitorProperty", nodeType, visitorKey));
13280 }
13281 }
13282 }
13283 }
13284
13285 visitor._verified = true;
13286}
13287
13288function validateVisitorMethods(path, val) {
13289 var fns = [].concat(val);
13290 for (var _iterator5 = fns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) {
13291 var _ref5;
13292
13293 if (_isArray5) {
13294 if (_i5 >= _iterator5.length) break;
13295 _ref5 = _iterator5[_i5++];
13296 } else {
13297 _i5 = _iterator5.next();
13298 if (_i5.done) break;
13299 _ref5 = _i5.value;
13300 }
13301
13302 var fn = _ref5;
13303
13304 if (typeof fn !== "function") {
13305 throw new TypeError("Non-function found defined in " + path + " with type " + (typeof fn === "undefined" ? "undefined" : (0, _typeof3.default)(fn)));
13306 }
13307 }
13308}
13309
13310function merge(visitors) {
13311 var states = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
13312 var wrapper = arguments[2];
13313
13314 var rootVisitor = {};
13315
13316 for (var i = 0; i < visitors.length; i++) {
13317 var visitor = visitors[i];
13318 var state = states[i];
13319
13320 explode(visitor);
13321
13322 for (var type in visitor) {
13323 var visitorType = visitor[type];
13324
13325 if (state || wrapper) {
13326 visitorType = wrapWithStateOrWrapper(visitorType, state, wrapper);
13327 }
13328
13329 var nodeVisitor = rootVisitor[type] = rootVisitor[type] || {};
13330 mergePair(nodeVisitor, visitorType);
13331 }
13332 }
13333
13334 return rootVisitor;
13335}
13336
13337function wrapWithStateOrWrapper(oldVisitor, state, wrapper) {
13338 var newVisitor = {};
13339
13340 var _loop = function _loop(key) {
13341 var fns = oldVisitor[key];
13342
13343 if (!Array.isArray(fns)) return "continue";
13344
13345 fns = fns.map(function (fn) {
13346 var newFn = fn;
13347
13348 if (state) {
13349 newFn = function newFn(path) {
13350 return fn.call(state, path, state);
13351 };
13352 }
13353
13354 if (wrapper) {
13355 newFn = wrapper(state.key, key, newFn);
13356 }
13357
13358 return newFn;
13359 });
13360
13361 newVisitor[key] = fns;
13362 };
13363
13364 for (var key in oldVisitor) {
13365 var _ret = _loop(key);
13366
13367 if (_ret === "continue") continue;
13368 }
13369
13370 return newVisitor;
13371}
13372
13373function ensureEntranceObjects(obj) {
13374 for (var key in obj) {
13375 if (shouldIgnoreKey(key)) continue;
13376
13377 var fns = obj[key];
13378 if (typeof fns === "function") {
13379 obj[key] = { enter: fns };
13380 }
13381 }
13382}
13383
13384function ensureCallbackArrays(obj) {
13385 if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter];
13386 if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit];
13387}
13388
13389function wrapCheck(wrapper, fn) {
13390 var newFn = function newFn(path) {
13391 if (wrapper.checkPath(path)) {
13392 return fn.apply(this, arguments);
13393 }
13394 };
13395 newFn.toString = function () {
13396 return fn.toString();
13397 };
13398 return newFn;
13399}
13400
13401function shouldIgnoreKey(key) {
13402 if (key[0] === "_") return true;
13403
13404 if (key === "enter" || key === "exit" || key === "shouldSkip") return true;
13405
13406 if (key === "blacklist" || key === "noScope" || key === "skipKeys") return true;
13407
13408 return false;
13409}
13410
13411function mergePair(dest, src) {
13412 for (var key in src) {
13413 dest[key] = [].concat(dest[key] || [], src[key]);
13414 }
13415}
13416},{"./path/lib/virtual-types":93,"babel-messages":53,"babel-runtime/core-js/get-iterator":56,"babel-runtime/core-js/object/keys":63,"babel-runtime/helpers/typeof":74,"babel-types":112,"lodash/clone":416}],101:[function(require,module,exports){
13417"use strict";
13418
13419exports.__esModule = true;
13420exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = undefined;
13421
13422var _for = require("babel-runtime/core-js/symbol/for");
13423
13424var _for2 = _interopRequireDefault(_for);
13425
13426function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13427
13428var STATEMENT_OR_BLOCK_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = ["consequent", "body", "alternate"];
13429var FLATTENABLE_KEYS = exports.FLATTENABLE_KEYS = ["body", "expressions"];
13430var FOR_INIT_KEYS = exports.FOR_INIT_KEYS = ["left", "init"];
13431var COMMENT_KEYS = exports.COMMENT_KEYS = ["leadingComments", "trailingComments", "innerComments"];
13432
13433var LOGICAL_OPERATORS = exports.LOGICAL_OPERATORS = ["||", "&&"];
13434var UPDATE_OPERATORS = exports.UPDATE_OPERATORS = ["++", "--"];
13435
13436var BOOLEAN_NUMBER_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = [">", "<", ">=", "<="];
13437var EQUALITY_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = ["==", "===", "!=", "!=="];
13438var COMPARISON_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = [].concat(EQUALITY_BINARY_OPERATORS, ["in", "instanceof"]);
13439var BOOLEAN_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = [].concat(COMPARISON_BINARY_OPERATORS, BOOLEAN_NUMBER_BINARY_OPERATORS);
13440var NUMBER_BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = ["-", "/", "%", "*", "**", "&", "|", ">>", ">>>", "<<", "^"];
13441var BINARY_OPERATORS = exports.BINARY_OPERATORS = ["+"].concat(NUMBER_BINARY_OPERATORS, BOOLEAN_BINARY_OPERATORS);
13442
13443var BOOLEAN_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = ["delete", "!"];
13444var NUMBER_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = ["+", "-", "++", "--", "~"];
13445var STRING_UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = ["typeof"];
13446var UNARY_OPERATORS = exports.UNARY_OPERATORS = ["void"].concat(BOOLEAN_UNARY_OPERATORS, NUMBER_UNARY_OPERATORS, STRING_UNARY_OPERATORS);
13447
13448var INHERIT_KEYS = exports.INHERIT_KEYS = {
13449 optional: ["typeAnnotation", "typeParameters", "returnType"],
13450 force: ["start", "loc", "end"]
13451};
13452
13453var BLOCK_SCOPED_SYMBOL = exports.BLOCK_SCOPED_SYMBOL = (0, _for2.default)("var used to be block scoped");
13454var NOT_LOCAL_BINDING = exports.NOT_LOCAL_BINDING = (0, _for2.default)("should not be considered a local binding");
13455},{"babel-runtime/core-js/symbol/for":66}],102:[function(require,module,exports){
13456"use strict";
13457
13458exports.__esModule = true;
13459
13460var _maxSafeInteger = require("babel-runtime/core-js/number/max-safe-integer");
13461
13462var _maxSafeInteger2 = _interopRequireDefault(_maxSafeInteger);
13463
13464var _stringify = require("babel-runtime/core-js/json/stringify");
13465
13466var _stringify2 = _interopRequireDefault(_stringify);
13467
13468var _getIterator2 = require("babel-runtime/core-js/get-iterator");
13469
13470var _getIterator3 = _interopRequireDefault(_getIterator2);
13471
13472exports.toComputedKey = toComputedKey;
13473exports.toSequenceExpression = toSequenceExpression;
13474exports.toKeyAlias = toKeyAlias;
13475exports.toIdentifier = toIdentifier;
13476exports.toBindingIdentifierName = toBindingIdentifierName;
13477exports.toStatement = toStatement;
13478exports.toExpression = toExpression;
13479exports.toBlock = toBlock;
13480exports.valueToNode = valueToNode;
13481
13482var _isPlainObject = require("lodash/isPlainObject");
13483
13484var _isPlainObject2 = _interopRequireDefault(_isPlainObject);
13485
13486var _isRegExp = require("lodash/isRegExp");
13487
13488var _isRegExp2 = _interopRequireDefault(_isRegExp);
13489
13490var _index = require("./index");
13491
13492var t = _interopRequireWildcard(_index);
13493
13494function _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; } }
13495
13496function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13497
13498function toComputedKey(node) {
13499 var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : node.key || node.property;
13500
13501 if (!node.computed) {
13502 if (t.isIdentifier(key)) key = t.stringLiteral(key.name);
13503 }
13504 return key;
13505}
13506
13507function toSequenceExpression(nodes, scope) {
13508 if (!nodes || !nodes.length) return;
13509
13510 var declars = [];
13511 var bailed = false;
13512
13513 var result = convert(nodes);
13514 if (bailed) return;
13515
13516 for (var i = 0; i < declars.length; i++) {
13517 scope.push(declars[i]);
13518 }
13519
13520 return result;
13521
13522 function convert(nodes) {
13523 var ensureLastUndefined = false;
13524 var exprs = [];
13525
13526 for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
13527 var _ref;
13528
13529 if (_isArray) {
13530 if (_i >= _iterator.length) break;
13531 _ref = _iterator[_i++];
13532 } else {
13533 _i = _iterator.next();
13534 if (_i.done) break;
13535 _ref = _i.value;
13536 }
13537
13538 var node = _ref;
13539
13540 if (t.isExpression(node)) {
13541 exprs.push(node);
13542 } else if (t.isExpressionStatement(node)) {
13543 exprs.push(node.expression);
13544 } else if (t.isVariableDeclaration(node)) {
13545 if (node.kind !== "var") return bailed = true;
13546
13547 for (var _iterator2 = node.declarations, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
13548 var _ref2;
13549
13550 if (_isArray2) {
13551 if (_i2 >= _iterator2.length) break;
13552 _ref2 = _iterator2[_i2++];
13553 } else {
13554 _i2 = _iterator2.next();
13555 if (_i2.done) break;
13556 _ref2 = _i2.value;
13557 }
13558
13559 var declar = _ref2;
13560
13561 var bindings = t.getBindingIdentifiers(declar);
13562 for (var key in bindings) {
13563 declars.push({
13564 kind: node.kind,
13565 id: bindings[key]
13566 });
13567 }
13568
13569 if (declar.init) {
13570 exprs.push(t.assignmentExpression("=", declar.id, declar.init));
13571 }
13572 }
13573
13574 ensureLastUndefined = true;
13575 continue;
13576 } else if (t.isIfStatement(node)) {
13577 var consequent = node.consequent ? convert([node.consequent]) : scope.buildUndefinedNode();
13578 var alternate = node.alternate ? convert([node.alternate]) : scope.buildUndefinedNode();
13579 if (!consequent || !alternate) return bailed = true;
13580
13581 exprs.push(t.conditionalExpression(node.test, consequent, alternate));
13582 } else if (t.isBlockStatement(node)) {
13583 exprs.push(convert(node.body));
13584 } else if (t.isEmptyStatement(node)) {
13585 ensureLastUndefined = true;
13586 continue;
13587 } else {
13588 return bailed = true;
13589 }
13590
13591 ensureLastUndefined = false;
13592 }
13593
13594 if (ensureLastUndefined || exprs.length === 0) {
13595 exprs.push(scope.buildUndefinedNode());
13596 }
13597
13598 if (exprs.length === 1) {
13599 return exprs[0];
13600 } else {
13601 return t.sequenceExpression(exprs);
13602 }
13603 }
13604}
13605
13606function toKeyAlias(node) {
13607 var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : node.key;
13608
13609 var alias = void 0;
13610
13611 if (node.kind === "method") {
13612 return toKeyAlias.increment() + "";
13613 } else if (t.isIdentifier(key)) {
13614 alias = key.name;
13615 } else if (t.isStringLiteral(key)) {
13616 alias = (0, _stringify2.default)(key.value);
13617 } else {
13618 alias = (0, _stringify2.default)(t.removePropertiesDeep(t.cloneDeep(key)));
13619 }
13620
13621 if (node.computed) {
13622 alias = "[" + alias + "]";
13623 }
13624
13625 if (node.static) {
13626 alias = "static:" + alias;
13627 }
13628
13629 return alias;
13630}
13631
13632toKeyAlias.uid = 0;
13633
13634toKeyAlias.increment = function () {
13635 if (toKeyAlias.uid >= _maxSafeInteger2.default) {
13636 return toKeyAlias.uid = 0;
13637 } else {
13638 return toKeyAlias.uid++;
13639 }
13640};
13641
13642function toIdentifier(name) {
13643 name = name + "";
13644
13645 name = name.replace(/[^a-zA-Z0-9$_]/g, "-");
13646
13647 name = name.replace(/^[-0-9]+/, "");
13648
13649 name = name.replace(/[-\s]+(.)?/g, function (match, c) {
13650 return c ? c.toUpperCase() : "";
13651 });
13652
13653 if (!t.isValidIdentifier(name)) {
13654 name = "_" + name;
13655 }
13656
13657 return name || "_";
13658}
13659
13660function toBindingIdentifierName(name) {
13661 name = toIdentifier(name);
13662 if (name === "eval" || name === "arguments") name = "_" + name;
13663 return name;
13664}
13665
13666function toStatement(node, ignore) {
13667 if (t.isStatement(node)) {
13668 return node;
13669 }
13670
13671 var mustHaveId = false;
13672 var newType = void 0;
13673
13674 if (t.isClass(node)) {
13675 mustHaveId = true;
13676 newType = "ClassDeclaration";
13677 } else if (t.isFunction(node)) {
13678 mustHaveId = true;
13679 newType = "FunctionDeclaration";
13680 } else if (t.isAssignmentExpression(node)) {
13681 return t.expressionStatement(node);
13682 }
13683
13684 if (mustHaveId && !node.id) {
13685 newType = false;
13686 }
13687
13688 if (!newType) {
13689 if (ignore) {
13690 return false;
13691 } else {
13692 throw new Error("cannot turn " + node.type + " to a statement");
13693 }
13694 }
13695
13696 node.type = newType;
13697
13698 return node;
13699}
13700
13701function toExpression(node) {
13702 if (t.isExpressionStatement(node)) {
13703 node = node.expression;
13704 }
13705
13706 if (t.isExpression(node)) {
13707 return node;
13708 }
13709
13710 if (t.isClass(node)) {
13711 node.type = "ClassExpression";
13712 } else if (t.isFunction(node)) {
13713 node.type = "FunctionExpression";
13714 }
13715
13716 if (!t.isExpression(node)) {
13717 throw new Error("cannot turn " + node.type + " to an expression");
13718 }
13719
13720 return node;
13721}
13722
13723function toBlock(node, parent) {
13724 if (t.isBlockStatement(node)) {
13725 return node;
13726 }
13727
13728 if (t.isEmptyStatement(node)) {
13729 node = [];
13730 }
13731
13732 if (!Array.isArray(node)) {
13733 if (!t.isStatement(node)) {
13734 if (t.isFunction(parent)) {
13735 node = t.returnStatement(node);
13736 } else {
13737 node = t.expressionStatement(node);
13738 }
13739 }
13740
13741 node = [node];
13742 }
13743
13744 return t.blockStatement(node);
13745}
13746
13747function valueToNode(value) {
13748 if (value === undefined) {
13749 return t.identifier("undefined");
13750 }
13751
13752 if (value === true || value === false) {
13753 return t.booleanLiteral(value);
13754 }
13755
13756 if (value === null) {
13757 return t.nullLiteral();
13758 }
13759
13760 if (typeof value === "string") {
13761 return t.stringLiteral(value);
13762 }
13763
13764 if (typeof value === "number") {
13765 return t.numericLiteral(value);
13766 }
13767
13768 if ((0, _isRegExp2.default)(value)) {
13769 var pattern = value.source;
13770 var flags = value.toString().match(/\/([a-z]+|)$/)[1];
13771 return t.regExpLiteral(pattern, flags);
13772 }
13773
13774 if (Array.isArray(value)) {
13775 return t.arrayExpression(value.map(t.valueToNode));
13776 }
13777
13778 if ((0, _isPlainObject2.default)(value)) {
13779 var props = [];
13780 for (var key in value) {
13781 var nodeKey = void 0;
13782 if (t.isValidIdentifier(key)) {
13783 nodeKey = t.identifier(key);
13784 } else {
13785 nodeKey = t.stringLiteral(key);
13786 }
13787 props.push(t.objectProperty(nodeKey, t.valueToNode(value[key])));
13788 }
13789 return t.objectExpression(props);
13790 }
13791
13792 throw new Error("don't know how to turn this value into a node");
13793}
13794},{"./index":112,"babel-runtime/core-js/get-iterator":56,"babel-runtime/core-js/json/stringify":57,"babel-runtime/core-js/number/max-safe-integer":59,"lodash/isPlainObject":442,"lodash/isRegExp":443}],103:[function(require,module,exports){
13795"use strict";
13796
13797var _index = require("../index");
13798
13799var t = _interopRequireWildcard(_index);
13800
13801var _constants = require("../constants");
13802
13803var _index2 = require("./index");
13804
13805var _index3 = _interopRequireDefault(_index2);
13806
13807function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13808
13809function _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; } }
13810
13811(0, _index3.default)("ArrayExpression", {
13812 fields: {
13813 elements: {
13814 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeOrValueType)("null", "Expression", "SpreadElement"))),
13815 default: []
13816 }
13817 },
13818 visitor: ["elements"],
13819 aliases: ["Expression"]
13820});
13821
13822(0, _index3.default)("AssignmentExpression", {
13823 fields: {
13824 operator: {
13825 validate: (0, _index2.assertValueType)("string")
13826 },
13827 left: {
13828 validate: (0, _index2.assertNodeType)("LVal")
13829 },
13830 right: {
13831 validate: (0, _index2.assertNodeType)("Expression")
13832 }
13833 },
13834 builder: ["operator", "left", "right"],
13835 visitor: ["left", "right"],
13836 aliases: ["Expression"]
13837});
13838
13839(0, _index3.default)("BinaryExpression", {
13840 builder: ["operator", "left", "right"],
13841 fields: {
13842 operator: {
13843 validate: _index2.assertOneOf.apply(undefined, _constants.BINARY_OPERATORS)
13844 },
13845 left: {
13846 validate: (0, _index2.assertNodeType)("Expression")
13847 },
13848 right: {
13849 validate: (0, _index2.assertNodeType)("Expression")
13850 }
13851 },
13852 visitor: ["left", "right"],
13853 aliases: ["Binary", "Expression"]
13854});
13855
13856(0, _index3.default)("Directive", {
13857 visitor: ["value"],
13858 fields: {
13859 value: {
13860 validate: (0, _index2.assertNodeType)("DirectiveLiteral")
13861 }
13862 }
13863});
13864
13865(0, _index3.default)("DirectiveLiteral", {
13866 builder: ["value"],
13867 fields: {
13868 value: {
13869 validate: (0, _index2.assertValueType)("string")
13870 }
13871 }
13872});
13873
13874(0, _index3.default)("BlockStatement", {
13875 builder: ["body", "directives"],
13876 visitor: ["directives", "body"],
13877 fields: {
13878 directives: {
13879 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Directive"))),
13880 default: []
13881 },
13882 body: {
13883 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement")))
13884 }
13885 },
13886 aliases: ["Scopable", "BlockParent", "Block", "Statement"]
13887});
13888
13889(0, _index3.default)("BreakStatement", {
13890 visitor: ["label"],
13891 fields: {
13892 label: {
13893 validate: (0, _index2.assertNodeType)("Identifier"),
13894 optional: true
13895 }
13896 },
13897 aliases: ["Statement", "Terminatorless", "CompletionStatement"]
13898});
13899
13900(0, _index3.default)("CallExpression", {
13901 visitor: ["callee", "arguments"],
13902 fields: {
13903 callee: {
13904 validate: (0, _index2.assertNodeType)("Expression")
13905 },
13906 arguments: {
13907 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression", "SpreadElement")))
13908 }
13909 },
13910 aliases: ["Expression"]
13911});
13912
13913(0, _index3.default)("CatchClause", {
13914 visitor: ["param", "body"],
13915 fields: {
13916 param: {
13917 validate: (0, _index2.assertNodeType)("Identifier")
13918 },
13919 body: {
13920 validate: (0, _index2.assertNodeType)("BlockStatement")
13921 }
13922 },
13923 aliases: ["Scopable"]
13924});
13925
13926(0, _index3.default)("ConditionalExpression", {
13927 visitor: ["test", "consequent", "alternate"],
13928 fields: {
13929 test: {
13930 validate: (0, _index2.assertNodeType)("Expression")
13931 },
13932 consequent: {
13933 validate: (0, _index2.assertNodeType)("Expression")
13934 },
13935 alternate: {
13936 validate: (0, _index2.assertNodeType)("Expression")
13937 }
13938 },
13939 aliases: ["Expression", "Conditional"]
13940});
13941
13942(0, _index3.default)("ContinueStatement", {
13943 visitor: ["label"],
13944 fields: {
13945 label: {
13946 validate: (0, _index2.assertNodeType)("Identifier"),
13947 optional: true
13948 }
13949 },
13950 aliases: ["Statement", "Terminatorless", "CompletionStatement"]
13951});
13952
13953(0, _index3.default)("DebuggerStatement", {
13954 aliases: ["Statement"]
13955});
13956
13957(0, _index3.default)("DoWhileStatement", {
13958 visitor: ["test", "body"],
13959 fields: {
13960 test: {
13961 validate: (0, _index2.assertNodeType)("Expression")
13962 },
13963 body: {
13964 validate: (0, _index2.assertNodeType)("Statement")
13965 }
13966 },
13967 aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"]
13968});
13969
13970(0, _index3.default)("EmptyStatement", {
13971 aliases: ["Statement"]
13972});
13973
13974(0, _index3.default)("ExpressionStatement", {
13975 visitor: ["expression"],
13976 fields: {
13977 expression: {
13978 validate: (0, _index2.assertNodeType)("Expression")
13979 }
13980 },
13981 aliases: ["Statement", "ExpressionWrapper"]
13982});
13983
13984(0, _index3.default)("File", {
13985 builder: ["program", "comments", "tokens"],
13986 visitor: ["program"],
13987 fields: {
13988 program: {
13989 validate: (0, _index2.assertNodeType)("Program")
13990 }
13991 }
13992});
13993
13994(0, _index3.default)("ForInStatement", {
13995 visitor: ["left", "right", "body"],
13996 aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
13997 fields: {
13998 left: {
13999 validate: (0, _index2.assertNodeType)("VariableDeclaration", "LVal")
14000 },
14001 right: {
14002 validate: (0, _index2.assertNodeType)("Expression")
14003 },
14004 body: {
14005 validate: (0, _index2.assertNodeType)("Statement")
14006 }
14007 }
14008});
14009
14010(0, _index3.default)("ForStatement", {
14011 visitor: ["init", "test", "update", "body"],
14012 aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop"],
14013 fields: {
14014 init: {
14015 validate: (0, _index2.assertNodeType)("VariableDeclaration", "Expression"),
14016 optional: true
14017 },
14018 test: {
14019 validate: (0, _index2.assertNodeType)("Expression"),
14020 optional: true
14021 },
14022 update: {
14023 validate: (0, _index2.assertNodeType)("Expression"),
14024 optional: true
14025 },
14026 body: {
14027 validate: (0, _index2.assertNodeType)("Statement")
14028 }
14029 }
14030});
14031
14032(0, _index3.default)("FunctionDeclaration", {
14033 builder: ["id", "params", "body", "generator", "async"],
14034 visitor: ["id", "params", "body", "returnType", "typeParameters"],
14035 fields: {
14036 id: {
14037 validate: (0, _index2.assertNodeType)("Identifier")
14038 },
14039 params: {
14040 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("LVal")))
14041 },
14042 body: {
14043 validate: (0, _index2.assertNodeType)("BlockStatement")
14044 },
14045 generator: {
14046 default: false,
14047 validate: (0, _index2.assertValueType)("boolean")
14048 },
14049 async: {
14050 default: false,
14051 validate: (0, _index2.assertValueType)("boolean")
14052 }
14053 },
14054 aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Statement", "Pureish", "Declaration"]
14055});
14056
14057(0, _index3.default)("FunctionExpression", {
14058 inherits: "FunctionDeclaration",
14059 aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
14060 fields: {
14061 id: {
14062 validate: (0, _index2.assertNodeType)("Identifier"),
14063 optional: true
14064 },
14065 params: {
14066 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("LVal")))
14067 },
14068 body: {
14069 validate: (0, _index2.assertNodeType)("BlockStatement")
14070 },
14071 generator: {
14072 default: false,
14073 validate: (0, _index2.assertValueType)("boolean")
14074 },
14075 async: {
14076 default: false,
14077 validate: (0, _index2.assertValueType)("boolean")
14078 }
14079 }
14080});
14081
14082(0, _index3.default)("Identifier", {
14083 builder: ["name"],
14084 visitor: ["typeAnnotation"],
14085 aliases: ["Expression", "LVal"],
14086 fields: {
14087 name: {
14088 validate: function validate(node, key, val) {
14089 if (!t.isValidIdentifier(val)) {}
14090 }
14091 },
14092 decorators: {
14093 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator")))
14094 }
14095 }
14096});
14097
14098(0, _index3.default)("IfStatement", {
14099 visitor: ["test", "consequent", "alternate"],
14100 aliases: ["Statement", "Conditional"],
14101 fields: {
14102 test: {
14103 validate: (0, _index2.assertNodeType)("Expression")
14104 },
14105 consequent: {
14106 validate: (0, _index2.assertNodeType)("Statement")
14107 },
14108 alternate: {
14109 optional: true,
14110 validate: (0, _index2.assertNodeType)("Statement")
14111 }
14112 }
14113});
14114
14115(0, _index3.default)("LabeledStatement", {
14116 visitor: ["label", "body"],
14117 aliases: ["Statement"],
14118 fields: {
14119 label: {
14120 validate: (0, _index2.assertNodeType)("Identifier")
14121 },
14122 body: {
14123 validate: (0, _index2.assertNodeType)("Statement")
14124 }
14125 }
14126});
14127
14128(0, _index3.default)("StringLiteral", {
14129 builder: ["value"],
14130 fields: {
14131 value: {
14132 validate: (0, _index2.assertValueType)("string")
14133 }
14134 },
14135 aliases: ["Expression", "Pureish", "Literal", "Immutable"]
14136});
14137
14138(0, _index3.default)("NumericLiteral", {
14139 builder: ["value"],
14140 deprecatedAlias: "NumberLiteral",
14141 fields: {
14142 value: {
14143 validate: (0, _index2.assertValueType)("number")
14144 }
14145 },
14146 aliases: ["Expression", "Pureish", "Literal", "Immutable"]
14147});
14148
14149(0, _index3.default)("NullLiteral", {
14150 aliases: ["Expression", "Pureish", "Literal", "Immutable"]
14151});
14152
14153(0, _index3.default)("BooleanLiteral", {
14154 builder: ["value"],
14155 fields: {
14156 value: {
14157 validate: (0, _index2.assertValueType)("boolean")
14158 }
14159 },
14160 aliases: ["Expression", "Pureish", "Literal", "Immutable"]
14161});
14162
14163(0, _index3.default)("RegExpLiteral", {
14164 builder: ["pattern", "flags"],
14165 deprecatedAlias: "RegexLiteral",
14166 aliases: ["Expression", "Literal"],
14167 fields: {
14168 pattern: {
14169 validate: (0, _index2.assertValueType)("string")
14170 },
14171 flags: {
14172 validate: (0, _index2.assertValueType)("string"),
14173 default: ""
14174 }
14175 }
14176});
14177
14178(0, _index3.default)("LogicalExpression", {
14179 builder: ["operator", "left", "right"],
14180 visitor: ["left", "right"],
14181 aliases: ["Binary", "Expression"],
14182 fields: {
14183 operator: {
14184 validate: _index2.assertOneOf.apply(undefined, _constants.LOGICAL_OPERATORS)
14185 },
14186 left: {
14187 validate: (0, _index2.assertNodeType)("Expression")
14188 },
14189 right: {
14190 validate: (0, _index2.assertNodeType)("Expression")
14191 }
14192 }
14193});
14194
14195(0, _index3.default)("MemberExpression", {
14196 builder: ["object", "property", "computed"],
14197 visitor: ["object", "property"],
14198 aliases: ["Expression", "LVal"],
14199 fields: {
14200 object: {
14201 validate: (0, _index2.assertNodeType)("Expression")
14202 },
14203 property: {
14204 validate: function validate(node, key, val) {
14205 var expectedType = node.computed ? "Expression" : "Identifier";
14206 (0, _index2.assertNodeType)(expectedType)(node, key, val);
14207 }
14208 },
14209 computed: {
14210 default: false
14211 }
14212 }
14213});
14214
14215(0, _index3.default)("NewExpression", {
14216 visitor: ["callee", "arguments"],
14217 aliases: ["Expression"],
14218 fields: {
14219 callee: {
14220 validate: (0, _index2.assertNodeType)("Expression")
14221 },
14222 arguments: {
14223 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression", "SpreadElement")))
14224 }
14225 }
14226});
14227
14228(0, _index3.default)("Program", {
14229 visitor: ["directives", "body"],
14230 builder: ["body", "directives"],
14231 fields: {
14232 directives: {
14233 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Directive"))),
14234 default: []
14235 },
14236 body: {
14237 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement")))
14238 }
14239 },
14240 aliases: ["Scopable", "BlockParent", "Block", "FunctionParent"]
14241});
14242
14243(0, _index3.default)("ObjectExpression", {
14244 visitor: ["properties"],
14245 aliases: ["Expression"],
14246 fields: {
14247 properties: {
14248 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("ObjectMethod", "ObjectProperty", "SpreadProperty")))
14249 }
14250 }
14251});
14252
14253(0, _index3.default)("ObjectMethod", {
14254 builder: ["kind", "key", "params", "body", "computed"],
14255 fields: {
14256 kind: {
14257 validate: (0, _index2.chain)((0, _index2.assertValueType)("string"), (0, _index2.assertOneOf)("method", "get", "set")),
14258 default: "method"
14259 },
14260 computed: {
14261 validate: (0, _index2.assertValueType)("boolean"),
14262 default: false
14263 },
14264 key: {
14265 validate: function validate(node, key, val) {
14266 var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"];
14267 _index2.assertNodeType.apply(undefined, expectedTypes)(node, key, val);
14268 }
14269 },
14270 decorators: {
14271 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator")))
14272 },
14273 body: {
14274 validate: (0, _index2.assertNodeType)("BlockStatement")
14275 },
14276 generator: {
14277 default: false,
14278 validate: (0, _index2.assertValueType)("boolean")
14279 },
14280 async: {
14281 default: false,
14282 validate: (0, _index2.assertValueType)("boolean")
14283 }
14284 },
14285 visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
14286 aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
14287});
14288
14289(0, _index3.default)("ObjectProperty", {
14290 builder: ["key", "value", "computed", "shorthand", "decorators"],
14291 fields: {
14292 computed: {
14293 validate: (0, _index2.assertValueType)("boolean"),
14294 default: false
14295 },
14296 key: {
14297 validate: function validate(node, key, val) {
14298 var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"];
14299 _index2.assertNodeType.apply(undefined, expectedTypes)(node, key, val);
14300 }
14301 },
14302 value: {
14303 validate: (0, _index2.assertNodeType)("Expression")
14304 },
14305 shorthand: {
14306 validate: (0, _index2.assertValueType)("boolean"),
14307 default: false
14308 },
14309 decorators: {
14310 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator"))),
14311 optional: true
14312 }
14313 },
14314 visitor: ["key", "value", "decorators"],
14315 aliases: ["UserWhitespacable", "Property", "ObjectMember"]
14316});
14317
14318(0, _index3.default)("RestElement", {
14319 visitor: ["argument", "typeAnnotation"],
14320 aliases: ["LVal"],
14321 fields: {
14322 argument: {
14323 validate: (0, _index2.assertNodeType)("LVal")
14324 },
14325 decorators: {
14326 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Decorator")))
14327 }
14328 }
14329});
14330
14331(0, _index3.default)("ReturnStatement", {
14332 visitor: ["argument"],
14333 aliases: ["Statement", "Terminatorless", "CompletionStatement"],
14334 fields: {
14335 argument: {
14336 validate: (0, _index2.assertNodeType)("Expression"),
14337 optional: true
14338 }
14339 }
14340});
14341
14342(0, _index3.default)("SequenceExpression", {
14343 visitor: ["expressions"],
14344 fields: {
14345 expressions: {
14346 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Expression")))
14347 }
14348 },
14349 aliases: ["Expression"]
14350});
14351
14352(0, _index3.default)("SwitchCase", {
14353 visitor: ["test", "consequent"],
14354 fields: {
14355 test: {
14356 validate: (0, _index2.assertNodeType)("Expression"),
14357 optional: true
14358 },
14359 consequent: {
14360 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("Statement")))
14361 }
14362 }
14363});
14364
14365(0, _index3.default)("SwitchStatement", {
14366 visitor: ["discriminant", "cases"],
14367 aliases: ["Statement", "BlockParent", "Scopable"],
14368 fields: {
14369 discriminant: {
14370 validate: (0, _index2.assertNodeType)("Expression")
14371 },
14372 cases: {
14373 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("SwitchCase")))
14374 }
14375 }
14376});
14377
14378(0, _index3.default)("ThisExpression", {
14379 aliases: ["Expression"]
14380});
14381
14382(0, _index3.default)("ThrowStatement", {
14383 visitor: ["argument"],
14384 aliases: ["Statement", "Terminatorless", "CompletionStatement"],
14385 fields: {
14386 argument: {
14387 validate: (0, _index2.assertNodeType)("Expression")
14388 }
14389 }
14390});
14391
14392(0, _index3.default)("TryStatement", {
14393 visitor: ["block", "handler", "finalizer"],
14394 aliases: ["Statement"],
14395 fields: {
14396 body: {
14397 validate: (0, _index2.assertNodeType)("BlockStatement")
14398 },
14399 handler: {
14400 optional: true,
14401 handler: (0, _index2.assertNodeType)("BlockStatement")
14402 },
14403 finalizer: {
14404 optional: true,
14405 validate: (0, _index2.assertNodeType)("BlockStatement")
14406 }
14407 }
14408});
14409
14410(0, _index3.default)("UnaryExpression", {
14411 builder: ["operator", "argument", "prefix"],
14412 fields: {
14413 prefix: {
14414 default: true
14415 },
14416 argument: {
14417 validate: (0, _index2.assertNodeType)("Expression")
14418 },
14419 operator: {
14420 validate: _index2.assertOneOf.apply(undefined, _constants.UNARY_OPERATORS)
14421 }
14422 },
14423 visitor: ["argument"],
14424 aliases: ["UnaryLike", "Expression"]
14425});
14426
14427(0, _index3.default)("UpdateExpression", {
14428 builder: ["operator", "argument", "prefix"],
14429 fields: {
14430 prefix: {
14431 default: false
14432 },
14433 argument: {
14434 validate: (0, _index2.assertNodeType)("Expression")
14435 },
14436 operator: {
14437 validate: _index2.assertOneOf.apply(undefined, _constants.UPDATE_OPERATORS)
14438 }
14439 },
14440 visitor: ["argument"],
14441 aliases: ["Expression"]
14442});
14443
14444(0, _index3.default)("VariableDeclaration", {
14445 builder: ["kind", "declarations"],
14446 visitor: ["declarations"],
14447 aliases: ["Statement", "Declaration"],
14448 fields: {
14449 kind: {
14450 validate: (0, _index2.chain)((0, _index2.assertValueType)("string"), (0, _index2.assertOneOf)("var", "let", "const"))
14451 },
14452 declarations: {
14453 validate: (0, _index2.chain)((0, _index2.assertValueType)("array"), (0, _index2.assertEach)((0, _index2.assertNodeType)("VariableDeclarator")))
14454 }
14455 }
14456});
14457
14458(0, _index3.default)("VariableDeclarator", {
14459 visitor: ["id", "init"],
14460 fields: {
14461 id: {
14462 validate: (0, _index2.assertNodeType)("LVal")
14463 },
14464 init: {
14465 optional: true,
14466 validate: (0, _index2.assertNodeType)("Expression")
14467 }
14468 }
14469});
14470
14471(0, _index3.default)("WhileStatement", {
14472 visitor: ["test", "body"],
14473 aliases: ["Statement", "BlockParent", "Loop", "While", "Scopable"],
14474 fields: {
14475 test: {
14476 validate: (0, _index2.assertNodeType)("Expression")
14477 },
14478 body: {
14479 validate: (0, _index2.assertNodeType)("BlockStatement", "Statement")
14480 }
14481 }
14482});
14483
14484(0, _index3.default)("WithStatement", {
14485 visitor: ["object", "body"],
14486 aliases: ["Statement"],
14487 fields: {
14488 object: {
14489 object: (0, _index2.assertNodeType)("Expression")
14490 },
14491 body: {
14492 validate: (0, _index2.assertNodeType)("BlockStatement", "Statement")
14493 }
14494 }
14495});
14496},{"../constants":101,"../index":112,"./index":107}],104:[function(require,module,exports){
14497"use strict";
14498
14499var _index = require("./index");
14500
14501var _index2 = _interopRequireDefault(_index);
14502
14503function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14504
14505(0, _index2.default)("AssignmentPattern", {
14506 visitor: ["left", "right"],
14507 aliases: ["Pattern", "LVal"],
14508 fields: {
14509 left: {
14510 validate: (0, _index.assertNodeType)("Identifier")
14511 },
14512 right: {
14513 validate: (0, _index.assertNodeType)("Expression")
14514 },
14515 decorators: {
14516 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
14517 }
14518 }
14519});
14520
14521(0, _index2.default)("ArrayPattern", {
14522 visitor: ["elements", "typeAnnotation"],
14523 aliases: ["Pattern", "LVal"],
14524 fields: {
14525 elements: {
14526 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Expression")))
14527 },
14528 decorators: {
14529 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
14530 }
14531 }
14532});
14533
14534(0, _index2.default)("ArrowFunctionExpression", {
14535 builder: ["params", "body", "async"],
14536 visitor: ["params", "body", "returnType", "typeParameters"],
14537 aliases: ["Scopable", "Function", "BlockParent", "FunctionParent", "Expression", "Pureish"],
14538 fields: {
14539 params: {
14540 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("LVal")))
14541 },
14542 body: {
14543 validate: (0, _index.assertNodeType)("BlockStatement", "Expression")
14544 },
14545 async: {
14546 validate: (0, _index.assertValueType)("boolean"),
14547 default: false
14548 }
14549 }
14550});
14551
14552(0, _index2.default)("ClassBody", {
14553 visitor: ["body"],
14554 fields: {
14555 body: {
14556 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ClassMethod", "ClassProperty")))
14557 }
14558 }
14559});
14560
14561(0, _index2.default)("ClassDeclaration", {
14562 builder: ["id", "superClass", "body", "decorators"],
14563 visitor: ["id", "body", "superClass", "mixins", "typeParameters", "superTypeParameters", "implements", "decorators"],
14564 aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"],
14565 fields: {
14566 id: {
14567 validate: (0, _index.assertNodeType)("Identifier")
14568 },
14569 body: {
14570 validate: (0, _index.assertNodeType)("ClassBody")
14571 },
14572 superClass: {
14573 optional: true,
14574 validate: (0, _index.assertNodeType)("Expression")
14575 },
14576 decorators: {
14577 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
14578 }
14579 }
14580});
14581
14582(0, _index2.default)("ClassExpression", {
14583 inherits: "ClassDeclaration",
14584 aliases: ["Scopable", "Class", "Expression", "Pureish"],
14585 fields: {
14586 id: {
14587 optional: true,
14588 validate: (0, _index.assertNodeType)("Identifier")
14589 },
14590 body: {
14591 validate: (0, _index.assertNodeType)("ClassBody")
14592 },
14593 superClass: {
14594 optional: true,
14595 validate: (0, _index.assertNodeType)("Expression")
14596 },
14597 decorators: {
14598 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
14599 }
14600 }
14601});
14602
14603(0, _index2.default)("ExportAllDeclaration", {
14604 visitor: ["source"],
14605 aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
14606 fields: {
14607 source: {
14608 validate: (0, _index.assertNodeType)("StringLiteral")
14609 }
14610 }
14611});
14612
14613(0, _index2.default)("ExportDefaultDeclaration", {
14614 visitor: ["declaration"],
14615 aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
14616 fields: {
14617 declaration: {
14618 validate: (0, _index.assertNodeType)("FunctionDeclaration", "ClassDeclaration", "Expression")
14619 }
14620 }
14621});
14622
14623(0, _index2.default)("ExportNamedDeclaration", {
14624 visitor: ["declaration", "specifiers", "source"],
14625 aliases: ["Statement", "Declaration", "ModuleDeclaration", "ExportDeclaration"],
14626 fields: {
14627 declaration: {
14628 validate: (0, _index.assertNodeType)("Declaration"),
14629 optional: true
14630 },
14631 specifiers: {
14632 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ExportSpecifier")))
14633 },
14634 source: {
14635 validate: (0, _index.assertNodeType)("StringLiteral"),
14636 optional: true
14637 }
14638 }
14639});
14640
14641(0, _index2.default)("ExportSpecifier", {
14642 visitor: ["local", "exported"],
14643 aliases: ["ModuleSpecifier"],
14644 fields: {
14645 local: {
14646 validate: (0, _index.assertNodeType)("Identifier")
14647 },
14648 exported: {
14649 validate: (0, _index.assertNodeType)("Identifier")
14650 }
14651 }
14652});
14653
14654(0, _index2.default)("ForOfStatement", {
14655 visitor: ["left", "right", "body"],
14656 aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
14657 fields: {
14658 left: {
14659 validate: (0, _index.assertNodeType)("VariableDeclaration", "LVal")
14660 },
14661 right: {
14662 validate: (0, _index.assertNodeType)("Expression")
14663 },
14664 body: {
14665 validate: (0, _index.assertNodeType)("Statement")
14666 }
14667 }
14668});
14669
14670(0, _index2.default)("ImportDeclaration", {
14671 visitor: ["specifiers", "source"],
14672 aliases: ["Statement", "Declaration", "ModuleDeclaration"],
14673 fields: {
14674 specifiers: {
14675 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("ImportSpecifier", "ImportDefaultSpecifier", "ImportNamespaceSpecifier")))
14676 },
14677 source: {
14678 validate: (0, _index.assertNodeType)("StringLiteral")
14679 }
14680 }
14681});
14682
14683(0, _index2.default)("ImportDefaultSpecifier", {
14684 visitor: ["local"],
14685 aliases: ["ModuleSpecifier"],
14686 fields: {
14687 local: {
14688 validate: (0, _index.assertNodeType)("Identifier")
14689 }
14690 }
14691});
14692
14693(0, _index2.default)("ImportNamespaceSpecifier", {
14694 visitor: ["local"],
14695 aliases: ["ModuleSpecifier"],
14696 fields: {
14697 local: {
14698 validate: (0, _index.assertNodeType)("Identifier")
14699 }
14700 }
14701});
14702
14703(0, _index2.default)("ImportSpecifier", {
14704 visitor: ["local", "imported"],
14705 aliases: ["ModuleSpecifier"],
14706 fields: {
14707 local: {
14708 validate: (0, _index.assertNodeType)("Identifier")
14709 },
14710 imported: {
14711 validate: (0, _index.assertNodeType)("Identifier")
14712 },
14713 importKind: {
14714 validate: (0, _index.assertOneOf)(null, "type", "typeof")
14715 }
14716 }
14717});
14718
14719(0, _index2.default)("MetaProperty", {
14720 visitor: ["meta", "property"],
14721 aliases: ["Expression"],
14722 fields: {
14723 meta: {
14724 validate: (0, _index.assertValueType)("string")
14725 },
14726 property: {
14727 validate: (0, _index.assertValueType)("string")
14728 }
14729 }
14730});
14731
14732(0, _index2.default)("ClassMethod", {
14733 aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"],
14734 builder: ["kind", "key", "params", "body", "computed", "static"],
14735 visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
14736 fields: {
14737 kind: {
14738 validate: (0, _index.chain)((0, _index.assertValueType)("string"), (0, _index.assertOneOf)("get", "set", "method", "constructor")),
14739 default: "method"
14740 },
14741 computed: {
14742 default: false,
14743 validate: (0, _index.assertValueType)("boolean")
14744 },
14745 static: {
14746 default: false,
14747 validate: (0, _index.assertValueType)("boolean")
14748 },
14749 key: {
14750 validate: function validate(node, key, val) {
14751 var expectedTypes = node.computed ? ["Expression"] : ["Identifier", "StringLiteral", "NumericLiteral"];
14752 _index.assertNodeType.apply(undefined, expectedTypes)(node, key, val);
14753 }
14754 },
14755 params: {
14756 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("LVal")))
14757 },
14758 body: {
14759 validate: (0, _index.assertNodeType)("BlockStatement")
14760 },
14761 generator: {
14762 default: false,
14763 validate: (0, _index.assertValueType)("boolean")
14764 },
14765 async: {
14766 default: false,
14767 validate: (0, _index.assertValueType)("boolean")
14768 }
14769 }
14770});
14771
14772(0, _index2.default)("ObjectPattern", {
14773 visitor: ["properties", "typeAnnotation"],
14774 aliases: ["Pattern", "LVal"],
14775 fields: {
14776 properties: {
14777 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("RestProperty", "Property")))
14778 },
14779 decorators: {
14780 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Decorator")))
14781 }
14782 }
14783});
14784
14785(0, _index2.default)("SpreadElement", {
14786 visitor: ["argument"],
14787 aliases: ["UnaryLike"],
14788 fields: {
14789 argument: {
14790 validate: (0, _index.assertNodeType)("Expression")
14791 }
14792 }
14793});
14794
14795(0, _index2.default)("Super", {
14796 aliases: ["Expression"]
14797});
14798
14799(0, _index2.default)("TaggedTemplateExpression", {
14800 visitor: ["tag", "quasi"],
14801 aliases: ["Expression"],
14802 fields: {
14803 tag: {
14804 validate: (0, _index.assertNodeType)("Expression")
14805 },
14806 quasi: {
14807 validate: (0, _index.assertNodeType)("TemplateLiteral")
14808 }
14809 }
14810});
14811
14812(0, _index2.default)("TemplateElement", {
14813 builder: ["value", "tail"],
14814 fields: {
14815 value: {},
14816 tail: {
14817 validate: (0, _index.assertValueType)("boolean"),
14818 default: false
14819 }
14820 }
14821});
14822
14823(0, _index2.default)("TemplateLiteral", {
14824 visitor: ["quasis", "expressions"],
14825 aliases: ["Expression", "Literal"],
14826 fields: {
14827 quasis: {
14828 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("TemplateElement")))
14829 },
14830 expressions: {
14831 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("Expression")))
14832 }
14833 }
14834});
14835
14836(0, _index2.default)("YieldExpression", {
14837 builder: ["argument", "delegate"],
14838 visitor: ["argument"],
14839 aliases: ["Expression", "Terminatorless"],
14840 fields: {
14841 delegate: {
14842 validate: (0, _index.assertValueType)("boolean"),
14843 default: false
14844 },
14845 argument: {
14846 optional: true,
14847 validate: (0, _index.assertNodeType)("Expression")
14848 }
14849 }
14850});
14851},{"./index":107}],105:[function(require,module,exports){
14852"use strict";
14853
14854var _index = require("./index");
14855
14856var _index2 = _interopRequireDefault(_index);
14857
14858function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14859
14860(0, _index2.default)("AwaitExpression", {
14861 builder: ["argument"],
14862 visitor: ["argument"],
14863 aliases: ["Expression", "Terminatorless"],
14864 fields: {
14865 argument: {
14866 validate: (0, _index.assertNodeType)("Expression")
14867 }
14868 }
14869});
14870
14871(0, _index2.default)("ForAwaitStatement", {
14872 visitor: ["left", "right", "body"],
14873 aliases: ["Scopable", "Statement", "For", "BlockParent", "Loop", "ForXStatement"],
14874 fields: {
14875 left: {
14876 validate: (0, _index.assertNodeType)("VariableDeclaration", "LVal")
14877 },
14878 right: {
14879 validate: (0, _index.assertNodeType)("Expression")
14880 },
14881 body: {
14882 validate: (0, _index.assertNodeType)("Statement")
14883 }
14884 }
14885});
14886
14887(0, _index2.default)("BindExpression", {
14888 visitor: ["object", "callee"],
14889 aliases: ["Expression"],
14890 fields: {}
14891});
14892
14893(0, _index2.default)("Import", {
14894 aliases: ["Expression"]
14895});
14896
14897(0, _index2.default)("Decorator", {
14898 visitor: ["expression"],
14899 fields: {
14900 expression: {
14901 validate: (0, _index.assertNodeType)("Expression")
14902 }
14903 }
14904});
14905
14906(0, _index2.default)("DoExpression", {
14907 visitor: ["body"],
14908 aliases: ["Expression"],
14909 fields: {
14910 body: {
14911 validate: (0, _index.assertNodeType)("BlockStatement")
14912 }
14913 }
14914});
14915
14916(0, _index2.default)("ExportDefaultSpecifier", {
14917 visitor: ["exported"],
14918 aliases: ["ModuleSpecifier"],
14919 fields: {
14920 exported: {
14921 validate: (0, _index.assertNodeType)("Identifier")
14922 }
14923 }
14924});
14925
14926(0, _index2.default)("ExportNamespaceSpecifier", {
14927 visitor: ["exported"],
14928 aliases: ["ModuleSpecifier"],
14929 fields: {
14930 exported: {
14931 validate: (0, _index.assertNodeType)("Identifier")
14932 }
14933 }
14934});
14935
14936(0, _index2.default)("RestProperty", {
14937 visitor: ["argument"],
14938 aliases: ["UnaryLike"],
14939 fields: {
14940 argument: {
14941 validate: (0, _index.assertNodeType)("LVal")
14942 }
14943 }
14944});
14945
14946(0, _index2.default)("SpreadProperty", {
14947 visitor: ["argument"],
14948 aliases: ["UnaryLike"],
14949 fields: {
14950 argument: {
14951 validate: (0, _index.assertNodeType)("Expression")
14952 }
14953 }
14954});
14955},{"./index":107}],106:[function(require,module,exports){
14956"use strict";
14957
14958var _index = require("./index");
14959
14960var _index2 = _interopRequireDefault(_index);
14961
14962function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14963
14964(0, _index2.default)("AnyTypeAnnotation", {
14965 aliases: ["Flow", "FlowBaseAnnotation"],
14966 fields: {}
14967});
14968
14969(0, _index2.default)("ArrayTypeAnnotation", {
14970 visitor: ["elementType"],
14971 aliases: ["Flow"],
14972 fields: {}
14973});
14974
14975(0, _index2.default)("BooleanTypeAnnotation", {
14976 aliases: ["Flow", "FlowBaseAnnotation"],
14977 fields: {}
14978});
14979
14980(0, _index2.default)("BooleanLiteralTypeAnnotation", {
14981 aliases: ["Flow"],
14982 fields: {}
14983});
14984
14985(0, _index2.default)("NullLiteralTypeAnnotation", {
14986 aliases: ["Flow", "FlowBaseAnnotation"],
14987 fields: {}
14988});
14989
14990(0, _index2.default)("ClassImplements", {
14991 visitor: ["id", "typeParameters"],
14992 aliases: ["Flow"],
14993 fields: {}
14994});
14995
14996(0, _index2.default)("ClassProperty", {
14997 visitor: ["key", "value", "typeAnnotation", "decorators"],
14998 builder: ["key", "value", "typeAnnotation", "decorators", "computed"],
14999 aliases: ["Property"],
15000 fields: {
15001 computed: {
15002 validate: (0, _index.assertValueType)("boolean"),
15003 default: false
15004 }
15005 }
15006});
15007
15008(0, _index2.default)("DeclareClass", {
15009 visitor: ["id", "typeParameters", "extends", "body"],
15010 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
15011 fields: {}
15012});
15013
15014(0, _index2.default)("DeclareFunction", {
15015 visitor: ["id"],
15016 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
15017 fields: {}
15018});
15019
15020(0, _index2.default)("DeclareInterface", {
15021 visitor: ["id", "typeParameters", "extends", "body"],
15022 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
15023 fields: {}
15024});
15025
15026(0, _index2.default)("DeclareModule", {
15027 visitor: ["id", "body"],
15028 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
15029 fields: {}
15030});
15031
15032(0, _index2.default)("DeclareModuleExports", {
15033 visitor: ["typeAnnotation"],
15034 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
15035 fields: {}
15036});
15037
15038(0, _index2.default)("DeclareTypeAlias", {
15039 visitor: ["id", "typeParameters", "right"],
15040 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
15041 fields: {}
15042});
15043
15044(0, _index2.default)("DeclareVariable", {
15045 visitor: ["id"],
15046 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
15047 fields: {}
15048});
15049
15050(0, _index2.default)("ExistentialTypeParam", {
15051 aliases: ["Flow"]
15052});
15053
15054(0, _index2.default)("FunctionTypeAnnotation", {
15055 visitor: ["typeParameters", "params", "rest", "returnType"],
15056 aliases: ["Flow"],
15057 fields: {}
15058});
15059
15060(0, _index2.default)("FunctionTypeParam", {
15061 visitor: ["name", "typeAnnotation"],
15062 aliases: ["Flow"],
15063 fields: {}
15064});
15065
15066(0, _index2.default)("GenericTypeAnnotation", {
15067 visitor: ["id", "typeParameters"],
15068 aliases: ["Flow"],
15069 fields: {}
15070});
15071
15072(0, _index2.default)("InterfaceExtends", {
15073 visitor: ["id", "typeParameters"],
15074 aliases: ["Flow"],
15075 fields: {}
15076});
15077
15078(0, _index2.default)("InterfaceDeclaration", {
15079 visitor: ["id", "typeParameters", "extends", "body"],
15080 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
15081 fields: {}
15082});
15083
15084(0, _index2.default)("IntersectionTypeAnnotation", {
15085 visitor: ["types"],
15086 aliases: ["Flow"],
15087 fields: {}
15088});
15089
15090(0, _index2.default)("MixedTypeAnnotation", {
15091 aliases: ["Flow", "FlowBaseAnnotation"]
15092});
15093
15094(0, _index2.default)("EmptyTypeAnnotation", {
15095 aliases: ["Flow", "FlowBaseAnnotation"]
15096});
15097
15098(0, _index2.default)("NullableTypeAnnotation", {
15099 visitor: ["typeAnnotation"],
15100 aliases: ["Flow"],
15101 fields: {}
15102});
15103
15104(0, _index2.default)("NumericLiteralTypeAnnotation", {
15105 aliases: ["Flow"],
15106 fields: {}
15107});
15108
15109(0, _index2.default)("NumberTypeAnnotation", {
15110 aliases: ["Flow", "FlowBaseAnnotation"],
15111 fields: {}
15112});
15113
15114(0, _index2.default)("StringLiteralTypeAnnotation", {
15115 aliases: ["Flow"],
15116 fields: {}
15117});
15118
15119(0, _index2.default)("StringTypeAnnotation", {
15120 aliases: ["Flow", "FlowBaseAnnotation"],
15121 fields: {}
15122});
15123
15124(0, _index2.default)("ThisTypeAnnotation", {
15125 aliases: ["Flow", "FlowBaseAnnotation"],
15126 fields: {}
15127});
15128
15129(0, _index2.default)("TupleTypeAnnotation", {
15130 visitor: ["types"],
15131 aliases: ["Flow"],
15132 fields: {}
15133});
15134
15135(0, _index2.default)("TypeofTypeAnnotation", {
15136 visitor: ["argument"],
15137 aliases: ["Flow"],
15138 fields: {}
15139});
15140
15141(0, _index2.default)("TypeAlias", {
15142 visitor: ["id", "typeParameters", "right"],
15143 aliases: ["Flow", "FlowDeclaration", "Statement", "Declaration"],
15144 fields: {}
15145});
15146
15147(0, _index2.default)("TypeAnnotation", {
15148 visitor: ["typeAnnotation"],
15149 aliases: ["Flow"],
15150 fields: {}
15151});
15152
15153(0, _index2.default)("TypeCastExpression", {
15154 visitor: ["expression", "typeAnnotation"],
15155 aliases: ["Flow", "ExpressionWrapper", "Expression"],
15156 fields: {}
15157});
15158
15159(0, _index2.default)("TypeParameter", {
15160 visitor: ["bound"],
15161 aliases: ["Flow"],
15162 fields: {}
15163});
15164
15165(0, _index2.default)("TypeParameterDeclaration", {
15166 visitor: ["params"],
15167 aliases: ["Flow"],
15168 fields: {}
15169});
15170
15171(0, _index2.default)("TypeParameterInstantiation", {
15172 visitor: ["params"],
15173 aliases: ["Flow"],
15174 fields: {}
15175});
15176
15177(0, _index2.default)("ObjectTypeAnnotation", {
15178 visitor: ["properties", "indexers", "callProperties"],
15179 aliases: ["Flow"],
15180 fields: {}
15181});
15182
15183(0, _index2.default)("ObjectTypeCallProperty", {
15184 visitor: ["value"],
15185 aliases: ["Flow", "UserWhitespacable"],
15186 fields: {}
15187});
15188
15189(0, _index2.default)("ObjectTypeIndexer", {
15190 visitor: ["id", "key", "value"],
15191 aliases: ["Flow", "UserWhitespacable"],
15192 fields: {}
15193});
15194
15195(0, _index2.default)("ObjectTypeProperty", {
15196 visitor: ["key", "value"],
15197 aliases: ["Flow", "UserWhitespacable"],
15198 fields: {}
15199});
15200
15201(0, _index2.default)("QualifiedTypeIdentifier", {
15202 visitor: ["id", "qualification"],
15203 aliases: ["Flow"],
15204 fields: {}
15205});
15206
15207(0, _index2.default)("UnionTypeAnnotation", {
15208 visitor: ["types"],
15209 aliases: ["Flow"],
15210 fields: {}
15211});
15212
15213(0, _index2.default)("VoidTypeAnnotation", {
15214 aliases: ["Flow", "FlowBaseAnnotation"],
15215 fields: {}
15216});
15217},{"./index":107}],107:[function(require,module,exports){
15218"use strict";
15219
15220exports.__esModule = true;
15221exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = undefined;
15222
15223var _getIterator2 = require("babel-runtime/core-js/get-iterator");
15224
15225var _getIterator3 = _interopRequireDefault(_getIterator2);
15226
15227var _stringify = require("babel-runtime/core-js/json/stringify");
15228
15229var _stringify2 = _interopRequireDefault(_stringify);
15230
15231var _typeof2 = require("babel-runtime/helpers/typeof");
15232
15233var _typeof3 = _interopRequireDefault(_typeof2);
15234
15235exports.assertEach = assertEach;
15236exports.assertOneOf = assertOneOf;
15237exports.assertNodeType = assertNodeType;
15238exports.assertNodeOrValueType = assertNodeOrValueType;
15239exports.assertValueType = assertValueType;
15240exports.chain = chain;
15241exports.default = defineType;
15242
15243var _index = require("../index");
15244
15245var t = _interopRequireWildcard(_index);
15246
15247function _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; } }
15248
15249function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15250
15251var VISITOR_KEYS = exports.VISITOR_KEYS = {};
15252var ALIAS_KEYS = exports.ALIAS_KEYS = {};
15253var NODE_FIELDS = exports.NODE_FIELDS = {};
15254var BUILDER_KEYS = exports.BUILDER_KEYS = {};
15255var DEPRECATED_KEYS = exports.DEPRECATED_KEYS = {};
15256
15257function getType(val) {
15258 if (Array.isArray(val)) {
15259 return "array";
15260 } else if (val === null) {
15261 return "null";
15262 } else if (val === undefined) {
15263 return "undefined";
15264 } else {
15265 return typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val);
15266 }
15267}
15268
15269function assertEach(callback) {
15270 function validator(node, key, val) {
15271 if (!Array.isArray(val)) return;
15272
15273 for (var i = 0; i < val.length; i++) {
15274 callback(node, key + "[" + i + "]", val[i]);
15275 }
15276 }
15277 validator.each = callback;
15278 return validator;
15279}
15280
15281function assertOneOf() {
15282 for (var _len = arguments.length, vals = Array(_len), _key = 0; _key < _len; _key++) {
15283 vals[_key] = arguments[_key];
15284 }
15285
15286 function validate(node, key, val) {
15287 if (vals.indexOf(val) < 0) {
15288 throw new TypeError("Property " + key + " expected value to be one of " + (0, _stringify2.default)(vals) + " but got " + (0, _stringify2.default)(val));
15289 }
15290 }
15291
15292 validate.oneOf = vals;
15293
15294 return validate;
15295}
15296
15297function assertNodeType() {
15298 for (var _len2 = arguments.length, types = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
15299 types[_key2] = arguments[_key2];
15300 }
15301
15302 function validate(node, key, val) {
15303 var valid = false;
15304
15305 for (var _iterator = types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
15306 var _ref;
15307
15308 if (_isArray) {
15309 if (_i >= _iterator.length) break;
15310 _ref = _iterator[_i++];
15311 } else {
15312 _i = _iterator.next();
15313 if (_i.done) break;
15314 _ref = _i.value;
15315 }
15316
15317 var type = _ref;
15318
15319 if (t.is(type, val)) {
15320 valid = true;
15321 break;
15322 }
15323 }
15324
15325 if (!valid) {
15326 throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + (0, _stringify2.default)(types) + " " + ("but instead got " + (0, _stringify2.default)(val && val.type)));
15327 }
15328 }
15329
15330 validate.oneOfNodeTypes = types;
15331
15332 return validate;
15333}
15334
15335function assertNodeOrValueType() {
15336 for (var _len3 = arguments.length, types = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
15337 types[_key3] = arguments[_key3];
15338 }
15339
15340 function validate(node, key, val) {
15341 var valid = false;
15342
15343 for (var _iterator2 = types, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
15344 var _ref2;
15345
15346 if (_isArray2) {
15347 if (_i2 >= _iterator2.length) break;
15348 _ref2 = _iterator2[_i2++];
15349 } else {
15350 _i2 = _iterator2.next();
15351 if (_i2.done) break;
15352 _ref2 = _i2.value;
15353 }
15354
15355 var type = _ref2;
15356
15357 if (getType(val) === type || t.is(type, val)) {
15358 valid = true;
15359 break;
15360 }
15361 }
15362
15363 if (!valid) {
15364 throw new TypeError("Property " + key + " of " + node.type + " expected node to be of a type " + (0, _stringify2.default)(types) + " " + ("but instead got " + (0, _stringify2.default)(val && val.type)));
15365 }
15366 }
15367
15368 validate.oneOfNodeOrValueTypes = types;
15369
15370 return validate;
15371}
15372
15373function assertValueType(type) {
15374 function validate(node, key, val) {
15375 var valid = getType(val) === type;
15376
15377 if (!valid) {
15378 throw new TypeError("Property " + key + " expected type of " + type + " but got " + getType(val));
15379 }
15380 }
15381
15382 validate.type = type;
15383
15384 return validate;
15385}
15386
15387function chain() {
15388 for (var _len4 = arguments.length, fns = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
15389 fns[_key4] = arguments[_key4];
15390 }
15391
15392 function validate() {
15393 for (var _iterator3 = fns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
15394 var _ref3;
15395
15396 if (_isArray3) {
15397 if (_i3 >= _iterator3.length) break;
15398 _ref3 = _iterator3[_i3++];
15399 } else {
15400 _i3 = _iterator3.next();
15401 if (_i3.done) break;
15402 _ref3 = _i3.value;
15403 }
15404
15405 var fn = _ref3;
15406
15407 fn.apply(undefined, arguments);
15408 }
15409 }
15410 validate.chainOf = fns;
15411 return validate;
15412}
15413
15414function defineType(type) {
15415 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
15416
15417 var inherits = opts.inherits && store[opts.inherits] || {};
15418
15419 opts.fields = opts.fields || inherits.fields || {};
15420 opts.visitor = opts.visitor || inherits.visitor || [];
15421 opts.aliases = opts.aliases || inherits.aliases || [];
15422 opts.builder = opts.builder || inherits.builder || opts.visitor || [];
15423
15424 if (opts.deprecatedAlias) {
15425 DEPRECATED_KEYS[opts.deprecatedAlias] = type;
15426 }
15427
15428 for (var _iterator4 = opts.visitor.concat(opts.builder), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
15429 var _ref4;
15430
15431 if (_isArray4) {
15432 if (_i4 >= _iterator4.length) break;
15433 _ref4 = _iterator4[_i4++];
15434 } else {
15435 _i4 = _iterator4.next();
15436 if (_i4.done) break;
15437 _ref4 = _i4.value;
15438 }
15439
15440 var _key5 = _ref4;
15441
15442 opts.fields[_key5] = opts.fields[_key5] || {};
15443 }
15444
15445 for (var key in opts.fields) {
15446 var field = opts.fields[key];
15447
15448 if (opts.builder.indexOf(key) === -1) {
15449 field.optional = true;
15450 }
15451 if (field.default === undefined) {
15452 field.default = null;
15453 } else if (!field.validate) {
15454 field.validate = assertValueType(getType(field.default));
15455 }
15456 }
15457
15458 VISITOR_KEYS[type] = opts.visitor;
15459 BUILDER_KEYS[type] = opts.builder;
15460 NODE_FIELDS[type] = opts.fields;
15461 ALIAS_KEYS[type] = opts.aliases;
15462
15463 store[type] = opts;
15464}
15465
15466var store = {};
15467},{"../index":112,"babel-runtime/core-js/get-iterator":56,"babel-runtime/core-js/json/stringify":57,"babel-runtime/helpers/typeof":74}],108:[function(require,module,exports){
15468"use strict";
15469
15470require("./index");
15471
15472require("./core");
15473
15474require("./es2015");
15475
15476require("./flow");
15477
15478require("./jsx");
15479
15480require("./misc");
15481
15482require("./experimental");
15483},{"./core":103,"./es2015":104,"./experimental":105,"./flow":106,"./index":107,"./jsx":109,"./misc":110}],109:[function(require,module,exports){
15484"use strict";
15485
15486var _index = require("./index");
15487
15488var _index2 = _interopRequireDefault(_index);
15489
15490function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15491
15492(0, _index2.default)("JSXAttribute", {
15493 visitor: ["name", "value"],
15494 aliases: ["JSX", "Immutable"],
15495 fields: {
15496 name: {
15497 validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXNamespacedName")
15498 },
15499 value: {
15500 optional: true,
15501 validate: (0, _index.assertNodeType)("JSXElement", "StringLiteral", "JSXExpressionContainer")
15502 }
15503 }
15504});
15505
15506(0, _index2.default)("JSXClosingElement", {
15507 visitor: ["name"],
15508 aliases: ["JSX", "Immutable"],
15509 fields: {
15510 name: {
15511 validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXMemberExpression")
15512 }
15513 }
15514});
15515
15516(0, _index2.default)("JSXElement", {
15517 builder: ["openingElement", "closingElement", "children", "selfClosing"],
15518 visitor: ["openingElement", "children", "closingElement"],
15519 aliases: ["JSX", "Immutable", "Expression"],
15520 fields: {
15521 openingElement: {
15522 validate: (0, _index.assertNodeType)("JSXOpeningElement")
15523 },
15524 closingElement: {
15525 optional: true,
15526 validate: (0, _index.assertNodeType)("JSXClosingElement")
15527 },
15528 children: {
15529 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("JSXText", "JSXExpressionContainer", "JSXSpreadChild", "JSXElement")))
15530 }
15531 }
15532});
15533
15534(0, _index2.default)("JSXEmptyExpression", {
15535 aliases: ["JSX", "Expression"]
15536});
15537
15538(0, _index2.default)("JSXExpressionContainer", {
15539 visitor: ["expression"],
15540 aliases: ["JSX", "Immutable"],
15541 fields: {
15542 expression: {
15543 validate: (0, _index.assertNodeType)("Expression")
15544 }
15545 }
15546});
15547
15548(0, _index2.default)("JSXSpreadChild", {
15549 visitor: ["expression"],
15550 aliases: ["JSX", "Immutable"],
15551 fields: {
15552 expression: {
15553 validate: (0, _index.assertNodeType)("Expression")
15554 }
15555 }
15556});
15557
15558(0, _index2.default)("JSXIdentifier", {
15559 builder: ["name"],
15560 aliases: ["JSX", "Expression"],
15561 fields: {
15562 name: {
15563 validate: (0, _index.assertValueType)("string")
15564 }
15565 }
15566});
15567
15568(0, _index2.default)("JSXMemberExpression", {
15569 visitor: ["object", "property"],
15570 aliases: ["JSX", "Expression"],
15571 fields: {
15572 object: {
15573 validate: (0, _index.assertNodeType)("JSXMemberExpression", "JSXIdentifier")
15574 },
15575 property: {
15576 validate: (0, _index.assertNodeType)("JSXIdentifier")
15577 }
15578 }
15579});
15580
15581(0, _index2.default)("JSXNamespacedName", {
15582 visitor: ["namespace", "name"],
15583 aliases: ["JSX"],
15584 fields: {
15585 namespace: {
15586 validate: (0, _index.assertNodeType)("JSXIdentifier")
15587 },
15588 name: {
15589 validate: (0, _index.assertNodeType)("JSXIdentifier")
15590 }
15591 }
15592});
15593
15594(0, _index2.default)("JSXOpeningElement", {
15595 builder: ["name", "attributes", "selfClosing"],
15596 visitor: ["name", "attributes"],
15597 aliases: ["JSX", "Immutable"],
15598 fields: {
15599 name: {
15600 validate: (0, _index.assertNodeType)("JSXIdentifier", "JSXMemberExpression")
15601 },
15602 selfClosing: {
15603 default: false,
15604 validate: (0, _index.assertValueType)("boolean")
15605 },
15606 attributes: {
15607 validate: (0, _index.chain)((0, _index.assertValueType)("array"), (0, _index.assertEach)((0, _index.assertNodeType)("JSXAttribute", "JSXSpreadAttribute")))
15608 }
15609 }
15610});
15611
15612(0, _index2.default)("JSXSpreadAttribute", {
15613 visitor: ["argument"],
15614 aliases: ["JSX"],
15615 fields: {
15616 argument: {
15617 validate: (0, _index.assertNodeType)("Expression")
15618 }
15619 }
15620});
15621
15622(0, _index2.default)("JSXText", {
15623 aliases: ["JSX", "Immutable"],
15624 builder: ["value"],
15625 fields: {
15626 value: {
15627 validate: (0, _index.assertValueType)("string")
15628 }
15629 }
15630});
15631},{"./index":107}],110:[function(require,module,exports){
15632"use strict";
15633
15634var _index = require("./index");
15635
15636var _index2 = _interopRequireDefault(_index);
15637
15638function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15639
15640(0, _index2.default)("Noop", {
15641 visitor: []
15642});
15643
15644(0, _index2.default)("ParenthesizedExpression", {
15645 visitor: ["expression"],
15646 aliases: ["Expression", "ExpressionWrapper"],
15647 fields: {
15648 expression: {
15649 validate: (0, _index.assertNodeType)("Expression")
15650 }
15651 }
15652});
15653},{"./index":107}],111:[function(require,module,exports){
15654"use strict";
15655
15656exports.__esModule = true;
15657exports.createUnionTypeAnnotation = createUnionTypeAnnotation;
15658exports.removeTypeDuplicates = removeTypeDuplicates;
15659exports.createTypeAnnotationBasedOnTypeof = createTypeAnnotationBasedOnTypeof;
15660
15661var _index = require("./index");
15662
15663var t = _interopRequireWildcard(_index);
15664
15665function _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; } }
15666
15667function createUnionTypeAnnotation(types) {
15668 var flattened = removeTypeDuplicates(types);
15669
15670 if (flattened.length === 1) {
15671 return flattened[0];
15672 } else {
15673 return t.unionTypeAnnotation(flattened);
15674 }
15675}
15676
15677function removeTypeDuplicates(nodes) {
15678 var generics = {};
15679 var bases = {};
15680
15681 var typeGroups = [];
15682
15683 var types = [];
15684
15685 for (var i = 0; i < nodes.length; i++) {
15686 var node = nodes[i];
15687 if (!node) continue;
15688
15689 if (types.indexOf(node) >= 0) {
15690 continue;
15691 }
15692
15693 if (t.isAnyTypeAnnotation(node)) {
15694 return [node];
15695 }
15696
15697 if (t.isFlowBaseAnnotation(node)) {
15698 bases[node.type] = node;
15699 continue;
15700 }
15701
15702 if (t.isUnionTypeAnnotation(node)) {
15703 if (typeGroups.indexOf(node.types) < 0) {
15704 nodes = nodes.concat(node.types);
15705 typeGroups.push(node.types);
15706 }
15707 continue;
15708 }
15709
15710 if (t.isGenericTypeAnnotation(node)) {
15711 var name = node.id.name;
15712
15713 if (generics[name]) {
15714 var existing = generics[name];
15715 if (existing.typeParameters) {
15716 if (node.typeParameters) {
15717 existing.typeParameters.params = removeTypeDuplicates(existing.typeParameters.params.concat(node.typeParameters.params));
15718 }
15719 } else {
15720 existing = node.typeParameters;
15721 }
15722 } else {
15723 generics[name] = node;
15724 }
15725
15726 continue;
15727 }
15728
15729 types.push(node);
15730 }
15731
15732 for (var type in bases) {
15733 types.push(bases[type]);
15734 }
15735
15736 for (var _name in generics) {
15737 types.push(generics[_name]);
15738 }
15739
15740 return types;
15741}
15742
15743function createTypeAnnotationBasedOnTypeof(type) {
15744 if (type === "string") {
15745 return t.stringTypeAnnotation();
15746 } else if (type === "number") {
15747 return t.numberTypeAnnotation();
15748 } else if (type === "undefined") {
15749 return t.voidTypeAnnotation();
15750 } else if (type === "boolean") {
15751 return t.booleanTypeAnnotation();
15752 } else if (type === "function") {
15753 return t.genericTypeAnnotation(t.identifier("Function"));
15754 } else if (type === "object") {
15755 return t.genericTypeAnnotation(t.identifier("Object"));
15756 } else if (type === "symbol") {
15757 return t.genericTypeAnnotation(t.identifier("Symbol"));
15758 } else {
15759 throw new Error("Invalid typeof value");
15760 }
15761}
15762},{"./index":112}],112:[function(require,module,exports){
15763"use strict";
15764
15765exports.__esModule = true;
15766exports.createTypeAnnotationBasedOnTypeof = exports.removeTypeDuplicates = exports.createUnionTypeAnnotation = exports.valueToNode = exports.toBlock = exports.toExpression = exports.toStatement = exports.toBindingIdentifierName = exports.toIdentifier = exports.toKeyAlias = exports.toSequenceExpression = exports.toComputedKey = exports.isNodesEquivalent = exports.isImmutable = exports.isScope = exports.isSpecifierDefault = exports.isVar = exports.isBlockScoped = exports.isLet = exports.isValidIdentifier = exports.isReferenced = exports.isBinding = exports.getOuterBindingIdentifiers = exports.getBindingIdentifiers = exports.TYPES = exports.react = exports.DEPRECATED_KEYS = exports.BUILDER_KEYS = exports.NODE_FIELDS = exports.ALIAS_KEYS = exports.VISITOR_KEYS = exports.NOT_LOCAL_BINDING = exports.BLOCK_SCOPED_SYMBOL = exports.INHERIT_KEYS = exports.UNARY_OPERATORS = exports.STRING_UNARY_OPERATORS = exports.NUMBER_UNARY_OPERATORS = exports.BOOLEAN_UNARY_OPERATORS = exports.BINARY_OPERATORS = exports.NUMBER_BINARY_OPERATORS = exports.BOOLEAN_BINARY_OPERATORS = exports.COMPARISON_BINARY_OPERATORS = exports.EQUALITY_BINARY_OPERATORS = exports.BOOLEAN_NUMBER_BINARY_OPERATORS = exports.UPDATE_OPERATORS = exports.LOGICAL_OPERATORS = exports.COMMENT_KEYS = exports.FOR_INIT_KEYS = exports.FLATTENABLE_KEYS = exports.STATEMENT_OR_BLOCK_KEYS = undefined;
15767
15768var _getOwnPropertySymbols = require("babel-runtime/core-js/object/get-own-property-symbols");
15769
15770var _getOwnPropertySymbols2 = _interopRequireDefault(_getOwnPropertySymbols);
15771
15772var _getIterator2 = require("babel-runtime/core-js/get-iterator");
15773
15774var _getIterator3 = _interopRequireDefault(_getIterator2);
15775
15776var _keys = require("babel-runtime/core-js/object/keys");
15777
15778var _keys2 = _interopRequireDefault(_keys);
15779
15780var _stringify = require("babel-runtime/core-js/json/stringify");
15781
15782var _stringify2 = _interopRequireDefault(_stringify);
15783
15784var _constants = require("./constants");
15785
15786Object.defineProperty(exports, "STATEMENT_OR_BLOCK_KEYS", {
15787 enumerable: true,
15788 get: function get() {
15789 return _constants.STATEMENT_OR_BLOCK_KEYS;
15790 }
15791});
15792Object.defineProperty(exports, "FLATTENABLE_KEYS", {
15793 enumerable: true,
15794 get: function get() {
15795 return _constants.FLATTENABLE_KEYS;
15796 }
15797});
15798Object.defineProperty(exports, "FOR_INIT_KEYS", {
15799 enumerable: true,
15800 get: function get() {
15801 return _constants.FOR_INIT_KEYS;
15802 }
15803});
15804Object.defineProperty(exports, "COMMENT_KEYS", {
15805 enumerable: true,
15806 get: function get() {
15807 return _constants.COMMENT_KEYS;
15808 }
15809});
15810Object.defineProperty(exports, "LOGICAL_OPERATORS", {
15811 enumerable: true,
15812 get: function get() {
15813 return _constants.LOGICAL_OPERATORS;
15814 }
15815});
15816Object.defineProperty(exports, "UPDATE_OPERATORS", {
15817 enumerable: true,
15818 get: function get() {
15819 return _constants.UPDATE_OPERATORS;
15820 }
15821});
15822Object.defineProperty(exports, "BOOLEAN_NUMBER_BINARY_OPERATORS", {
15823 enumerable: true,
15824 get: function get() {
15825 return _constants.BOOLEAN_NUMBER_BINARY_OPERATORS;
15826 }
15827});
15828Object.defineProperty(exports, "EQUALITY_BINARY_OPERATORS", {
15829 enumerable: true,
15830 get: function get() {
15831 return _constants.EQUALITY_BINARY_OPERATORS;
15832 }
15833});
15834Object.defineProperty(exports, "COMPARISON_BINARY_OPERATORS", {
15835 enumerable: true,
15836 get: function get() {
15837 return _constants.COMPARISON_BINARY_OPERATORS;
15838 }
15839});
15840Object.defineProperty(exports, "BOOLEAN_BINARY_OPERATORS", {
15841 enumerable: true,
15842 get: function get() {
15843 return _constants.BOOLEAN_BINARY_OPERATORS;
15844 }
15845});
15846Object.defineProperty(exports, "NUMBER_BINARY_OPERATORS", {
15847 enumerable: true,
15848 get: function get() {
15849 return _constants.NUMBER_BINARY_OPERATORS;
15850 }
15851});
15852Object.defineProperty(exports, "BINARY_OPERATORS", {
15853 enumerable: true,
15854 get: function get() {
15855 return _constants.BINARY_OPERATORS;
15856 }
15857});
15858Object.defineProperty(exports, "BOOLEAN_UNARY_OPERATORS", {
15859 enumerable: true,
15860 get: function get() {
15861 return _constants.BOOLEAN_UNARY_OPERATORS;
15862 }
15863});
15864Object.defineProperty(exports, "NUMBER_UNARY_OPERATORS", {
15865 enumerable: true,
15866 get: function get() {
15867 return _constants.NUMBER_UNARY_OPERATORS;
15868 }
15869});
15870Object.defineProperty(exports, "STRING_UNARY_OPERATORS", {
15871 enumerable: true,
15872 get: function get() {
15873 return _constants.STRING_UNARY_OPERATORS;
15874 }
15875});
15876Object.defineProperty(exports, "UNARY_OPERATORS", {
15877 enumerable: true,
15878 get: function get() {
15879 return _constants.UNARY_OPERATORS;
15880 }
15881});
15882Object.defineProperty(exports, "INHERIT_KEYS", {
15883 enumerable: true,
15884 get: function get() {
15885 return _constants.INHERIT_KEYS;
15886 }
15887});
15888Object.defineProperty(exports, "BLOCK_SCOPED_SYMBOL", {
15889 enumerable: true,
15890 get: function get() {
15891 return _constants.BLOCK_SCOPED_SYMBOL;
15892 }
15893});
15894Object.defineProperty(exports, "NOT_LOCAL_BINDING", {
15895 enumerable: true,
15896 get: function get() {
15897 return _constants.NOT_LOCAL_BINDING;
15898 }
15899});
15900exports.is = is;
15901exports.isType = isType;
15902exports.validate = validate;
15903exports.shallowEqual = shallowEqual;
15904exports.appendToMemberExpression = appendToMemberExpression;
15905exports.prependToMemberExpression = prependToMemberExpression;
15906exports.ensureBlock = ensureBlock;
15907exports.clone = clone;
15908exports.cloneWithoutLoc = cloneWithoutLoc;
15909exports.cloneDeep = cloneDeep;
15910exports.buildMatchMemberExpression = buildMatchMemberExpression;
15911exports.removeComments = removeComments;
15912exports.inheritsComments = inheritsComments;
15913exports.inheritTrailingComments = inheritTrailingComments;
15914exports.inheritLeadingComments = inheritLeadingComments;
15915exports.inheritInnerComments = inheritInnerComments;
15916exports.inherits = inherits;
15917exports.assertNode = assertNode;
15918exports.isNode = isNode;
15919exports.traverseFast = traverseFast;
15920exports.removeProperties = removeProperties;
15921exports.removePropertiesDeep = removePropertiesDeep;
15922
15923var _retrievers = require("./retrievers");
15924
15925Object.defineProperty(exports, "getBindingIdentifiers", {
15926 enumerable: true,
15927 get: function get() {
15928 return _retrievers.getBindingIdentifiers;
15929 }
15930});
15931Object.defineProperty(exports, "getOuterBindingIdentifiers", {
15932 enumerable: true,
15933 get: function get() {
15934 return _retrievers.getOuterBindingIdentifiers;
15935 }
15936});
15937
15938var _validators = require("./validators");
15939
15940Object.defineProperty(exports, "isBinding", {
15941 enumerable: true,
15942 get: function get() {
15943 return _validators.isBinding;
15944 }
15945});
15946Object.defineProperty(exports, "isReferenced", {
15947 enumerable: true,
15948 get: function get() {
15949 return _validators.isReferenced;
15950 }
15951});
15952Object.defineProperty(exports, "isValidIdentifier", {
15953 enumerable: true,
15954 get: function get() {
15955 return _validators.isValidIdentifier;
15956 }
15957});
15958Object.defineProperty(exports, "isLet", {
15959 enumerable: true,
15960 get: function get() {
15961 return _validators.isLet;
15962 }
15963});
15964Object.defineProperty(exports, "isBlockScoped", {
15965 enumerable: true,
15966 get: function get() {
15967 return _validators.isBlockScoped;
15968 }
15969});
15970Object.defineProperty(exports, "isVar", {
15971 enumerable: true,
15972 get: function get() {
15973 return _validators.isVar;
15974 }
15975});
15976Object.defineProperty(exports, "isSpecifierDefault", {
15977 enumerable: true,
15978 get: function get() {
15979 return _validators.isSpecifierDefault;
15980 }
15981});
15982Object.defineProperty(exports, "isScope", {
15983 enumerable: true,
15984 get: function get() {
15985 return _validators.isScope;
15986 }
15987});
15988Object.defineProperty(exports, "isImmutable", {
15989 enumerable: true,
15990 get: function get() {
15991 return _validators.isImmutable;
15992 }
15993});
15994Object.defineProperty(exports, "isNodesEquivalent", {
15995 enumerable: true,
15996 get: function get() {
15997 return _validators.isNodesEquivalent;
15998 }
15999});
16000
16001var _converters = require("./converters");
16002
16003Object.defineProperty(exports, "toComputedKey", {
16004 enumerable: true,
16005 get: function get() {
16006 return _converters.toComputedKey;
16007 }
16008});
16009Object.defineProperty(exports, "toSequenceExpression", {
16010 enumerable: true,
16011 get: function get() {
16012 return _converters.toSequenceExpression;
16013 }
16014});
16015Object.defineProperty(exports, "toKeyAlias", {
16016 enumerable: true,
16017 get: function get() {
16018 return _converters.toKeyAlias;
16019 }
16020});
16021Object.defineProperty(exports, "toIdentifier", {
16022 enumerable: true,
16023 get: function get() {
16024 return _converters.toIdentifier;
16025 }
16026});
16027Object.defineProperty(exports, "toBindingIdentifierName", {
16028 enumerable: true,
16029 get: function get() {
16030 return _converters.toBindingIdentifierName;
16031 }
16032});
16033Object.defineProperty(exports, "toStatement", {
16034 enumerable: true,
16035 get: function get() {
16036 return _converters.toStatement;
16037 }
16038});
16039Object.defineProperty(exports, "toExpression", {
16040 enumerable: true,
16041 get: function get() {
16042 return _converters.toExpression;
16043 }
16044});
16045Object.defineProperty(exports, "toBlock", {
16046 enumerable: true,
16047 get: function get() {
16048 return _converters.toBlock;
16049 }
16050});
16051Object.defineProperty(exports, "valueToNode", {
16052 enumerable: true,
16053 get: function get() {
16054 return _converters.valueToNode;
16055 }
16056});
16057
16058var _flow = require("./flow");
16059
16060Object.defineProperty(exports, "createUnionTypeAnnotation", {
16061 enumerable: true,
16062 get: function get() {
16063 return _flow.createUnionTypeAnnotation;
16064 }
16065});
16066Object.defineProperty(exports, "removeTypeDuplicates", {
16067 enumerable: true,
16068 get: function get() {
16069 return _flow.removeTypeDuplicates;
16070 }
16071});
16072Object.defineProperty(exports, "createTypeAnnotationBasedOnTypeof", {
16073 enumerable: true,
16074 get: function get() {
16075 return _flow.createTypeAnnotationBasedOnTypeof;
16076 }
16077});
16078
16079var _toFastProperties = require("to-fast-properties");
16080
16081var _toFastProperties2 = _interopRequireDefault(_toFastProperties);
16082
16083var _clone = require("lodash/clone");
16084
16085var _clone2 = _interopRequireDefault(_clone);
16086
16087var _uniq = require("lodash/uniq");
16088
16089var _uniq2 = _interopRequireDefault(_uniq);
16090
16091require("./definitions/init");
16092
16093var _definitions = require("./definitions");
16094
16095var _react2 = require("./react");
16096
16097var _react = _interopRequireWildcard(_react2);
16098
16099function _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; } }
16100
16101function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16102
16103var t = exports;
16104
16105function registerType(type) {
16106 var is = t["is" + type];
16107 if (!is) {
16108 is = t["is" + type] = function (node, opts) {
16109 return t.is(type, node, opts);
16110 };
16111 }
16112
16113 t["assert" + type] = function (node, opts) {
16114 opts = opts || {};
16115 if (!is(node, opts)) {
16116 throw new Error("Expected type " + (0, _stringify2.default)(type) + " with option " + (0, _stringify2.default)(opts));
16117 }
16118 };
16119}
16120
16121exports.VISITOR_KEYS = _definitions.VISITOR_KEYS;
16122exports.ALIAS_KEYS = _definitions.ALIAS_KEYS;
16123exports.NODE_FIELDS = _definitions.NODE_FIELDS;
16124exports.BUILDER_KEYS = _definitions.BUILDER_KEYS;
16125exports.DEPRECATED_KEYS = _definitions.DEPRECATED_KEYS;
16126exports.react = _react;
16127
16128
16129for (var type in t.VISITOR_KEYS) {
16130 registerType(type);
16131}
16132
16133t.FLIPPED_ALIAS_KEYS = {};
16134
16135(0, _keys2.default)(t.ALIAS_KEYS).forEach(function (type) {
16136 t.ALIAS_KEYS[type].forEach(function (alias) {
16137 var types = t.FLIPPED_ALIAS_KEYS[alias] = t.FLIPPED_ALIAS_KEYS[alias] || [];
16138 types.push(type);
16139 });
16140});
16141
16142(0, _keys2.default)(t.FLIPPED_ALIAS_KEYS).forEach(function (type) {
16143 t[type.toUpperCase() + "_TYPES"] = t.FLIPPED_ALIAS_KEYS[type];
16144 registerType(type);
16145});
16146
16147var TYPES = exports.TYPES = (0, _keys2.default)(t.VISITOR_KEYS).concat((0, _keys2.default)(t.FLIPPED_ALIAS_KEYS)).concat((0, _keys2.default)(t.DEPRECATED_KEYS));
16148
16149function is(type, node, opts) {
16150 if (!node) return false;
16151
16152 var matches = isType(node.type, type);
16153 if (!matches) return false;
16154
16155 if (typeof opts === "undefined") {
16156 return true;
16157 } else {
16158 return t.shallowEqual(node, opts);
16159 }
16160}
16161
16162function isType(nodeType, targetType) {
16163 if (nodeType === targetType) return true;
16164
16165 if (t.ALIAS_KEYS[targetType]) return false;
16166
16167 var aliases = t.FLIPPED_ALIAS_KEYS[targetType];
16168 if (aliases) {
16169 if (aliases[0] === nodeType) return true;
16170
16171 for (var _iterator = aliases, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
16172 var _ref;
16173
16174 if (_isArray) {
16175 if (_i >= _iterator.length) break;
16176 _ref = _iterator[_i++];
16177 } else {
16178 _i = _iterator.next();
16179 if (_i.done) break;
16180 _ref = _i.value;
16181 }
16182
16183 var alias = _ref;
16184
16185 if (nodeType === alias) return true;
16186 }
16187 }
16188
16189 return false;
16190}
16191
16192(0, _keys2.default)(t.BUILDER_KEYS).forEach(function (type) {
16193 var keys = t.BUILDER_KEYS[type];
16194
16195 function builder() {
16196 if (arguments.length > keys.length) {
16197 throw new Error("t." + type + ": Too many arguments passed. Received " + arguments.length + " but can receive " + ("no more than " + keys.length));
16198 }
16199
16200 var node = {};
16201 node.type = type;
16202
16203 var i = 0;
16204
16205 for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
16206 var _ref2;
16207
16208 if (_isArray2) {
16209 if (_i2 >= _iterator2.length) break;
16210 _ref2 = _iterator2[_i2++];
16211 } else {
16212 _i2 = _iterator2.next();
16213 if (_i2.done) break;
16214 _ref2 = _i2.value;
16215 }
16216
16217 var _key = _ref2;
16218
16219 var field = t.NODE_FIELDS[type][_key];
16220
16221 var arg = arguments[i++];
16222 if (arg === undefined) arg = (0, _clone2.default)(field.default);
16223
16224 node[_key] = arg;
16225 }
16226
16227 for (var key in node) {
16228 validate(node, key, node[key]);
16229 }
16230
16231 return node;
16232 }
16233
16234 t[type] = builder;
16235 t[type[0].toLowerCase() + type.slice(1)] = builder;
16236});
16237
16238var _loop = function _loop(_type) {
16239 var newType = t.DEPRECATED_KEYS[_type];
16240
16241 function proxy(fn) {
16242 return function () {
16243 console.trace("The node type " + _type + " has been renamed to " + newType);
16244 return fn.apply(this, arguments);
16245 };
16246 }
16247
16248 t[_type] = t[_type[0].toLowerCase() + _type.slice(1)] = proxy(t[newType]);
16249 t["is" + _type] = proxy(t["is" + newType]);
16250 t["assert" + _type] = proxy(t["assert" + newType]);
16251};
16252
16253for (var _type in t.DEPRECATED_KEYS) {
16254 _loop(_type);
16255}
16256
16257function validate(node, key, val) {
16258 if (!node) return;
16259
16260 var fields = t.NODE_FIELDS[node.type];
16261 if (!fields) return;
16262
16263 var field = fields[key];
16264 if (!field || !field.validate) return;
16265 if (field.optional && val == null) return;
16266
16267 field.validate(node, key, val);
16268}
16269
16270function shallowEqual(actual, expected) {
16271 var keys = (0, _keys2.default)(expected);
16272
16273 for (var _iterator3 = keys, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
16274 var _ref3;
16275
16276 if (_isArray3) {
16277 if (_i3 >= _iterator3.length) break;
16278 _ref3 = _iterator3[_i3++];
16279 } else {
16280 _i3 = _iterator3.next();
16281 if (_i3.done) break;
16282 _ref3 = _i3.value;
16283 }
16284
16285 var key = _ref3;
16286
16287 if (actual[key] !== expected[key]) {
16288 return false;
16289 }
16290 }
16291
16292 return true;
16293}
16294
16295function appendToMemberExpression(member, append, computed) {
16296 member.object = t.memberExpression(member.object, member.property, member.computed);
16297 member.property = append;
16298 member.computed = !!computed;
16299 return member;
16300}
16301
16302function prependToMemberExpression(member, prepend) {
16303 member.object = t.memberExpression(prepend, member.object);
16304 return member;
16305}
16306
16307function ensureBlock(node) {
16308 var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "body";
16309
16310 return node[key] = t.toBlock(node[key], node);
16311}
16312
16313function clone(node) {
16314 if (!node) return node;
16315 var newNode = {};
16316 for (var key in node) {
16317 if (key[0] === "_") continue;
16318 newNode[key] = node[key];
16319 }
16320 return newNode;
16321}
16322
16323function cloneWithoutLoc(node) {
16324 var newNode = clone(node);
16325 delete newNode.loc;
16326 return newNode;
16327}
16328
16329function cloneDeep(node) {
16330 if (!node) return node;
16331 var newNode = {};
16332
16333 for (var key in node) {
16334 if (key[0] === "_") continue;
16335
16336 var val = node[key];
16337
16338 if (val) {
16339 if (val.type) {
16340 val = t.cloneDeep(val);
16341 } else if (Array.isArray(val)) {
16342 val = val.map(t.cloneDeep);
16343 }
16344 }
16345
16346 newNode[key] = val;
16347 }
16348
16349 return newNode;
16350}
16351
16352function buildMatchMemberExpression(match, allowPartial) {
16353 var parts = match.split(".");
16354
16355 return function (member) {
16356 if (!t.isMemberExpression(member)) return false;
16357
16358 var search = [member];
16359 var i = 0;
16360
16361 while (search.length) {
16362 var node = search.shift();
16363
16364 if (allowPartial && i === parts.length) {
16365 return true;
16366 }
16367
16368 if (t.isIdentifier(node)) {
16369 if (parts[i] !== node.name) return false;
16370 } else if (t.isStringLiteral(node)) {
16371 if (parts[i] !== node.value) return false;
16372 } else if (t.isMemberExpression(node)) {
16373 if (node.computed && !t.isStringLiteral(node.property)) {
16374 return false;
16375 } else {
16376 search.push(node.object);
16377 search.push(node.property);
16378 continue;
16379 }
16380 } else {
16381 return false;
16382 }
16383
16384 if (++i > parts.length) {
16385 return false;
16386 }
16387 }
16388
16389 return true;
16390 };
16391}
16392
16393function removeComments(node) {
16394 for (var _iterator4 = t.COMMENT_KEYS, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, _getIterator3.default)(_iterator4);;) {
16395 var _ref4;
16396
16397 if (_isArray4) {
16398 if (_i4 >= _iterator4.length) break;
16399 _ref4 = _iterator4[_i4++];
16400 } else {
16401 _i4 = _iterator4.next();
16402 if (_i4.done) break;
16403 _ref4 = _i4.value;
16404 }
16405
16406 var key = _ref4;
16407
16408 delete node[key];
16409 }
16410 return node;
16411}
16412
16413function inheritsComments(child, parent) {
16414 inheritTrailingComments(child, parent);
16415 inheritLeadingComments(child, parent);
16416 inheritInnerComments(child, parent);
16417 return child;
16418}
16419
16420function inheritTrailingComments(child, parent) {
16421 _inheritComments("trailingComments", child, parent);
16422}
16423
16424function inheritLeadingComments(child, parent) {
16425 _inheritComments("leadingComments", child, parent);
16426}
16427
16428function inheritInnerComments(child, parent) {
16429 _inheritComments("innerComments", child, parent);
16430}
16431
16432function _inheritComments(key, child, parent) {
16433 if (child && parent) {
16434 child[key] = (0, _uniq2.default)([].concat(child[key], parent[key]).filter(Boolean));
16435 }
16436}
16437
16438function inherits(child, parent) {
16439 if (!child || !parent) return child;
16440
16441 for (var _iterator5 = t.INHERIT_KEYS.optional, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, _getIterator3.default)(_iterator5);;) {
16442 var _ref5;
16443
16444 if (_isArray5) {
16445 if (_i5 >= _iterator5.length) break;
16446 _ref5 = _iterator5[_i5++];
16447 } else {
16448 _i5 = _iterator5.next();
16449 if (_i5.done) break;
16450 _ref5 = _i5.value;
16451 }
16452
16453 var _key2 = _ref5;
16454
16455 if (child[_key2] == null) {
16456 child[_key2] = parent[_key2];
16457 }
16458 }
16459
16460 for (var key in parent) {
16461 if (key[0] === "_") child[key] = parent[key];
16462 }
16463
16464 for (var _iterator6 = t.INHERIT_KEYS.force, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, _getIterator3.default)(_iterator6);;) {
16465 var _ref6;
16466
16467 if (_isArray6) {
16468 if (_i6 >= _iterator6.length) break;
16469 _ref6 = _iterator6[_i6++];
16470 } else {
16471 _i6 = _iterator6.next();
16472 if (_i6.done) break;
16473 _ref6 = _i6.value;
16474 }
16475
16476 var _key3 = _ref6;
16477
16478 child[_key3] = parent[_key3];
16479 }
16480
16481 t.inheritsComments(child, parent);
16482
16483 return child;
16484}
16485
16486function assertNode(node) {
16487 if (!isNode(node)) {
16488 throw new TypeError("Not a valid node " + (node && node.type));
16489 }
16490}
16491
16492function isNode(node) {
16493 return !!(node && _definitions.VISITOR_KEYS[node.type]);
16494}
16495
16496(0, _toFastProperties2.default)(t);
16497(0, _toFastProperties2.default)(t.VISITOR_KEYS);
16498
16499function traverseFast(node, enter, opts) {
16500 if (!node) return;
16501
16502 var keys = t.VISITOR_KEYS[node.type];
16503 if (!keys) return;
16504
16505 opts = opts || {};
16506 enter(node, opts);
16507
16508 for (var _iterator7 = keys, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, _getIterator3.default)(_iterator7);;) {
16509 var _ref7;
16510
16511 if (_isArray7) {
16512 if (_i7 >= _iterator7.length) break;
16513 _ref7 = _iterator7[_i7++];
16514 } else {
16515 _i7 = _iterator7.next();
16516 if (_i7.done) break;
16517 _ref7 = _i7.value;
16518 }
16519
16520 var key = _ref7;
16521
16522 var subNode = node[key];
16523
16524 if (Array.isArray(subNode)) {
16525 for (var _iterator8 = subNode, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, _getIterator3.default)(_iterator8);;) {
16526 var _ref8;
16527
16528 if (_isArray8) {
16529 if (_i8 >= _iterator8.length) break;
16530 _ref8 = _iterator8[_i8++];
16531 } else {
16532 _i8 = _iterator8.next();
16533 if (_i8.done) break;
16534 _ref8 = _i8.value;
16535 }
16536
16537 var _node = _ref8;
16538
16539 traverseFast(_node, enter, opts);
16540 }
16541 } else {
16542 traverseFast(subNode, enter, opts);
16543 }
16544 }
16545}
16546
16547var CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"];
16548
16549var CLEAR_KEYS_PLUS_COMMENTS = t.COMMENT_KEYS.concat(["comments"]).concat(CLEAR_KEYS);
16550
16551function removeProperties(node, opts) {
16552 opts = opts || {};
16553 var map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
16554 for (var _iterator9 = map, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, _getIterator3.default)(_iterator9);;) {
16555 var _ref9;
16556
16557 if (_isArray9) {
16558 if (_i9 >= _iterator9.length) break;
16559 _ref9 = _iterator9[_i9++];
16560 } else {
16561 _i9 = _iterator9.next();
16562 if (_i9.done) break;
16563 _ref9 = _i9.value;
16564 }
16565
16566 var _key4 = _ref9;
16567
16568 if (node[_key4] != null) node[_key4] = undefined;
16569 }
16570
16571 for (var key in node) {
16572 if (key[0] === "_" && node[key] != null) node[key] = undefined;
16573 }
16574
16575 var syms = (0, _getOwnPropertySymbols2.default)(node);
16576 for (var _iterator10 = syms, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, _getIterator3.default)(_iterator10);;) {
16577 var _ref10;
16578
16579 if (_isArray10) {
16580 if (_i10 >= _iterator10.length) break;
16581 _ref10 = _iterator10[_i10++];
16582 } else {
16583 _i10 = _iterator10.next();
16584 if (_i10.done) break;
16585 _ref10 = _i10.value;
16586 }
16587
16588 var sym = _ref10;
16589
16590 node[sym] = null;
16591 }
16592}
16593
16594function removePropertiesDeep(tree, opts) {
16595 traverseFast(tree, removeProperties, opts);
16596 return tree;
16597}
16598},{"./constants":101,"./converters":102,"./definitions":107,"./definitions/init":108,"./flow":111,"./react":113,"./retrievers":114,"./validators":115,"babel-runtime/core-js/get-iterator":56,"babel-runtime/core-js/json/stringify":57,"babel-runtime/core-js/object/get-own-property-symbols":62,"babel-runtime/core-js/object/keys":63,"lodash/clone":416,"lodash/uniq":464,"to-fast-properties":487}],113:[function(require,module,exports){
16599"use strict";
16600
16601exports.__esModule = true;
16602exports.isReactComponent = undefined;
16603exports.isCompatTag = isCompatTag;
16604exports.buildChildren = buildChildren;
16605
16606var _index = require("./index");
16607
16608var t = _interopRequireWildcard(_index);
16609
16610function _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; } }
16611
16612var isReactComponent = exports.isReactComponent = t.buildMatchMemberExpression("React.Component");
16613
16614function isCompatTag(tagName) {
16615 return !!tagName && /^[a-z]|\-/.test(tagName);
16616}
16617
16618function cleanJSXElementLiteralChild(child, args) {
16619 var lines = child.value.split(/\r\n|\n|\r/);
16620
16621 var lastNonEmptyLine = 0;
16622
16623 for (var i = 0; i < lines.length; i++) {
16624 if (lines[i].match(/[^ \t]/)) {
16625 lastNonEmptyLine = i;
16626 }
16627 }
16628
16629 var str = "";
16630
16631 for (var _i = 0; _i < lines.length; _i++) {
16632 var line = lines[_i];
16633
16634 var isFirstLine = _i === 0;
16635 var isLastLine = _i === lines.length - 1;
16636 var isLastNonEmptyLine = _i === lastNonEmptyLine;
16637
16638 var trimmedLine = line.replace(/\t/g, " ");
16639
16640 if (!isFirstLine) {
16641 trimmedLine = trimmedLine.replace(/^[ ]+/, "");
16642 }
16643
16644 if (!isLastLine) {
16645 trimmedLine = trimmedLine.replace(/[ ]+$/, "");
16646 }
16647
16648 if (trimmedLine) {
16649 if (!isLastNonEmptyLine) {
16650 trimmedLine += " ";
16651 }
16652
16653 str += trimmedLine;
16654 }
16655 }
16656
16657 if (str) args.push(t.stringLiteral(str));
16658}
16659
16660function buildChildren(node) {
16661 var elems = [];
16662
16663 for (var i = 0; i < node.children.length; i++) {
16664 var child = node.children[i];
16665
16666 if (t.isJSXText(child)) {
16667 cleanJSXElementLiteralChild(child, elems);
16668 continue;
16669 }
16670
16671 if (t.isJSXExpressionContainer(child)) child = child.expression;
16672 if (t.isJSXEmptyExpression(child)) continue;
16673
16674 elems.push(child);
16675 }
16676
16677 return elems;
16678}
16679},{"./index":112}],114:[function(require,module,exports){
16680"use strict";
16681
16682exports.__esModule = true;
16683
16684var _create = require("babel-runtime/core-js/object/create");
16685
16686var _create2 = _interopRequireDefault(_create);
16687
16688exports.getBindingIdentifiers = getBindingIdentifiers;
16689exports.getOuterBindingIdentifiers = getOuterBindingIdentifiers;
16690
16691var _index = require("./index");
16692
16693var t = _interopRequireWildcard(_index);
16694
16695function _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; } }
16696
16697function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16698
16699function getBindingIdentifiers(node, duplicates, outerOnly) {
16700 var search = [].concat(node);
16701 var ids = (0, _create2.default)(null);
16702
16703 while (search.length) {
16704 var id = search.shift();
16705 if (!id) continue;
16706
16707 var keys = t.getBindingIdentifiers.keys[id.type];
16708
16709 if (t.isIdentifier(id)) {
16710 if (duplicates) {
16711 var _ids = ids[id.name] = ids[id.name] || [];
16712 _ids.push(id);
16713 } else {
16714 ids[id.name] = id;
16715 }
16716 continue;
16717 }
16718
16719 if (t.isExportDeclaration(id)) {
16720 if (t.isDeclaration(id.declaration)) {
16721 search.push(id.declaration);
16722 }
16723 continue;
16724 }
16725
16726 if (outerOnly) {
16727 if (t.isFunctionDeclaration(id)) {
16728 search.push(id.id);
16729 continue;
16730 }
16731
16732 if (t.isFunctionExpression(id)) {
16733 continue;
16734 }
16735 }
16736
16737 if (keys) {
16738 for (var i = 0; i < keys.length; i++) {
16739 var key = keys[i];
16740 if (id[key]) {
16741 search = search.concat(id[key]);
16742 }
16743 }
16744 }
16745 }
16746
16747 return ids;
16748}
16749
16750getBindingIdentifiers.keys = {
16751 DeclareClass: ["id"],
16752 DeclareFunction: ["id"],
16753 DeclareModule: ["id"],
16754 DeclareVariable: ["id"],
16755 InterfaceDeclaration: ["id"],
16756 TypeAlias: ["id"],
16757
16758 CatchClause: ["param"],
16759 LabeledStatement: ["label"],
16760 UnaryExpression: ["argument"],
16761 AssignmentExpression: ["left"],
16762
16763 ImportSpecifier: ["local"],
16764 ImportNamespaceSpecifier: ["local"],
16765 ImportDefaultSpecifier: ["local"],
16766 ImportDeclaration: ["specifiers"],
16767
16768 ExportSpecifier: ["exported"],
16769 ExportNamespaceSpecifier: ["exported"],
16770 ExportDefaultSpecifier: ["exported"],
16771
16772 FunctionDeclaration: ["id", "params"],
16773 FunctionExpression: ["id", "params"],
16774
16775 ClassDeclaration: ["id"],
16776 ClassExpression: ["id"],
16777
16778 RestElement: ["argument"],
16779 UpdateExpression: ["argument"],
16780
16781 RestProperty: ["argument"],
16782 ObjectProperty: ["value"],
16783
16784 AssignmentPattern: ["left"],
16785 ArrayPattern: ["elements"],
16786 ObjectPattern: ["properties"],
16787
16788 VariableDeclaration: ["declarations"],
16789 VariableDeclarator: ["id"]
16790};
16791
16792function getOuterBindingIdentifiers(node, duplicates) {
16793 return getBindingIdentifiers(node, duplicates, true);
16794}
16795},{"./index":112,"babel-runtime/core-js/object/create":61}],115:[function(require,module,exports){
16796"use strict";
16797
16798exports.__esModule = true;
16799
16800var _keys = require("babel-runtime/core-js/object/keys");
16801
16802var _keys2 = _interopRequireDefault(_keys);
16803
16804var _typeof2 = require("babel-runtime/helpers/typeof");
16805
16806var _typeof3 = _interopRequireDefault(_typeof2);
16807
16808var _getIterator2 = require("babel-runtime/core-js/get-iterator");
16809
16810var _getIterator3 = _interopRequireDefault(_getIterator2);
16811
16812exports.isBinding = isBinding;
16813exports.isReferenced = isReferenced;
16814exports.isValidIdentifier = isValidIdentifier;
16815exports.isLet = isLet;
16816exports.isBlockScoped = isBlockScoped;
16817exports.isVar = isVar;
16818exports.isSpecifierDefault = isSpecifierDefault;
16819exports.isScope = isScope;
16820exports.isImmutable = isImmutable;
16821exports.isNodesEquivalent = isNodesEquivalent;
16822
16823var _retrievers = require("./retrievers");
16824
16825var _esutils = require("esutils");
16826
16827var _esutils2 = _interopRequireDefault(_esutils);
16828
16829var _index = require("./index");
16830
16831var t = _interopRequireWildcard(_index);
16832
16833var _constants = require("./constants");
16834
16835function _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; } }
16836
16837function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16838
16839function isBinding(node, parent) {
16840 var keys = _retrievers.getBindingIdentifiers.keys[parent.type];
16841 if (keys) {
16842 for (var i = 0; i < keys.length; i++) {
16843 var key = keys[i];
16844 var val = parent[key];
16845 if (Array.isArray(val)) {
16846 if (val.indexOf(node) >= 0) return true;
16847 } else {
16848 if (val === node) return true;
16849 }
16850 }
16851 }
16852
16853 return false;
16854}
16855
16856function isReferenced(node, parent) {
16857 switch (parent.type) {
16858 case "BindExpression":
16859 return parent.object === node || parent.callee === node;
16860
16861 case "MemberExpression":
16862 case "JSXMemberExpression":
16863 if (parent.property === node && parent.computed) {
16864 return true;
16865 } else if (parent.object === node) {
16866 return true;
16867 } else {
16868 return false;
16869 }
16870
16871 case "MetaProperty":
16872 return false;
16873
16874 case "ObjectProperty":
16875 if (parent.key === node) {
16876 return parent.computed;
16877 }
16878
16879 case "VariableDeclarator":
16880 return parent.id !== node;
16881
16882 case "ArrowFunctionExpression":
16883 case "FunctionDeclaration":
16884 case "FunctionExpression":
16885 for (var _iterator = parent.params, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
16886 var _ref;
16887
16888 if (_isArray) {
16889 if (_i >= _iterator.length) break;
16890 _ref = _iterator[_i++];
16891 } else {
16892 _i = _iterator.next();
16893 if (_i.done) break;
16894 _ref = _i.value;
16895 }
16896
16897 var param = _ref;
16898
16899 if (param === node) return false;
16900 }
16901
16902 return parent.id !== node;
16903
16904 case "ExportSpecifier":
16905 if (parent.source) {
16906 return false;
16907 } else {
16908 return parent.local === node;
16909 }
16910
16911 case "ExportNamespaceSpecifier":
16912 case "ExportDefaultSpecifier":
16913 return false;
16914
16915 case "JSXAttribute":
16916 return parent.name !== node;
16917
16918 case "ClassProperty":
16919 if (parent.key === node) {
16920 return parent.computed;
16921 } else {
16922 return parent.value === node;
16923 }
16924
16925 case "ImportDefaultSpecifier":
16926 case "ImportNamespaceSpecifier":
16927 case "ImportSpecifier":
16928 return false;
16929
16930 case "ClassDeclaration":
16931 case "ClassExpression":
16932 return parent.id !== node;
16933
16934 case "ClassMethod":
16935 case "ObjectMethod":
16936 return parent.key === node && parent.computed;
16937
16938 case "LabeledStatement":
16939 return false;
16940
16941 case "CatchClause":
16942 return parent.param !== node;
16943
16944 case "RestElement":
16945 return false;
16946
16947 case "AssignmentExpression":
16948 return parent.right === node;
16949
16950 case "AssignmentPattern":
16951 return parent.right === node;
16952
16953 case "ObjectPattern":
16954 case "ArrayPattern":
16955 return false;
16956 }
16957
16958 return true;
16959}
16960
16961function isValidIdentifier(name) {
16962 if (typeof name !== "string" || _esutils2.default.keyword.isReservedWordES6(name, true)) {
16963 return false;
16964 } else {
16965 return _esutils2.default.keyword.isIdentifierNameES6(name);
16966 }
16967}
16968
16969function isLet(node) {
16970 return t.isVariableDeclaration(node) && (node.kind !== "var" || node[_constants.BLOCK_SCOPED_SYMBOL]);
16971}
16972
16973function isBlockScoped(node) {
16974 return t.isFunctionDeclaration(node) || t.isClassDeclaration(node) || t.isLet(node);
16975}
16976
16977function isVar(node) {
16978 return t.isVariableDeclaration(node, { kind: "var" }) && !node[_constants.BLOCK_SCOPED_SYMBOL];
16979}
16980
16981function isSpecifierDefault(specifier) {
16982 return t.isImportDefaultSpecifier(specifier) || t.isIdentifier(specifier.imported || specifier.exported, { name: "default" });
16983}
16984
16985function isScope(node, parent) {
16986 if (t.isBlockStatement(node) && t.isFunction(parent, { body: node })) {
16987 return false;
16988 }
16989
16990 return t.isScopable(node);
16991}
16992
16993function isImmutable(node) {
16994 if (t.isType(node.type, "Immutable")) return true;
16995
16996 if (t.isIdentifier(node)) {
16997 if (node.name === "undefined") {
16998 return true;
16999 } else {
17000 return false;
17001 }
17002 }
17003
17004 return false;
17005}
17006
17007function isNodesEquivalent(a, b) {
17008 if ((typeof a === "undefined" ? "undefined" : (0, _typeof3.default)(a)) !== "object" || (typeof a === "undefined" ? "undefined" : (0, _typeof3.default)(a)) !== "object" || a == null || b == null) {
17009 return a === b;
17010 }
17011
17012 if (a.type !== b.type) {
17013 return false;
17014 }
17015
17016 var fields = (0, _keys2.default)(t.NODE_FIELDS[a.type] || a.type);
17017
17018 for (var _iterator2 = fields, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
17019 var _ref2;
17020
17021 if (_isArray2) {
17022 if (_i2 >= _iterator2.length) break;
17023 _ref2 = _iterator2[_i2++];
17024 } else {
17025 _i2 = _iterator2.next();
17026 if (_i2.done) break;
17027 _ref2 = _i2.value;
17028 }
17029
17030 var field = _ref2;
17031
17032 if ((0, _typeof3.default)(a[field]) !== (0, _typeof3.default)(b[field])) {
17033 return false;
17034 }
17035
17036 if (Array.isArray(a[field])) {
17037 if (!Array.isArray(b[field])) {
17038 return false;
17039 }
17040 if (a[field].length !== b[field].length) {
17041 return false;
17042 }
17043
17044 for (var i = 0; i < a[field].length; i++) {
17045 if (!isNodesEquivalent(a[field][i], b[field][i])) {
17046 return false;
17047 }
17048 }
17049 continue;
17050 }
17051
17052 if (!isNodesEquivalent(a[field], b[field])) {
17053 return false;
17054 }
17055 }
17056
17057 return true;
17058}
17059},{"./constants":101,"./index":112,"./retrievers":114,"babel-runtime/core-js/get-iterator":56,"babel-runtime/core-js/object/keys":63,"babel-runtime/helpers/typeof":74,"esutils":240}],116:[function(require,module,exports){
17060'use strict';
17061
17062Object.defineProperty(exports, '__esModule', { value: true });
17063
17064/* eslint max-len: 0 */
17065
17066// This is a trick taken from Esprima. It turns out that, on
17067// non-Chrome browsers, to check whether a string is in a set, a
17068// predicate containing a big ugly `switch` statement is faster than
17069// a regular expression, and on Chrome the two are about on par.
17070// This function uses `eval` (non-lexical) to produce such a
17071// predicate from a space-separated string of words.
17072//
17073// It starts by sorting the words by length.
17074
17075function makePredicate(words) {
17076 words = words.split(" ");
17077 return function (str) {
17078 return words.indexOf(str) >= 0;
17079 };
17080}
17081
17082// Reserved word lists for various dialects of the language
17083
17084var reservedWords = {
17085 6: makePredicate("enum await"),
17086 strict: makePredicate("implements interface let package private protected public static yield"),
17087 strictBind: makePredicate("eval arguments")
17088};
17089
17090// And the keywords
17091
17092var 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");
17093
17094// ## Character categories
17095
17096// Big ugly regular expressions that match characters in the
17097// whitespace, identifier, and identifier-start categories. These
17098// are only applied when a character is found to actually have a
17099// code point above 128.
17100// Generated by `bin/generate-identifier-regex.js`.
17101
17102var 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";
17103var 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";
17104
17105var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
17106var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
17107
17108nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
17109
17110// These are a run-length and offset encoded representation of the
17111// >0xffff code points that are a valid part of identifiers. The
17112// offset starts at 0x10000, and each pair of numbers represents an
17113// offset to the next range, and then a size of the range. They were
17114// generated by `bin/generate-identifier-regex.js`.
17115// eslint-disable-next-line comma-spacing
17116var 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];
17117// eslint-disable-next-line comma-spacing
17118var 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];
17119
17120// This has a complexity linear to the value of the code. The
17121// assumption is that looking up astral identifier characters is
17122// rare.
17123function isInAstralSet(code, set) {
17124 var pos = 0x10000;
17125 for (var i = 0; i < set.length; i += 2) {
17126 pos += set[i];
17127 if (pos > code) return false;
17128
17129 pos += set[i + 1];
17130 if (pos >= code) return true;
17131 }
17132}
17133
17134// Test whether a given character code starts an identifier.
17135
17136function isIdentifierStart(code) {
17137 if (code < 65) return code === 36;
17138 if (code < 91) return true;
17139 if (code < 97) return code === 95;
17140 if (code < 123) return true;
17141 if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
17142 return isInAstralSet(code, astralIdentifierStartCodes);
17143}
17144
17145// Test whether a given character is part of an identifier.
17146
17147function isIdentifierChar(code) {
17148 if (code < 48) return code === 36;
17149 if (code < 58) return true;
17150 if (code < 65) return false;
17151 if (code < 91) return true;
17152 if (code < 97) return code === 95;
17153 if (code < 123) return true;
17154 if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
17155 return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
17156}
17157
17158// A second optional argument can be given to further configure
17159var defaultOptions = {
17160 // Source type ("script" or "module") for different semantics
17161 sourceType: "script",
17162 // Source filename.
17163 sourceFilename: undefined,
17164 // Line from which to start counting source. Useful for
17165 // integration with other tools.
17166 startLine: 1,
17167 // When enabled, a return at the top level is not considered an
17168 // error.
17169 allowReturnOutsideFunction: false,
17170 // When enabled, import/export statements are not constrained to
17171 // appearing at the top of the program.
17172 allowImportExportEverywhere: false,
17173 // TODO
17174 allowSuperOutsideMethod: false,
17175 // An array of plugins to enable
17176 plugins: [],
17177 // TODO
17178 strictMode: null
17179};
17180
17181// Interpret and default an options object
17182
17183function getOptions(opts) {
17184 var options = {};
17185 for (var key in defaultOptions) {
17186 options[key] = opts && key in opts ? opts[key] : defaultOptions[key];
17187 }
17188 return options;
17189}
17190
17191var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
17192 return typeof obj;
17193} : function (obj) {
17194 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
17195};
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207var classCallCheck = function (instance, Constructor) {
17208 if (!(instance instanceof Constructor)) {
17209 throw new TypeError("Cannot call a class as a function");
17210 }
17211};
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223var inherits = function (subClass, superClass) {
17224 if (typeof superClass !== "function" && superClass !== null) {
17225 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
17226 }
17227
17228 subClass.prototype = Object.create(superClass && superClass.prototype, {
17229 constructor: {
17230 value: subClass,
17231 enumerable: false,
17232 writable: true,
17233 configurable: true
17234 }
17235 });
17236 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
17237};
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249var possibleConstructorReturn = function (self, call) {
17250 if (!self) {
17251 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
17252 }
17253
17254 return call && (typeof call === "object" || typeof call === "function") ? call : self;
17255};
17256
17257// ## Token types
17258
17259// The assignment of fine-grained, information-carrying type objects
17260// allows the tokenizer to store the information it has about a
17261// token in a way that is very cheap for the parser to look up.
17262
17263// All token type variables start with an underscore, to make them
17264// easy to recognize.
17265
17266// The `beforeExpr` property is used to disambiguate between regular
17267// expressions and divisions. It is set on all token types that can
17268// be followed by an expression (thus, a slash after them would be a
17269// regular expression).
17270//
17271// `isLoop` marks a keyword as starting a loop, which is important
17272// to know when parsing a label, in order to allow or disallow
17273// continue jumps to that label.
17274
17275var beforeExpr = true;
17276var startsExpr = true;
17277var isLoop = true;
17278var isAssign = true;
17279var prefix = true;
17280var postfix = true;
17281
17282var TokenType = function TokenType(label) {
17283 var conf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
17284 classCallCheck(this, TokenType);
17285
17286 this.label = label;
17287 this.keyword = conf.keyword;
17288 this.beforeExpr = !!conf.beforeExpr;
17289 this.startsExpr = !!conf.startsExpr;
17290 this.rightAssociative = !!conf.rightAssociative;
17291 this.isLoop = !!conf.isLoop;
17292 this.isAssign = !!conf.isAssign;
17293 this.prefix = !!conf.prefix;
17294 this.postfix = !!conf.postfix;
17295 this.binop = conf.binop || null;
17296 this.updateContext = null;
17297};
17298
17299var KeywordTokenType = function (_TokenType) {
17300 inherits(KeywordTokenType, _TokenType);
17301
17302 function KeywordTokenType(name) {
17303 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
17304 classCallCheck(this, KeywordTokenType);
17305
17306 options.keyword = name;
17307
17308 return possibleConstructorReturn(this, _TokenType.call(this, name, options));
17309 }
17310
17311 return KeywordTokenType;
17312}(TokenType);
17313
17314var BinopTokenType = function (_TokenType2) {
17315 inherits(BinopTokenType, _TokenType2);
17316
17317 function BinopTokenType(name, prec) {
17318 classCallCheck(this, BinopTokenType);
17319 return possibleConstructorReturn(this, _TokenType2.call(this, name, { beforeExpr: beforeExpr, binop: prec }));
17320 }
17321
17322 return BinopTokenType;
17323}(TokenType);
17324
17325var types = {
17326 num: new TokenType("num", { startsExpr: startsExpr }),
17327 regexp: new TokenType("regexp", { startsExpr: startsExpr }),
17328 string: new TokenType("string", { startsExpr: startsExpr }),
17329 name: new TokenType("name", { startsExpr: startsExpr }),
17330 eof: new TokenType("eof"),
17331
17332 // Punctuation token types.
17333 bracketL: new TokenType("[", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
17334 bracketR: new TokenType("]"),
17335 braceL: new TokenType("{", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
17336 braceBarL: new TokenType("{|", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
17337 braceR: new TokenType("}"),
17338 braceBarR: new TokenType("|}"),
17339 parenL: new TokenType("(", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
17340 parenR: new TokenType(")"),
17341 comma: new TokenType(",", { beforeExpr: beforeExpr }),
17342 semi: new TokenType(";", { beforeExpr: beforeExpr }),
17343 colon: new TokenType(":", { beforeExpr: beforeExpr }),
17344 doubleColon: new TokenType("::", { beforeExpr: beforeExpr }),
17345 dot: new TokenType("."),
17346 question: new TokenType("?", { beforeExpr: beforeExpr }),
17347 arrow: new TokenType("=>", { beforeExpr: beforeExpr }),
17348 template: new TokenType("template"),
17349 ellipsis: new TokenType("...", { beforeExpr: beforeExpr }),
17350 backQuote: new TokenType("`", { startsExpr: startsExpr }),
17351 dollarBraceL: new TokenType("${", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
17352 at: new TokenType("@"),
17353
17354 // Operators. These carry several kinds of properties to help the
17355 // parser use them properly (the presence of these properties is
17356 // what categorizes them as operators).
17357 //
17358 // `binop`, when present, specifies that this operator is a binary
17359 // operator, and will refer to its precedence.
17360 //
17361 // `prefix` and `postfix` mark the operator as a prefix or postfix
17362 // unary operator.
17363 //
17364 // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
17365 // binary operators with a very low precedence, that should result
17366 // in AssignmentExpression nodes.
17367
17368 eq: new TokenType("=", { beforeExpr: beforeExpr, isAssign: isAssign }),
17369 assign: new TokenType("_=", { beforeExpr: beforeExpr, isAssign: isAssign }),
17370 incDec: new TokenType("++/--", { prefix: prefix, postfix: postfix, startsExpr: startsExpr }),
17371 prefix: new TokenType("prefix", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }),
17372 logicalOR: new BinopTokenType("||", 1),
17373 logicalAND: new BinopTokenType("&&", 2),
17374 bitwiseOR: new BinopTokenType("|", 3),
17375 bitwiseXOR: new BinopTokenType("^", 4),
17376 bitwiseAND: new BinopTokenType("&", 5),
17377 equality: new BinopTokenType("==/!=", 6),
17378 relational: new BinopTokenType("</>", 7),
17379 bitShift: new BinopTokenType("<</>>", 8),
17380 plusMin: new TokenType("+/-", { beforeExpr: beforeExpr, binop: 9, prefix: prefix, startsExpr: startsExpr }),
17381 modulo: new BinopTokenType("%", 10),
17382 star: new BinopTokenType("*", 10),
17383 slash: new BinopTokenType("/", 10),
17384 exponent: new TokenType("**", { beforeExpr: beforeExpr, binop: 11, rightAssociative: true })
17385};
17386
17387var keywords = {
17388 "break": new KeywordTokenType("break"),
17389 "case": new KeywordTokenType("case", { beforeExpr: beforeExpr }),
17390 "catch": new KeywordTokenType("catch"),
17391 "continue": new KeywordTokenType("continue"),
17392 "debugger": new KeywordTokenType("debugger"),
17393 "default": new KeywordTokenType("default", { beforeExpr: beforeExpr }),
17394 "do": new KeywordTokenType("do", { isLoop: isLoop, beforeExpr: beforeExpr }),
17395 "else": new KeywordTokenType("else", { beforeExpr: beforeExpr }),
17396 "finally": new KeywordTokenType("finally"),
17397 "for": new KeywordTokenType("for", { isLoop: isLoop }),
17398 "function": new KeywordTokenType("function", { startsExpr: startsExpr }),
17399 "if": new KeywordTokenType("if"),
17400 "return": new KeywordTokenType("return", { beforeExpr: beforeExpr }),
17401 "switch": new KeywordTokenType("switch"),
17402 "throw": new KeywordTokenType("throw", { beforeExpr: beforeExpr }),
17403 "try": new KeywordTokenType("try"),
17404 "var": new KeywordTokenType("var"),
17405 "let": new KeywordTokenType("let"),
17406 "const": new KeywordTokenType("const"),
17407 "while": new KeywordTokenType("while", { isLoop: isLoop }),
17408 "with": new KeywordTokenType("with"),
17409 "new": new KeywordTokenType("new", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
17410 "this": new KeywordTokenType("this", { startsExpr: startsExpr }),
17411 "super": new KeywordTokenType("super", { startsExpr: startsExpr }),
17412 "class": new KeywordTokenType("class"),
17413 "extends": new KeywordTokenType("extends", { beforeExpr: beforeExpr }),
17414 "export": new KeywordTokenType("export"),
17415 "import": new KeywordTokenType("import"),
17416 "yield": new KeywordTokenType("yield", { beforeExpr: beforeExpr, startsExpr: startsExpr }),
17417 "null": new KeywordTokenType("null", { startsExpr: startsExpr }),
17418 "true": new KeywordTokenType("true", { startsExpr: startsExpr }),
17419 "false": new KeywordTokenType("false", { startsExpr: startsExpr }),
17420 "in": new KeywordTokenType("in", { beforeExpr: beforeExpr, binop: 7 }),
17421 "instanceof": new KeywordTokenType("instanceof", { beforeExpr: beforeExpr, binop: 7 }),
17422 "typeof": new KeywordTokenType("typeof", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }),
17423 "void": new KeywordTokenType("void", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr }),
17424 "delete": new KeywordTokenType("delete", { beforeExpr: beforeExpr, prefix: prefix, startsExpr: startsExpr })
17425};
17426
17427// Map keyword names to token types.
17428Object.keys(keywords).forEach(function (name) {
17429 types["_" + name] = keywords[name];
17430});
17431
17432// Matches a whole line break (where CRLF is considered a single
17433// line break). Used to count lines.
17434
17435var lineBreak = /\r\n?|\n|\u2028|\u2029/;
17436var lineBreakG = new RegExp(lineBreak.source, "g");
17437
17438function isNewLine(code) {
17439 return code === 10 || code === 13 || code === 0x2028 || code === 0x2029;
17440}
17441
17442var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
17443
17444// The algorithm used to determine whether a regexp can appear at a
17445// given point in the program is loosely based on sweet.js' approach.
17446// See https://github.com/mozilla/sweet.js/wiki/design
17447
17448var TokContext = function TokContext(token, isExpr, preserveSpace, override) {
17449 classCallCheck(this, TokContext);
17450
17451 this.token = token;
17452 this.isExpr = !!isExpr;
17453 this.preserveSpace = !!preserveSpace;
17454 this.override = override;
17455};
17456
17457var types$1 = {
17458 braceStatement: new TokContext("{", false),
17459 braceExpression: new TokContext("{", true),
17460 templateQuasi: new TokContext("${", true),
17461 parenStatement: new TokContext("(", false),
17462 parenExpression: new TokContext("(", true),
17463 template: new TokContext("`", true, true, function (p) {
17464 return p.readTmplToken();
17465 }),
17466 functionExpression: new TokContext("function", true)
17467};
17468
17469// Token-specific context update code
17470
17471types.parenR.updateContext = types.braceR.updateContext = function () {
17472 if (this.state.context.length === 1) {
17473 this.state.exprAllowed = true;
17474 return;
17475 }
17476
17477 var out = this.state.context.pop();
17478 if (out === types$1.braceStatement && this.curContext() === types$1.functionExpression) {
17479 this.state.context.pop();
17480 this.state.exprAllowed = false;
17481 } else if (out === types$1.templateQuasi) {
17482 this.state.exprAllowed = true;
17483 } else {
17484 this.state.exprAllowed = !out.isExpr;
17485 }
17486};
17487
17488types.name.updateContext = function (prevType) {
17489 this.state.exprAllowed = false;
17490
17491 if (prevType === types._let || prevType === types._const || prevType === types._var) {
17492 if (lineBreak.test(this.input.slice(this.state.end))) {
17493 this.state.exprAllowed = true;
17494 }
17495 }
17496};
17497
17498types.braceL.updateContext = function (prevType) {
17499 this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpression);
17500 this.state.exprAllowed = true;
17501};
17502
17503types.dollarBraceL.updateContext = function () {
17504 this.state.context.push(types$1.templateQuasi);
17505 this.state.exprAllowed = true;
17506};
17507
17508types.parenL.updateContext = function (prevType) {
17509 var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
17510 this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression);
17511 this.state.exprAllowed = true;
17512};
17513
17514types.incDec.updateContext = function () {
17515 // tokExprAllowed stays unchanged
17516};
17517
17518types._function.updateContext = function () {
17519 if (this.curContext() !== types$1.braceStatement) {
17520 this.state.context.push(types$1.functionExpression);
17521 }
17522
17523 this.state.exprAllowed = false;
17524};
17525
17526types.backQuote.updateContext = function () {
17527 if (this.curContext() === types$1.template) {
17528 this.state.context.pop();
17529 } else {
17530 this.state.context.push(types$1.template);
17531 }
17532 this.state.exprAllowed = false;
17533};
17534
17535// These are used when `options.locations` is on, for the
17536// `startLoc` and `endLoc` properties.
17537
17538var Position = function Position(line, col) {
17539 classCallCheck(this, Position);
17540
17541 this.line = line;
17542 this.column = col;
17543};
17544
17545var SourceLocation = function SourceLocation(start, end) {
17546 classCallCheck(this, SourceLocation);
17547
17548 this.start = start;
17549 this.end = end;
17550};
17551
17552// The `getLineInfo` function is mostly useful when the
17553// `locations` option is off (for performance reasons) and you
17554// want to find the line/column position for a given character
17555// offset. `input` should be the code string that the offset refers
17556// into.
17557
17558function getLineInfo(input, offset) {
17559 for (var line = 1, cur = 0;;) {
17560 lineBreakG.lastIndex = cur;
17561 var match = lineBreakG.exec(input);
17562 if (match && match.index < offset) {
17563 ++line;
17564 cur = match.index + match[0].length;
17565 } else {
17566 return new Position(line, offset - cur);
17567 }
17568 }
17569}
17570
17571var State = function () {
17572 function State() {
17573 classCallCheck(this, State);
17574 }
17575
17576 State.prototype.init = function init(options, input) {
17577 this.strict = options.strictMode === false ? false : options.sourceType === "module";
17578
17579 this.input = input;
17580
17581 this.potentialArrowAt = -1;
17582
17583 this.inMethod = this.inFunction = this.inGenerator = this.inAsync = this.inPropertyName = this.inType = this.noAnonFunctionType = false;
17584
17585 this.labels = [];
17586
17587 this.decorators = [];
17588
17589 this.tokens = [];
17590
17591 this.comments = [];
17592
17593 this.trailingComments = [];
17594 this.leadingComments = [];
17595 this.commentStack = [];
17596
17597 this.pos = this.lineStart = 0;
17598 this.curLine = options.startLine;
17599
17600 this.type = types.eof;
17601 this.value = null;
17602 this.start = this.end = this.pos;
17603 this.startLoc = this.endLoc = this.curPosition();
17604
17605 this.lastTokEndLoc = this.lastTokStartLoc = null;
17606 this.lastTokStart = this.lastTokEnd = this.pos;
17607
17608 this.context = [types$1.braceStatement];
17609 this.exprAllowed = true;
17610
17611 this.containsEsc = this.containsOctal = false;
17612 this.octalPosition = null;
17613
17614 this.exportedIdentifiers = [];
17615
17616 return this;
17617 };
17618
17619 // TODO
17620
17621
17622 // TODO
17623
17624
17625 // Used to signify the start of a potential arrow function
17626
17627
17628 // Flags to track whether we are in a function, a generator.
17629
17630
17631 // Labels in scope.
17632
17633
17634 // Leading decorators.
17635
17636
17637 // Token store.
17638
17639
17640 // Comment store.
17641
17642
17643 // Comment attachment store
17644
17645
17646 // The current position of the tokenizer in the input.
17647
17648
17649 // Properties of the current token:
17650 // Its type
17651
17652
17653 // For tokens that include more information than their type, the value
17654
17655
17656 // Its start and end offset
17657
17658
17659 // And, if locations are used, the {line, column} object
17660 // corresponding to those offsets
17661
17662
17663 // Position information for the previous token
17664
17665
17666 // The context stack is used to superficially track syntactic
17667 // context to predict whether a regular expression is allowed in a
17668 // given position.
17669
17670
17671 // Used to signal to callers of `readWord1` whether the word
17672 // contained any escape sequences. This is needed because words with
17673 // escape sequences must not be interpreted as keywords.
17674
17675
17676 // TODO
17677
17678
17679 // Names of exports store. `default` is stored as a name for both
17680 // `export default foo;` and `export { foo as default };`.
17681
17682
17683 State.prototype.curPosition = function curPosition() {
17684 return new Position(this.curLine, this.pos - this.lineStart);
17685 };
17686
17687 State.prototype.clone = function clone(skipArrays) {
17688 var state = new State();
17689 for (var key in this) {
17690 var val = this[key];
17691
17692 if ((!skipArrays || key === "context") && Array.isArray(val)) {
17693 val = val.slice();
17694 }
17695
17696 state[key] = val;
17697 }
17698 return state;
17699 };
17700
17701 return State;
17702}();
17703
17704// Object type used to represent tokens. Note that normally, tokens
17705// simply exist as properties on the parser object. This is only
17706// used for the onToken callback and the external tokenizer.
17707
17708var Token = function Token(state) {
17709 classCallCheck(this, Token);
17710
17711 this.type = state.type;
17712 this.value = state.value;
17713 this.start = state.start;
17714 this.end = state.end;
17715 this.loc = new SourceLocation(state.startLoc, state.endLoc);
17716};
17717
17718// ## Tokenizer
17719
17720function codePointToString(code) {
17721 // UTF-16 Decoding
17722 if (code <= 0xFFFF) {
17723 return String.fromCharCode(code);
17724 } else {
17725 return String.fromCharCode((code - 0x10000 >> 10) + 0xD800, (code - 0x10000 & 1023) + 0xDC00);
17726 }
17727}
17728
17729var Tokenizer = function () {
17730 function Tokenizer(options, input) {
17731 classCallCheck(this, Tokenizer);
17732
17733 this.state = new State();
17734 this.state.init(options, input);
17735 }
17736
17737 // Move to the next token
17738
17739 Tokenizer.prototype.next = function next() {
17740 if (!this.isLookahead) {
17741 this.state.tokens.push(new Token(this.state));
17742 }
17743
17744 this.state.lastTokEnd = this.state.end;
17745 this.state.lastTokStart = this.state.start;
17746 this.state.lastTokEndLoc = this.state.endLoc;
17747 this.state.lastTokStartLoc = this.state.startLoc;
17748 this.nextToken();
17749 };
17750
17751 // TODO
17752
17753 Tokenizer.prototype.eat = function eat(type) {
17754 if (this.match(type)) {
17755 this.next();
17756 return true;
17757 } else {
17758 return false;
17759 }
17760 };
17761
17762 // TODO
17763
17764 Tokenizer.prototype.match = function match(type) {
17765 return this.state.type === type;
17766 };
17767
17768 // TODO
17769
17770 Tokenizer.prototype.isKeyword = function isKeyword$$1(word) {
17771 return isKeyword(word);
17772 };
17773
17774 // TODO
17775
17776 Tokenizer.prototype.lookahead = function lookahead() {
17777 var old = this.state;
17778 this.state = old.clone(true);
17779
17780 this.isLookahead = true;
17781 this.next();
17782 this.isLookahead = false;
17783
17784 var curr = this.state.clone(true);
17785 this.state = old;
17786 return curr;
17787 };
17788
17789 // Toggle strict mode. Re-reads the next number or string to please
17790 // pedantic tests (`"use strict"; 010;` should fail).
17791
17792 Tokenizer.prototype.setStrict = function setStrict(strict) {
17793 this.state.strict = strict;
17794 if (!this.match(types.num) && !this.match(types.string)) return;
17795 this.state.pos = this.state.start;
17796 while (this.state.pos < this.state.lineStart) {
17797 this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1;
17798 --this.state.curLine;
17799 }
17800 this.nextToken();
17801 };
17802
17803 Tokenizer.prototype.curContext = function curContext() {
17804 return this.state.context[this.state.context.length - 1];
17805 };
17806
17807 // Read a single token, updating the parser object's token-related
17808 // properties.
17809
17810 Tokenizer.prototype.nextToken = function nextToken() {
17811 var curContext = this.curContext();
17812 if (!curContext || !curContext.preserveSpace) this.skipSpace();
17813
17814 this.state.containsOctal = false;
17815 this.state.octalPosition = null;
17816 this.state.start = this.state.pos;
17817 this.state.startLoc = this.state.curPosition();
17818 if (this.state.pos >= this.input.length) return this.finishToken(types.eof);
17819
17820 if (curContext.override) {
17821 return curContext.override(this);
17822 } else {
17823 return this.readToken(this.fullCharCodeAtPos());
17824 }
17825 };
17826
17827 Tokenizer.prototype.readToken = function readToken(code) {
17828 // Identifier or keyword. '\uXXXX' sequences are allowed in
17829 // identifiers, so '\' also dispatches to that.
17830 if (isIdentifierStart(code) || code === 92 /* '\' */) {
17831 return this.readWord();
17832 } else {
17833 return this.getTokenFromCode(code);
17834 }
17835 };
17836
17837 Tokenizer.prototype.fullCharCodeAtPos = function fullCharCodeAtPos() {
17838 var code = this.input.charCodeAt(this.state.pos);
17839 if (code <= 0xd7ff || code >= 0xe000) return code;
17840
17841 var next = this.input.charCodeAt(this.state.pos + 1);
17842 return (code << 10) + next - 0x35fdc00;
17843 };
17844
17845 Tokenizer.prototype.pushComment = function pushComment(block, text, start, end, startLoc, endLoc) {
17846 var comment = {
17847 type: block ? "CommentBlock" : "CommentLine",
17848 value: text,
17849 start: start,
17850 end: end,
17851 loc: new SourceLocation(startLoc, endLoc)
17852 };
17853
17854 if (!this.isLookahead) {
17855 this.state.tokens.push(comment);
17856 this.state.comments.push(comment);
17857 this.addComment(comment);
17858 }
17859 };
17860
17861 Tokenizer.prototype.skipBlockComment = function skipBlockComment() {
17862 var startLoc = this.state.curPosition();
17863 var start = this.state.pos;
17864 var end = this.input.indexOf("*/", this.state.pos += 2);
17865 if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment");
17866
17867 this.state.pos = end + 2;
17868 lineBreakG.lastIndex = start;
17869 var match = void 0;
17870 while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) {
17871 ++this.state.curLine;
17872 this.state.lineStart = match.index + match[0].length;
17873 }
17874
17875 this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition());
17876 };
17877
17878 Tokenizer.prototype.skipLineComment = function skipLineComment(startSkip) {
17879 var start = this.state.pos;
17880 var startLoc = this.state.curPosition();
17881 var ch = this.input.charCodeAt(this.state.pos += startSkip);
17882 while (this.state.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) {
17883 ++this.state.pos;
17884 ch = this.input.charCodeAt(this.state.pos);
17885 }
17886
17887 this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition());
17888 };
17889
17890 // Called at the start of the parse and after every token. Skips
17891 // whitespace and comments, and.
17892
17893 Tokenizer.prototype.skipSpace = function skipSpace() {
17894 loop: while (this.state.pos < this.input.length) {
17895 var ch = this.input.charCodeAt(this.state.pos);
17896 switch (ch) {
17897 case 32:case 160:
17898 // ' '
17899 ++this.state.pos;
17900 break;
17901
17902 case 13:
17903 if (this.input.charCodeAt(this.state.pos + 1) === 10) {
17904 ++this.state.pos;
17905 }
17906
17907 case 10:case 8232:case 8233:
17908 ++this.state.pos;
17909 ++this.state.curLine;
17910 this.state.lineStart = this.state.pos;
17911 break;
17912
17913 case 47:
17914 // '/'
17915 switch (this.input.charCodeAt(this.state.pos + 1)) {
17916 case 42:
17917 // '*'
17918 this.skipBlockComment();
17919 break;
17920
17921 case 47:
17922 this.skipLineComment(2);
17923 break;
17924
17925 default:
17926 break loop;
17927 }
17928 break;
17929
17930 default:
17931 if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
17932 ++this.state.pos;
17933 } else {
17934 break loop;
17935 }
17936 }
17937 }
17938 };
17939
17940 // Called at the end of every token. Sets `end`, `val`, and
17941 // maintains `context` and `exprAllowed`, and skips the space after
17942 // the token, so that the next one's `start` will point at the
17943 // right position.
17944
17945 Tokenizer.prototype.finishToken = function finishToken(type, val) {
17946 this.state.end = this.state.pos;
17947 this.state.endLoc = this.state.curPosition();
17948 var prevType = this.state.type;
17949 this.state.type = type;
17950 this.state.value = val;
17951
17952 this.updateContext(prevType);
17953 };
17954
17955 // ### Token reading
17956
17957 // This is the function that is called to fetch the next token. It
17958 // is somewhat obscure, because it works in character codes rather
17959 // than characters, and because operator parsing has been inlined
17960 // into it.
17961 //
17962 // All in the name of speed.
17963 //
17964
17965
17966 Tokenizer.prototype.readToken_dot = function readToken_dot() {
17967 var next = this.input.charCodeAt(this.state.pos + 1);
17968 if (next >= 48 && next <= 57) {
17969 return this.readNumber(true);
17970 }
17971
17972 var next2 = this.input.charCodeAt(this.state.pos + 2);
17973 if (next === 46 && next2 === 46) {
17974 // 46 = dot '.'
17975 this.state.pos += 3;
17976 return this.finishToken(types.ellipsis);
17977 } else {
17978 ++this.state.pos;
17979 return this.finishToken(types.dot);
17980 }
17981 };
17982
17983 Tokenizer.prototype.readToken_slash = function readToken_slash() {
17984 // '/'
17985 if (this.state.exprAllowed) {
17986 ++this.state.pos;
17987 return this.readRegexp();
17988 }
17989
17990 var next = this.input.charCodeAt(this.state.pos + 1);
17991 if (next === 61) {
17992 return this.finishOp(types.assign, 2);
17993 } else {
17994 return this.finishOp(types.slash, 1);
17995 }
17996 };
17997
17998 Tokenizer.prototype.readToken_mult_modulo = function readToken_mult_modulo(code) {
17999 // '%*'
18000 var type = code === 42 ? types.star : types.modulo;
18001 var width = 1;
18002 var next = this.input.charCodeAt(this.state.pos + 1);
18003
18004 if (next === 42) {
18005 // '*'
18006 width++;
18007 next = this.input.charCodeAt(this.state.pos + 2);
18008 type = types.exponent;
18009 }
18010
18011 if (next === 61) {
18012 width++;
18013 type = types.assign;
18014 }
18015
18016 return this.finishOp(type, width);
18017 };
18018
18019 Tokenizer.prototype.readToken_pipe_amp = function readToken_pipe_amp(code) {
18020 // '|&'
18021 var next = this.input.charCodeAt(this.state.pos + 1);
18022 if (next === code) return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2);
18023 if (next === 61) return this.finishOp(types.assign, 2);
18024 if (code === 124 && next === 125 && this.hasPlugin("flow")) return this.finishOp(types.braceBarR, 2);
18025 return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1);
18026 };
18027
18028 Tokenizer.prototype.readToken_caret = function readToken_caret() {
18029 // '^'
18030 var next = this.input.charCodeAt(this.state.pos + 1);
18031 if (next === 61) {
18032 return this.finishOp(types.assign, 2);
18033 } else {
18034 return this.finishOp(types.bitwiseXOR, 1);
18035 }
18036 };
18037
18038 Tokenizer.prototype.readToken_plus_min = function readToken_plus_min(code) {
18039 // '+-'
18040 var next = this.input.charCodeAt(this.state.pos + 1);
18041
18042 if (next === code) {
18043 if (next === 45 && this.input.charCodeAt(this.state.pos + 2) === 62 && lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos))) {
18044 // A `-->` line comment
18045 this.skipLineComment(3);
18046 this.skipSpace();
18047 return this.nextToken();
18048 }
18049 return this.finishOp(types.incDec, 2);
18050 }
18051
18052 if (next === 61) {
18053 return this.finishOp(types.assign, 2);
18054 } else {
18055 return this.finishOp(types.plusMin, 1);
18056 }
18057 };
18058
18059 Tokenizer.prototype.readToken_lt_gt = function readToken_lt_gt(code) {
18060 // '<>'
18061 var next = this.input.charCodeAt(this.state.pos + 1);
18062 var size = 1;
18063
18064 if (next === code) {
18065 size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2;
18066 if (this.input.charCodeAt(this.state.pos + size) === 61) return this.finishOp(types.assign, size + 1);
18067 return this.finishOp(types.bitShift, size);
18068 }
18069
18070 if (next === 33 && code === 60 && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) {
18071 if (this.inModule) this.unexpected();
18072 // `<!--`, an XML-style comment that should be interpreted as a line comment
18073 this.skipLineComment(4);
18074 this.skipSpace();
18075 return this.nextToken();
18076 }
18077
18078 if (next === 61) {
18079 // <= | >=
18080 size = 2;
18081 }
18082
18083 return this.finishOp(types.relational, size);
18084 };
18085
18086 Tokenizer.prototype.readToken_eq_excl = function readToken_eq_excl(code) {
18087 // '=!'
18088 var next = this.input.charCodeAt(this.state.pos + 1);
18089 if (next === 61) return this.finishOp(types.equality, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
18090 if (code === 61 && next === 62) {
18091 // '=>'
18092 this.state.pos += 2;
18093 return this.finishToken(types.arrow);
18094 }
18095 return this.finishOp(code === 61 ? types.eq : types.prefix, 1);
18096 };
18097
18098 Tokenizer.prototype.getTokenFromCode = function getTokenFromCode(code) {
18099 switch (code) {
18100 // The interpretation of a dot depends on whether it is followed
18101 // by a digit or another two dots.
18102 case 46:
18103 // '.'
18104 return this.readToken_dot();
18105
18106 // Punctuation tokens.
18107 case 40:
18108 ++this.state.pos;return this.finishToken(types.parenL);
18109 case 41:
18110 ++this.state.pos;return this.finishToken(types.parenR);
18111 case 59:
18112 ++this.state.pos;return this.finishToken(types.semi);
18113 case 44:
18114 ++this.state.pos;return this.finishToken(types.comma);
18115 case 91:
18116 ++this.state.pos;return this.finishToken(types.bracketL);
18117 case 93:
18118 ++this.state.pos;return this.finishToken(types.bracketR);
18119
18120 case 123:
18121 if (this.hasPlugin("flow") && this.input.charCodeAt(this.state.pos + 1) === 124) {
18122 return this.finishOp(types.braceBarL, 2);
18123 } else {
18124 ++this.state.pos;
18125 return this.finishToken(types.braceL);
18126 }
18127
18128 case 125:
18129 ++this.state.pos;return this.finishToken(types.braceR);
18130
18131 case 58:
18132 if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
18133 return this.finishOp(types.doubleColon, 2);
18134 } else {
18135 ++this.state.pos;
18136 return this.finishToken(types.colon);
18137 }
18138
18139 case 63:
18140 ++this.state.pos;return this.finishToken(types.question);
18141 case 64:
18142 ++this.state.pos;return this.finishToken(types.at);
18143
18144 case 96:
18145 // '`'
18146 ++this.state.pos;
18147 return this.finishToken(types.backQuote);
18148
18149 case 48:
18150 // '0'
18151 var next = this.input.charCodeAt(this.state.pos + 1);
18152 if (next === 120 || next === 88) return this.readRadixNumber(16); // '0x', '0X' - hex number
18153 if (next === 111 || next === 79) return this.readRadixNumber(8); // '0o', '0O' - octal number
18154 if (next === 98 || next === 66) return this.readRadixNumber(2); // '0b', '0B' - binary number
18155 // Anything else beginning with a digit is an integer, octal
18156 // number, or float.
18157 case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:
18158 // 1-9
18159 return this.readNumber(false);
18160
18161 // Quotes produce strings.
18162 case 34:case 39:
18163 // '"', "'"
18164 return this.readString(code);
18165
18166 // Operators are parsed inline in tiny state machines. '=' (61) is
18167 // often referred to. `finishOp` simply skips the amount of
18168 // characters it is given as second argument, and returns a token
18169 // of the type given by its first argument.
18170
18171 case 47:
18172 // '/'
18173 return this.readToken_slash();
18174
18175 case 37:case 42:
18176 // '%*'
18177 return this.readToken_mult_modulo(code);
18178
18179 case 124:case 38:
18180 // '|&'
18181 return this.readToken_pipe_amp(code);
18182
18183 case 94:
18184 // '^'
18185 return this.readToken_caret();
18186
18187 case 43:case 45:
18188 // '+-'
18189 return this.readToken_plus_min(code);
18190
18191 case 60:case 62:
18192 // '<>'
18193 return this.readToken_lt_gt(code);
18194
18195 case 61:case 33:
18196 // '=!'
18197 return this.readToken_eq_excl(code);
18198
18199 case 126:
18200 // '~'
18201 return this.finishOp(types.prefix, 1);
18202 }
18203
18204 this.raise(this.state.pos, "Unexpected character '" + codePointToString(code) + "'");
18205 };
18206
18207 Tokenizer.prototype.finishOp = function finishOp(type, size) {
18208 var str = this.input.slice(this.state.pos, this.state.pos + size);
18209 this.state.pos += size;
18210 return this.finishToken(type, str);
18211 };
18212
18213 Tokenizer.prototype.readRegexp = function readRegexp() {
18214 var start = this.state.pos;
18215 var escaped = void 0,
18216 inClass = void 0;
18217 for (;;) {
18218 if (this.state.pos >= this.input.length) this.raise(start, "Unterminated regular expression");
18219 var ch = this.input.charAt(this.state.pos);
18220 if (lineBreak.test(ch)) {
18221 this.raise(start, "Unterminated regular expression");
18222 }
18223 if (escaped) {
18224 escaped = false;
18225 } else {
18226 if (ch === "[") {
18227 inClass = true;
18228 } else if (ch === "]" && inClass) {
18229 inClass = false;
18230 } else if (ch === "/" && !inClass) {
18231 break;
18232 }
18233 escaped = ch === "\\";
18234 }
18235 ++this.state.pos;
18236 }
18237 var content = this.input.slice(start, this.state.pos);
18238 ++this.state.pos;
18239 // Need to use `readWord1` because '\uXXXX' sequences are allowed
18240 // here (don't ask).
18241 var mods = this.readWord1();
18242 if (mods) {
18243 var validFlags = /^[gmsiyu]*$/;
18244 if (!validFlags.test(mods)) this.raise(start, "Invalid regular expression flag");
18245 }
18246 return this.finishToken(types.regexp, {
18247 pattern: content,
18248 flags: mods
18249 });
18250 };
18251
18252 // Read an integer in the given radix. Return null if zero digits
18253 // were read, the integer value otherwise. When `len` is given, this
18254 // will return `null` unless the integer has exactly `len` digits.
18255
18256 Tokenizer.prototype.readInt = function readInt(radix, len) {
18257 var start = this.state.pos;
18258 var total = 0;
18259
18260 for (var i = 0, e = len == null ? Infinity : len; i < e; ++i) {
18261 var code = this.input.charCodeAt(this.state.pos);
18262 var val = void 0;
18263 if (code >= 97) {
18264 val = code - 97 + 10; // a
18265 } else if (code >= 65) {
18266 val = code - 65 + 10; // A
18267 } else if (code >= 48 && code <= 57) {
18268 val = code - 48; // 0-9
18269 } else {
18270 val = Infinity;
18271 }
18272 if (val >= radix) break;
18273 ++this.state.pos;
18274 total = total * radix + val;
18275 }
18276 if (this.state.pos === start || len != null && this.state.pos - start !== len) return null;
18277
18278 return total;
18279 };
18280
18281 Tokenizer.prototype.readRadixNumber = function readRadixNumber(radix) {
18282 this.state.pos += 2; // 0x
18283 var val = this.readInt(radix);
18284 if (val == null) this.raise(this.state.start + 2, "Expected number in radix " + radix);
18285 if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.state.pos, "Identifier directly after number");
18286 return this.finishToken(types.num, val);
18287 };
18288
18289 // Read an integer, octal integer, or floating-point number.
18290
18291 Tokenizer.prototype.readNumber = function readNumber(startsWithDot) {
18292 var start = this.state.pos;
18293 var octal = this.input.charCodeAt(this.state.pos) === 48;
18294 var isFloat = false;
18295
18296 if (!startsWithDot && this.readInt(10) === null) this.raise(start, "Invalid number");
18297 var next = this.input.charCodeAt(this.state.pos);
18298 if (next === 46) {
18299 // '.'
18300 ++this.state.pos;
18301 this.readInt(10);
18302 isFloat = true;
18303 next = this.input.charCodeAt(this.state.pos);
18304 }
18305 if (next === 69 || next === 101) {
18306 // 'eE'
18307 next = this.input.charCodeAt(++this.state.pos);
18308 if (next === 43 || next === 45) ++this.state.pos; // '+-'
18309 if (this.readInt(10) === null) this.raise(start, "Invalid number");
18310 isFloat = true;
18311 }
18312 if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.state.pos, "Identifier directly after number");
18313
18314 var str = this.input.slice(start, this.state.pos);
18315 var val = void 0;
18316 if (isFloat) {
18317 val = parseFloat(str);
18318 } else if (!octal || str.length === 1) {
18319 val = parseInt(str, 10);
18320 } else if (/[89]/.test(str) || this.state.strict) {
18321 this.raise(start, "Invalid number");
18322 } else {
18323 val = parseInt(str, 8);
18324 }
18325 return this.finishToken(types.num, val);
18326 };
18327
18328 // Read a string value, interpreting backslash-escapes.
18329
18330 Tokenizer.prototype.readCodePoint = function readCodePoint() {
18331 var ch = this.input.charCodeAt(this.state.pos);
18332 var code = void 0;
18333
18334 if (ch === 123) {
18335 var codePos = ++this.state.pos;
18336 code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos);
18337 ++this.state.pos;
18338 if (code > 0x10FFFF) this.raise(codePos, "Code point out of bounds");
18339 } else {
18340 code = this.readHexChar(4);
18341 }
18342 return code;
18343 };
18344
18345 Tokenizer.prototype.readString = function readString(quote) {
18346 var out = "",
18347 chunkStart = ++this.state.pos;
18348 for (;;) {
18349 if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated string constant");
18350 var ch = this.input.charCodeAt(this.state.pos);
18351 if (ch === quote) break;
18352 if (ch === 92) {
18353 // '\'
18354 out += this.input.slice(chunkStart, this.state.pos);
18355 out += this.readEscapedChar(false);
18356 chunkStart = this.state.pos;
18357 } else {
18358 if (isNewLine(ch)) this.raise(this.state.start, "Unterminated string constant");
18359 ++this.state.pos;
18360 }
18361 }
18362 out += this.input.slice(chunkStart, this.state.pos++);
18363 return this.finishToken(types.string, out);
18364 };
18365
18366 // Reads template string tokens.
18367
18368 Tokenizer.prototype.readTmplToken = function readTmplToken() {
18369 var out = "",
18370 chunkStart = this.state.pos;
18371 for (;;) {
18372 if (this.state.pos >= this.input.length) this.raise(this.state.start, "Unterminated template");
18373 var ch = this.input.charCodeAt(this.state.pos);
18374 if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) {
18375 // '`', '${'
18376 if (this.state.pos === this.state.start && this.match(types.template)) {
18377 if (ch === 36) {
18378 this.state.pos += 2;
18379 return this.finishToken(types.dollarBraceL);
18380 } else {
18381 ++this.state.pos;
18382 return this.finishToken(types.backQuote);
18383 }
18384 }
18385 out += this.input.slice(chunkStart, this.state.pos);
18386 return this.finishToken(types.template, out);
18387 }
18388 if (ch === 92) {
18389 // '\'
18390 out += this.input.slice(chunkStart, this.state.pos);
18391 out += this.readEscapedChar(true);
18392 chunkStart = this.state.pos;
18393 } else if (isNewLine(ch)) {
18394 out += this.input.slice(chunkStart, this.state.pos);
18395 ++this.state.pos;
18396 switch (ch) {
18397 case 13:
18398 if (this.input.charCodeAt(this.state.pos) === 10) ++this.state.pos;
18399 case 10:
18400 out += "\n";
18401 break;
18402 default:
18403 out += String.fromCharCode(ch);
18404 break;
18405 }
18406 ++this.state.curLine;
18407 this.state.lineStart = this.state.pos;
18408 chunkStart = this.state.pos;
18409 } else {
18410 ++this.state.pos;
18411 }
18412 }
18413 };
18414
18415 // Used to read escaped characters
18416
18417 Tokenizer.prototype.readEscapedChar = function readEscapedChar(inTemplate) {
18418 var ch = this.input.charCodeAt(++this.state.pos);
18419 ++this.state.pos;
18420 switch (ch) {
18421 case 110:
18422 return "\n"; // 'n' -> '\n'
18423 case 114:
18424 return "\r"; // 'r' -> '\r'
18425 case 120:
18426 return String.fromCharCode(this.readHexChar(2)); // 'x'
18427 case 117:
18428 return codePointToString(this.readCodePoint()); // 'u'
18429 case 116:
18430 return "\t"; // 't' -> '\t'
18431 case 98:
18432 return "\b"; // 'b' -> '\b'
18433 case 118:
18434 return "\x0B"; // 'v' -> '\u000b'
18435 case 102:
18436 return "\f"; // 'f' -> '\f'
18437 case 13:
18438 if (this.input.charCodeAt(this.state.pos) === 10) ++this.state.pos; // '\r\n'
18439 case 10:
18440 // ' \n'
18441 this.state.lineStart = this.state.pos;
18442 ++this.state.curLine;
18443 return "";
18444 default:
18445 if (ch >= 48 && ch <= 55) {
18446 var octalStr = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/)[0];
18447 var octal = parseInt(octalStr, 8);
18448 if (octal > 255) {
18449 octalStr = octalStr.slice(0, -1);
18450 octal = parseInt(octalStr, 8);
18451 }
18452 if (octal > 0) {
18453 if (!this.state.containsOctal) {
18454 this.state.containsOctal = true;
18455 this.state.octalPosition = this.state.pos - 2;
18456 }
18457 if (this.state.strict || inTemplate) {
18458 this.raise(this.state.pos - 2, "Octal literal in strict mode");
18459 }
18460 }
18461 this.state.pos += octalStr.length - 1;
18462 return String.fromCharCode(octal);
18463 }
18464 return String.fromCharCode(ch);
18465 }
18466 };
18467
18468 // Used to read character escape sequences ('\x', '\u', '\U').
18469
18470 Tokenizer.prototype.readHexChar = function readHexChar(len) {
18471 var codePos = this.state.pos;
18472 var n = this.readInt(16, len);
18473 if (n === null) this.raise(codePos, "Bad character escape sequence");
18474 return n;
18475 };
18476
18477 // Read an identifier, and return it as a string. Sets `this.state.containsEsc`
18478 // to whether the word contained a '\u' escape.
18479 //
18480 // Incrementally adds only escaped chars, adding other chunks as-is
18481 // as a micro-optimization.
18482
18483 Tokenizer.prototype.readWord1 = function readWord1() {
18484 this.state.containsEsc = false;
18485 var word = "",
18486 first = true,
18487 chunkStart = this.state.pos;
18488 while (this.state.pos < this.input.length) {
18489 var ch = this.fullCharCodeAtPos();
18490 if (isIdentifierChar(ch)) {
18491 this.state.pos += ch <= 0xffff ? 1 : 2;
18492 } else if (ch === 92) {
18493 // "\"
18494 this.state.containsEsc = true;
18495
18496 word += this.input.slice(chunkStart, this.state.pos);
18497 var escStart = this.state.pos;
18498
18499 if (this.input.charCodeAt(++this.state.pos) !== 117) {
18500 // "u"
18501 this.raise(this.state.pos, "Expecting Unicode escape sequence \\uXXXX");
18502 }
18503
18504 ++this.state.pos;
18505 var esc = this.readCodePoint();
18506 if (!(first ? isIdentifierStart : isIdentifierChar)(esc, true)) {
18507 this.raise(escStart, "Invalid Unicode escape");
18508 }
18509
18510 word += codePointToString(esc);
18511 chunkStart = this.state.pos;
18512 } else {
18513 break;
18514 }
18515 first = false;
18516 }
18517 return word + this.input.slice(chunkStart, this.state.pos);
18518 };
18519
18520 // Read an identifier or keyword token. Will check for reserved
18521 // words when necessary.
18522
18523 Tokenizer.prototype.readWord = function readWord() {
18524 var word = this.readWord1();
18525 var type = types.name;
18526 if (!this.state.containsEsc && this.isKeyword(word)) {
18527 type = keywords[word];
18528 }
18529 return this.finishToken(type, word);
18530 };
18531
18532 Tokenizer.prototype.braceIsBlock = function braceIsBlock(prevType) {
18533 if (prevType === types.colon) {
18534 var parent = this.curContext();
18535 if (parent === types$1.braceStatement || parent === types$1.braceExpression) {
18536 return !parent.isExpr;
18537 }
18538 }
18539
18540 if (prevType === types._return) {
18541 return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
18542 }
18543
18544 if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR) {
18545 return true;
18546 }
18547
18548 if (prevType === types.braceL) {
18549 return this.curContext() === types$1.braceStatement;
18550 }
18551
18552 return !this.state.exprAllowed;
18553 };
18554
18555 Tokenizer.prototype.updateContext = function updateContext(prevType) {
18556 var type = this.state.type;
18557 var update = void 0;
18558
18559 if (type.keyword && prevType === types.dot) {
18560 this.state.exprAllowed = false;
18561 } else if (update = type.updateContext) {
18562 update.call(this, prevType);
18563 } else {
18564 this.state.exprAllowed = type.beforeExpr;
18565 }
18566 };
18567
18568 return Tokenizer;
18569}();
18570
18571var plugins = {};
18572var frozenDeprecatedWildcardPluginList = ["jsx", "doExpressions", "objectRestSpread", "decorators", "classProperties", "exportExtensions", "asyncGenerators", "functionBind", "functionSent", "dynamicImport", "flow"];
18573
18574var Parser = function (_Tokenizer) {
18575 inherits(Parser, _Tokenizer);
18576
18577 function Parser(options, input) {
18578 classCallCheck(this, Parser);
18579
18580 options = getOptions(options);
18581
18582 var _this = possibleConstructorReturn(this, _Tokenizer.call(this, options, input));
18583
18584 _this.options = options;
18585 _this.inModule = _this.options.sourceType === "module";
18586 _this.input = input;
18587 _this.plugins = _this.loadPlugins(_this.options.plugins);
18588 _this.filename = options.sourceFilename;
18589
18590 // If enabled, skip leading hashbang line.
18591 if (_this.state.pos === 0 && _this.input[0] === "#" && _this.input[1] === "!") {
18592 _this.skipLineComment(2);
18593 }
18594 return _this;
18595 }
18596
18597 Parser.prototype.isReservedWord = function isReservedWord(word) {
18598 if (word === "await") {
18599 return this.inModule;
18600 } else {
18601 return reservedWords[6](word);
18602 }
18603 };
18604
18605 Parser.prototype.hasPlugin = function hasPlugin(name) {
18606 if (this.plugins["*"] && frozenDeprecatedWildcardPluginList.indexOf(name) > -1) {
18607 return true;
18608 }
18609
18610 return !!this.plugins[name];
18611 };
18612
18613 Parser.prototype.extend = function extend(name, f) {
18614 this[name] = f(this[name]);
18615 };
18616
18617 Parser.prototype.loadAllPlugins = function loadAllPlugins() {
18618 var _this2 = this;
18619
18620 // ensure flow plugin loads last, also ensure estree is not loaded with *
18621 var pluginNames = Object.keys(plugins).filter(function (name) {
18622 return name !== "flow" && name !== "estree";
18623 });
18624 pluginNames.push("flow");
18625
18626 pluginNames.forEach(function (name) {
18627 var plugin = plugins[name];
18628 if (plugin) plugin(_this2);
18629 });
18630 };
18631
18632 Parser.prototype.loadPlugins = function loadPlugins(pluginList) {
18633 // TODO: Deprecate "*" option in next major version of Babylon
18634 if (pluginList.indexOf("*") >= 0) {
18635 this.loadAllPlugins();
18636
18637 return { "*": true };
18638 }
18639
18640 var pluginMap = {};
18641
18642 if (pluginList.indexOf("flow") >= 0) {
18643 // ensure flow plugin loads last
18644 pluginList = pluginList.filter(function (plugin) {
18645 return plugin !== "flow";
18646 });
18647 pluginList.push("flow");
18648 }
18649
18650 if (pluginList.indexOf("estree") >= 0) {
18651 // ensure estree plugin loads first
18652 pluginList = pluginList.filter(function (plugin) {
18653 return plugin !== "estree";
18654 });
18655 pluginList.unshift("estree");
18656 }
18657
18658 for (var _iterator = pluginList, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
18659 var _ref;
18660
18661 if (_isArray) {
18662 if (_i >= _iterator.length) break;
18663 _ref = _iterator[_i++];
18664 } else {
18665 _i = _iterator.next();
18666 if (_i.done) break;
18667 _ref = _i.value;
18668 }
18669
18670 var name = _ref;
18671
18672 if (!pluginMap[name]) {
18673 pluginMap[name] = true;
18674
18675 var plugin = plugins[name];
18676 if (plugin) plugin(this);
18677 }
18678 }
18679
18680 return pluginMap;
18681 };
18682
18683 Parser.prototype.parse = function parse() {
18684 var file = this.startNode();
18685 var program = this.startNode();
18686 this.nextToken();
18687 return this.parseTopLevel(file, program);
18688 };
18689
18690 return Parser;
18691}(Tokenizer);
18692
18693var pp = Parser.prototype;
18694
18695// ## Parser utilities
18696
18697// TODO
18698
18699pp.addExtra = function (node, key, val) {
18700 if (!node) return;
18701
18702 var extra = node.extra = node.extra || {};
18703 extra[key] = val;
18704};
18705
18706// TODO
18707
18708pp.isRelational = function (op) {
18709 return this.match(types.relational) && this.state.value === op;
18710};
18711
18712// TODO
18713
18714pp.expectRelational = function (op) {
18715 if (this.isRelational(op)) {
18716 this.next();
18717 } else {
18718 this.unexpected(null, types.relational);
18719 }
18720};
18721
18722// Tests whether parsed token is a contextual keyword.
18723
18724pp.isContextual = function (name) {
18725 return this.match(types.name) && this.state.value === name;
18726};
18727
18728// Consumes contextual keyword if possible.
18729
18730pp.eatContextual = function (name) {
18731 return this.state.value === name && this.eat(types.name);
18732};
18733
18734// Asserts that following token is given contextual keyword.
18735
18736pp.expectContextual = function (name, message) {
18737 if (!this.eatContextual(name)) this.unexpected(null, message);
18738};
18739
18740// Test whether a semicolon can be inserted at the current position.
18741
18742pp.canInsertSemicolon = function () {
18743 return this.match(types.eof) || this.match(types.braceR) || lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
18744};
18745
18746// TODO
18747
18748pp.isLineTerminator = function () {
18749 return this.eat(types.semi) || this.canInsertSemicolon();
18750};
18751
18752// Consume a semicolon, or, failing that, see if we are allowed to
18753// pretend that there is a semicolon at this position.
18754
18755pp.semicolon = function () {
18756 if (!this.isLineTerminator()) this.unexpected(null, types.semi);
18757};
18758
18759// Expect a token of a given type. If found, consume it, otherwise,
18760// raise an unexpected token error at given pos.
18761
18762pp.expect = function (type, pos) {
18763 return this.eat(type) || this.unexpected(pos, type);
18764};
18765
18766// Raise an unexpected token error. Can take the expected token type
18767// instead of a message string.
18768
18769pp.unexpected = function (pos) {
18770 var messageOrType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "Unexpected token";
18771
18772 if (messageOrType && (typeof messageOrType === "undefined" ? "undefined" : _typeof(messageOrType)) === "object" && messageOrType.label) {
18773 messageOrType = "Unexpected token, expected " + messageOrType.label;
18774 }
18775 this.raise(pos != null ? pos : this.state.start, messageOrType);
18776};
18777
18778/* eslint max-len: 0 */
18779
18780var pp$1 = Parser.prototype;
18781
18782// ### Statement parsing
18783
18784// Parse a program. Initializes the parser, reads any number of
18785// statements, and wraps them in a Program node. Optionally takes a
18786// `program` argument. If present, the statements will be appended
18787// to its body instead of creating a new node.
18788
18789pp$1.parseTopLevel = function (file, program) {
18790 program.sourceType = this.options.sourceType;
18791
18792 this.parseBlockBody(program, true, true, types.eof);
18793
18794 file.program = this.finishNode(program, "Program");
18795 file.comments = this.state.comments;
18796 file.tokens = this.state.tokens;
18797
18798 return this.finishNode(file, "File");
18799};
18800
18801var loopLabel = { kind: "loop" };
18802var switchLabel = { kind: "switch" };
18803
18804// TODO
18805
18806pp$1.stmtToDirective = function (stmt) {
18807 var expr = stmt.expression;
18808
18809 var directiveLiteral = this.startNodeAt(expr.start, expr.loc.start);
18810 var directive = this.startNodeAt(stmt.start, stmt.loc.start);
18811
18812 var raw = this.input.slice(expr.start, expr.end);
18813 var val = directiveLiteral.value = raw.slice(1, -1); // remove quotes
18814
18815 this.addExtra(directiveLiteral, "raw", raw);
18816 this.addExtra(directiveLiteral, "rawValue", val);
18817
18818 directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end);
18819
18820 return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end);
18821};
18822
18823// Parse a single statement.
18824//
18825// If expecting a statement and finding a slash operator, parse a
18826// regular expression literal. This is to handle cases like
18827// `if (foo) /blah/.exec(foo)`, where looking at the previous token
18828// does not help.
18829
18830pp$1.parseStatement = function (declaration, topLevel) {
18831 if (this.match(types.at)) {
18832 this.parseDecorators(true);
18833 }
18834
18835 var starttype = this.state.type;
18836 var node = this.startNode();
18837
18838 // Most types of statements are recognized by the keyword they
18839 // start with. Many are trivial to parse, some require a bit of
18840 // complexity.
18841
18842 switch (starttype) {
18843 case types._break:case types._continue:
18844 return this.parseBreakContinueStatement(node, starttype.keyword);
18845 case types._debugger:
18846 return this.parseDebuggerStatement(node);
18847 case types._do:
18848 return this.parseDoStatement(node);
18849 case types._for:
18850 return this.parseForStatement(node);
18851 case types._function:
18852 if (!declaration) this.unexpected();
18853 return this.parseFunctionStatement(node);
18854
18855 case types._class:
18856 if (!declaration) this.unexpected();
18857 return this.parseClass(node, true);
18858
18859 case types._if:
18860 return this.parseIfStatement(node);
18861 case types._return:
18862 return this.parseReturnStatement(node);
18863 case types._switch:
18864 return this.parseSwitchStatement(node);
18865 case types._throw:
18866 return this.parseThrowStatement(node);
18867 case types._try:
18868 return this.parseTryStatement(node);
18869
18870 case types._let:
18871 case types._const:
18872 if (!declaration) this.unexpected(); // NOTE: falls through to _var
18873
18874 case types._var:
18875 return this.parseVarStatement(node, starttype);
18876
18877 case types._while:
18878 return this.parseWhileStatement(node);
18879 case types._with:
18880 return this.parseWithStatement(node);
18881 case types.braceL:
18882 return this.parseBlock();
18883 case types.semi:
18884 return this.parseEmptyStatement(node);
18885 case types._export:
18886 case types._import:
18887 if (this.hasPlugin("dynamicImport") && this.lookahead().type === types.parenL) break;
18888
18889 if (!this.options.allowImportExportEverywhere) {
18890 if (!topLevel) {
18891 this.raise(this.state.start, "'import' and 'export' may only appear at the top level");
18892 }
18893
18894 if (!this.inModule) {
18895 this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: module'");
18896 }
18897 }
18898 return starttype === types._import ? this.parseImport(node) : this.parseExport(node);
18899
18900 case types.name:
18901 if (this.state.value === "async") {
18902 // peek ahead and see if next token is a function
18903 var state = this.state.clone();
18904 this.next();
18905 if (this.match(types._function) && !this.canInsertSemicolon()) {
18906 this.expect(types._function);
18907 return this.parseFunction(node, true, false, true);
18908 } else {
18909 this.state = state;
18910 }
18911 }
18912 }
18913
18914 // If the statement does not start with a statement keyword or a
18915 // brace, it's an ExpressionStatement or LabeledStatement. We
18916 // simply start parsing an expression, and afterwards, if the
18917 // next token is a colon and the expression was a simple
18918 // Identifier node, we switch to interpreting it as a label.
18919 var maybeName = this.state.value;
18920 var expr = this.parseExpression();
18921
18922 if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) {
18923 return this.parseLabeledStatement(node, maybeName, expr);
18924 } else {
18925 return this.parseExpressionStatement(node, expr);
18926 }
18927};
18928
18929pp$1.takeDecorators = function (node) {
18930 if (this.state.decorators.length) {
18931 node.decorators = this.state.decorators;
18932 this.state.decorators = [];
18933 }
18934};
18935
18936pp$1.parseDecorators = function (allowExport) {
18937 while (this.match(types.at)) {
18938 var decorator = this.parseDecorator();
18939 this.state.decorators.push(decorator);
18940 }
18941
18942 if (allowExport && this.match(types._export)) {
18943 return;
18944 }
18945
18946 if (!this.match(types._class)) {
18947 this.raise(this.state.start, "Leading decorators must be attached to a class declaration");
18948 }
18949};
18950
18951pp$1.parseDecorator = function () {
18952 if (!this.hasPlugin("decorators")) {
18953 this.unexpected();
18954 }
18955 var node = this.startNode();
18956 this.next();
18957 node.expression = this.parseMaybeAssign();
18958 return this.finishNode(node, "Decorator");
18959};
18960
18961pp$1.parseBreakContinueStatement = function (node, keyword) {
18962 var isBreak = keyword === "break";
18963 this.next();
18964
18965 if (this.isLineTerminator()) {
18966 node.label = null;
18967 } else if (!this.match(types.name)) {
18968 this.unexpected();
18969 } else {
18970 node.label = this.parseIdentifier();
18971 this.semicolon();
18972 }
18973
18974 // Verify that there is an actual destination to break or
18975 // continue to.
18976 var i = void 0;
18977 for (i = 0; i < this.state.labels.length; ++i) {
18978 var lab = this.state.labels[i];
18979 if (node.label == null || lab.name === node.label.name) {
18980 if (lab.kind != null && (isBreak || lab.kind === "loop")) break;
18981 if (node.label && isBreak) break;
18982 }
18983 }
18984 if (i === this.state.labels.length) this.raise(node.start, "Unsyntactic " + keyword);
18985 return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
18986};
18987
18988pp$1.parseDebuggerStatement = function (node) {
18989 this.next();
18990 this.semicolon();
18991 return this.finishNode(node, "DebuggerStatement");
18992};
18993
18994pp$1.parseDoStatement = function (node) {
18995 this.next();
18996 this.state.labels.push(loopLabel);
18997 node.body = this.parseStatement(false);
18998 this.state.labels.pop();
18999 this.expect(types._while);
19000 node.test = this.parseParenExpression();
19001 this.eat(types.semi);
19002 return this.finishNode(node, "DoWhileStatement");
19003};
19004
19005// Disambiguating between a `for` and a `for`/`in` or `for`/`of`
19006// loop is non-trivial. Basically, we have to parse the init `var`
19007// statement or expression, disallowing the `in` operator (see
19008// the second parameter to `parseExpression`), and then check
19009// whether the next token is `in` or `of`. When there is no init
19010// part (semicolon immediately after the opening parenthesis), it
19011// is a regular `for` loop.
19012
19013pp$1.parseForStatement = function (node) {
19014 this.next();
19015 this.state.labels.push(loopLabel);
19016
19017 var forAwait = false;
19018 if (this.hasPlugin("asyncGenerators") && this.state.inAsync && this.isContextual("await")) {
19019 forAwait = true;
19020 this.next();
19021 }
19022 this.expect(types.parenL);
19023
19024 if (this.match(types.semi)) {
19025 if (forAwait) {
19026 this.unexpected();
19027 }
19028 return this.parseFor(node, null);
19029 }
19030
19031 if (this.match(types._var) || this.match(types._let) || this.match(types._const)) {
19032 var _init = this.startNode();
19033 var varKind = this.state.type;
19034 this.next();
19035 this.parseVar(_init, true, varKind);
19036 this.finishNode(_init, "VariableDeclaration");
19037
19038 if (this.match(types._in) || this.isContextual("of")) {
19039 if (_init.declarations.length === 1 && !_init.declarations[0].init) {
19040 return this.parseForIn(node, _init, forAwait);
19041 }
19042 }
19043 if (forAwait) {
19044 this.unexpected();
19045 }
19046 return this.parseFor(node, _init);
19047 }
19048
19049 var refShorthandDefaultPos = { start: 0 };
19050 var init = this.parseExpression(true, refShorthandDefaultPos);
19051 if (this.match(types._in) || this.isContextual("of")) {
19052 var description = this.isContextual("of") ? "for-of statement" : "for-in statement";
19053 this.toAssignable(init, undefined, description);
19054 this.checkLVal(init, undefined, undefined, description);
19055 return this.parseForIn(node, init, forAwait);
19056 } else if (refShorthandDefaultPos.start) {
19057 this.unexpected(refShorthandDefaultPos.start);
19058 }
19059 if (forAwait) {
19060 this.unexpected();
19061 }
19062 return this.parseFor(node, init);
19063};
19064
19065pp$1.parseFunctionStatement = function (node) {
19066 this.next();
19067 return this.parseFunction(node, true);
19068};
19069
19070pp$1.parseIfStatement = function (node) {
19071 this.next();
19072 node.test = this.parseParenExpression();
19073 node.consequent = this.parseStatement(false);
19074 node.alternate = this.eat(types._else) ? this.parseStatement(false) : null;
19075 return this.finishNode(node, "IfStatement");
19076};
19077
19078pp$1.parseReturnStatement = function (node) {
19079 if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) {
19080 this.raise(this.state.start, "'return' outside of function");
19081 }
19082
19083 this.next();
19084
19085 // In `return` (and `break`/`continue`), the keywords with
19086 // optional arguments, we eagerly look for a semicolon or the
19087 // possibility to insert one.
19088
19089 if (this.isLineTerminator()) {
19090 node.argument = null;
19091 } else {
19092 node.argument = this.parseExpression();
19093 this.semicolon();
19094 }
19095
19096 return this.finishNode(node, "ReturnStatement");
19097};
19098
19099pp$1.parseSwitchStatement = function (node) {
19100 this.next();
19101 node.discriminant = this.parseParenExpression();
19102 node.cases = [];
19103 this.expect(types.braceL);
19104 this.state.labels.push(switchLabel);
19105
19106 // Statements under must be grouped (by label) in SwitchCase
19107 // nodes. `cur` is used to keep the node that we are currently
19108 // adding statements to.
19109
19110 var cur = void 0;
19111 for (var sawDefault; !this.match(types.braceR);) {
19112 if (this.match(types._case) || this.match(types._default)) {
19113 var isCase = this.match(types._case);
19114 if (cur) this.finishNode(cur, "SwitchCase");
19115 node.cases.push(cur = this.startNode());
19116 cur.consequent = [];
19117 this.next();
19118 if (isCase) {
19119 cur.test = this.parseExpression();
19120 } else {
19121 if (sawDefault) this.raise(this.state.lastTokStart, "Multiple default clauses");
19122 sawDefault = true;
19123 cur.test = null;
19124 }
19125 this.expect(types.colon);
19126 } else {
19127 if (cur) {
19128 cur.consequent.push(this.parseStatement(true));
19129 } else {
19130 this.unexpected();
19131 }
19132 }
19133 }
19134 if (cur) this.finishNode(cur, "SwitchCase");
19135 this.next(); // Closing brace
19136 this.state.labels.pop();
19137 return this.finishNode(node, "SwitchStatement");
19138};
19139
19140pp$1.parseThrowStatement = function (node) {
19141 this.next();
19142 if (lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) this.raise(this.state.lastTokEnd, "Illegal newline after throw");
19143 node.argument = this.parseExpression();
19144 this.semicolon();
19145 return this.finishNode(node, "ThrowStatement");
19146};
19147
19148// Reused empty array added for node fields that are always empty.
19149
19150var empty = [];
19151
19152pp$1.parseTryStatement = function (node) {
19153 this.next();
19154
19155 node.block = this.parseBlock();
19156 node.handler = null;
19157
19158 if (this.match(types._catch)) {
19159 var clause = this.startNode();
19160 this.next();
19161
19162 this.expect(types.parenL);
19163 clause.param = this.parseBindingAtom();
19164 this.checkLVal(clause.param, true, Object.create(null), "catch clause");
19165 this.expect(types.parenR);
19166
19167 clause.body = this.parseBlock();
19168 node.handler = this.finishNode(clause, "CatchClause");
19169 }
19170
19171 node.guardedHandlers = empty;
19172 node.finalizer = this.eat(types._finally) ? this.parseBlock() : null;
19173
19174 if (!node.handler && !node.finalizer) {
19175 this.raise(node.start, "Missing catch or finally clause");
19176 }
19177
19178 return this.finishNode(node, "TryStatement");
19179};
19180
19181pp$1.parseVarStatement = function (node, kind) {
19182 this.next();
19183 this.parseVar(node, false, kind);
19184 this.semicolon();
19185 return this.finishNode(node, "VariableDeclaration");
19186};
19187
19188pp$1.parseWhileStatement = function (node) {
19189 this.next();
19190 node.test = this.parseParenExpression();
19191 this.state.labels.push(loopLabel);
19192 node.body = this.parseStatement(false);
19193 this.state.labels.pop();
19194 return this.finishNode(node, "WhileStatement");
19195};
19196
19197pp$1.parseWithStatement = function (node) {
19198 if (this.state.strict) this.raise(this.state.start, "'with' in strict mode");
19199 this.next();
19200 node.object = this.parseParenExpression();
19201 node.body = this.parseStatement(false);
19202 return this.finishNode(node, "WithStatement");
19203};
19204
19205pp$1.parseEmptyStatement = function (node) {
19206 this.next();
19207 return this.finishNode(node, "EmptyStatement");
19208};
19209
19210pp$1.parseLabeledStatement = function (node, maybeName, expr) {
19211 for (var _iterator = this.state.labels, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
19212 var _ref;
19213
19214 if (_isArray) {
19215 if (_i >= _iterator.length) break;
19216 _ref = _iterator[_i++];
19217 } else {
19218 _i = _iterator.next();
19219 if (_i.done) break;
19220 _ref = _i.value;
19221 }
19222
19223 var _label = _ref;
19224
19225 if (_label.name === maybeName) {
19226 this.raise(expr.start, "Label '" + maybeName + "' is already declared");
19227 }
19228 }
19229
19230 var kind = this.state.type.isLoop ? "loop" : this.match(types._switch) ? "switch" : null;
19231 for (var i = this.state.labels.length - 1; i >= 0; i--) {
19232 var label = this.state.labels[i];
19233 if (label.statementStart === node.start) {
19234 label.statementStart = this.state.start;
19235 label.kind = kind;
19236 } else {
19237 break;
19238 }
19239 }
19240
19241 this.state.labels.push({ name: maybeName, kind: kind, statementStart: this.state.start });
19242 node.body = this.parseStatement(true);
19243 this.state.labels.pop();
19244 node.label = expr;
19245 return this.finishNode(node, "LabeledStatement");
19246};
19247
19248pp$1.parseExpressionStatement = function (node, expr) {
19249 node.expression = expr;
19250 this.semicolon();
19251 return this.finishNode(node, "ExpressionStatement");
19252};
19253
19254// Parse a semicolon-enclosed block of statements, handling `"use
19255// strict"` declarations when `allowStrict` is true (used for
19256// function bodies).
19257
19258pp$1.parseBlock = function (allowDirectives) {
19259 var node = this.startNode();
19260 this.expect(types.braceL);
19261 this.parseBlockBody(node, allowDirectives, false, types.braceR);
19262 return this.finishNode(node, "BlockStatement");
19263};
19264
19265pp$1.isValidDirective = function (stmt) {
19266 return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized;
19267};
19268
19269pp$1.parseBlockBody = function (node, allowDirectives, topLevel, end) {
19270 node.body = [];
19271 node.directives = [];
19272
19273 var parsedNonDirective = false;
19274 var oldStrict = void 0;
19275 var octalPosition = void 0;
19276
19277 while (!this.eat(end)) {
19278 if (!parsedNonDirective && this.state.containsOctal && !octalPosition) {
19279 octalPosition = this.state.octalPosition;
19280 }
19281
19282 var stmt = this.parseStatement(true, topLevel);
19283
19284 if (allowDirectives && !parsedNonDirective && this.isValidDirective(stmt)) {
19285 var directive = this.stmtToDirective(stmt);
19286 node.directives.push(directive);
19287
19288 if (oldStrict === undefined && directive.value.value === "use strict") {
19289 oldStrict = this.state.strict;
19290 this.setStrict(true);
19291
19292 if (octalPosition) {
19293 this.raise(octalPosition, "Octal literal in strict mode");
19294 }
19295 }
19296
19297 continue;
19298 }
19299
19300 parsedNonDirective = true;
19301 node.body.push(stmt);
19302 }
19303
19304 if (oldStrict === false) {
19305 this.setStrict(false);
19306 }
19307};
19308
19309// Parse a regular `for` loop. The disambiguation code in
19310// `parseStatement` will already have parsed the init statement or
19311// expression.
19312
19313pp$1.parseFor = function (node, init) {
19314 node.init = init;
19315 this.expect(types.semi);
19316 node.test = this.match(types.semi) ? null : this.parseExpression();
19317 this.expect(types.semi);
19318 node.update = this.match(types.parenR) ? null : this.parseExpression();
19319 this.expect(types.parenR);
19320 node.body = this.parseStatement(false);
19321 this.state.labels.pop();
19322 return this.finishNode(node, "ForStatement");
19323};
19324
19325// Parse a `for`/`in` and `for`/`of` loop, which are almost
19326// same from parser's perspective.
19327
19328pp$1.parseForIn = function (node, init, forAwait) {
19329 var type = void 0;
19330 if (forAwait) {
19331 this.eatContextual("of");
19332 type = "ForAwaitStatement";
19333 } else {
19334 type = this.match(types._in) ? "ForInStatement" : "ForOfStatement";
19335 this.next();
19336 }
19337 node.left = init;
19338 node.right = this.parseExpression();
19339 this.expect(types.parenR);
19340 node.body = this.parseStatement(false);
19341 this.state.labels.pop();
19342 return this.finishNode(node, type);
19343};
19344
19345// Parse a list of variable declarations.
19346
19347pp$1.parseVar = function (node, isFor, kind) {
19348 node.declarations = [];
19349 node.kind = kind.keyword;
19350 for (;;) {
19351 var decl = this.startNode();
19352 this.parseVarHead(decl);
19353 if (this.eat(types.eq)) {
19354 decl.init = this.parseMaybeAssign(isFor);
19355 } else if (kind === types._const && !(this.match(types._in) || this.isContextual("of"))) {
19356 this.unexpected();
19357 } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(types._in) || this.isContextual("of")))) {
19358 this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value");
19359 } else {
19360 decl.init = null;
19361 }
19362 node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
19363 if (!this.eat(types.comma)) break;
19364 }
19365 return node;
19366};
19367
19368pp$1.parseVarHead = function (decl) {
19369 decl.id = this.parseBindingAtom();
19370 this.checkLVal(decl.id, true, undefined, "variable declaration");
19371};
19372
19373// Parse a function declaration or literal (depending on the
19374// `isStatement` parameter).
19375
19376pp$1.parseFunction = function (node, isStatement, allowExpressionBody, isAsync, optionalId) {
19377 var oldInMethod = this.state.inMethod;
19378 this.state.inMethod = false;
19379
19380 this.initFunction(node, isAsync);
19381
19382 if (this.match(types.star)) {
19383 if (node.async && !this.hasPlugin("asyncGenerators")) {
19384 this.unexpected();
19385 } else {
19386 node.generator = true;
19387 this.next();
19388 }
19389 }
19390
19391 if (isStatement && !optionalId && !this.match(types.name) && !this.match(types._yield)) {
19392 this.unexpected();
19393 }
19394
19395 if (this.match(types.name) || this.match(types._yield)) {
19396 node.id = this.parseBindingIdentifier();
19397 }
19398
19399 this.parseFunctionParams(node);
19400 this.parseFunctionBody(node, allowExpressionBody);
19401
19402 this.state.inMethod = oldInMethod;
19403
19404 return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression");
19405};
19406
19407pp$1.parseFunctionParams = function (node) {
19408 this.expect(types.parenL);
19409 node.params = this.parseBindingList(types.parenR);
19410};
19411
19412// Parse a class declaration or literal (depending on the
19413// `isStatement` parameter).
19414
19415pp$1.parseClass = function (node, isStatement, optionalId) {
19416 this.next();
19417 this.takeDecorators(node);
19418 this.parseClassId(node, isStatement, optionalId);
19419 this.parseClassSuper(node);
19420 this.parseClassBody(node);
19421 return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
19422};
19423
19424pp$1.isClassProperty = function () {
19425 return this.match(types.eq) || this.isLineTerminator();
19426};
19427
19428pp$1.isClassMutatorStarter = function () {
19429 return false;
19430};
19431
19432pp$1.parseClassBody = function (node) {
19433 // class bodies are implicitly strict
19434 var oldStrict = this.state.strict;
19435 this.state.strict = true;
19436
19437 var hadConstructorCall = false;
19438 var hadConstructor = false;
19439 var decorators = [];
19440 var classBody = this.startNode();
19441
19442 classBody.body = [];
19443
19444 this.expect(types.braceL);
19445
19446 while (!this.eat(types.braceR)) {
19447 if (this.eat(types.semi)) {
19448 if (decorators.length > 0) {
19449 this.raise(this.state.lastTokEnd, "Decorators must not be followed by a semicolon");
19450 }
19451 continue;
19452 }
19453
19454 if (this.match(types.at)) {
19455 decorators.push(this.parseDecorator());
19456 continue;
19457 }
19458
19459 var method = this.startNode();
19460
19461 // steal the decorators if there are any
19462 if (decorators.length) {
19463 method.decorators = decorators;
19464 decorators = [];
19465 }
19466
19467 var isConstructorCall = false;
19468 var isMaybeStatic = this.match(types.name) && this.state.value === "static";
19469 var isGenerator = this.eat(types.star);
19470 var isGetSet = false;
19471 var isAsync = false;
19472
19473 this.parsePropertyName(method);
19474
19475 method.static = isMaybeStatic && !this.match(types.parenL);
19476 if (method.static) {
19477 isGenerator = this.eat(types.star);
19478 this.parsePropertyName(method);
19479 }
19480
19481 if (!isGenerator) {
19482 if (this.isClassProperty()) {
19483 classBody.body.push(this.parseClassProperty(method));
19484 continue;
19485 }
19486
19487 if (method.key.type === "Identifier" && !method.computed && this.hasPlugin("classConstructorCall") && method.key.name === "call" && this.match(types.name) && this.state.value === "constructor") {
19488 isConstructorCall = true;
19489 this.parsePropertyName(method);
19490 }
19491 }
19492
19493 var isAsyncMethod = !this.match(types.parenL) && !method.computed && method.key.type === "Identifier" && method.key.name === "async";
19494 if (isAsyncMethod) {
19495 if (this.hasPlugin("asyncGenerators") && this.eat(types.star)) isGenerator = true;
19496 isAsync = true;
19497 this.parsePropertyName(method);
19498 }
19499
19500 method.kind = "method";
19501
19502 if (!method.computed) {
19503 var key = method.key;
19504
19505 // handle get/set methods
19506 // eg. class Foo { get bar() {} set bar() {} }
19507
19508 if (!isAsync && !isGenerator && !this.isClassMutatorStarter() && key.type === "Identifier" && !this.match(types.parenL) && (key.name === "get" || key.name === "set")) {
19509 isGetSet = true;
19510 method.kind = key.name;
19511 key = this.parsePropertyName(method);
19512 }
19513
19514 // disallow invalid constructors
19515 var isConstructor = !isConstructorCall && !method.static && (key.name === "constructor" || // Identifier
19516 key.value === "constructor" // Literal
19517 );
19518 if (isConstructor) {
19519 if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class");
19520 if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier");
19521 if (isGenerator) this.raise(key.start, "Constructor can't be a generator");
19522 if (isAsync) this.raise(key.start, "Constructor can't be an async function");
19523 method.kind = "constructor";
19524 hadConstructor = true;
19525 }
19526
19527 // disallow static prototype method
19528 var isStaticPrototype = method.static && (key.name === "prototype" || // Identifier
19529 key.value === "prototype" // Literal
19530 );
19531 if (isStaticPrototype) {
19532 this.raise(key.start, "Classes may not have static property named prototype");
19533 }
19534 }
19535
19536 // convert constructor to a constructor call
19537 if (isConstructorCall) {
19538 if (hadConstructorCall) this.raise(method.start, "Duplicate constructor call in the same class");
19539 method.kind = "constructorCall";
19540 hadConstructorCall = true;
19541 }
19542
19543 // disallow decorators on class constructors
19544 if ((method.kind === "constructor" || method.kind === "constructorCall") && method.decorators) {
19545 this.raise(method.start, "You can't attach decorators to a class constructor");
19546 }
19547
19548 this.parseClassMethod(classBody, method, isGenerator, isAsync);
19549
19550 if (isGetSet) {
19551 this.checkGetterSetterParamCount(method);
19552 }
19553 }
19554
19555 if (decorators.length) {
19556 this.raise(this.state.start, "You have trailing decorators with no method");
19557 }
19558
19559 node.body = this.finishNode(classBody, "ClassBody");
19560
19561 this.state.strict = oldStrict;
19562};
19563
19564pp$1.parseClassProperty = function (node) {
19565 if (this.match(types.eq)) {
19566 if (!this.hasPlugin("classProperties")) this.unexpected();
19567 this.next();
19568 node.value = this.parseMaybeAssign();
19569 } else {
19570 node.value = null;
19571 }
19572 this.semicolon();
19573 return this.finishNode(node, "ClassProperty");
19574};
19575
19576pp$1.parseClassMethod = function (classBody, method, isGenerator, isAsync) {
19577 this.parseMethod(method, isGenerator, isAsync);
19578 classBody.body.push(this.finishNode(method, "ClassMethod"));
19579};
19580
19581pp$1.parseClassId = function (node, isStatement, optionalId) {
19582 if (this.match(types.name)) {
19583 node.id = this.parseIdentifier();
19584 } else {
19585 if (optionalId || !isStatement) {
19586 node.id = null;
19587 } else {
19588 this.unexpected();
19589 }
19590 }
19591};
19592
19593pp$1.parseClassSuper = function (node) {
19594 node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null;
19595};
19596
19597// Parses module export declaration.
19598
19599pp$1.parseExport = function (node) {
19600 this.next();
19601 // export * from '...'
19602 if (this.match(types.star)) {
19603 var specifier = this.startNode();
19604 this.next();
19605 if (this.hasPlugin("exportExtensions") && this.eatContextual("as")) {
19606 specifier.exported = this.parseIdentifier();
19607 node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")];
19608 this.parseExportSpecifiersMaybe(node);
19609 this.parseExportFrom(node, true);
19610 } else {
19611 this.parseExportFrom(node, true);
19612 return this.finishNode(node, "ExportAllDeclaration");
19613 }
19614 } else if (this.hasPlugin("exportExtensions") && this.isExportDefaultSpecifier()) {
19615 var _specifier = this.startNode();
19616 _specifier.exported = this.parseIdentifier(true);
19617 node.specifiers = [this.finishNode(_specifier, "ExportDefaultSpecifier")];
19618 if (this.match(types.comma) && this.lookahead().type === types.star) {
19619 this.expect(types.comma);
19620 var _specifier2 = this.startNode();
19621 this.expect(types.star);
19622 this.expectContextual("as");
19623 _specifier2.exported = this.parseIdentifier();
19624 node.specifiers.push(this.finishNode(_specifier2, "ExportNamespaceSpecifier"));
19625 } else {
19626 this.parseExportSpecifiersMaybe(node);
19627 }
19628 this.parseExportFrom(node, true);
19629 } else if (this.eat(types._default)) {
19630 // export default ...
19631 var expr = this.startNode();
19632 var needsSemi = false;
19633 if (this.eat(types._function)) {
19634 expr = this.parseFunction(expr, true, false, false, true);
19635 } else if (this.match(types._class)) {
19636 expr = this.parseClass(expr, true, true);
19637 } else {
19638 needsSemi = true;
19639 expr = this.parseMaybeAssign();
19640 }
19641 node.declaration = expr;
19642 if (needsSemi) this.semicolon();
19643 this.checkExport(node, true, true);
19644 return this.finishNode(node, "ExportDefaultDeclaration");
19645 } else if (this.shouldParseExportDeclaration()) {
19646 node.specifiers = [];
19647 node.source = null;
19648 node.declaration = this.parseExportDeclaration(node);
19649 } else {
19650 // export { x, y as z } [from '...']
19651 node.declaration = null;
19652 node.specifiers = this.parseExportSpecifiers();
19653 this.parseExportFrom(node);
19654 }
19655 this.checkExport(node, true);
19656 return this.finishNode(node, "ExportNamedDeclaration");
19657};
19658
19659pp$1.parseExportDeclaration = function () {
19660 return this.parseStatement(true);
19661};
19662
19663pp$1.isExportDefaultSpecifier = function () {
19664 if (this.match(types.name)) {
19665 return this.state.value !== "type" && this.state.value !== "async" && this.state.value !== "interface";
19666 }
19667
19668 if (!this.match(types._default)) {
19669 return false;
19670 }
19671
19672 var lookahead = this.lookahead();
19673 return lookahead.type === types.comma || lookahead.type === types.name && lookahead.value === "from";
19674};
19675
19676pp$1.parseExportSpecifiersMaybe = function (node) {
19677 if (this.eat(types.comma)) {
19678 node.specifiers = node.specifiers.concat(this.parseExportSpecifiers());
19679 }
19680};
19681
19682pp$1.parseExportFrom = function (node, expect) {
19683 if (this.eatContextual("from")) {
19684 node.source = this.match(types.string) ? this.parseExprAtom() : this.unexpected();
19685 this.checkExport(node);
19686 } else {
19687 if (expect) {
19688 this.unexpected();
19689 } else {
19690 node.source = null;
19691 }
19692 }
19693
19694 this.semicolon();
19695};
19696
19697pp$1.shouldParseExportDeclaration = function () {
19698 return this.state.type.keyword === "var" || this.state.type.keyword === "const" || this.state.type.keyword === "let" || this.state.type.keyword === "function" || this.state.type.keyword === "class" || this.isContextual("async");
19699};
19700
19701pp$1.checkExport = function (node, checkNames, isDefault) {
19702 if (checkNames) {
19703 // Check for duplicate exports
19704 if (isDefault) {
19705 // Default exports
19706 this.checkDuplicateExports(node, "default");
19707 } else if (node.specifiers && node.specifiers.length) {
19708 // Named exports
19709 for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
19710 var _ref2;
19711
19712 if (_isArray2) {
19713 if (_i2 >= _iterator2.length) break;
19714 _ref2 = _iterator2[_i2++];
19715 } else {
19716 _i2 = _iterator2.next();
19717 if (_i2.done) break;
19718 _ref2 = _i2.value;
19719 }
19720
19721 var specifier = _ref2;
19722
19723 this.checkDuplicateExports(specifier, specifier.exported.name);
19724 }
19725 } else if (node.declaration) {
19726 // Exported declarations
19727 if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") {
19728 this.checkDuplicateExports(node, node.declaration.id.name);
19729 } else if (node.declaration.type === "VariableDeclaration") {
19730 for (var _iterator3 = node.declaration.declarations, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
19731 var _ref3;
19732
19733 if (_isArray3) {
19734 if (_i3 >= _iterator3.length) break;
19735 _ref3 = _iterator3[_i3++];
19736 } else {
19737 _i3 = _iterator3.next();
19738 if (_i3.done) break;
19739 _ref3 = _i3.value;
19740 }
19741
19742 var declaration = _ref3;
19743
19744 this.checkDeclaration(declaration.id);
19745 }
19746 }
19747 }
19748 }
19749
19750 if (this.state.decorators.length) {
19751 var isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression");
19752 if (!node.declaration || !isClass) {
19753 this.raise(node.start, "You can only use decorators on an export when exporting a class");
19754 }
19755 this.takeDecorators(node.declaration);
19756 }
19757};
19758
19759pp$1.checkDeclaration = function (node) {
19760 if (node.type === "ObjectPattern") {
19761 for (var _iterator4 = node.properties, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
19762 var _ref4;
19763
19764 if (_isArray4) {
19765 if (_i4 >= _iterator4.length) break;
19766 _ref4 = _iterator4[_i4++];
19767 } else {
19768 _i4 = _iterator4.next();
19769 if (_i4.done) break;
19770 _ref4 = _i4.value;
19771 }
19772
19773 var prop = _ref4;
19774
19775 this.checkDeclaration(prop);
19776 }
19777 } else if (node.type === "ArrayPattern") {
19778 for (var _iterator5 = node.elements, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
19779 var _ref5;
19780
19781 if (_isArray5) {
19782 if (_i5 >= _iterator5.length) break;
19783 _ref5 = _iterator5[_i5++];
19784 } else {
19785 _i5 = _iterator5.next();
19786 if (_i5.done) break;
19787 _ref5 = _i5.value;
19788 }
19789
19790 var elem = _ref5;
19791
19792 if (elem) {
19793 this.checkDeclaration(elem);
19794 }
19795 }
19796 } else if (node.type === "ObjectProperty") {
19797 this.checkDeclaration(node.value);
19798 } else if (node.type === "RestElement" || node.type === "RestProperty") {
19799 this.checkDeclaration(node.argument);
19800 } else if (node.type === "Identifier") {
19801 this.checkDuplicateExports(node, node.name);
19802 }
19803};
19804
19805pp$1.checkDuplicateExports = function (node, name) {
19806 if (this.state.exportedIdentifiers.indexOf(name) > -1) {
19807 this.raiseDuplicateExportError(node, name);
19808 }
19809 this.state.exportedIdentifiers.push(name);
19810};
19811
19812pp$1.raiseDuplicateExportError = function (node, name) {
19813 this.raise(node.start, name === "default" ? "Only one default export allowed per module." : "`" + name + "` has already been exported. Exported identifiers must be unique.");
19814};
19815
19816// Parses a comma-separated list of module exports.
19817
19818pp$1.parseExportSpecifiers = function () {
19819 var nodes = [];
19820 var first = true;
19821 var needsFrom = void 0;
19822
19823 // export { x, y as z } [from '...']
19824 this.expect(types.braceL);
19825
19826 while (!this.eat(types.braceR)) {
19827 if (first) {
19828 first = false;
19829 } else {
19830 this.expect(types.comma);
19831 if (this.eat(types.braceR)) break;
19832 }
19833
19834 var isDefault = this.match(types._default);
19835 if (isDefault && !needsFrom) needsFrom = true;
19836
19837 var node = this.startNode();
19838 node.local = this.parseIdentifier(isDefault);
19839 node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone();
19840 nodes.push(this.finishNode(node, "ExportSpecifier"));
19841 }
19842
19843 // https://github.com/ember-cli/ember-cli/pull/3739
19844 if (needsFrom && !this.isContextual("from")) {
19845 this.unexpected();
19846 }
19847
19848 return nodes;
19849};
19850
19851// Parses import declaration.
19852
19853pp$1.parseImport = function (node) {
19854 this.eat(types._import);
19855
19856 // import '...'
19857 if (this.match(types.string)) {
19858 node.specifiers = [];
19859 node.source = this.parseExprAtom();
19860 } else {
19861 node.specifiers = [];
19862 this.parseImportSpecifiers(node);
19863 this.expectContextual("from");
19864 node.source = this.match(types.string) ? this.parseExprAtom() : this.unexpected();
19865 }
19866 this.semicolon();
19867 return this.finishNode(node, "ImportDeclaration");
19868};
19869
19870// Parses a comma-separated list of module imports.
19871
19872pp$1.parseImportSpecifiers = function (node) {
19873 var first = true;
19874 if (this.match(types.name)) {
19875 // import defaultObj, { x, y as z } from '...'
19876 var startPos = this.state.start;
19877 var startLoc = this.state.startLoc;
19878 node.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(), startPos, startLoc));
19879 if (!this.eat(types.comma)) return;
19880 }
19881
19882 if (this.match(types.star)) {
19883 var specifier = this.startNode();
19884 this.next();
19885 this.expectContextual("as");
19886 specifier.local = this.parseIdentifier();
19887 this.checkLVal(specifier.local, true, undefined, "import namespace specifier");
19888 node.specifiers.push(this.finishNode(specifier, "ImportNamespaceSpecifier"));
19889 return;
19890 }
19891
19892 this.expect(types.braceL);
19893 while (!this.eat(types.braceR)) {
19894 if (first) {
19895 first = false;
19896 } else {
19897 // Detect an attempt to deep destructure
19898 if (this.eat(types.colon)) {
19899 this.unexpected(null, "ES2015 named imports do not destructure. Use another statement for destructuring after the import.");
19900 }
19901
19902 this.expect(types.comma);
19903 if (this.eat(types.braceR)) break;
19904 }
19905
19906 this.parseImportSpecifier(node);
19907 }
19908};
19909
19910pp$1.parseImportSpecifier = function (node) {
19911 var specifier = this.startNode();
19912 specifier.imported = this.parseIdentifier(true);
19913 if (this.eatContextual("as")) {
19914 specifier.local = this.parseIdentifier();
19915 } else {
19916 this.checkReservedWord(specifier.imported.name, specifier.start, true, true);
19917 specifier.local = specifier.imported.__clone();
19918 }
19919 this.checkLVal(specifier.local, true, undefined, "import specifier");
19920 node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
19921};
19922
19923pp$1.parseImportSpecifierDefault = function (id, startPos, startLoc) {
19924 var node = this.startNodeAt(startPos, startLoc);
19925 node.local = id;
19926 this.checkLVal(node.local, true, undefined, "default import specifier");
19927 return this.finishNode(node, "ImportDefaultSpecifier");
19928};
19929
19930var pp$2 = Parser.prototype;
19931
19932// Convert existing expression atom to assignable pattern
19933// if possible.
19934
19935pp$2.toAssignable = function (node, isBinding, contextDescription) {
19936 if (node) {
19937 switch (node.type) {
19938 case "Identifier":
19939 case "ObjectPattern":
19940 case "ArrayPattern":
19941 case "AssignmentPattern":
19942 break;
19943
19944 case "ObjectExpression":
19945 node.type = "ObjectPattern";
19946 for (var _iterator = node.properties, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
19947 var _ref;
19948
19949 if (_isArray) {
19950 if (_i >= _iterator.length) break;
19951 _ref = _iterator[_i++];
19952 } else {
19953 _i = _iterator.next();
19954 if (_i.done) break;
19955 _ref = _i.value;
19956 }
19957
19958 var prop = _ref;
19959
19960 if (prop.type === "ObjectMethod") {
19961 if (prop.kind === "get" || prop.kind === "set") {
19962 this.raise(prop.key.start, "Object pattern can't contain getter or setter");
19963 } else {
19964 this.raise(prop.key.start, "Object pattern can't contain methods");
19965 }
19966 } else {
19967 this.toAssignable(prop, isBinding, "object destructuring pattern");
19968 }
19969 }
19970 break;
19971
19972 case "ObjectProperty":
19973 this.toAssignable(node.value, isBinding, contextDescription);
19974 break;
19975
19976 case "SpreadProperty":
19977 node.type = "RestProperty";
19978 break;
19979
19980 case "ArrayExpression":
19981 node.type = "ArrayPattern";
19982 this.toAssignableList(node.elements, isBinding, contextDescription);
19983 break;
19984
19985 case "AssignmentExpression":
19986 if (node.operator === "=") {
19987 node.type = "AssignmentPattern";
19988 delete node.operator;
19989 } else {
19990 this.raise(node.left.end, "Only '=' operator can be used for specifying default value.");
19991 }
19992 break;
19993
19994 case "MemberExpression":
19995 if (!isBinding) break;
19996
19997 default:
19998 {
19999 var message = "Invalid left-hand side" + (contextDescription ? " in " + contextDescription : /* istanbul ignore next */"expression");
20000 this.raise(node.start, message);
20001 }
20002 }
20003 }
20004 return node;
20005};
20006
20007// Convert list of expression atoms to binding list.
20008
20009pp$2.toAssignableList = function (exprList, isBinding, contextDescription) {
20010 var end = exprList.length;
20011 if (end) {
20012 var last = exprList[end - 1];
20013 if (last && last.type === "RestElement") {
20014 --end;
20015 } else if (last && last.type === "SpreadElement") {
20016 last.type = "RestElement";
20017 var arg = last.argument;
20018 this.toAssignable(arg, isBinding, contextDescription);
20019 if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") {
20020 this.unexpected(arg.start);
20021 }
20022 --end;
20023 }
20024 }
20025 for (var i = 0; i < end; i++) {
20026 var elt = exprList[i];
20027 if (elt) this.toAssignable(elt, isBinding, contextDescription);
20028 }
20029 return exprList;
20030};
20031
20032// Convert list of expression atoms to a list of
20033
20034pp$2.toReferencedList = function (exprList) {
20035 return exprList;
20036};
20037
20038// Parses spread element.
20039
20040pp$2.parseSpread = function (refShorthandDefaultPos) {
20041 var node = this.startNode();
20042 this.next();
20043 node.argument = this.parseMaybeAssign(false, refShorthandDefaultPos);
20044 return this.finishNode(node, "SpreadElement");
20045};
20046
20047pp$2.parseRest = function () {
20048 var node = this.startNode();
20049 this.next();
20050 node.argument = this.parseBindingIdentifier();
20051 return this.finishNode(node, "RestElement");
20052};
20053
20054pp$2.shouldAllowYieldIdentifier = function () {
20055 return this.match(types._yield) && !this.state.strict && !this.state.inGenerator;
20056};
20057
20058pp$2.parseBindingIdentifier = function () {
20059 return this.parseIdentifier(this.shouldAllowYieldIdentifier());
20060};
20061
20062// Parses lvalue (assignable) atom.
20063
20064pp$2.parseBindingAtom = function () {
20065 switch (this.state.type) {
20066 case types._yield:
20067 if (this.state.strict || this.state.inGenerator) this.unexpected();
20068 // fall-through
20069 case types.name:
20070 return this.parseIdentifier(true);
20071
20072 case types.bracketL:
20073 var node = this.startNode();
20074 this.next();
20075 node.elements = this.parseBindingList(types.bracketR, true);
20076 return this.finishNode(node, "ArrayPattern");
20077
20078 case types.braceL:
20079 return this.parseObj(true);
20080
20081 default:
20082 this.unexpected();
20083 }
20084};
20085
20086pp$2.parseBindingList = function (close, allowEmpty) {
20087 var elts = [];
20088 var first = true;
20089 while (!this.eat(close)) {
20090 if (first) {
20091 first = false;
20092 } else {
20093 this.expect(types.comma);
20094 }
20095 if (allowEmpty && this.match(types.comma)) {
20096 elts.push(null);
20097 } else if (this.eat(close)) {
20098 break;
20099 } else if (this.match(types.ellipsis)) {
20100 elts.push(this.parseAssignableListItemTypes(this.parseRest()));
20101 this.expect(close);
20102 break;
20103 } else {
20104 var decorators = [];
20105 while (this.match(types.at)) {
20106 decorators.push(this.parseDecorator());
20107 }
20108 var left = this.parseMaybeDefault();
20109 if (decorators.length) {
20110 left.decorators = decorators;
20111 }
20112 this.parseAssignableListItemTypes(left);
20113 elts.push(this.parseMaybeDefault(left.start, left.loc.start, left));
20114 }
20115 }
20116 return elts;
20117};
20118
20119pp$2.parseAssignableListItemTypes = function (param) {
20120 return param;
20121};
20122
20123// Parses assignment pattern around given atom if possible.
20124
20125pp$2.parseMaybeDefault = function (startPos, startLoc, left) {
20126 startLoc = startLoc || this.state.startLoc;
20127 startPos = startPos || this.state.start;
20128 left = left || this.parseBindingAtom();
20129 if (!this.eat(types.eq)) return left;
20130
20131 var node = this.startNodeAt(startPos, startLoc);
20132 node.left = left;
20133 node.right = this.parseMaybeAssign();
20134 return this.finishNode(node, "AssignmentPattern");
20135};
20136
20137// Verify that a node is an lval — something that can be assigned
20138// to.
20139
20140pp$2.checkLVal = function (expr, isBinding, checkClashes, contextDescription) {
20141 switch (expr.type) {
20142 case "Identifier":
20143 this.checkReservedWord(expr.name, expr.start, false, true);
20144
20145 if (checkClashes) {
20146 // we need to prefix this with an underscore for the cases where we have a key of
20147 // `__proto__`. there's a bug in old V8 where the following wouldn't work:
20148 //
20149 // > var obj = Object.create(null);
20150 // undefined
20151 // > obj.__proto__
20152 // null
20153 // > obj.__proto__ = true;
20154 // true
20155 // > obj.__proto__
20156 // null
20157 var key = "_" + expr.name;
20158
20159 if (checkClashes[key]) {
20160 this.raise(expr.start, "Argument name clash in strict mode");
20161 } else {
20162 checkClashes[key] = true;
20163 }
20164 }
20165 break;
20166
20167 case "MemberExpression":
20168 if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression");
20169 break;
20170
20171 case "ObjectPattern":
20172 for (var _iterator2 = expr.properties, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
20173 var _ref2;
20174
20175 if (_isArray2) {
20176 if (_i2 >= _iterator2.length) break;
20177 _ref2 = _iterator2[_i2++];
20178 } else {
20179 _i2 = _iterator2.next();
20180 if (_i2.done) break;
20181 _ref2 = _i2.value;
20182 }
20183
20184 var prop = _ref2;
20185
20186 if (prop.type === "ObjectProperty") prop = prop.value;
20187 this.checkLVal(prop, isBinding, checkClashes, "object destructuring pattern");
20188 }
20189 break;
20190
20191 case "ArrayPattern":
20192 for (var _iterator3 = expr.elements, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
20193 var _ref3;
20194
20195 if (_isArray3) {
20196 if (_i3 >= _iterator3.length) break;
20197 _ref3 = _iterator3[_i3++];
20198 } else {
20199 _i3 = _iterator3.next();
20200 if (_i3.done) break;
20201 _ref3 = _i3.value;
20202 }
20203
20204 var elem = _ref3;
20205
20206 if (elem) this.checkLVal(elem, isBinding, checkClashes, "array destructuring pattern");
20207 }
20208 break;
20209
20210 case "AssignmentPattern":
20211 this.checkLVal(expr.left, isBinding, checkClashes, "assignment pattern");
20212 break;
20213
20214 case "RestProperty":
20215 this.checkLVal(expr.argument, isBinding, checkClashes, "rest property");
20216 break;
20217
20218 case "RestElement":
20219 this.checkLVal(expr.argument, isBinding, checkClashes, "rest element");
20220 break;
20221
20222 default:
20223 {
20224 var message = (isBinding ? /* istanbul ignore next */"Binding invalid" : "Invalid") + " left-hand side" + (contextDescription ? " in " + contextDescription : /* istanbul ignore next */"expression");
20225 this.raise(expr.start, message);
20226 }
20227 }
20228};
20229
20230/* eslint max-len: 0 */
20231
20232// A recursive descent parser operates by defining functions for all
20233// syntactic elements, and recursively calling those, each function
20234// advancing the input stream and returning an AST node. Precedence
20235// of constructs (for example, the fact that `!x[1]` means `!(x[1])`
20236// instead of `(!x)[1]` is handled by the fact that the parser
20237// function that parses unary prefix operators is called first, and
20238// in turn calls the function that parses `[]` subscripts — that
20239// way, it'll receive the node for `x[1]` already parsed, and wraps
20240// *that* in the unary operator node.
20241//
20242// Acorn uses an [operator precedence parser][opp] to handle binary
20243// operator precedence, because it is much more compact than using
20244// the technique outlined above, which uses different, nesting
20245// functions to specify precedence, for all of the ten binary
20246// precedence levels that JavaScript defines.
20247//
20248// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser
20249
20250var pp$3 = Parser.prototype;
20251
20252// Check if property name clashes with already added.
20253// Object/class getters and setters are not allowed to clash —
20254// either with each other or with an init property — and in
20255// strict mode, init properties are also not allowed to be repeated.
20256
20257pp$3.checkPropClash = function (prop, propHash) {
20258 if (prop.computed || prop.kind) return;
20259
20260 var key = prop.key;
20261 // It is either an Identifier or a String/NumericLiteral
20262 var name = key.type === "Identifier" ? key.name : String(key.value);
20263
20264 if (name === "__proto__") {
20265 if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property");
20266 propHash.proto = true;
20267 }
20268};
20269
20270// Convenience method to parse an Expression only
20271pp$3.getExpression = function () {
20272 this.nextToken();
20273 var expr = this.parseExpression();
20274 if (!this.match(types.eof)) {
20275 this.unexpected();
20276 }
20277 return expr;
20278};
20279
20280// ### Expression parsing
20281
20282// These nest, from the most general expression type at the top to
20283// 'atomic', nondivisible expression types at the bottom. Most of
20284// the functions will simply let the function (s) below them parse,
20285// and, *if* the syntactic construct they handle is present, wrap
20286// the AST node that the inner parser gave them in another node.
20287
20288// Parse a full expression. The optional arguments are used to
20289// forbid the `in` operator (in for loops initalization expressions)
20290// and provide reference for storing '=' operator inside shorthand
20291// property assignment in contexts where both object expression
20292// and object pattern might appear (so it's possible to raise
20293// delayed syntax error at correct position).
20294
20295pp$3.parseExpression = function (noIn, refShorthandDefaultPos) {
20296 var startPos = this.state.start;
20297 var startLoc = this.state.startLoc;
20298 var expr = this.parseMaybeAssign(noIn, refShorthandDefaultPos);
20299 if (this.match(types.comma)) {
20300 var node = this.startNodeAt(startPos, startLoc);
20301 node.expressions = [expr];
20302 while (this.eat(types.comma)) {
20303 node.expressions.push(this.parseMaybeAssign(noIn, refShorthandDefaultPos));
20304 }
20305 this.toReferencedList(node.expressions);
20306 return this.finishNode(node, "SequenceExpression");
20307 }
20308 return expr;
20309};
20310
20311// Parse an assignment expression. This includes applications of
20312// operators like `+=`.
20313
20314pp$3.parseMaybeAssign = function (noIn, refShorthandDefaultPos, afterLeftParse, refNeedsArrowPos) {
20315 var startPos = this.state.start;
20316 var startLoc = this.state.startLoc;
20317
20318 if (this.match(types._yield) && this.state.inGenerator) {
20319 var _left = this.parseYield();
20320 if (afterLeftParse) _left = afterLeftParse.call(this, _left, startPos, startLoc);
20321 return _left;
20322 }
20323
20324 var failOnShorthandAssign = void 0;
20325 if (refShorthandDefaultPos) {
20326 failOnShorthandAssign = false;
20327 } else {
20328 refShorthandDefaultPos = { start: 0 };
20329 failOnShorthandAssign = true;
20330 }
20331
20332 if (this.match(types.parenL) || this.match(types.name)) {
20333 this.state.potentialArrowAt = this.state.start;
20334 }
20335
20336 var left = this.parseMaybeConditional(noIn, refShorthandDefaultPos, refNeedsArrowPos);
20337 if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc);
20338 if (this.state.type.isAssign) {
20339 var node = this.startNodeAt(startPos, startLoc);
20340 node.operator = this.state.value;
20341 node.left = this.match(types.eq) ? this.toAssignable(left, undefined, "assignment expression") : left;
20342 refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly
20343
20344 this.checkLVal(left, undefined, undefined, "assignment expression");
20345
20346 if (left.extra && left.extra.parenthesized) {
20347 var errorMsg = void 0;
20348 if (left.type === "ObjectPattern") {
20349 errorMsg = "`({a}) = 0` use `({a} = 0)`";
20350 } else if (left.type === "ArrayPattern") {
20351 errorMsg = "`([a]) = 0` use `([a] = 0)`";
20352 }
20353 if (errorMsg) {
20354 this.raise(left.start, "You're trying to assign to a parenthesized expression, eg. instead of " + errorMsg);
20355 }
20356 }
20357
20358 this.next();
20359 node.right = this.parseMaybeAssign(noIn);
20360 return this.finishNode(node, "AssignmentExpression");
20361 } else if (failOnShorthandAssign && refShorthandDefaultPos.start) {
20362 this.unexpected(refShorthandDefaultPos.start);
20363 }
20364
20365 return left;
20366};
20367
20368// Parse a ternary conditional (`?:`) operator.
20369
20370pp$3.parseMaybeConditional = function (noIn, refShorthandDefaultPos, refNeedsArrowPos) {
20371 var startPos = this.state.start;
20372 var startLoc = this.state.startLoc;
20373 var expr = this.parseExprOps(noIn, refShorthandDefaultPos);
20374 if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr;
20375
20376 return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos);
20377};
20378
20379pp$3.parseConditional = function (expr, noIn, startPos, startLoc) {
20380 if (this.eat(types.question)) {
20381 var node = this.startNodeAt(startPos, startLoc);
20382 node.test = expr;
20383 node.consequent = this.parseMaybeAssign();
20384 this.expect(types.colon);
20385 node.alternate = this.parseMaybeAssign(noIn);
20386 return this.finishNode(node, "ConditionalExpression");
20387 }
20388 return expr;
20389};
20390
20391// Start the precedence parser.
20392
20393pp$3.parseExprOps = function (noIn, refShorthandDefaultPos) {
20394 var startPos = this.state.start;
20395 var startLoc = this.state.startLoc;
20396 var expr = this.parseMaybeUnary(refShorthandDefaultPos);
20397 if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
20398 return expr;
20399 } else {
20400 return this.parseExprOp(expr, startPos, startLoc, -1, noIn);
20401 }
20402};
20403
20404// Parse binary operators with the operator precedence parsing
20405// algorithm. `left` is the left-hand side of the operator.
20406// `minPrec` provides context that allows the function to stop and
20407// defer further parser to one of its callers when it encounters an
20408// operator that has a lower precedence than the set it is parsing.
20409
20410pp$3.parseExprOp = function (left, leftStartPos, leftStartLoc, minPrec, noIn) {
20411 var prec = this.state.type.binop;
20412 if (prec != null && (!noIn || !this.match(types._in))) {
20413 if (prec > minPrec) {
20414 var node = this.startNodeAt(leftStartPos, leftStartLoc);
20415 node.left = left;
20416 node.operator = this.state.value;
20417
20418 if (node.operator === "**" && left.type === "UnaryExpression" && left.extra && !left.extra.parenthesizedArgument && !left.extra.parenthesized) {
20419 this.raise(left.argument.start, "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.");
20420 }
20421
20422 var op = this.state.type;
20423 this.next();
20424
20425 var startPos = this.state.start;
20426 var startLoc = this.state.startLoc;
20427 node.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec, noIn);
20428
20429 this.finishNode(node, op === types.logicalOR || op === types.logicalAND ? "LogicalExpression" : "BinaryExpression");
20430 return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn);
20431 }
20432 }
20433 return left;
20434};
20435
20436// Parse unary operators, both prefix and postfix.
20437
20438pp$3.parseMaybeUnary = function (refShorthandDefaultPos) {
20439 if (this.state.type.prefix) {
20440 var node = this.startNode();
20441 var update = this.match(types.incDec);
20442 node.operator = this.state.value;
20443 node.prefix = true;
20444 this.next();
20445
20446 var argType = this.state.type;
20447 node.argument = this.parseMaybeUnary();
20448
20449 this.addExtra(node, "parenthesizedArgument", argType === types.parenL && (!node.argument.extra || !node.argument.extra.parenthesized));
20450
20451 if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
20452 this.unexpected(refShorthandDefaultPos.start);
20453 }
20454
20455 if (update) {
20456 this.checkLVal(node.argument, undefined, undefined, "prefix operation");
20457 } else if (this.state.strict && node.operator === "delete" && node.argument.type === "Identifier") {
20458 this.raise(node.start, "Deleting local variable in strict mode");
20459 }
20460
20461 return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
20462 }
20463
20464 var startPos = this.state.start;
20465 var startLoc = this.state.startLoc;
20466 var expr = this.parseExprSubscripts(refShorthandDefaultPos);
20467 if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr;
20468 while (this.state.type.postfix && !this.canInsertSemicolon()) {
20469 var _node = this.startNodeAt(startPos, startLoc);
20470 _node.operator = this.state.value;
20471 _node.prefix = false;
20472 _node.argument = expr;
20473 this.checkLVal(expr, undefined, undefined, "postfix operation");
20474 this.next();
20475 expr = this.finishNode(_node, "UpdateExpression");
20476 }
20477 return expr;
20478};
20479
20480// Parse call, dot, and `[]`-subscript expressions.
20481
20482pp$3.parseExprSubscripts = function (refShorthandDefaultPos) {
20483 var startPos = this.state.start;
20484 var startLoc = this.state.startLoc;
20485 var potentialArrowAt = this.state.potentialArrowAt;
20486 var expr = this.parseExprAtom(refShorthandDefaultPos);
20487
20488 if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
20489 return expr;
20490 }
20491
20492 if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
20493 return expr;
20494 }
20495
20496 return this.parseSubscripts(expr, startPos, startLoc);
20497};
20498
20499pp$3.parseSubscripts = function (base, startPos, startLoc, noCalls) {
20500 for (;;) {
20501 if (!noCalls && this.eat(types.doubleColon)) {
20502 var node = this.startNodeAt(startPos, startLoc);
20503 node.object = base;
20504 node.callee = this.parseNoCallExpr();
20505 return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls);
20506 } else if (this.eat(types.dot)) {
20507 var _node2 = this.startNodeAt(startPos, startLoc);
20508 _node2.object = base;
20509 _node2.property = this.parseIdentifier(true);
20510 _node2.computed = false;
20511 base = this.finishNode(_node2, "MemberExpression");
20512 } else if (this.eat(types.bracketL)) {
20513 var _node3 = this.startNodeAt(startPos, startLoc);
20514 _node3.object = base;
20515 _node3.property = this.parseExpression();
20516 _node3.computed = true;
20517 this.expect(types.bracketR);
20518 base = this.finishNode(_node3, "MemberExpression");
20519 } else if (!noCalls && this.match(types.parenL)) {
20520 var possibleAsync = this.state.potentialArrowAt === base.start && base.type === "Identifier" && base.name === "async" && !this.canInsertSemicolon();
20521 this.next();
20522
20523 var _node4 = this.startNodeAt(startPos, startLoc);
20524 _node4.callee = base;
20525 _node4.arguments = this.parseCallExpressionArguments(types.parenR, possibleAsync);
20526 if (_node4.callee.type === "Import" && _node4.arguments.length !== 1) {
20527 this.raise(_node4.start, "import() requires exactly one argument");
20528 }
20529 base = this.finishNode(_node4, "CallExpression");
20530
20531 if (possibleAsync && this.shouldParseAsyncArrow()) {
20532 return this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), _node4);
20533 } else {
20534 this.toReferencedList(_node4.arguments);
20535 }
20536 } else if (this.match(types.backQuote)) {
20537 var _node5 = this.startNodeAt(startPos, startLoc);
20538 _node5.tag = base;
20539 _node5.quasi = this.parseTemplate();
20540 base = this.finishNode(_node5, "TaggedTemplateExpression");
20541 } else {
20542 return base;
20543 }
20544 }
20545};
20546
20547pp$3.parseCallExpressionArguments = function (close, possibleAsyncArrow) {
20548 var elts = [];
20549 var innerParenStart = void 0;
20550 var first = true;
20551
20552 while (!this.eat(close)) {
20553 if (first) {
20554 first = false;
20555 } else {
20556 this.expect(types.comma);
20557 if (this.eat(close)) break;
20558 }
20559
20560 // we need to make sure that if this is an async arrow functions, that we don't allow inner parens inside the params
20561 if (this.match(types.parenL) && !innerParenStart) {
20562 innerParenStart = this.state.start;
20563 }
20564
20565 elts.push(this.parseExprListItem(false, possibleAsyncArrow ? { start: 0 } : undefined, possibleAsyncArrow ? { start: 0 } : undefined));
20566 }
20567
20568 // we found an async arrow function so let's not allow any inner parens
20569 if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) {
20570 this.unexpected();
20571 }
20572
20573 return elts;
20574};
20575
20576pp$3.shouldParseAsyncArrow = function () {
20577 return this.match(types.arrow);
20578};
20579
20580pp$3.parseAsyncArrowFromCallExpression = function (node, call) {
20581 this.expect(types.arrow);
20582 return this.parseArrowExpression(node, call.arguments, true);
20583};
20584
20585// Parse a no-call expression (like argument of `new` or `::` operators).
20586
20587pp$3.parseNoCallExpr = function () {
20588 var startPos = this.state.start;
20589 var startLoc = this.state.startLoc;
20590 return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
20591};
20592
20593// Parse an atomic expression — either a single token that is an
20594// expression, an expression started by a keyword like `function` or
20595// `new`, or an expression wrapped in punctuation like `()`, `[]`,
20596// or `{}`.
20597
20598pp$3.parseExprAtom = function (refShorthandDefaultPos) {
20599 var canBeArrow = this.state.potentialArrowAt === this.state.start;
20600 var node = void 0;
20601
20602 switch (this.state.type) {
20603 case types._super:
20604 if (!this.state.inMethod && !this.options.allowSuperOutsideMethod) {
20605 this.raise(this.state.start, "'super' outside of function or class");
20606 }
20607
20608 node = this.startNode();
20609 this.next();
20610 if (!this.match(types.parenL) && !this.match(types.bracketL) && !this.match(types.dot)) {
20611 this.unexpected();
20612 }
20613 if (this.match(types.parenL) && this.state.inMethod !== "constructor" && !this.options.allowSuperOutsideMethod) {
20614 this.raise(node.start, "super() outside of class constructor");
20615 }
20616 return this.finishNode(node, "Super");
20617
20618 case types._import:
20619 if (!this.hasPlugin("dynamicImport")) this.unexpected();
20620
20621 node = this.startNode();
20622 this.next();
20623 if (!this.match(types.parenL)) {
20624 this.unexpected(null, types.parenL);
20625 }
20626 return this.finishNode(node, "Import");
20627
20628 case types._this:
20629 node = this.startNode();
20630 this.next();
20631 return this.finishNode(node, "ThisExpression");
20632
20633 case types._yield:
20634 if (this.state.inGenerator) this.unexpected();
20635
20636 case types.name:
20637 node = this.startNode();
20638 var allowAwait = this.state.value === "await" && this.state.inAsync;
20639 var allowYield = this.shouldAllowYieldIdentifier();
20640 var id = this.parseIdentifier(allowAwait || allowYield);
20641
20642 if (id.name === "await") {
20643 if (this.state.inAsync || this.inModule) {
20644 return this.parseAwait(node);
20645 }
20646 } else if (id.name === "async" && this.match(types._function) && !this.canInsertSemicolon()) {
20647 this.next();
20648 return this.parseFunction(node, false, false, true);
20649 } else if (canBeArrow && id.name === "async" && this.match(types.name)) {
20650 var params = [this.parseIdentifier()];
20651 this.expect(types.arrow);
20652 // let foo = bar => {};
20653 return this.parseArrowExpression(node, params, true);
20654 }
20655
20656 if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) {
20657 return this.parseArrowExpression(node, [id]);
20658 }
20659
20660 return id;
20661
20662 case types._do:
20663 if (this.hasPlugin("doExpressions")) {
20664 var _node6 = this.startNode();
20665 this.next();
20666 var oldInFunction = this.state.inFunction;
20667 var oldLabels = this.state.labels;
20668 this.state.labels = [];
20669 this.state.inFunction = false;
20670 _node6.body = this.parseBlock(false, true);
20671 this.state.inFunction = oldInFunction;
20672 this.state.labels = oldLabels;
20673 return this.finishNode(_node6, "DoExpression");
20674 }
20675
20676 case types.regexp:
20677 var value = this.state.value;
20678 node = this.parseLiteral(value.value, "RegExpLiteral");
20679 node.pattern = value.pattern;
20680 node.flags = value.flags;
20681 return node;
20682
20683 case types.num:
20684 return this.parseLiteral(this.state.value, "NumericLiteral");
20685
20686 case types.string:
20687 return this.parseLiteral(this.state.value, "StringLiteral");
20688
20689 case types._null:
20690 node = this.startNode();
20691 this.next();
20692 return this.finishNode(node, "NullLiteral");
20693
20694 case types._true:case types._false:
20695 node = this.startNode();
20696 node.value = this.match(types._true);
20697 this.next();
20698 return this.finishNode(node, "BooleanLiteral");
20699
20700 case types.parenL:
20701 return this.parseParenAndDistinguishExpression(null, null, canBeArrow);
20702
20703 case types.bracketL:
20704 node = this.startNode();
20705 this.next();
20706 node.elements = this.parseExprList(types.bracketR, true, refShorthandDefaultPos);
20707 this.toReferencedList(node.elements);
20708 return this.finishNode(node, "ArrayExpression");
20709
20710 case types.braceL:
20711 return this.parseObj(false, refShorthandDefaultPos);
20712
20713 case types._function:
20714 return this.parseFunctionExpression();
20715
20716 case types.at:
20717 this.parseDecorators();
20718
20719 case types._class:
20720 node = this.startNode();
20721 this.takeDecorators(node);
20722 return this.parseClass(node, false);
20723
20724 case types._new:
20725 return this.parseNew();
20726
20727 case types.backQuote:
20728 return this.parseTemplate();
20729
20730 case types.doubleColon:
20731 node = this.startNode();
20732 this.next();
20733 node.object = null;
20734 var callee = node.callee = this.parseNoCallExpr();
20735 if (callee.type === "MemberExpression") {
20736 return this.finishNode(node, "BindExpression");
20737 } else {
20738 this.raise(callee.start, "Binding should be performed on object property.");
20739 }
20740
20741 default:
20742 this.unexpected();
20743 }
20744};
20745
20746pp$3.parseFunctionExpression = function () {
20747 var node = this.startNode();
20748 var meta = this.parseIdentifier(true);
20749 if (this.state.inGenerator && this.eat(types.dot) && this.hasPlugin("functionSent")) {
20750 return this.parseMetaProperty(node, meta, "sent");
20751 } else {
20752 return this.parseFunction(node, false);
20753 }
20754};
20755
20756pp$3.parseMetaProperty = function (node, meta, propertyName) {
20757 node.meta = meta;
20758 node.property = this.parseIdentifier(true);
20759
20760 if (node.property.name !== propertyName) {
20761 this.raise(node.property.start, "The only valid meta property for new is " + meta.name + "." + propertyName);
20762 }
20763
20764 return this.finishNode(node, "MetaProperty");
20765};
20766
20767pp$3.parseLiteral = function (value, type, startPos, startLoc) {
20768 startPos = startPos || this.state.start;
20769 startLoc = startLoc || this.state.startLoc;
20770
20771 var node = this.startNodeAt(startPos, startLoc);
20772 this.addExtra(node, "rawValue", value);
20773 this.addExtra(node, "raw", this.input.slice(startPos, this.state.end));
20774 node.value = value;
20775 this.next();
20776 return this.finishNode(node, type);
20777};
20778
20779pp$3.parseParenExpression = function () {
20780 this.expect(types.parenL);
20781 var val = this.parseExpression();
20782 this.expect(types.parenR);
20783 return val;
20784};
20785
20786pp$3.parseParenAndDistinguishExpression = function (startPos, startLoc, canBeArrow) {
20787 startPos = startPos || this.state.start;
20788 startLoc = startLoc || this.state.startLoc;
20789
20790 var val = void 0;
20791 this.expect(types.parenL);
20792
20793 var innerStartPos = this.state.start;
20794 var innerStartLoc = this.state.startLoc;
20795 var exprList = [];
20796 var refShorthandDefaultPos = { start: 0 };
20797 var refNeedsArrowPos = { start: 0 };
20798 var first = true;
20799 var spreadStart = void 0;
20800 var optionalCommaStart = void 0;
20801
20802 while (!this.match(types.parenR)) {
20803 if (first) {
20804 first = false;
20805 } else {
20806 this.expect(types.comma, refNeedsArrowPos.start || null);
20807 if (this.match(types.parenR)) {
20808 optionalCommaStart = this.state.start;
20809 break;
20810 }
20811 }
20812
20813 if (this.match(types.ellipsis)) {
20814 var spreadNodeStartPos = this.state.start;
20815 var spreadNodeStartLoc = this.state.startLoc;
20816 spreadStart = this.state.start;
20817 exprList.push(this.parseParenItem(this.parseRest(), spreadNodeStartLoc, spreadNodeStartPos));
20818 break;
20819 } else {
20820 exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos));
20821 }
20822 }
20823
20824 var innerEndPos = this.state.start;
20825 var innerEndLoc = this.state.startLoc;
20826 this.expect(types.parenR);
20827
20828 var arrowNode = this.startNodeAt(startPos, startLoc);
20829 if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) {
20830 for (var _iterator = exprList, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
20831 var _ref;
20832
20833 if (_isArray) {
20834 if (_i >= _iterator.length) break;
20835 _ref = _iterator[_i++];
20836 } else {
20837 _i = _iterator.next();
20838 if (_i.done) break;
20839 _ref = _i.value;
20840 }
20841
20842 var param = _ref;
20843
20844 if (param.extra && param.extra.parenthesized) this.unexpected(param.extra.parenStart);
20845 }
20846
20847 return this.parseArrowExpression(arrowNode, exprList);
20848 }
20849
20850 if (!exprList.length) {
20851 this.unexpected(this.state.lastTokStart);
20852 }
20853 if (optionalCommaStart) this.unexpected(optionalCommaStart);
20854 if (spreadStart) this.unexpected(spreadStart);
20855 if (refShorthandDefaultPos.start) this.unexpected(refShorthandDefaultPos.start);
20856 if (refNeedsArrowPos.start) this.unexpected(refNeedsArrowPos.start);
20857
20858 if (exprList.length > 1) {
20859 val = this.startNodeAt(innerStartPos, innerStartLoc);
20860 val.expressions = exprList;
20861 this.toReferencedList(val.expressions);
20862 this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
20863 } else {
20864 val = exprList[0];
20865 }
20866
20867 this.addExtra(val, "parenthesized", true);
20868 this.addExtra(val, "parenStart", startPos);
20869
20870 return val;
20871};
20872
20873pp$3.shouldParseArrow = function () {
20874 return !this.canInsertSemicolon();
20875};
20876
20877pp$3.parseArrow = function (node) {
20878 if (this.eat(types.arrow)) {
20879 return node;
20880 }
20881};
20882
20883pp$3.parseParenItem = function (node) {
20884 return node;
20885};
20886
20887// New's precedence is slightly tricky. It must allow its argument
20888// to be a `[]` or dot subscript expression, but not a call — at
20889// least, not without wrapping it in parentheses. Thus, it uses the
20890
20891pp$3.parseNew = function () {
20892 var node = this.startNode();
20893 var meta = this.parseIdentifier(true);
20894
20895 if (this.eat(types.dot)) {
20896 return this.parseMetaProperty(node, meta, "target");
20897 }
20898
20899 node.callee = this.parseNoCallExpr();
20900
20901 if (this.eat(types.parenL)) {
20902 node.arguments = this.parseExprList(types.parenR);
20903 this.toReferencedList(node.arguments);
20904 } else {
20905 node.arguments = [];
20906 }
20907
20908 return this.finishNode(node, "NewExpression");
20909};
20910
20911// Parse template expression.
20912
20913pp$3.parseTemplateElement = function () {
20914 var elem = this.startNode();
20915 elem.value = {
20916 raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"),
20917 cooked: this.state.value
20918 };
20919 this.next();
20920 elem.tail = this.match(types.backQuote);
20921 return this.finishNode(elem, "TemplateElement");
20922};
20923
20924pp$3.parseTemplate = function () {
20925 var node = this.startNode();
20926 this.next();
20927 node.expressions = [];
20928 var curElt = this.parseTemplateElement();
20929 node.quasis = [curElt];
20930 while (!curElt.tail) {
20931 this.expect(types.dollarBraceL);
20932 node.expressions.push(this.parseExpression());
20933 this.expect(types.braceR);
20934 node.quasis.push(curElt = this.parseTemplateElement());
20935 }
20936 this.next();
20937 return this.finishNode(node, "TemplateLiteral");
20938};
20939
20940// Parse an object literal or binding pattern.
20941
20942pp$3.parseObj = function (isPattern, refShorthandDefaultPos) {
20943 var decorators = [];
20944 var propHash = Object.create(null);
20945 var first = true;
20946 var node = this.startNode();
20947
20948 node.properties = [];
20949 this.next();
20950
20951 var firstRestLocation = null;
20952
20953 while (!this.eat(types.braceR)) {
20954 if (first) {
20955 first = false;
20956 } else {
20957 this.expect(types.comma);
20958 if (this.eat(types.braceR)) break;
20959 }
20960
20961 while (this.match(types.at)) {
20962 decorators.push(this.parseDecorator());
20963 }
20964
20965 var prop = this.startNode(),
20966 isGenerator = false,
20967 isAsync = false,
20968 startPos = void 0,
20969 startLoc = void 0;
20970 if (decorators.length) {
20971 prop.decorators = decorators;
20972 decorators = [];
20973 }
20974
20975 if (this.hasPlugin("objectRestSpread") && this.match(types.ellipsis)) {
20976 prop = this.parseSpread(isPattern ? { start: 0 } : undefined);
20977 prop.type = isPattern ? "RestProperty" : "SpreadProperty";
20978 if (isPattern) this.toAssignable(prop.argument, true, "object pattern");
20979 node.properties.push(prop);
20980 if (isPattern) {
20981 var position = this.state.start;
20982 if (firstRestLocation !== null) {
20983 this.unexpected(firstRestLocation, "Cannot have multiple rest elements when destructuring");
20984 } else if (this.eat(types.braceR)) {
20985 break;
20986 } else if (this.match(types.comma) && this.lookahead().type === types.braceR) {
20987 // TODO: temporary rollback
20988 // this.unexpected(position, "A trailing comma is not permitted after the rest element");
20989 continue;
20990 } else {
20991 firstRestLocation = position;
20992 continue;
20993 }
20994 } else {
20995 continue;
20996 }
20997 }
20998
20999 prop.method = false;
21000 prop.shorthand = false;
21001
21002 if (isPattern || refShorthandDefaultPos) {
21003 startPos = this.state.start;
21004 startLoc = this.state.startLoc;
21005 }
21006
21007 if (!isPattern) {
21008 isGenerator = this.eat(types.star);
21009 }
21010
21011 if (!isPattern && this.isContextual("async")) {
21012 if (isGenerator) this.unexpected();
21013
21014 var asyncId = this.parseIdentifier();
21015 if (this.match(types.colon) || this.match(types.parenL) || this.match(types.braceR) || this.match(types.eq) || this.match(types.comma)) {
21016 prop.key = asyncId;
21017 prop.computed = false;
21018 } else {
21019 isAsync = true;
21020 if (this.hasPlugin("asyncGenerators")) isGenerator = this.eat(types.star);
21021 this.parsePropertyName(prop);
21022 }
21023 } else {
21024 this.parsePropertyName(prop);
21025 }
21026
21027 this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos);
21028 this.checkPropClash(prop, propHash);
21029
21030 if (prop.shorthand) {
21031 this.addExtra(prop, "shorthand", true);
21032 }
21033
21034 node.properties.push(prop);
21035 }
21036
21037 if (firstRestLocation !== null) {
21038 this.unexpected(firstRestLocation, "The rest element has to be the last element when destructuring");
21039 }
21040
21041 if (decorators.length) {
21042 this.raise(this.state.start, "You have trailing decorators with no property");
21043 }
21044
21045 return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression");
21046};
21047
21048pp$3.isGetterOrSetterMethod = function (prop, isPattern) {
21049 return !isPattern && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.match(types.string) || // get "string"() {}
21050 this.match(types.num) || // get 1() {}
21051 this.match(types.bracketL) || // get ["string"]() {}
21052 this.match(types.name) || // get foo() {}
21053 this.state.type.keyword // get debugger() {}
21054 );
21055};
21056
21057// get methods aren't allowed to have any parameters
21058// set methods must have exactly 1 parameter
21059pp$3.checkGetterSetterParamCount = function (method) {
21060 var paramCount = method.kind === "get" ? 0 : 1;
21061 if (method.params.length !== paramCount) {
21062 var start = method.start;
21063 if (method.kind === "get") {
21064 this.raise(start, "getter should have no params");
21065 } else {
21066 this.raise(start, "setter should have exactly one param");
21067 }
21068 }
21069};
21070
21071pp$3.parseObjectMethod = function (prop, isGenerator, isAsync, isPattern) {
21072 if (isAsync || isGenerator || this.match(types.parenL)) {
21073 if (isPattern) this.unexpected();
21074 prop.kind = "method";
21075 prop.method = true;
21076 this.parseMethod(prop, isGenerator, isAsync);
21077
21078 return this.finishNode(prop, "ObjectMethod");
21079 }
21080
21081 if (this.isGetterOrSetterMethod(prop, isPattern)) {
21082 if (isGenerator || isAsync) this.unexpected();
21083 prop.kind = prop.key.name;
21084 this.parsePropertyName(prop);
21085 this.parseMethod(prop);
21086 this.checkGetterSetterParamCount(prop);
21087
21088 return this.finishNode(prop, "ObjectMethod");
21089 }
21090};
21091
21092pp$3.parseObjectProperty = function (prop, startPos, startLoc, isPattern, refShorthandDefaultPos) {
21093 if (this.eat(types.colon)) {
21094 prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos);
21095
21096 return this.finishNode(prop, "ObjectProperty");
21097 }
21098
21099 if (!prop.computed && prop.key.type === "Identifier") {
21100 if (isPattern) {
21101 this.checkReservedWord(prop.key.name, prop.key.start, true, true);
21102 prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
21103 } else if (this.match(types.eq) && refShorthandDefaultPos) {
21104 if (!refShorthandDefaultPos.start) {
21105 refShorthandDefaultPos.start = this.state.start;
21106 }
21107 prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
21108 } else {
21109 prop.value = prop.key.__clone();
21110 }
21111 prop.shorthand = true;
21112
21113 return this.finishNode(prop, "ObjectProperty");
21114 }
21115};
21116
21117pp$3.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos) {
21118 var node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refShorthandDefaultPos);
21119
21120 if (!node) this.unexpected();
21121
21122 return node;
21123};
21124
21125pp$3.parsePropertyName = function (prop) {
21126 if (this.eat(types.bracketL)) {
21127 prop.computed = true;
21128 prop.key = this.parseMaybeAssign();
21129 this.expect(types.bracketR);
21130 } else {
21131 prop.computed = false;
21132 var oldInPropertyName = this.state.inPropertyName;
21133 this.state.inPropertyName = true;
21134 prop.key = this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true);
21135 this.state.inPropertyName = oldInPropertyName;
21136 }
21137 return prop.key;
21138};
21139
21140// Initialize empty function node.
21141
21142pp$3.initFunction = function (node, isAsync) {
21143 node.id = null;
21144 node.generator = false;
21145 node.expression = false;
21146 node.async = !!isAsync;
21147};
21148
21149// Parse object or class method.
21150
21151pp$3.parseMethod = function (node, isGenerator, isAsync) {
21152 var oldInMethod = this.state.inMethod;
21153 this.state.inMethod = node.kind || true;
21154 this.initFunction(node, isAsync);
21155 this.expect(types.parenL);
21156 node.params = this.parseBindingList(types.parenR);
21157 node.generator = !!isGenerator;
21158 this.parseFunctionBody(node);
21159 this.state.inMethod = oldInMethod;
21160 return node;
21161};
21162
21163// Parse arrow function expression with given parameters.
21164
21165pp$3.parseArrowExpression = function (node, params, isAsync) {
21166 this.initFunction(node, isAsync);
21167 node.params = this.toAssignableList(params, true, "arrow function parameters");
21168 this.parseFunctionBody(node, true);
21169 return this.finishNode(node, "ArrowFunctionExpression");
21170};
21171
21172pp$3.isStrictBody = function (node, isExpression) {
21173 if (!isExpression && node.body.directives.length) {
21174 for (var _iterator2 = node.body.directives, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
21175 var _ref2;
21176
21177 if (_isArray2) {
21178 if (_i2 >= _iterator2.length) break;
21179 _ref2 = _iterator2[_i2++];
21180 } else {
21181 _i2 = _iterator2.next();
21182 if (_i2.done) break;
21183 _ref2 = _i2.value;
21184 }
21185
21186 var directive = _ref2;
21187
21188 if (directive.value.value === "use strict") {
21189 return true;
21190 }
21191 }
21192 }
21193
21194 return false;
21195};
21196
21197// Parse function body and check parameters.
21198pp$3.parseFunctionBody = function (node, allowExpression) {
21199 var isExpression = allowExpression && !this.match(types.braceL);
21200
21201 var oldInAsync = this.state.inAsync;
21202 this.state.inAsync = node.async;
21203 if (isExpression) {
21204 node.body = this.parseMaybeAssign();
21205 node.expression = true;
21206 } else {
21207 // Start a new scope with regard to labels and the `inFunction`
21208 // flag (restore them to their old value afterwards).
21209 var oldInFunc = this.state.inFunction;
21210 var oldInGen = this.state.inGenerator;
21211 var oldLabels = this.state.labels;
21212 this.state.inFunction = true;this.state.inGenerator = node.generator;this.state.labels = [];
21213 node.body = this.parseBlock(true);
21214 node.expression = false;
21215 this.state.inFunction = oldInFunc;this.state.inGenerator = oldInGen;this.state.labels = oldLabels;
21216 }
21217 this.state.inAsync = oldInAsync;
21218
21219 // If this is a strict mode function, verify that argument names
21220 // are not repeated, and it does not try to bind the words `eval`
21221 // or `arguments`.
21222 var isStrict = this.isStrictBody(node, isExpression);
21223 // Also check when allowExpression === true for arrow functions
21224 var checkLVal = this.state.strict || allowExpression || isStrict;
21225
21226 if (isStrict && node.id && node.id.type === "Identifier" && node.id.name === "yield") {
21227 this.raise(node.id.start, "Binding yield in strict mode");
21228 }
21229
21230 if (checkLVal) {
21231 var nameHash = Object.create(null);
21232 var oldStrict = this.state.strict;
21233 if (isStrict) this.state.strict = true;
21234 if (node.id) {
21235 this.checkLVal(node.id, true, undefined, "function name");
21236 }
21237 for (var _iterator3 = node.params, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
21238 var _ref3;
21239
21240 if (_isArray3) {
21241 if (_i3 >= _iterator3.length) break;
21242 _ref3 = _iterator3[_i3++];
21243 } else {
21244 _i3 = _iterator3.next();
21245 if (_i3.done) break;
21246 _ref3 = _i3.value;
21247 }
21248
21249 var param = _ref3;
21250
21251 if (isStrict && param.type !== "Identifier") {
21252 this.raise(param.start, "Non-simple parameter in strict mode");
21253 }
21254 this.checkLVal(param, true, nameHash, "function parameter list");
21255 }
21256 this.state.strict = oldStrict;
21257 }
21258};
21259
21260// Parses a comma-separated list of expressions, and returns them as
21261// an array. `close` is the token type that ends the list, and
21262// `allowEmpty` can be turned on to allow subsequent commas with
21263// nothing in between them to be parsed as `null` (which is needed
21264// for array literals).
21265
21266pp$3.parseExprList = function (close, allowEmpty, refShorthandDefaultPos) {
21267 var elts = [];
21268 var first = true;
21269
21270 while (!this.eat(close)) {
21271 if (first) {
21272 first = false;
21273 } else {
21274 this.expect(types.comma);
21275 if (this.eat(close)) break;
21276 }
21277
21278 elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos));
21279 }
21280 return elts;
21281};
21282
21283pp$3.parseExprListItem = function (allowEmpty, refShorthandDefaultPos, refNeedsArrowPos) {
21284 var elt = void 0;
21285 if (allowEmpty && this.match(types.comma)) {
21286 elt = null;
21287 } else if (this.match(types.ellipsis)) {
21288 elt = this.parseSpread(refShorthandDefaultPos);
21289 } else {
21290 elt = this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos);
21291 }
21292 return elt;
21293};
21294
21295// Parse the next token as an identifier. If `liberal` is true (used
21296// when parsing properties), it will also convert keywords into
21297// identifiers.
21298
21299pp$3.parseIdentifier = function (liberal) {
21300 var node = this.startNode();
21301 if (!liberal) {
21302 this.checkReservedWord(this.state.value, this.state.start, !!this.state.type.keyword, false);
21303 }
21304
21305 if (this.match(types.name)) {
21306 node.name = this.state.value;
21307 } else if (this.state.type.keyword) {
21308 node.name = this.state.type.keyword;
21309 } else {
21310 this.unexpected();
21311 }
21312
21313 if (!liberal && node.name === "await" && this.state.inAsync) {
21314 this.raise(node.start, "invalid use of await inside of an async function");
21315 }
21316
21317 node.loc.identifierName = node.name;
21318
21319 this.next();
21320 return this.finishNode(node, "Identifier");
21321};
21322
21323pp$3.checkReservedWord = function (word, startLoc, checkKeywords, isBinding) {
21324 if (this.isReservedWord(word) || checkKeywords && this.isKeyword(word)) {
21325 this.raise(startLoc, word + " is a reserved word");
21326 }
21327
21328 if (this.state.strict && (reservedWords.strict(word) || isBinding && reservedWords.strictBind(word))) {
21329 this.raise(startLoc, word + " is a reserved word in strict mode");
21330 }
21331};
21332
21333// Parses await expression inside async function.
21334
21335pp$3.parseAwait = function (node) {
21336 // istanbul ignore next: this condition is checked at the call site so won't be hit here
21337 if (!this.state.inAsync) {
21338 this.unexpected();
21339 }
21340 if (this.match(types.star)) {
21341 this.raise(node.start, "await* has been removed from the async functions proposal. Use Promise.all() instead.");
21342 }
21343 node.argument = this.parseMaybeUnary();
21344 return this.finishNode(node, "AwaitExpression");
21345};
21346
21347// Parses yield expression inside generator.
21348
21349pp$3.parseYield = function () {
21350 var node = this.startNode();
21351 this.next();
21352 if (this.match(types.semi) || this.canInsertSemicolon() || !this.match(types.star) && !this.state.type.startsExpr) {
21353 node.delegate = false;
21354 node.argument = null;
21355 } else {
21356 node.delegate = this.eat(types.star);
21357 node.argument = this.parseMaybeAssign();
21358 }
21359 return this.finishNode(node, "YieldExpression");
21360};
21361
21362// Start an AST node, attaching a start offset.
21363
21364var pp$4 = Parser.prototype;
21365var commentKeys = ["leadingComments", "trailingComments", "innerComments"];
21366
21367var Node = function () {
21368 function Node(pos, loc, filename) {
21369 classCallCheck(this, Node);
21370
21371 this.type = "";
21372 this.start = pos;
21373 this.end = 0;
21374 this.loc = new SourceLocation(loc);
21375 if (filename) this.loc.filename = filename;
21376 }
21377
21378 Node.prototype.__clone = function __clone() {
21379 var node2 = new Node();
21380 for (var key in this) {
21381 // Do not clone comments that are already attached to the node
21382 if (commentKeys.indexOf(key) < 0) {
21383 node2[key] = this[key];
21384 }
21385 }
21386
21387 return node2;
21388 };
21389
21390 return Node;
21391}();
21392
21393pp$4.startNode = function () {
21394 return new Node(this.state.start, this.state.startLoc, this.filename);
21395};
21396
21397pp$4.startNodeAt = function (pos, loc) {
21398 return new Node(pos, loc, this.filename);
21399};
21400
21401function finishNodeAt(node, type, pos, loc) {
21402 node.type = type;
21403 node.end = pos;
21404 node.loc.end = loc;
21405 this.processComment(node);
21406 return node;
21407}
21408
21409// Finish an AST node, adding `type` and `end` properties.
21410
21411pp$4.finishNode = function (node, type) {
21412 return finishNodeAt.call(this, node, type, this.state.lastTokEnd, this.state.lastTokEndLoc);
21413};
21414
21415// Finish node at given position
21416
21417pp$4.finishNodeAt = function (node, type, pos, loc) {
21418 return finishNodeAt.call(this, node, type, pos, loc);
21419};
21420
21421var pp$5 = Parser.prototype;
21422
21423// This function is used to raise exceptions on parse errors. It
21424// takes an offset integer (into the current `input`) to indicate
21425// the location of the error, attaches the position to the end
21426// of the error message, and then raises a `SyntaxError` with that
21427// message.
21428
21429pp$5.raise = function (pos, message) {
21430 var loc = getLineInfo(this.input, pos);
21431 message += " (" + loc.line + ":" + loc.column + ")";
21432 var err = new SyntaxError(message);
21433 err.pos = pos;
21434 err.loc = loc;
21435 throw err;
21436};
21437
21438/* eslint max-len: 0 */
21439
21440/**
21441 * Based on the comment attachment algorithm used in espree and estraverse.
21442 *
21443 * Redistribution and use in source and binary forms, with or without
21444 * modification, are permitted provided that the following conditions are met:
21445 *
21446 * * Redistributions of source code must retain the above copyright
21447 * notice, this list of conditions and the following disclaimer.
21448 * * Redistributions in binary form must reproduce the above copyright
21449 * notice, this list of conditions and the following disclaimer in the
21450 * documentation and/or other materials provided with the distribution.
21451 *
21452 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21453 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21454 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21455 * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
21456 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21457 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21458 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21459 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21460 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21461 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21462 */
21463
21464function last(stack) {
21465 return stack[stack.length - 1];
21466}
21467
21468var pp$6 = Parser.prototype;
21469
21470pp$6.addComment = function (comment) {
21471 if (this.filename) comment.loc.filename = this.filename;
21472 this.state.trailingComments.push(comment);
21473 this.state.leadingComments.push(comment);
21474};
21475
21476pp$6.processComment = function (node) {
21477 if (node.type === "Program" && node.body.length > 0) return;
21478
21479 var stack = this.state.commentStack;
21480
21481 var lastChild = void 0,
21482 trailingComments = void 0,
21483 i = void 0,
21484 j = void 0;
21485
21486 if (this.state.trailingComments.length > 0) {
21487 // If the first comment in trailingComments comes after the
21488 // current node, then we're good - all comments in the array will
21489 // come after the node and so it's safe to add them as official
21490 // trailingComments.
21491 if (this.state.trailingComments[0].start >= node.end) {
21492 trailingComments = this.state.trailingComments;
21493 this.state.trailingComments = [];
21494 } else {
21495 // Otherwise, if the first comment doesn't come after the
21496 // current node, that means we have a mix of leading and trailing
21497 // comments in the array and that leadingComments contains the
21498 // same items as trailingComments. Reset trailingComments to
21499 // zero items and we'll handle this by evaluating leadingComments
21500 // later.
21501 this.state.trailingComments.length = 0;
21502 }
21503 } else {
21504 var lastInStack = last(stack);
21505 if (stack.length > 0 && lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) {
21506 trailingComments = lastInStack.trailingComments;
21507 lastInStack.trailingComments = null;
21508 }
21509 }
21510
21511 // Eating the stack.
21512 while (stack.length > 0 && last(stack).start >= node.start) {
21513 lastChild = stack.pop();
21514 }
21515
21516 if (lastChild) {
21517 if (lastChild.leadingComments) {
21518 if (lastChild !== node && last(lastChild.leadingComments).end <= node.start) {
21519 node.leadingComments = lastChild.leadingComments;
21520 lastChild.leadingComments = null;
21521 } else {
21522 // A leading comment for an anonymous class had been stolen by its first ClassMethod,
21523 // so this takes back the leading comment.
21524 // See also: https://github.com/eslint/espree/issues/158
21525 for (i = lastChild.leadingComments.length - 2; i >= 0; --i) {
21526 if (lastChild.leadingComments[i].end <= node.start) {
21527 node.leadingComments = lastChild.leadingComments.splice(0, i + 1);
21528 break;
21529 }
21530 }
21531 }
21532 }
21533 } else if (this.state.leadingComments.length > 0) {
21534 if (last(this.state.leadingComments).end <= node.start) {
21535 if (this.state.commentPreviousNode) {
21536 for (j = 0; j < this.state.leadingComments.length; j++) {
21537 if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
21538 this.state.leadingComments.splice(j, 1);
21539 j--;
21540 }
21541 }
21542 }
21543 if (this.state.leadingComments.length > 0) {
21544 node.leadingComments = this.state.leadingComments;
21545 this.state.leadingComments = [];
21546 }
21547 } else {
21548 // https://github.com/eslint/espree/issues/2
21549 //
21550 // In special cases, such as return (without a value) and
21551 // debugger, all comments will end up as leadingComments and
21552 // will otherwise be eliminated. This step runs when the
21553 // commentStack is empty and there are comments left
21554 // in leadingComments.
21555 //
21556 // This loop figures out the stopping point between the actual
21557 // leading and trailing comments by finding the location of the
21558 // first comment that comes after the given node.
21559 for (i = 0; i < this.state.leadingComments.length; i++) {
21560 if (this.state.leadingComments[i].end > node.start) {
21561 break;
21562 }
21563 }
21564
21565 // Split the array based on the location of the first comment
21566 // that comes after the node. Keep in mind that this could
21567 // result in an empty array, and if so, the array must be
21568 // deleted.
21569 node.leadingComments = this.state.leadingComments.slice(0, i);
21570 if (node.leadingComments.length === 0) {
21571 node.leadingComments = null;
21572 }
21573
21574 // Similarly, trailing comments are attached later. The variable
21575 // must be reset to null if there are no trailing comments.
21576 trailingComments = this.state.leadingComments.slice(i);
21577 if (trailingComments.length === 0) {
21578 trailingComments = null;
21579 }
21580 }
21581 }
21582
21583 this.state.commentPreviousNode = node;
21584
21585 if (trailingComments) {
21586 if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) {
21587 node.innerComments = trailingComments;
21588 } else {
21589 node.trailingComments = trailingComments;
21590 }
21591 }
21592
21593 stack.push(node);
21594};
21595
21596var pp$7 = Parser.prototype;
21597
21598pp$7.estreeParseRegExpLiteral = function (_ref) {
21599 var pattern = _ref.pattern,
21600 flags = _ref.flags;
21601
21602 var regex = null;
21603 try {
21604 regex = new RegExp(pattern, flags);
21605 } catch (e) {
21606 // In environments that don't support these flags value will
21607 // be null as the regex can't be represented natively.
21608 }
21609 var node = this.estreeParseLiteral(regex);
21610 node.regex = { pattern: pattern, flags: flags };
21611
21612 return node;
21613};
21614
21615pp$7.estreeParseLiteral = function (value) {
21616 return this.parseLiteral(value, "Literal");
21617};
21618
21619pp$7.directiveToStmt = function (directive) {
21620 var directiveLiteral = directive.value;
21621
21622 var stmt = this.startNodeAt(directive.start, directive.loc.start);
21623 var expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start);
21624
21625 expression.value = directiveLiteral.value;
21626 expression.raw = directiveLiteral.extra.raw;
21627
21628 stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end);
21629 stmt.directive = directiveLiteral.extra.raw.slice(1, -1);
21630
21631 return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end);
21632};
21633
21634function isSimpleProperty(node) {
21635 return node && node.type === "Property" && node.kind === "init" && node.method === false;
21636}
21637
21638var estreePlugin = function (instance) {
21639 instance.extend("checkDeclaration", function (inner) {
21640 return function (node) {
21641 if (isSimpleProperty(node)) {
21642 this.checkDeclaration(node.value);
21643 } else {
21644 inner.call(this, node);
21645 }
21646 };
21647 });
21648
21649 instance.extend("checkGetterSetterParamCount", function () {
21650 return function (prop) {
21651 var paramCount = prop.kind === "get" ? 0 : 1;
21652 if (prop.value.params.length !== paramCount) {
21653 var start = prop.start;
21654 if (prop.kind === "get") {
21655 this.raise(start, "getter should have no params");
21656 } else {
21657 this.raise(start, "setter should have exactly one param");
21658 }
21659 }
21660 };
21661 });
21662
21663 instance.extend("checkLVal", function (inner) {
21664 return function (expr, isBinding, checkClashes) {
21665 var _this = this;
21666
21667 switch (expr.type) {
21668 case "ObjectPattern":
21669 expr.properties.forEach(function (prop) {
21670 _this.checkLVal(prop.type === "Property" ? prop.value : prop, isBinding, checkClashes, "object destructuring pattern");
21671 });
21672 break;
21673 default:
21674 for (var _len = arguments.length, args = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
21675 args[_key - 3] = arguments[_key];
21676 }
21677
21678 inner.call.apply(inner, [this, expr, isBinding, checkClashes].concat(args));
21679 }
21680 };
21681 });
21682
21683 instance.extend("checkPropClash", function () {
21684 return function (prop, propHash) {
21685 if (prop.computed || !isSimpleProperty(prop)) return;
21686
21687 var key = prop.key;
21688 // It is either an Identifier or a String/NumericLiteral
21689 var name = key.type === "Identifier" ? key.name : String(key.value);
21690
21691 if (name === "__proto__") {
21692 if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property");
21693 propHash.proto = true;
21694 }
21695 };
21696 });
21697
21698 instance.extend("isStrictBody", function () {
21699 return function (node, isExpression) {
21700 if (!isExpression && node.body.body.length > 0) {
21701 for (var _iterator = node.body.body, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
21702 var _ref2;
21703
21704 if (_isArray) {
21705 if (_i >= _iterator.length) break;
21706 _ref2 = _iterator[_i++];
21707 } else {
21708 _i = _iterator.next();
21709 if (_i.done) break;
21710 _ref2 = _i.value;
21711 }
21712
21713 var directive = _ref2;
21714
21715 if (directive.type === "ExpressionStatement" && directive.expression.type === "Literal") {
21716 if (directive.expression.value === "use strict") return true;
21717 } else {
21718 // Break for the first non literal expression
21719 break;
21720 }
21721 }
21722 }
21723
21724 return false;
21725 };
21726 });
21727
21728 instance.extend("isValidDirective", function () {
21729 return function (stmt) {
21730 return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && (!stmt.expression.extra || !stmt.expression.extra.parenthesized);
21731 };
21732 });
21733
21734 instance.extend("parseBlockBody", function (inner) {
21735 return function (node) {
21736 var _this2 = this;
21737
21738 for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
21739 args[_key2 - 1] = arguments[_key2];
21740 }
21741
21742 inner.call.apply(inner, [this, node].concat(args));
21743
21744 node.directives.reverse().forEach(function (directive) {
21745 node.body.unshift(_this2.directiveToStmt(directive));
21746 });
21747 delete node.directives;
21748 };
21749 });
21750
21751 instance.extend("parseClassMethod", function (inner) {
21752 return function (classBody) {
21753 for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
21754 args[_key3 - 1] = arguments[_key3];
21755 }
21756
21757 inner.call.apply(inner, [this, classBody].concat(args));
21758
21759 var body = classBody.body;
21760 body[body.length - 1].type = "MethodDefinition";
21761 };
21762 });
21763
21764 instance.extend("parseExprAtom", function (inner) {
21765 return function () {
21766 switch (this.state.type) {
21767 case types.regexp:
21768 return this.estreeParseRegExpLiteral(this.state.value);
21769
21770 case types.num:
21771 case types.string:
21772 return this.estreeParseLiteral(this.state.value);
21773
21774 case types._null:
21775 return this.estreeParseLiteral(null);
21776
21777 case types._true:
21778 return this.estreeParseLiteral(true);
21779
21780 case types._false:
21781 return this.estreeParseLiteral(false);
21782
21783 default:
21784 for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
21785 args[_key4] = arguments[_key4];
21786 }
21787
21788 return inner.call.apply(inner, [this].concat(args));
21789 }
21790 };
21791 });
21792
21793 instance.extend("parseLiteral", function (inner) {
21794 return function () {
21795 for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
21796 args[_key5] = arguments[_key5];
21797 }
21798
21799 var node = inner.call.apply(inner, [this].concat(args));
21800 node.raw = node.extra.raw;
21801 delete node.extra;
21802
21803 return node;
21804 };
21805 });
21806
21807 instance.extend("parseMethod", function (inner) {
21808 return function (node) {
21809 var funcNode = this.startNode();
21810 funcNode.kind = node.kind; // provide kind, so inner method correctly sets state
21811
21812 for (var _len6 = arguments.length, args = Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
21813 args[_key6 - 1] = arguments[_key6];
21814 }
21815
21816 funcNode = inner.call.apply(inner, [this, funcNode].concat(args));
21817 delete funcNode.kind;
21818 node.value = this.finishNode(funcNode, "FunctionExpression");
21819
21820 return node;
21821 };
21822 });
21823
21824 instance.extend("parseObjectMethod", function (inner) {
21825 return function () {
21826 for (var _len7 = arguments.length, args = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
21827 args[_key7] = arguments[_key7];
21828 }
21829
21830 var node = inner.call.apply(inner, [this].concat(args));
21831
21832 if (node) {
21833 if (node.kind === "method") node.kind = "init";
21834 node.type = "Property";
21835 }
21836
21837 return node;
21838 };
21839 });
21840
21841 instance.extend("parseObjectProperty", function (inner) {
21842 return function () {
21843 for (var _len8 = arguments.length, args = Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
21844 args[_key8] = arguments[_key8];
21845 }
21846
21847 var node = inner.call.apply(inner, [this].concat(args));
21848
21849 if (node) {
21850 node.kind = "init";
21851 node.type = "Property";
21852 }
21853
21854 return node;
21855 };
21856 });
21857
21858 instance.extend("toAssignable", function (inner) {
21859 return function (node, isBinding) {
21860 for (var _len9 = arguments.length, args = Array(_len9 > 2 ? _len9 - 2 : 0), _key9 = 2; _key9 < _len9; _key9++) {
21861 args[_key9 - 2] = arguments[_key9];
21862 }
21863
21864 if (isSimpleProperty(node)) {
21865 this.toAssignable.apply(this, [node.value, isBinding].concat(args));
21866
21867 return node;
21868 } else if (node.type === "ObjectExpression") {
21869 node.type = "ObjectPattern";
21870 for (var _iterator2 = node.properties, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
21871 var _ref3;
21872
21873 if (_isArray2) {
21874 if (_i2 >= _iterator2.length) break;
21875 _ref3 = _iterator2[_i2++];
21876 } else {
21877 _i2 = _iterator2.next();
21878 if (_i2.done) break;
21879 _ref3 = _i2.value;
21880 }
21881
21882 var prop = _ref3;
21883
21884 if (prop.kind === "get" || prop.kind === "set") {
21885 this.raise(prop.key.start, "Object pattern can't contain getter or setter");
21886 } else if (prop.method) {
21887 this.raise(prop.key.start, "Object pattern can't contain methods");
21888 } else {
21889 this.toAssignable(prop, isBinding, "object destructuring pattern");
21890 }
21891 }
21892
21893 return node;
21894 }
21895
21896 return inner.call.apply(inner, [this, node, isBinding].concat(args));
21897 };
21898 });
21899};
21900
21901/* eslint max-len: 0 */
21902
21903var primitiveTypes = ["any", "mixed", "empty", "bool", "boolean", "number", "string", "void", "null"];
21904
21905var pp$8 = Parser.prototype;
21906
21907pp$8.flowParseTypeInitialiser = function (tok) {
21908 var oldInType = this.state.inType;
21909 this.state.inType = true;
21910 this.expect(tok || types.colon);
21911
21912 var type = this.flowParseType();
21913 this.state.inType = oldInType;
21914 return type;
21915};
21916
21917pp$8.flowParsePredicate = function () {
21918 var node = this.startNode();
21919 var moduloLoc = this.state.startLoc;
21920 var moduloPos = this.state.start;
21921 this.expect(types.modulo);
21922 var checksLoc = this.state.startLoc;
21923 this.expectContextual("checks");
21924 // Force '%' and 'checks' to be adjacent
21925 if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) {
21926 this.raise(moduloPos, "Spaces between ´%´ and ´checks´ are not allowed here.");
21927 }
21928 if (this.eat(types.parenL)) {
21929 node.expression = this.parseExpression();
21930 this.expect(types.parenR);
21931 return this.finishNode(node, "DeclaredPredicate");
21932 } else {
21933 return this.finishNode(node, "InferredPredicate");
21934 }
21935};
21936
21937pp$8.flowParseTypeAndPredicateInitialiser = function () {
21938 var oldInType = this.state.inType;
21939 this.state.inType = true;
21940 this.expect(types.colon);
21941 var type = null;
21942 var predicate = null;
21943 if (this.match(types.modulo)) {
21944 this.state.inType = oldInType;
21945 predicate = this.flowParsePredicate();
21946 } else {
21947 type = this.flowParseType();
21948 this.state.inType = oldInType;
21949 if (this.match(types.modulo)) {
21950 predicate = this.flowParsePredicate();
21951 }
21952 }
21953 return [type, predicate];
21954};
21955
21956pp$8.flowParseDeclareClass = function (node) {
21957 this.next();
21958 this.flowParseInterfaceish(node, true);
21959 return this.finishNode(node, "DeclareClass");
21960};
21961
21962pp$8.flowParseDeclareFunction = function (node) {
21963 this.next();
21964
21965 var id = node.id = this.parseIdentifier();
21966
21967 var typeNode = this.startNode();
21968 var typeContainer = this.startNode();
21969
21970 if (this.isRelational("<")) {
21971 typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
21972 } else {
21973 typeNode.typeParameters = null;
21974 }
21975
21976 this.expect(types.parenL);
21977 var tmp = this.flowParseFunctionTypeParams();
21978 typeNode.params = tmp.params;
21979 typeNode.rest = tmp.rest;
21980 this.expect(types.parenR);
21981 var predicate = null;
21982
21983 var _flowParseTypeAndPred = this.flowParseTypeAndPredicateInitialiser();
21984
21985 typeNode.returnType = _flowParseTypeAndPred[0];
21986 predicate = _flowParseTypeAndPred[1];
21987
21988 typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation");
21989 typeContainer.predicate = predicate;
21990 id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
21991
21992 this.finishNode(id, id.type);
21993
21994 this.semicolon();
21995
21996 return this.finishNode(node, "DeclareFunction");
21997};
21998
21999pp$8.flowParseDeclare = function (node) {
22000 if (this.match(types._class)) {
22001 return this.flowParseDeclareClass(node);
22002 } else if (this.match(types._function)) {
22003 return this.flowParseDeclareFunction(node);
22004 } else if (this.match(types._var)) {
22005 return this.flowParseDeclareVariable(node);
22006 } else if (this.isContextual("module")) {
22007 if (this.lookahead().type === types.dot) {
22008 return this.flowParseDeclareModuleExports(node);
22009 } else {
22010 return this.flowParseDeclareModule(node);
22011 }
22012 } else if (this.isContextual("type")) {
22013 return this.flowParseDeclareTypeAlias(node);
22014 } else if (this.isContextual("interface")) {
22015 return this.flowParseDeclareInterface(node);
22016 } else {
22017 this.unexpected();
22018 }
22019};
22020
22021pp$8.flowParseDeclareVariable = function (node) {
22022 this.next();
22023 node.id = this.flowParseTypeAnnotatableIdentifier();
22024 this.semicolon();
22025 return this.finishNode(node, "DeclareVariable");
22026};
22027
22028pp$8.flowParseDeclareModule = function (node) {
22029 this.next();
22030
22031 if (this.match(types.string)) {
22032 node.id = this.parseExprAtom();
22033 } else {
22034 node.id = this.parseIdentifier();
22035 }
22036
22037 var bodyNode = node.body = this.startNode();
22038 var body = bodyNode.body = [];
22039 this.expect(types.braceL);
22040 while (!this.match(types.braceR)) {
22041 var _bodyNode = this.startNode();
22042
22043 if (this.match(types._import)) {
22044 var lookahead = this.lookahead();
22045 if (lookahead.value !== "type" && lookahead.value !== "typeof") {
22046 this.unexpected(null, "Imports within a `declare module` body must always be `import type` or `import typeof`");
22047 }
22048
22049 this.parseImport(_bodyNode);
22050 } else {
22051 this.expectContextual("declare", "Only declares and type imports are allowed inside declare module");
22052
22053 _bodyNode = this.flowParseDeclare(_bodyNode, true);
22054 }
22055
22056 body.push(_bodyNode);
22057 }
22058 this.expect(types.braceR);
22059
22060 this.finishNode(bodyNode, "BlockStatement");
22061 return this.finishNode(node, "DeclareModule");
22062};
22063
22064pp$8.flowParseDeclareModuleExports = function (node) {
22065 this.expectContextual("module");
22066 this.expect(types.dot);
22067 this.expectContextual("exports");
22068 node.typeAnnotation = this.flowParseTypeAnnotation();
22069 this.semicolon();
22070
22071 return this.finishNode(node, "DeclareModuleExports");
22072};
22073
22074pp$8.flowParseDeclareTypeAlias = function (node) {
22075 this.next();
22076 this.flowParseTypeAlias(node);
22077 return this.finishNode(node, "DeclareTypeAlias");
22078};
22079
22080pp$8.flowParseDeclareInterface = function (node) {
22081 this.next();
22082 this.flowParseInterfaceish(node);
22083 return this.finishNode(node, "DeclareInterface");
22084};
22085
22086// Interfaces
22087
22088pp$8.flowParseInterfaceish = function (node, allowStatic) {
22089 node.id = this.parseIdentifier();
22090
22091 if (this.isRelational("<")) {
22092 node.typeParameters = this.flowParseTypeParameterDeclaration();
22093 } else {
22094 node.typeParameters = null;
22095 }
22096
22097 node.extends = [];
22098 node.mixins = [];
22099
22100 if (this.eat(types._extends)) {
22101 do {
22102 node.extends.push(this.flowParseInterfaceExtends());
22103 } while (this.eat(types.comma));
22104 }
22105
22106 if (this.isContextual("mixins")) {
22107 this.next();
22108 do {
22109 node.mixins.push(this.flowParseInterfaceExtends());
22110 } while (this.eat(types.comma));
22111 }
22112
22113 node.body = this.flowParseObjectType(allowStatic);
22114};
22115
22116pp$8.flowParseInterfaceExtends = function () {
22117 var node = this.startNode();
22118
22119 node.id = this.flowParseQualifiedTypeIdentifier();
22120 if (this.isRelational("<")) {
22121 node.typeParameters = this.flowParseTypeParameterInstantiation();
22122 } else {
22123 node.typeParameters = null;
22124 }
22125
22126 return this.finishNode(node, "InterfaceExtends");
22127};
22128
22129pp$8.flowParseInterface = function (node) {
22130 this.flowParseInterfaceish(node, false);
22131 return this.finishNode(node, "InterfaceDeclaration");
22132};
22133
22134pp$8.flowParseRestrictedIdentifier = function (liberal) {
22135 if (primitiveTypes.indexOf(this.state.value) > -1) {
22136 this.raise(this.state.start, "Cannot overwrite primitive type " + this.state.value);
22137 }
22138
22139 return this.parseIdentifier(liberal);
22140};
22141
22142// Type aliases
22143
22144pp$8.flowParseTypeAlias = function (node) {
22145 node.id = this.flowParseRestrictedIdentifier();
22146
22147 if (this.isRelational("<")) {
22148 node.typeParameters = this.flowParseTypeParameterDeclaration();
22149 } else {
22150 node.typeParameters = null;
22151 }
22152
22153 node.right = this.flowParseTypeInitialiser(types.eq);
22154 this.semicolon();
22155
22156 return this.finishNode(node, "TypeAlias");
22157};
22158
22159// Type annotations
22160
22161pp$8.flowParseTypeParameter = function () {
22162 var node = this.startNode();
22163
22164 var variance = this.flowParseVariance();
22165
22166 var ident = this.flowParseTypeAnnotatableIdentifier();
22167 node.name = ident.name;
22168 node.variance = variance;
22169 node.bound = ident.typeAnnotation;
22170
22171 if (this.match(types.eq)) {
22172 this.eat(types.eq);
22173 node.default = this.flowParseType();
22174 }
22175
22176 return this.finishNode(node, "TypeParameter");
22177};
22178
22179pp$8.flowParseTypeParameterDeclaration = function () {
22180 var oldInType = this.state.inType;
22181 var node = this.startNode();
22182 node.params = [];
22183
22184 this.state.inType = true;
22185
22186 // istanbul ignore else: this condition is already checked at all call sites
22187 if (this.isRelational("<") || this.match(types.jsxTagStart)) {
22188 this.next();
22189 } else {
22190 this.unexpected();
22191 }
22192
22193 do {
22194 node.params.push(this.flowParseTypeParameter());
22195 if (!this.isRelational(">")) {
22196 this.expect(types.comma);
22197 }
22198 } while (!this.isRelational(">"));
22199 this.expectRelational(">");
22200
22201 this.state.inType = oldInType;
22202
22203 return this.finishNode(node, "TypeParameterDeclaration");
22204};
22205
22206pp$8.flowParseTypeParameterInstantiation = function () {
22207 var node = this.startNode();
22208 var oldInType = this.state.inType;
22209 node.params = [];
22210
22211 this.state.inType = true;
22212
22213 this.expectRelational("<");
22214 while (!this.isRelational(">")) {
22215 node.params.push(this.flowParseType());
22216 if (!this.isRelational(">")) {
22217 this.expect(types.comma);
22218 }
22219 }
22220 this.expectRelational(">");
22221
22222 this.state.inType = oldInType;
22223
22224 return this.finishNode(node, "TypeParameterInstantiation");
22225};
22226
22227pp$8.flowParseObjectPropertyKey = function () {
22228 return this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true);
22229};
22230
22231pp$8.flowParseObjectTypeIndexer = function (node, isStatic, variance) {
22232 node.static = isStatic;
22233
22234 this.expect(types.bracketL);
22235 if (this.lookahead().type === types.colon) {
22236 node.id = this.flowParseObjectPropertyKey();
22237 node.key = this.flowParseTypeInitialiser();
22238 } else {
22239 node.id = null;
22240 node.key = this.flowParseType();
22241 }
22242 this.expect(types.bracketR);
22243 node.value = this.flowParseTypeInitialiser();
22244 node.variance = variance;
22245
22246 this.flowObjectTypeSemicolon();
22247 return this.finishNode(node, "ObjectTypeIndexer");
22248};
22249
22250pp$8.flowParseObjectTypeMethodish = function (node) {
22251 node.params = [];
22252 node.rest = null;
22253 node.typeParameters = null;
22254
22255 if (this.isRelational("<")) {
22256 node.typeParameters = this.flowParseTypeParameterDeclaration();
22257 }
22258
22259 this.expect(types.parenL);
22260 while (this.match(types.name)) {
22261 node.params.push(this.flowParseFunctionTypeParam());
22262 if (!this.match(types.parenR)) {
22263 this.expect(types.comma);
22264 }
22265 }
22266
22267 if (this.eat(types.ellipsis)) {
22268 node.rest = this.flowParseFunctionTypeParam();
22269 }
22270 this.expect(types.parenR);
22271 node.returnType = this.flowParseTypeInitialiser();
22272
22273 return this.finishNode(node, "FunctionTypeAnnotation");
22274};
22275
22276pp$8.flowParseObjectTypeMethod = function (startPos, startLoc, isStatic, key) {
22277 var node = this.startNodeAt(startPos, startLoc);
22278 node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(startPos, startLoc));
22279 node.static = isStatic;
22280 node.key = key;
22281 node.optional = false;
22282 this.flowObjectTypeSemicolon();
22283 return this.finishNode(node, "ObjectTypeProperty");
22284};
22285
22286pp$8.flowParseObjectTypeCallProperty = function (node, isStatic) {
22287 var valueNode = this.startNode();
22288 node.static = isStatic;
22289 node.value = this.flowParseObjectTypeMethodish(valueNode);
22290 this.flowObjectTypeSemicolon();
22291 return this.finishNode(node, "ObjectTypeCallProperty");
22292};
22293
22294pp$8.flowParseObjectType = function (allowStatic, allowExact) {
22295 var oldInType = this.state.inType;
22296 this.state.inType = true;
22297
22298 var nodeStart = this.startNode();
22299 var node = void 0;
22300 var propertyKey = void 0;
22301 var isStatic = false;
22302
22303 nodeStart.callProperties = [];
22304 nodeStart.properties = [];
22305 nodeStart.indexers = [];
22306
22307 var endDelim = void 0;
22308 var exact = void 0;
22309 if (allowExact && this.match(types.braceBarL)) {
22310 this.expect(types.braceBarL);
22311 endDelim = types.braceBarR;
22312 exact = true;
22313 } else {
22314 this.expect(types.braceL);
22315 endDelim = types.braceR;
22316 exact = false;
22317 }
22318
22319 nodeStart.exact = exact;
22320
22321 while (!this.match(endDelim)) {
22322 var optional = false;
22323 var startPos = this.state.start;
22324 var startLoc = this.state.startLoc;
22325 node = this.startNode();
22326 if (allowStatic && this.isContextual("static") && this.lookahead().type !== types.colon) {
22327 this.next();
22328 isStatic = true;
22329 }
22330
22331 var variancePos = this.state.start;
22332 var variance = this.flowParseVariance();
22333
22334 if (this.match(types.bracketL)) {
22335 nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));
22336 } else if (this.match(types.parenL) || this.isRelational("<")) {
22337 if (variance) {
22338 this.unexpected(variancePos);
22339 }
22340 nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));
22341 } else {
22342 propertyKey = this.flowParseObjectPropertyKey();
22343 if (this.isRelational("<") || this.match(types.parenL)) {
22344 // This is a method property
22345 if (variance) {
22346 this.unexpected(variancePos);
22347 }
22348 nodeStart.properties.push(this.flowParseObjectTypeMethod(startPos, startLoc, isStatic, propertyKey));
22349 } else {
22350 if (this.eat(types.question)) {
22351 optional = true;
22352 }
22353 node.key = propertyKey;
22354 node.value = this.flowParseTypeInitialiser();
22355 node.optional = optional;
22356 node.static = isStatic;
22357 node.variance = variance;
22358 this.flowObjectTypeSemicolon();
22359 nodeStart.properties.push(this.finishNode(node, "ObjectTypeProperty"));
22360 }
22361 }
22362
22363 isStatic = false;
22364 }
22365
22366 this.expect(endDelim);
22367
22368 var out = this.finishNode(nodeStart, "ObjectTypeAnnotation");
22369
22370 this.state.inType = oldInType;
22371
22372 return out;
22373};
22374
22375pp$8.flowObjectTypeSemicolon = function () {
22376 if (!this.eat(types.semi) && !this.eat(types.comma) && !this.match(types.braceR) && !this.match(types.braceBarR)) {
22377 this.unexpected();
22378 }
22379};
22380
22381pp$8.flowParseQualifiedTypeIdentifier = function (startPos, startLoc, id) {
22382 startPos = startPos || this.state.start;
22383 startLoc = startLoc || this.state.startLoc;
22384 var node = id || this.parseIdentifier();
22385
22386 while (this.eat(types.dot)) {
22387 var node2 = this.startNodeAt(startPos, startLoc);
22388 node2.qualification = node;
22389 node2.id = this.parseIdentifier();
22390 node = this.finishNode(node2, "QualifiedTypeIdentifier");
22391 }
22392
22393 return node;
22394};
22395
22396pp$8.flowParseGenericType = function (startPos, startLoc, id) {
22397 var node = this.startNodeAt(startPos, startLoc);
22398
22399 node.typeParameters = null;
22400 node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id);
22401
22402 if (this.isRelational("<")) {
22403 node.typeParameters = this.flowParseTypeParameterInstantiation();
22404 }
22405
22406 return this.finishNode(node, "GenericTypeAnnotation");
22407};
22408
22409pp$8.flowParseTypeofType = function () {
22410 var node = this.startNode();
22411 this.expect(types._typeof);
22412 node.argument = this.flowParsePrimaryType();
22413 return this.finishNode(node, "TypeofTypeAnnotation");
22414};
22415
22416pp$8.flowParseTupleType = function () {
22417 var node = this.startNode();
22418 node.types = [];
22419 this.expect(types.bracketL);
22420 // We allow trailing commas
22421 while (this.state.pos < this.input.length && !this.match(types.bracketR)) {
22422 node.types.push(this.flowParseType());
22423 if (this.match(types.bracketR)) break;
22424 this.expect(types.comma);
22425 }
22426 this.expect(types.bracketR);
22427 return this.finishNode(node, "TupleTypeAnnotation");
22428};
22429
22430pp$8.flowParseFunctionTypeParam = function () {
22431 var name = null;
22432 var optional = false;
22433 var typeAnnotation = null;
22434 var node = this.startNode();
22435 var lh = this.lookahead();
22436 if (lh.type === types.colon || lh.type === types.question) {
22437 name = this.parseIdentifier();
22438 if (this.eat(types.question)) {
22439 optional = true;
22440 }
22441 typeAnnotation = this.flowParseTypeInitialiser();
22442 } else {
22443 typeAnnotation = this.flowParseType();
22444 }
22445 node.name = name;
22446 node.optional = optional;
22447 node.typeAnnotation = typeAnnotation;
22448 return this.finishNode(node, "FunctionTypeParam");
22449};
22450
22451pp$8.reinterpretTypeAsFunctionTypeParam = function (type) {
22452 var node = this.startNodeAt(type.start, type.loc);
22453 node.name = null;
22454 node.optional = false;
22455 node.typeAnnotation = type;
22456 return this.finishNode(node, "FunctionTypeParam");
22457};
22458
22459pp$8.flowParseFunctionTypeParams = function () {
22460 var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
22461
22462 var ret = { params: params, rest: null };
22463 while (!this.match(types.parenR) && !this.match(types.ellipsis)) {
22464 ret.params.push(this.flowParseFunctionTypeParam());
22465 if (!this.match(types.parenR)) {
22466 this.expect(types.comma);
22467 }
22468 }
22469 if (this.eat(types.ellipsis)) {
22470 ret.rest = this.flowParseFunctionTypeParam();
22471 }
22472 return ret;
22473};
22474
22475pp$8.flowIdentToTypeAnnotation = function (startPos, startLoc, node, id) {
22476 switch (id.name) {
22477 case "any":
22478 return this.finishNode(node, "AnyTypeAnnotation");
22479
22480 case "void":
22481 return this.finishNode(node, "VoidTypeAnnotation");
22482
22483 case "bool":
22484 case "boolean":
22485 return this.finishNode(node, "BooleanTypeAnnotation");
22486
22487 case "mixed":
22488 return this.finishNode(node, "MixedTypeAnnotation");
22489
22490 case "empty":
22491 return this.finishNode(node, "EmptyTypeAnnotation");
22492
22493 case "number":
22494 return this.finishNode(node, "NumberTypeAnnotation");
22495
22496 case "string":
22497 return this.finishNode(node, "StringTypeAnnotation");
22498
22499 default:
22500 return this.flowParseGenericType(startPos, startLoc, id);
22501 }
22502};
22503
22504// The parsing of types roughly parallels the parsing of expressions, and
22505// primary types are kind of like primary expressions...they're the
22506// primitives with which other types are constructed.
22507pp$8.flowParsePrimaryType = function () {
22508 var startPos = this.state.start;
22509 var startLoc = this.state.startLoc;
22510 var node = this.startNode();
22511 var tmp = void 0;
22512 var type = void 0;
22513 var isGroupedType = false;
22514 var oldNoAnonFunctionType = this.state.noAnonFunctionType;
22515
22516 switch (this.state.type) {
22517 case types.name:
22518 return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier());
22519
22520 case types.braceL:
22521 return this.flowParseObjectType(false, false);
22522
22523 case types.braceBarL:
22524 return this.flowParseObjectType(false, true);
22525
22526 case types.bracketL:
22527 return this.flowParseTupleType();
22528
22529 case types.relational:
22530 if (this.state.value === "<") {
22531 node.typeParameters = this.flowParseTypeParameterDeclaration();
22532 this.expect(types.parenL);
22533 tmp = this.flowParseFunctionTypeParams();
22534 node.params = tmp.params;
22535 node.rest = tmp.rest;
22536 this.expect(types.parenR);
22537
22538 this.expect(types.arrow);
22539
22540 node.returnType = this.flowParseType();
22541
22542 return this.finishNode(node, "FunctionTypeAnnotation");
22543 }
22544 break;
22545
22546 case types.parenL:
22547 this.next();
22548
22549 // Check to see if this is actually a grouped type
22550 if (!this.match(types.parenR) && !this.match(types.ellipsis)) {
22551 if (this.match(types.name)) {
22552 var token = this.lookahead().type;
22553 isGroupedType = token !== types.question && token !== types.colon;
22554 } else {
22555 isGroupedType = true;
22556 }
22557 }
22558
22559 if (isGroupedType) {
22560 this.state.noAnonFunctionType = false;
22561 type = this.flowParseType();
22562 this.state.noAnonFunctionType = oldNoAnonFunctionType;
22563
22564 // A `,` or a `) =>` means this is an anonymous function type
22565 if (this.state.noAnonFunctionType || !(this.match(types.comma) || this.match(types.parenR) && this.lookahead().type === types.arrow)) {
22566 this.expect(types.parenR);
22567 return type;
22568 } else {
22569 // Eat a comma if there is one
22570 this.eat(types.comma);
22571 }
22572 }
22573
22574 if (type) {
22575 tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);
22576 } else {
22577 tmp = this.flowParseFunctionTypeParams();
22578 }
22579
22580 node.params = tmp.params;
22581 node.rest = tmp.rest;
22582
22583 this.expect(types.parenR);
22584
22585 this.expect(types.arrow);
22586
22587 node.returnType = this.flowParseType();
22588
22589 node.typeParameters = null;
22590
22591 return this.finishNode(node, "FunctionTypeAnnotation");
22592
22593 case types.string:
22594 return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
22595
22596 case types._true:case types._false:
22597 node.value = this.match(types._true);
22598 this.next();
22599 return this.finishNode(node, "BooleanLiteralTypeAnnotation");
22600
22601 case types.plusMin:
22602 if (this.state.value === "-") {
22603 this.next();
22604 if (!this.match(types.num)) this.unexpected(null, "Unexpected token, expected number");
22605
22606 return this.parseLiteral(-this.state.value, "NumericLiteralTypeAnnotation", node.start, node.loc.start);
22607 }
22608
22609 this.unexpected();
22610 case types.num:
22611 return this.parseLiteral(this.state.value, "NumericLiteralTypeAnnotation");
22612
22613 case types._null:
22614 node.value = this.match(types._null);
22615 this.next();
22616 return this.finishNode(node, "NullLiteralTypeAnnotation");
22617
22618 case types._this:
22619 node.value = this.match(types._this);
22620 this.next();
22621 return this.finishNode(node, "ThisTypeAnnotation");
22622
22623 case types.star:
22624 this.next();
22625 return this.finishNode(node, "ExistentialTypeParam");
22626
22627 default:
22628 if (this.state.type.keyword === "typeof") {
22629 return this.flowParseTypeofType();
22630 }
22631 }
22632
22633 this.unexpected();
22634};
22635
22636pp$8.flowParsePostfixType = function () {
22637 var startPos = this.state.start,
22638 startLoc = this.state.startLoc;
22639 var type = this.flowParsePrimaryType();
22640 while (!this.canInsertSemicolon() && this.match(types.bracketL)) {
22641 var node = this.startNodeAt(startPos, startLoc);
22642 node.elementType = type;
22643 this.expect(types.bracketL);
22644 this.expect(types.bracketR);
22645 type = this.finishNode(node, "ArrayTypeAnnotation");
22646 }
22647 return type;
22648};
22649
22650pp$8.flowParsePrefixType = function () {
22651 var node = this.startNode();
22652 if (this.eat(types.question)) {
22653 node.typeAnnotation = this.flowParsePrefixType();
22654 return this.finishNode(node, "NullableTypeAnnotation");
22655 } else {
22656 return this.flowParsePostfixType();
22657 }
22658};
22659
22660pp$8.flowParseAnonFunctionWithoutParens = function () {
22661 var param = this.flowParsePrefixType();
22662 if (!this.state.noAnonFunctionType && this.eat(types.arrow)) {
22663 var node = this.startNodeAt(param.start, param.loc);
22664 node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
22665 node.rest = null;
22666 node.returnType = this.flowParseType();
22667 node.typeParameters = null;
22668 return this.finishNode(node, "FunctionTypeAnnotation");
22669 }
22670 return param;
22671};
22672
22673pp$8.flowParseIntersectionType = function () {
22674 var node = this.startNode();
22675 this.eat(types.bitwiseAND);
22676 var type = this.flowParseAnonFunctionWithoutParens();
22677 node.types = [type];
22678 while (this.eat(types.bitwiseAND)) {
22679 node.types.push(this.flowParseAnonFunctionWithoutParens());
22680 }
22681 return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation");
22682};
22683
22684pp$8.flowParseUnionType = function () {
22685 var node = this.startNode();
22686 this.eat(types.bitwiseOR);
22687 var type = this.flowParseIntersectionType();
22688 node.types = [type];
22689 while (this.eat(types.bitwiseOR)) {
22690 node.types.push(this.flowParseIntersectionType());
22691 }
22692 return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation");
22693};
22694
22695pp$8.flowParseType = function () {
22696 var oldInType = this.state.inType;
22697 this.state.inType = true;
22698 var type = this.flowParseUnionType();
22699 this.state.inType = oldInType;
22700 return type;
22701};
22702
22703pp$8.flowParseTypeAnnotation = function () {
22704 var node = this.startNode();
22705 node.typeAnnotation = this.flowParseTypeInitialiser();
22706 return this.finishNode(node, "TypeAnnotation");
22707};
22708
22709pp$8.flowParseTypeAndPredicateAnnotation = function () {
22710 var node = this.startNode();
22711
22712 var _flowParseTypeAndPred2 = this.flowParseTypeAndPredicateInitialiser();
22713
22714 node.typeAnnotation = _flowParseTypeAndPred2[0];
22715 node.predicate = _flowParseTypeAndPred2[1];
22716
22717 return this.finishNode(node, "TypeAnnotation");
22718};
22719
22720pp$8.flowParseTypeAnnotatableIdentifier = function () {
22721 var ident = this.flowParseRestrictedIdentifier();
22722 if (this.match(types.colon)) {
22723 ident.typeAnnotation = this.flowParseTypeAnnotation();
22724 this.finishNode(ident, ident.type);
22725 }
22726 return ident;
22727};
22728
22729pp$8.typeCastToParameter = function (node) {
22730 node.expression.typeAnnotation = node.typeAnnotation;
22731
22732 return this.finishNodeAt(node.expression, node.expression.type, node.typeAnnotation.end, node.typeAnnotation.loc.end);
22733};
22734
22735pp$8.flowParseVariance = function () {
22736 var variance = null;
22737 if (this.match(types.plusMin)) {
22738 if (this.state.value === "+") {
22739 variance = "plus";
22740 } else if (this.state.value === "-") {
22741 variance = "minus";
22742 }
22743 this.next();
22744 }
22745 return variance;
22746};
22747
22748var flowPlugin = function (instance) {
22749 // plain function return types: function name(): string {}
22750 instance.extend("parseFunctionBody", function (inner) {
22751 return function (node, allowExpression) {
22752 if (this.match(types.colon) && !allowExpression) {
22753 // if allowExpression is true then we're parsing an arrow function and if
22754 // there's a return type then it's been handled elsewhere
22755 node.returnType = this.flowParseTypeAndPredicateAnnotation();
22756 }
22757
22758 return inner.call(this, node, allowExpression);
22759 };
22760 });
22761
22762 // interfaces
22763 instance.extend("parseStatement", function (inner) {
22764 return function (declaration, topLevel) {
22765 // strict mode handling of `interface` since it's a reserved word
22766 if (this.state.strict && this.match(types.name) && this.state.value === "interface") {
22767 var node = this.startNode();
22768 this.next();
22769 return this.flowParseInterface(node);
22770 } else {
22771 return inner.call(this, declaration, topLevel);
22772 }
22773 };
22774 });
22775
22776 // declares, interfaces and type aliases
22777 instance.extend("parseExpressionStatement", function (inner) {
22778 return function (node, expr) {
22779 if (expr.type === "Identifier") {
22780 if (expr.name === "declare") {
22781 if (this.match(types._class) || this.match(types.name) || this.match(types._function) || this.match(types._var)) {
22782 return this.flowParseDeclare(node);
22783 }
22784 } else if (this.match(types.name)) {
22785 if (expr.name === "interface") {
22786 return this.flowParseInterface(node);
22787 } else if (expr.name === "type") {
22788 return this.flowParseTypeAlias(node);
22789 }
22790 }
22791 }
22792
22793 return inner.call(this, node, expr);
22794 };
22795 });
22796
22797 // export type
22798 instance.extend("shouldParseExportDeclaration", function (inner) {
22799 return function () {
22800 return this.isContextual("type") || this.isContextual("interface") || inner.call(this);
22801 };
22802 });
22803
22804 instance.extend("parseConditional", function (inner) {
22805 return function (expr, noIn, startPos, startLoc, refNeedsArrowPos) {
22806 // only do the expensive clone if there is a question mark
22807 // and if we come from inside parens
22808 if (refNeedsArrowPos && this.match(types.question)) {
22809 var state = this.state.clone();
22810 try {
22811 return inner.call(this, expr, noIn, startPos, startLoc);
22812 } catch (err) {
22813 if (err instanceof SyntaxError) {
22814 this.state = state;
22815 refNeedsArrowPos.start = err.pos || this.state.start;
22816 return expr;
22817 } else {
22818 // istanbul ignore next: no such error is expected
22819 throw err;
22820 }
22821 }
22822 }
22823
22824 return inner.call(this, expr, noIn, startPos, startLoc);
22825 };
22826 });
22827
22828 instance.extend("parseParenItem", function (inner) {
22829 return function (node, startLoc, startPos) {
22830 node = inner.call(this, node, startLoc, startPos);
22831 if (this.eat(types.question)) {
22832 node.optional = true;
22833 }
22834
22835 if (this.match(types.colon)) {
22836 var typeCastNode = this.startNodeAt(startLoc, startPos);
22837 typeCastNode.expression = node;
22838 typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
22839
22840 return this.finishNode(typeCastNode, "TypeCastExpression");
22841 }
22842
22843 return node;
22844 };
22845 });
22846
22847 instance.extend("parseExport", function (inner) {
22848 return function (node) {
22849 node = inner.call(this, node);
22850 if (node.type === "ExportNamedDeclaration") {
22851 node.exportKind = node.exportKind || "value";
22852 }
22853 return node;
22854 };
22855 });
22856
22857 instance.extend("parseExportDeclaration", function (inner) {
22858 return function (node) {
22859 if (this.isContextual("type")) {
22860 node.exportKind = "type";
22861
22862 var declarationNode = this.startNode();
22863 this.next();
22864
22865 if (this.match(types.braceL)) {
22866 // export type { foo, bar };
22867 node.specifiers = this.parseExportSpecifiers();
22868 this.parseExportFrom(node);
22869 return null;
22870 } else {
22871 // export type Foo = Bar;
22872 return this.flowParseTypeAlias(declarationNode);
22873 }
22874 } else if (this.isContextual("interface")) {
22875 node.exportKind = "type";
22876 var _declarationNode = this.startNode();
22877 this.next();
22878 return this.flowParseInterface(_declarationNode);
22879 } else {
22880 return inner.call(this, node);
22881 }
22882 };
22883 });
22884
22885 instance.extend("parseClassId", function (inner) {
22886 return function (node) {
22887 inner.apply(this, arguments);
22888 if (this.isRelational("<")) {
22889 node.typeParameters = this.flowParseTypeParameterDeclaration();
22890 }
22891 };
22892 });
22893
22894 // don't consider `void` to be a keyword as then it'll use the void token type
22895 // and set startExpr
22896 instance.extend("isKeyword", function (inner) {
22897 return function (name) {
22898 if (this.state.inType && name === "void") {
22899 return false;
22900 } else {
22901 return inner.call(this, name);
22902 }
22903 };
22904 });
22905
22906 // ensure that inside flow types, we bypass the jsx parser plugin
22907 instance.extend("readToken", function (inner) {
22908 return function (code) {
22909 if (this.state.inType && (code === 62 || code === 60)) {
22910 return this.finishOp(types.relational, 1);
22911 } else {
22912 return inner.call(this, code);
22913 }
22914 };
22915 });
22916
22917 // don't lex any token as a jsx one inside a flow type
22918 instance.extend("jsx_readToken", function (inner) {
22919 return function () {
22920 if (!this.state.inType) return inner.call(this);
22921 };
22922 });
22923
22924 instance.extend("toAssignable", function (inner) {
22925 return function (node, isBinding, contextDescription) {
22926 if (node.type === "TypeCastExpression") {
22927 return inner.call(this, this.typeCastToParameter(node), isBinding, contextDescription);
22928 } else {
22929 return inner.call(this, node, isBinding, contextDescription);
22930 }
22931 };
22932 });
22933
22934 // turn type casts that we found in function parameter head into type annotated params
22935 instance.extend("toAssignableList", function (inner) {
22936 return function (exprList, isBinding, contextDescription) {
22937 for (var i = 0; i < exprList.length; i++) {
22938 var expr = exprList[i];
22939 if (expr && expr.type === "TypeCastExpression") {
22940 exprList[i] = this.typeCastToParameter(expr);
22941 }
22942 }
22943 return inner.call(this, exprList, isBinding, contextDescription);
22944 };
22945 });
22946
22947 // this is a list of nodes, from something like a call expression, we need to filter the
22948 // type casts that we've found that are illegal in this context
22949 instance.extend("toReferencedList", function () {
22950 return function (exprList) {
22951 for (var i = 0; i < exprList.length; i++) {
22952 var expr = exprList[i];
22953 if (expr && expr._exprListItem && expr.type === "TypeCastExpression") {
22954 this.raise(expr.start, "Unexpected type cast");
22955 }
22956 }
22957
22958 return exprList;
22959 };
22960 });
22961
22962 // parse an item inside a expression list eg. `(NODE, NODE)` where NODE represents
22963 // the position where this function is called
22964 instance.extend("parseExprListItem", function (inner) {
22965 return function () {
22966 var container = this.startNode();
22967
22968 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
22969 args[_key] = arguments[_key];
22970 }
22971
22972 var node = inner.call.apply(inner, [this].concat(args));
22973 if (this.match(types.colon)) {
22974 container._exprListItem = true;
22975 container.expression = node;
22976 container.typeAnnotation = this.flowParseTypeAnnotation();
22977 return this.finishNode(container, "TypeCastExpression");
22978 } else {
22979 return node;
22980 }
22981 };
22982 });
22983
22984 instance.extend("checkLVal", function (inner) {
22985 return function (node) {
22986 if (node.type !== "TypeCastExpression") {
22987 return inner.apply(this, arguments);
22988 }
22989 };
22990 });
22991
22992 // parse class property type annotations
22993 instance.extend("parseClassProperty", function (inner) {
22994 return function (node) {
22995 delete node.variancePos;
22996 if (this.match(types.colon)) {
22997 node.typeAnnotation = this.flowParseTypeAnnotation();
22998 }
22999 return inner.call(this, node);
23000 };
23001 });
23002
23003 // determine whether or not we're currently in the position where a class property would appear
23004 instance.extend("isClassProperty", function (inner) {
23005 return function () {
23006 return this.match(types.colon) || inner.call(this);
23007 };
23008 });
23009
23010 // parse type parameters for class methods
23011 instance.extend("parseClassMethod", function (inner) {
23012 return function (classBody, method) {
23013 if (method.variance) {
23014 this.unexpected(method.variancePos);
23015 }
23016 delete method.variance;
23017 delete method.variancePos;
23018 if (this.isRelational("<")) {
23019 method.typeParameters = this.flowParseTypeParameterDeclaration();
23020 }
23021
23022 for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
23023 args[_key2 - 2] = arguments[_key2];
23024 }
23025
23026 inner.call.apply(inner, [this, classBody, method].concat(args));
23027 };
23028 });
23029
23030 // parse a the super class type parameters and implements
23031 instance.extend("parseClassSuper", function (inner) {
23032 return function (node, isStatement) {
23033 inner.call(this, node, isStatement);
23034 if (node.superClass && this.isRelational("<")) {
23035 node.superTypeParameters = this.flowParseTypeParameterInstantiation();
23036 }
23037 if (this.isContextual("implements")) {
23038 this.next();
23039 var implemented = node.implements = [];
23040 do {
23041 var _node = this.startNode();
23042 _node.id = this.parseIdentifier();
23043 if (this.isRelational("<")) {
23044 _node.typeParameters = this.flowParseTypeParameterInstantiation();
23045 } else {
23046 _node.typeParameters = null;
23047 }
23048 implemented.push(this.finishNode(_node, "ClassImplements"));
23049 } while (this.eat(types.comma));
23050 }
23051 };
23052 });
23053
23054 instance.extend("parsePropertyName", function (inner) {
23055 return function (node) {
23056 var variancePos = this.state.start;
23057 var variance = this.flowParseVariance();
23058 var key = inner.call(this, node);
23059 node.variance = variance;
23060 node.variancePos = variancePos;
23061 return key;
23062 };
23063 });
23064
23065 // parse type parameters for object method shorthand
23066 instance.extend("parseObjPropValue", function (inner) {
23067 return function (prop) {
23068 if (prop.variance) {
23069 this.unexpected(prop.variancePos);
23070 }
23071 delete prop.variance;
23072 delete prop.variancePos;
23073
23074 var typeParameters = void 0;
23075
23076 // method shorthand
23077 if (this.isRelational("<")) {
23078 typeParameters = this.flowParseTypeParameterDeclaration();
23079 if (!this.match(types.parenL)) this.unexpected();
23080 }
23081
23082 inner.apply(this, arguments);
23083
23084 // add typeParameters if we found them
23085 if (typeParameters) {
23086 (prop.value || prop).typeParameters = typeParameters;
23087 }
23088 };
23089 });
23090
23091 instance.extend("parseAssignableListItemTypes", function () {
23092 return function (param) {
23093 if (this.eat(types.question)) {
23094 param.optional = true;
23095 }
23096 if (this.match(types.colon)) {
23097 param.typeAnnotation = this.flowParseTypeAnnotation();
23098 }
23099 this.finishNode(param, param.type);
23100 return param;
23101 };
23102 });
23103
23104 instance.extend("parseMaybeDefault", function (inner) {
23105 return function () {
23106 for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
23107 args[_key3] = arguments[_key3];
23108 }
23109
23110 var node = inner.apply(this, args);
23111
23112 if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
23113 this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`");
23114 }
23115
23116 return node;
23117 };
23118 });
23119
23120 // parse typeof and type imports
23121 instance.extend("parseImportSpecifiers", function (inner) {
23122 return function (node) {
23123 node.importKind = "value";
23124
23125 var kind = null;
23126 if (this.match(types._typeof)) {
23127 kind = "typeof";
23128 } else if (this.isContextual("type")) {
23129 kind = "type";
23130 }
23131 if (kind) {
23132 var lh = this.lookahead();
23133 if (lh.type === types.name && lh.value !== "from" || lh.type === types.braceL || lh.type === types.star) {
23134 this.next();
23135 node.importKind = kind;
23136 }
23137 }
23138
23139 inner.call(this, node);
23140 };
23141 });
23142
23143 // parse import-type/typeof shorthand
23144 instance.extend("parseImportSpecifier", function () {
23145 return function (node) {
23146 var specifier = this.startNode();
23147 var firstIdentLoc = this.state.start;
23148 var firstIdent = this.parseIdentifier(true);
23149
23150 var specifierTypeKind = null;
23151 if (firstIdent.name === "type") {
23152 specifierTypeKind = "type";
23153 } else if (firstIdent.name === "typeof") {
23154 specifierTypeKind = "typeof";
23155 }
23156
23157 var isBinding = false;
23158 if (this.isContextual("as")) {
23159 var as_ident = this.parseIdentifier(true);
23160 if (specifierTypeKind !== null && !this.match(types.name) && !this.state.type.keyword) {
23161 // `import {type as ,` or `import {type as }`
23162 specifier.imported = as_ident;
23163 specifier.importKind = specifierTypeKind;
23164 specifier.local = as_ident.__clone();
23165 } else {
23166 // `import {type as foo`
23167 specifier.imported = firstIdent;
23168 specifier.importKind = null;
23169 specifier.local = this.parseIdentifier();
23170 }
23171 } else if (specifierTypeKind !== null && (this.match(types.name) || this.state.type.keyword)) {
23172 // `import {type foo`
23173 specifier.imported = this.parseIdentifier(true);
23174 specifier.importKind = specifierTypeKind;
23175 if (this.eatContextual("as")) {
23176 specifier.local = this.parseIdentifier();
23177 } else {
23178 isBinding = true;
23179 specifier.local = specifier.imported.__clone();
23180 }
23181 } else {
23182 isBinding = true;
23183 specifier.imported = firstIdent;
23184 specifier.importKind = null;
23185 specifier.local = specifier.imported.__clone();
23186 }
23187
23188 if ((node.importKind === "type" || node.importKind === "typeof") && (specifier.importKind === "type" || specifier.importKind === "typeof")) {
23189 this.raise(firstIdentLoc, "`The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements`");
23190 }
23191
23192 if (isBinding) this.checkReservedWord(specifier.local.name, specifier.start, true, true);
23193
23194 this.checkLVal(specifier.local, true, undefined, "import specifier");
23195 node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
23196 };
23197 });
23198
23199 // parse function type parameters - function foo<T>() {}
23200 instance.extend("parseFunctionParams", function (inner) {
23201 return function (node) {
23202 if (this.isRelational("<")) {
23203 node.typeParameters = this.flowParseTypeParameterDeclaration();
23204 }
23205 inner.call(this, node);
23206 };
23207 });
23208
23209 // parse flow type annotations on variable declarator heads - let foo: string = bar
23210 instance.extend("parseVarHead", function (inner) {
23211 return function (decl) {
23212 inner.call(this, decl);
23213 if (this.match(types.colon)) {
23214 decl.id.typeAnnotation = this.flowParseTypeAnnotation();
23215 this.finishNode(decl.id, decl.id.type);
23216 }
23217 };
23218 });
23219
23220 // parse the return type of an async arrow function - let foo = (async (): number => {});
23221 instance.extend("parseAsyncArrowFromCallExpression", function (inner) {
23222 return function (node, call) {
23223 if (this.match(types.colon)) {
23224 var oldNoAnonFunctionType = this.state.noAnonFunctionType;
23225 this.state.noAnonFunctionType = true;
23226 node.returnType = this.flowParseTypeAnnotation();
23227 this.state.noAnonFunctionType = oldNoAnonFunctionType;
23228 }
23229
23230 return inner.call(this, node, call);
23231 };
23232 });
23233
23234 // todo description
23235 instance.extend("shouldParseAsyncArrow", function (inner) {
23236 return function () {
23237 return this.match(types.colon) || inner.call(this);
23238 };
23239 });
23240
23241 // We need to support type parameter declarations for arrow functions. This
23242 // is tricky. There are three situations we need to handle
23243 //
23244 // 1. This is either JSX or an arrow function. We'll try JSX first. If that
23245 // fails, we'll try an arrow function. If that fails, we'll throw the JSX
23246 // error.
23247 // 2. This is an arrow function. We'll parse the type parameter declaration,
23248 // parse the rest, make sure the rest is an arrow function, and go from
23249 // there
23250 // 3. This is neither. Just call the inner function
23251 instance.extend("parseMaybeAssign", function (inner) {
23252 return function () {
23253 var jsxError = null;
23254
23255 for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
23256 args[_key4] = arguments[_key4];
23257 }
23258
23259 if (types.jsxTagStart && this.match(types.jsxTagStart)) {
23260 var state = this.state.clone();
23261 try {
23262 return inner.apply(this, args);
23263 } catch (err) {
23264 if (err instanceof SyntaxError) {
23265 this.state = state;
23266 jsxError = err;
23267 } else {
23268 // istanbul ignore next: no such error is expected
23269 throw err;
23270 }
23271 }
23272 }
23273
23274 // Need to push something onto the context to stop
23275 // the JSX plugin from messing with the tokens
23276 this.state.context.push(types$1.parenExpression);
23277 if (jsxError != null || this.isRelational("<")) {
23278 var arrowExpression = void 0;
23279 var typeParameters = void 0;
23280 try {
23281 typeParameters = this.flowParseTypeParameterDeclaration();
23282
23283 arrowExpression = inner.apply(this, args);
23284 arrowExpression.typeParameters = typeParameters;
23285 arrowExpression.start = typeParameters.start;
23286 arrowExpression.loc.start = typeParameters.loc.start;
23287 } catch (err) {
23288 throw jsxError || err;
23289 }
23290
23291 if (arrowExpression.type === "ArrowFunctionExpression") {
23292 return arrowExpression;
23293 } else if (jsxError != null) {
23294 throw jsxError;
23295 } else {
23296 this.raise(typeParameters.start, "Expected an arrow function after this type parameter declaration");
23297 }
23298 }
23299 this.state.context.pop();
23300
23301 return inner.apply(this, args);
23302 };
23303 });
23304
23305 // handle return types for arrow functions
23306 instance.extend("parseArrow", function (inner) {
23307 return function (node) {
23308 if (this.match(types.colon)) {
23309 var state = this.state.clone();
23310 try {
23311 var oldNoAnonFunctionType = this.state.noAnonFunctionType;
23312 this.state.noAnonFunctionType = true;
23313 var returnType = this.flowParseTypeAndPredicateAnnotation();
23314 this.state.noAnonFunctionType = oldNoAnonFunctionType;
23315
23316 if (this.canInsertSemicolon()) this.unexpected();
23317 if (!this.match(types.arrow)) this.unexpected();
23318 // assign after it is clear it is an arrow
23319 node.returnType = returnType;
23320 } catch (err) {
23321 if (err instanceof SyntaxError) {
23322 this.state = state;
23323 } else {
23324 // istanbul ignore next: no such error is expected
23325 throw err;
23326 }
23327 }
23328 }
23329
23330 return inner.call(this, node);
23331 };
23332 });
23333
23334 instance.extend("shouldParseArrow", function (inner) {
23335 return function () {
23336 return this.match(types.colon) || inner.call(this);
23337 };
23338 });
23339
23340 instance.extend("isClassMutatorStarter", function (inner) {
23341 return function () {
23342 if (this.isRelational("<")) {
23343 return true;
23344 } else {
23345 return inner.call(this);
23346 }
23347 };
23348 });
23349};
23350
23351// Adapted from String.fromcodepoint to export the function without modifying String
23352/*! https://mths.be/fromcodepoint v0.2.1 by @mathias */
23353
23354// The MIT License (MIT)
23355// Copyright (c) Mathias Bynens
23356//
23357// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
23358// associated documentation files (the "Software"), to deal in the Software without restriction,
23359// including without limitation the rights to use, copy, modify, merge, publish, distribute,
23360// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
23361// furnished to do so, subject to the following conditions:
23362//
23363// The above copyright notice and this permission notice shall be included in all copies or
23364// substantial portions of the Software.
23365//
23366// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
23367// NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23368// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
23369// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23370// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23371
23372var fromCodePoint = String.fromCodePoint;
23373
23374if (!fromCodePoint) {
23375 var stringFromCharCode = String.fromCharCode;
23376 var floor = Math.floor;
23377 fromCodePoint = function fromCodePoint() {
23378 var MAX_SIZE = 0x4000;
23379 var codeUnits = [];
23380 var highSurrogate = void 0;
23381 var lowSurrogate = void 0;
23382 var index = -1;
23383 var length = arguments.length;
23384 if (!length) {
23385 return "";
23386 }
23387 var result = "";
23388 while (++index < length) {
23389 var codePoint = Number(arguments[index]);
23390 if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
23391 codePoint < 0 || // not a valid Unicode code point
23392 codePoint > 0x10FFFF || // not a valid Unicode code point
23393 floor(codePoint) != codePoint // not an integer
23394 ) {
23395 throw RangeError("Invalid code point: " + codePoint);
23396 }
23397 if (codePoint <= 0xFFFF) {
23398 // BMP code point
23399 codeUnits.push(codePoint);
23400 } else {
23401 // Astral code point; split in surrogate halves
23402 // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
23403 codePoint -= 0x10000;
23404 highSurrogate = (codePoint >> 10) + 0xD800;
23405 lowSurrogate = codePoint % 0x400 + 0xDC00;
23406 codeUnits.push(highSurrogate, lowSurrogate);
23407 }
23408 if (index + 1 == length || codeUnits.length > MAX_SIZE) {
23409 result += stringFromCharCode.apply(null, codeUnits);
23410 codeUnits.length = 0;
23411 }
23412 }
23413 return result;
23414 };
23415}
23416
23417var fromCodePoint$1 = fromCodePoint;
23418
23419var XHTMLEntities = {
23420 quot: "\"",
23421 amp: "&",
23422 apos: "'",
23423 lt: "<",
23424 gt: ">",
23425 nbsp: "\xA0",
23426 iexcl: "\xA1",
23427 cent: "\xA2",
23428 pound: "\xA3",
23429 curren: "\xA4",
23430 yen: "\xA5",
23431 brvbar: "\xA6",
23432 sect: "\xA7",
23433 uml: "\xA8",
23434 copy: "\xA9",
23435 ordf: "\xAA",
23436 laquo: "\xAB",
23437 not: "\xAC",
23438 shy: "\xAD",
23439 reg: "\xAE",
23440 macr: "\xAF",
23441 deg: "\xB0",
23442 plusmn: "\xB1",
23443 sup2: "\xB2",
23444 sup3: "\xB3",
23445 acute: "\xB4",
23446 micro: "\xB5",
23447 para: "\xB6",
23448 middot: "\xB7",
23449 cedil: "\xB8",
23450 sup1: "\xB9",
23451 ordm: "\xBA",
23452 raquo: "\xBB",
23453 frac14: "\xBC",
23454 frac12: "\xBD",
23455 frac34: "\xBE",
23456 iquest: "\xBF",
23457 Agrave: "\xC0",
23458 Aacute: "\xC1",
23459 Acirc: "\xC2",
23460 Atilde: "\xC3",
23461 Auml: "\xC4",
23462 Aring: "\xC5",
23463 AElig: "\xC6",
23464 Ccedil: "\xC7",
23465 Egrave: "\xC8",
23466 Eacute: "\xC9",
23467 Ecirc: "\xCA",
23468 Euml: "\xCB",
23469 Igrave: "\xCC",
23470 Iacute: "\xCD",
23471 Icirc: "\xCE",
23472 Iuml: "\xCF",
23473 ETH: "\xD0",
23474 Ntilde: "\xD1",
23475 Ograve: "\xD2",
23476 Oacute: "\xD3",
23477 Ocirc: "\xD4",
23478 Otilde: "\xD5",
23479 Ouml: "\xD6",
23480 times: "\xD7",
23481 Oslash: "\xD8",
23482 Ugrave: "\xD9",
23483 Uacute: "\xDA",
23484 Ucirc: "\xDB",
23485 Uuml: "\xDC",
23486 Yacute: "\xDD",
23487 THORN: "\xDE",
23488 szlig: "\xDF",
23489 agrave: "\xE0",
23490 aacute: "\xE1",
23491 acirc: "\xE2",
23492 atilde: "\xE3",
23493 auml: "\xE4",
23494 aring: "\xE5",
23495 aelig: "\xE6",
23496 ccedil: "\xE7",
23497 egrave: "\xE8",
23498 eacute: "\xE9",
23499 ecirc: "\xEA",
23500 euml: "\xEB",
23501 igrave: "\xEC",
23502 iacute: "\xED",
23503 icirc: "\xEE",
23504 iuml: "\xEF",
23505 eth: "\xF0",
23506 ntilde: "\xF1",
23507 ograve: "\xF2",
23508 oacute: "\xF3",
23509 ocirc: "\xF4",
23510 otilde: "\xF5",
23511 ouml: "\xF6",
23512 divide: "\xF7",
23513 oslash: "\xF8",
23514 ugrave: "\xF9",
23515 uacute: "\xFA",
23516 ucirc: "\xFB",
23517 uuml: "\xFC",
23518 yacute: "\xFD",
23519 thorn: "\xFE",
23520 yuml: "\xFF",
23521 OElig: "\u0152",
23522 oelig: "\u0153",
23523 Scaron: "\u0160",
23524 scaron: "\u0161",
23525 Yuml: "\u0178",
23526 fnof: "\u0192",
23527 circ: "\u02C6",
23528 tilde: "\u02DC",
23529 Alpha: "\u0391",
23530 Beta: "\u0392",
23531 Gamma: "\u0393",
23532 Delta: "\u0394",
23533 Epsilon: "\u0395",
23534 Zeta: "\u0396",
23535 Eta: "\u0397",
23536 Theta: "\u0398",
23537 Iota: "\u0399",
23538 Kappa: "\u039A",
23539 Lambda: "\u039B",
23540 Mu: "\u039C",
23541 Nu: "\u039D",
23542 Xi: "\u039E",
23543 Omicron: "\u039F",
23544 Pi: "\u03A0",
23545 Rho: "\u03A1",
23546 Sigma: "\u03A3",
23547 Tau: "\u03A4",
23548 Upsilon: "\u03A5",
23549 Phi: "\u03A6",
23550 Chi: "\u03A7",
23551 Psi: "\u03A8",
23552 Omega: "\u03A9",
23553 alpha: "\u03B1",
23554 beta: "\u03B2",
23555 gamma: "\u03B3",
23556 delta: "\u03B4",
23557 epsilon: "\u03B5",
23558 zeta: "\u03B6",
23559 eta: "\u03B7",
23560 theta: "\u03B8",
23561 iota: "\u03B9",
23562 kappa: "\u03BA",
23563 lambda: "\u03BB",
23564 mu: "\u03BC",
23565 nu: "\u03BD",
23566 xi: "\u03BE",
23567 omicron: "\u03BF",
23568 pi: "\u03C0",
23569 rho: "\u03C1",
23570 sigmaf: "\u03C2",
23571 sigma: "\u03C3",
23572 tau: "\u03C4",
23573 upsilon: "\u03C5",
23574 phi: "\u03C6",
23575 chi: "\u03C7",
23576 psi: "\u03C8",
23577 omega: "\u03C9",
23578 thetasym: "\u03D1",
23579 upsih: "\u03D2",
23580 piv: "\u03D6",
23581 ensp: "\u2002",
23582 emsp: "\u2003",
23583 thinsp: "\u2009",
23584 zwnj: "\u200C",
23585 zwj: "\u200D",
23586 lrm: "\u200E",
23587 rlm: "\u200F",
23588 ndash: "\u2013",
23589 mdash: "\u2014",
23590 lsquo: "\u2018",
23591 rsquo: "\u2019",
23592 sbquo: "\u201A",
23593 ldquo: "\u201C",
23594 rdquo: "\u201D",
23595 bdquo: "\u201E",
23596 dagger: "\u2020",
23597 Dagger: "\u2021",
23598 bull: "\u2022",
23599 hellip: "\u2026",
23600 permil: "\u2030",
23601 prime: "\u2032",
23602 Prime: "\u2033",
23603 lsaquo: "\u2039",
23604 rsaquo: "\u203A",
23605 oline: "\u203E",
23606 frasl: "\u2044",
23607 euro: "\u20AC",
23608 image: "\u2111",
23609 weierp: "\u2118",
23610 real: "\u211C",
23611 trade: "\u2122",
23612 alefsym: "\u2135",
23613 larr: "\u2190",
23614 uarr: "\u2191",
23615 rarr: "\u2192",
23616 darr: "\u2193",
23617 harr: "\u2194",
23618 crarr: "\u21B5",
23619 lArr: "\u21D0",
23620 uArr: "\u21D1",
23621 rArr: "\u21D2",
23622 dArr: "\u21D3",
23623 hArr: "\u21D4",
23624 forall: "\u2200",
23625 part: "\u2202",
23626 exist: "\u2203",
23627 empty: "\u2205",
23628 nabla: "\u2207",
23629 isin: "\u2208",
23630 notin: "\u2209",
23631 ni: "\u220B",
23632 prod: "\u220F",
23633 sum: "\u2211",
23634 minus: "\u2212",
23635 lowast: "\u2217",
23636 radic: "\u221A",
23637 prop: "\u221D",
23638 infin: "\u221E",
23639 ang: "\u2220",
23640 and: "\u2227",
23641 or: "\u2228",
23642 cap: "\u2229",
23643 cup: "\u222A",
23644 "int": "\u222B",
23645 there4: "\u2234",
23646 sim: "\u223C",
23647 cong: "\u2245",
23648 asymp: "\u2248",
23649 ne: "\u2260",
23650 equiv: "\u2261",
23651 le: "\u2264",
23652 ge: "\u2265",
23653 sub: "\u2282",
23654 sup: "\u2283",
23655 nsub: "\u2284",
23656 sube: "\u2286",
23657 supe: "\u2287",
23658 oplus: "\u2295",
23659 otimes: "\u2297",
23660 perp: "\u22A5",
23661 sdot: "\u22C5",
23662 lceil: "\u2308",
23663 rceil: "\u2309",
23664 lfloor: "\u230A",
23665 rfloor: "\u230B",
23666 lang: "\u2329",
23667 rang: "\u232A",
23668 loz: "\u25CA",
23669 spades: "\u2660",
23670 clubs: "\u2663",
23671 hearts: "\u2665",
23672 diams: "\u2666"
23673};
23674
23675var HEX_NUMBER = /^[\da-fA-F]+$/;
23676var DECIMAL_NUMBER = /^\d+$/;
23677
23678types$1.j_oTag = new TokContext("<tag", false);
23679types$1.j_cTag = new TokContext("</tag", false);
23680types$1.j_expr = new TokContext("<tag>...</tag>", true, true);
23681
23682types.jsxName = new TokenType("jsxName");
23683types.jsxText = new TokenType("jsxText", { beforeExpr: true });
23684types.jsxTagStart = new TokenType("jsxTagStart", { startsExpr: true });
23685types.jsxTagEnd = new TokenType("jsxTagEnd");
23686
23687types.jsxTagStart.updateContext = function () {
23688 this.state.context.push(types$1.j_expr); // treat as beginning of JSX expression
23689 this.state.context.push(types$1.j_oTag); // start opening tag context
23690 this.state.exprAllowed = false;
23691};
23692
23693types.jsxTagEnd.updateContext = function (prevType) {
23694 var out = this.state.context.pop();
23695 if (out === types$1.j_oTag && prevType === types.slash || out === types$1.j_cTag) {
23696 this.state.context.pop();
23697 this.state.exprAllowed = this.curContext() === types$1.j_expr;
23698 } else {
23699 this.state.exprAllowed = true;
23700 }
23701};
23702
23703var pp$9 = Parser.prototype;
23704
23705// Reads inline JSX contents token.
23706
23707pp$9.jsxReadToken = function () {
23708 var out = "";
23709 var chunkStart = this.state.pos;
23710 for (;;) {
23711 if (this.state.pos >= this.input.length) {
23712 this.raise(this.state.start, "Unterminated JSX contents");
23713 }
23714
23715 var ch = this.input.charCodeAt(this.state.pos);
23716
23717 switch (ch) {
23718 case 60: // "<"
23719 case 123:
23720 // "{"
23721 if (this.state.pos === this.state.start) {
23722 if (ch === 60 && this.state.exprAllowed) {
23723 ++this.state.pos;
23724 return this.finishToken(types.jsxTagStart);
23725 }
23726 return this.getTokenFromCode(ch);
23727 }
23728 out += this.input.slice(chunkStart, this.state.pos);
23729 return this.finishToken(types.jsxText, out);
23730
23731 case 38:
23732 // "&"
23733 out += this.input.slice(chunkStart, this.state.pos);
23734 out += this.jsxReadEntity();
23735 chunkStart = this.state.pos;
23736 break;
23737
23738 default:
23739 if (isNewLine(ch)) {
23740 out += this.input.slice(chunkStart, this.state.pos);
23741 out += this.jsxReadNewLine(true);
23742 chunkStart = this.state.pos;
23743 } else {
23744 ++this.state.pos;
23745 }
23746 }
23747 }
23748};
23749
23750pp$9.jsxReadNewLine = function (normalizeCRLF) {
23751 var ch = this.input.charCodeAt(this.state.pos);
23752 var out = void 0;
23753 ++this.state.pos;
23754 if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
23755 ++this.state.pos;
23756 out = normalizeCRLF ? "\n" : "\r\n";
23757 } else {
23758 out = String.fromCharCode(ch);
23759 }
23760 ++this.state.curLine;
23761 this.state.lineStart = this.state.pos;
23762
23763 return out;
23764};
23765
23766pp$9.jsxReadString = function (quote) {
23767 var out = "";
23768 var chunkStart = ++this.state.pos;
23769 for (;;) {
23770 if (this.state.pos >= this.input.length) {
23771 this.raise(this.state.start, "Unterminated string constant");
23772 }
23773
23774 var ch = this.input.charCodeAt(this.state.pos);
23775 if (ch === quote) break;
23776 if (ch === 38) {
23777 // "&"
23778 out += this.input.slice(chunkStart, this.state.pos);
23779 out += this.jsxReadEntity();
23780 chunkStart = this.state.pos;
23781 } else if (isNewLine(ch)) {
23782 out += this.input.slice(chunkStart, this.state.pos);
23783 out += this.jsxReadNewLine(false);
23784 chunkStart = this.state.pos;
23785 } else {
23786 ++this.state.pos;
23787 }
23788 }
23789 out += this.input.slice(chunkStart, this.state.pos++);
23790 return this.finishToken(types.string, out);
23791};
23792
23793pp$9.jsxReadEntity = function () {
23794 var str = "";
23795 var count = 0;
23796 var entity = void 0;
23797 var ch = this.input[this.state.pos];
23798
23799 var startPos = ++this.state.pos;
23800 while (this.state.pos < this.input.length && count++ < 10) {
23801 ch = this.input[this.state.pos++];
23802 if (ch === ";") {
23803 if (str[0] === "#") {
23804 if (str[1] === "x") {
23805 str = str.substr(2);
23806 if (HEX_NUMBER.test(str)) entity = fromCodePoint$1(parseInt(str, 16));
23807 } else {
23808 str = str.substr(1);
23809 if (DECIMAL_NUMBER.test(str)) entity = fromCodePoint$1(parseInt(str, 10));
23810 }
23811 } else {
23812 entity = XHTMLEntities[str];
23813 }
23814 break;
23815 }
23816 str += ch;
23817 }
23818 if (!entity) {
23819 this.state.pos = startPos;
23820 return "&";
23821 }
23822 return entity;
23823};
23824
23825// Read a JSX identifier (valid tag or attribute name).
23826//
23827// Optimized version since JSX identifiers can"t contain
23828// escape characters and so can be read as single slice.
23829// Also assumes that first character was already checked
23830// by isIdentifierStart in readToken.
23831
23832pp$9.jsxReadWord = function () {
23833 var ch = void 0;
23834 var start = this.state.pos;
23835 do {
23836 ch = this.input.charCodeAt(++this.state.pos);
23837 } while (isIdentifierChar(ch) || ch === 45); // "-"
23838 return this.finishToken(types.jsxName, this.input.slice(start, this.state.pos));
23839};
23840
23841// Transforms JSX element name to string.
23842
23843function getQualifiedJSXName(object) {
23844 if (object.type === "JSXIdentifier") {
23845 return object.name;
23846 }
23847
23848 if (object.type === "JSXNamespacedName") {
23849 return object.namespace.name + ":" + object.name.name;
23850 }
23851
23852 if (object.type === "JSXMemberExpression") {
23853 return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
23854 }
23855}
23856
23857// Parse next token as JSX identifier
23858
23859pp$9.jsxParseIdentifier = function () {
23860 var node = this.startNode();
23861 if (this.match(types.jsxName)) {
23862 node.name = this.state.value;
23863 } else if (this.state.type.keyword) {
23864 node.name = this.state.type.keyword;
23865 } else {
23866 this.unexpected();
23867 }
23868 this.next();
23869 return this.finishNode(node, "JSXIdentifier");
23870};
23871
23872// Parse namespaced identifier.
23873
23874pp$9.jsxParseNamespacedName = function () {
23875 var startPos = this.state.start;
23876 var startLoc = this.state.startLoc;
23877 var name = this.jsxParseIdentifier();
23878 if (!this.eat(types.colon)) return name;
23879
23880 var node = this.startNodeAt(startPos, startLoc);
23881 node.namespace = name;
23882 node.name = this.jsxParseIdentifier();
23883 return this.finishNode(node, "JSXNamespacedName");
23884};
23885
23886// Parses element name in any form - namespaced, member
23887// or single identifier.
23888
23889pp$9.jsxParseElementName = function () {
23890 var startPos = this.state.start;
23891 var startLoc = this.state.startLoc;
23892 var node = this.jsxParseNamespacedName();
23893 while (this.eat(types.dot)) {
23894 var newNode = this.startNodeAt(startPos, startLoc);
23895 newNode.object = node;
23896 newNode.property = this.jsxParseIdentifier();
23897 node = this.finishNode(newNode, "JSXMemberExpression");
23898 }
23899 return node;
23900};
23901
23902// Parses any type of JSX attribute value.
23903
23904pp$9.jsxParseAttributeValue = function () {
23905 var node = void 0;
23906 switch (this.state.type) {
23907 case types.braceL:
23908 node = this.jsxParseExpressionContainer();
23909 if (node.expression.type === "JSXEmptyExpression") {
23910 this.raise(node.start, "JSX attributes must only be assigned a non-empty expression");
23911 } else {
23912 return node;
23913 }
23914
23915 case types.jsxTagStart:
23916 case types.string:
23917 node = this.parseExprAtom();
23918 node.extra = null;
23919 return node;
23920
23921 default:
23922 this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text");
23923 }
23924};
23925
23926// JSXEmptyExpression is unique type since it doesn't actually parse anything,
23927// and so it should start at the end of last read token (left brace) and finish
23928// at the beginning of the next one (right brace).
23929
23930pp$9.jsxParseEmptyExpression = function () {
23931 var node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc);
23932 return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc);
23933};
23934
23935// Parse JSX spread child
23936
23937pp$9.jsxParseSpreadChild = function () {
23938 var node = this.startNode();
23939 this.expect(types.braceL);
23940 this.expect(types.ellipsis);
23941 node.expression = this.parseExpression();
23942 this.expect(types.braceR);
23943
23944 return this.finishNode(node, "JSXSpreadChild");
23945};
23946
23947// Parses JSX expression enclosed into curly brackets.
23948
23949
23950pp$9.jsxParseExpressionContainer = function () {
23951 var node = this.startNode();
23952 this.next();
23953 if (this.match(types.braceR)) {
23954 node.expression = this.jsxParseEmptyExpression();
23955 } else {
23956 node.expression = this.parseExpression();
23957 }
23958 this.expect(types.braceR);
23959 return this.finishNode(node, "JSXExpressionContainer");
23960};
23961
23962// Parses following JSX attribute name-value pair.
23963
23964pp$9.jsxParseAttribute = function () {
23965 var node = this.startNode();
23966 if (this.eat(types.braceL)) {
23967 this.expect(types.ellipsis);
23968 node.argument = this.parseMaybeAssign();
23969 this.expect(types.braceR);
23970 return this.finishNode(node, "JSXSpreadAttribute");
23971 }
23972 node.name = this.jsxParseNamespacedName();
23973 node.value = this.eat(types.eq) ? this.jsxParseAttributeValue() : null;
23974 return this.finishNode(node, "JSXAttribute");
23975};
23976
23977// Parses JSX opening tag starting after "<".
23978
23979pp$9.jsxParseOpeningElementAt = function (startPos, startLoc) {
23980 var node = this.startNodeAt(startPos, startLoc);
23981 node.attributes = [];
23982 node.name = this.jsxParseElementName();
23983 while (!this.match(types.slash) && !this.match(types.jsxTagEnd)) {
23984 node.attributes.push(this.jsxParseAttribute());
23985 }
23986 node.selfClosing = this.eat(types.slash);
23987 this.expect(types.jsxTagEnd);
23988 return this.finishNode(node, "JSXOpeningElement");
23989};
23990
23991// Parses JSX closing tag starting after "</".
23992
23993pp$9.jsxParseClosingElementAt = function (startPos, startLoc) {
23994 var node = this.startNodeAt(startPos, startLoc);
23995 node.name = this.jsxParseElementName();
23996 this.expect(types.jsxTagEnd);
23997 return this.finishNode(node, "JSXClosingElement");
23998};
23999
24000// Parses entire JSX element, including it"s opening tag
24001// (starting after "<"), attributes, contents and closing tag.
24002
24003pp$9.jsxParseElementAt = function (startPos, startLoc) {
24004 var node = this.startNodeAt(startPos, startLoc);
24005 var children = [];
24006 var openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);
24007 var closingElement = null;
24008
24009 if (!openingElement.selfClosing) {
24010 contents: for (;;) {
24011 switch (this.state.type) {
24012 case types.jsxTagStart:
24013 startPos = this.state.start;startLoc = this.state.startLoc;
24014 this.next();
24015 if (this.eat(types.slash)) {
24016 closingElement = this.jsxParseClosingElementAt(startPos, startLoc);
24017 break contents;
24018 }
24019 children.push(this.jsxParseElementAt(startPos, startLoc));
24020 break;
24021
24022 case types.jsxText:
24023 children.push(this.parseExprAtom());
24024 break;
24025
24026 case types.braceL:
24027 if (this.lookahead().type === types.ellipsis) {
24028 children.push(this.jsxParseSpreadChild());
24029 } else {
24030 children.push(this.jsxParseExpressionContainer());
24031 }
24032
24033 break;
24034
24035 // istanbul ignore next - should never happen
24036 default:
24037 this.unexpected();
24038 }
24039 }
24040
24041 if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
24042 this.raise(closingElement.start, "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">");
24043 }
24044 }
24045
24046 node.openingElement = openingElement;
24047 node.closingElement = closingElement;
24048 node.children = children;
24049 if (this.match(types.relational) && this.state.value === "<") {
24050 this.raise(this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag");
24051 }
24052 return this.finishNode(node, "JSXElement");
24053};
24054
24055// Parses entire JSX element from current position.
24056
24057pp$9.jsxParseElement = function () {
24058 var startPos = this.state.start;
24059 var startLoc = this.state.startLoc;
24060 this.next();
24061 return this.jsxParseElementAt(startPos, startLoc);
24062};
24063
24064var jsxPlugin = function (instance) {
24065 instance.extend("parseExprAtom", function (inner) {
24066 return function (refShortHandDefaultPos) {
24067 if (this.match(types.jsxText)) {
24068 var node = this.parseLiteral(this.state.value, "JSXText");
24069 // https://github.com/babel/babel/issues/2078
24070 node.extra = null;
24071 return node;
24072 } else if (this.match(types.jsxTagStart)) {
24073 return this.jsxParseElement();
24074 } else {
24075 return inner.call(this, refShortHandDefaultPos);
24076 }
24077 };
24078 });
24079
24080 instance.extend("readToken", function (inner) {
24081 return function (code) {
24082 if (this.state.inPropertyName) return inner.call(this, code);
24083
24084 var context = this.curContext();
24085
24086 if (context === types$1.j_expr) {
24087 return this.jsxReadToken();
24088 }
24089
24090 if (context === types$1.j_oTag || context === types$1.j_cTag) {
24091 if (isIdentifierStart(code)) {
24092 return this.jsxReadWord();
24093 }
24094
24095 if (code === 62) {
24096 ++this.state.pos;
24097 return this.finishToken(types.jsxTagEnd);
24098 }
24099
24100 if ((code === 34 || code === 39) && context === types$1.j_oTag) {
24101 return this.jsxReadString(code);
24102 }
24103 }
24104
24105 if (code === 60 && this.state.exprAllowed) {
24106 ++this.state.pos;
24107 return this.finishToken(types.jsxTagStart);
24108 }
24109
24110 return inner.call(this, code);
24111 };
24112 });
24113
24114 instance.extend("updateContext", function (inner) {
24115 return function (prevType) {
24116 if (this.match(types.braceL)) {
24117 var curContext = this.curContext();
24118 if (curContext === types$1.j_oTag) {
24119 this.state.context.push(types$1.braceExpression);
24120 } else if (curContext === types$1.j_expr) {
24121 this.state.context.push(types$1.templateQuasi);
24122 } else {
24123 inner.call(this, prevType);
24124 }
24125 this.state.exprAllowed = true;
24126 } else if (this.match(types.slash) && prevType === types.jsxTagStart) {
24127 this.state.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore
24128 this.state.context.push(types$1.j_cTag); // reconsider as closing tag context
24129 this.state.exprAllowed = false;
24130 } else {
24131 return inner.call(this, prevType);
24132 }
24133 };
24134 });
24135};
24136
24137plugins.estree = estreePlugin;
24138plugins.flow = flowPlugin;
24139plugins.jsx = jsxPlugin;
24140
24141function parse(input, options) {
24142 return new Parser(options, input).parse();
24143}
24144
24145function parseExpression(input, options) {
24146 var parser = new Parser(options, input);
24147 if (parser.options.strictMode) {
24148 parser.state.strict = true;
24149 }
24150 return parser.getExpression();
24151}
24152
24153exports.parse = parse;
24154exports.parseExpression = parseExpression;
24155exports.tokTypes = types;
24156
24157},{}],117:[function(require,module,exports){
24158module.exports = balanced;
24159function balanced(a, b, str) {
24160 if (a instanceof RegExp) a = maybeMatch(a, str);
24161 if (b instanceof RegExp) b = maybeMatch(b, str);
24162
24163 var r = range(a, b, str);
24164
24165 return r && {
24166 start: r[0],
24167 end: r[1],
24168 pre: str.slice(0, r[0]),
24169 body: str.slice(r[0] + a.length, r[1]),
24170 post: str.slice(r[1] + b.length)
24171 };
24172}
24173
24174function maybeMatch(reg, str) {
24175 var m = str.match(reg);
24176 return m ? m[0] : null;
24177}
24178
24179balanced.range = range;
24180function range(a, b, str) {
24181 var begs, beg, left, right, result;
24182 var ai = str.indexOf(a);
24183 var bi = str.indexOf(b, ai + 1);
24184 var i = ai;
24185
24186 if (ai >= 0 && bi > 0) {
24187 begs = [];
24188 left = str.length;
24189
24190 while (i >= 0 && !result) {
24191 if (i == ai) {
24192 begs.push(i);
24193 ai = str.indexOf(a, i + 1);
24194 } else if (begs.length == 1) {
24195 result = [ begs.pop(), bi ];
24196 } else {
24197 beg = begs.pop();
24198 if (beg < left) {
24199 left = beg;
24200 right = bi;
24201 }
24202
24203 bi = str.indexOf(b, i + 1);
24204 }
24205
24206 i = ai < bi && ai >= 0 ? ai : bi;
24207 }
24208
24209 if (begs.length) {
24210 result = [ left, right ];
24211 }
24212 }
24213
24214 return result;
24215}
24216
24217},{}],118:[function(require,module,exports){
24218'use strict'
24219
24220exports.byteLength = byteLength
24221exports.toByteArray = toByteArray
24222exports.fromByteArray = fromByteArray
24223
24224var lookup = []
24225var revLookup = []
24226var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
24227
24228var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
24229for (var i = 0, len = code.length; i < len; ++i) {
24230 lookup[i] = code[i]
24231 revLookup[code.charCodeAt(i)] = i
24232}
24233
24234revLookup['-'.charCodeAt(0)] = 62
24235revLookup['_'.charCodeAt(0)] = 63
24236
24237function placeHoldersCount (b64) {
24238 var len = b64.length
24239 if (len % 4 > 0) {
24240 throw new Error('Invalid string. Length must be a multiple of 4')
24241 }
24242
24243 // the number of equal signs (place holders)
24244 // if there are two placeholders, than the two characters before it
24245 // represent one byte
24246 // if there is only one, then the three characters before it represent 2 bytes
24247 // this is just a cheap hack to not do indexOf twice
24248 return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
24249}
24250
24251function byteLength (b64) {
24252 // base64 is 4/3 + up to two characters of the original data
24253 return b64.length * 3 / 4 - placeHoldersCount(b64)
24254}
24255
24256function toByteArray (b64) {
24257 var i, j, l, tmp, placeHolders, arr
24258 var len = b64.length
24259 placeHolders = placeHoldersCount(b64)
24260
24261 arr = new Arr(len * 3 / 4 - placeHolders)
24262
24263 // if there are placeholders, only get up to the last complete 4 chars
24264 l = placeHolders > 0 ? len - 4 : len
24265
24266 var L = 0
24267
24268 for (i = 0, j = 0; i < l; i += 4, j += 3) {
24269 tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
24270 arr[L++] = (tmp >> 16) & 0xFF
24271 arr[L++] = (tmp >> 8) & 0xFF
24272 arr[L++] = tmp & 0xFF
24273 }
24274
24275 if (placeHolders === 2) {
24276 tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
24277 arr[L++] = tmp & 0xFF
24278 } else if (placeHolders === 1) {
24279 tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
24280 arr[L++] = (tmp >> 8) & 0xFF
24281 arr[L++] = tmp & 0xFF
24282 }
24283
24284 return arr
24285}
24286
24287function tripletToBase64 (num) {
24288 return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
24289}
24290
24291function encodeChunk (uint8, start, end) {
24292 var tmp
24293 var output = []
24294 for (var i = start; i < end; i += 3) {
24295 tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
24296 output.push(tripletToBase64(tmp))
24297 }
24298 return output.join('')
24299}
24300
24301function fromByteArray (uint8) {
24302 var tmp
24303 var len = uint8.length
24304 var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
24305 var output = ''
24306 var parts = []
24307 var maxChunkLength = 16383 // must be multiple of 3
24308
24309 // go through the array every three bytes, we'll deal with trailing stuff later
24310 for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
24311 parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
24312 }
24313
24314 // pad the end with zeros, but make sure to not forget the extra bytes
24315 if (extraBytes === 1) {
24316 tmp = uint8[len - 1]
24317 output += lookup[tmp >> 2]
24318 output += lookup[(tmp << 4) & 0x3F]
24319 output += '=='
24320 } else if (extraBytes === 2) {
24321 tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
24322 output += lookup[tmp >> 10]
24323 output += lookup[(tmp >> 4) & 0x3F]
24324 output += lookup[(tmp << 2) & 0x3F]
24325 output += '='
24326 }
24327
24328 parts.push(output)
24329
24330 return parts.join('')
24331}
24332
24333},{}],119:[function(require,module,exports){
24334var concatMap = require('concat-map');
24335var balanced = require('balanced-match');
24336
24337module.exports = expandTop;
24338
24339var escSlash = '\0SLASH'+Math.random()+'\0';
24340var escOpen = '\0OPEN'+Math.random()+'\0';
24341var escClose = '\0CLOSE'+Math.random()+'\0';
24342var escComma = '\0COMMA'+Math.random()+'\0';
24343var escPeriod = '\0PERIOD'+Math.random()+'\0';
24344
24345function numeric(str) {
24346 return parseInt(str, 10) == str
24347 ? parseInt(str, 10)
24348 : str.charCodeAt(0);
24349}
24350
24351function escapeBraces(str) {
24352 return str.split('\\\\').join(escSlash)
24353 .split('\\{').join(escOpen)
24354 .split('\\}').join(escClose)
24355 .split('\\,').join(escComma)
24356 .split('\\.').join(escPeriod);
24357}
24358
24359function unescapeBraces(str) {
24360 return str.split(escSlash).join('\\')
24361 .split(escOpen).join('{')
24362 .split(escClose).join('}')
24363 .split(escComma).join(',')
24364 .split(escPeriod).join('.');
24365}
24366
24367
24368// Basically just str.split(","), but handling cases
24369// where we have nested braced sections, which should be
24370// treated as individual members, like {a,{b,c},d}
24371function parseCommaParts(str) {
24372 if (!str)
24373 return [''];
24374
24375 var parts = [];
24376 var m = balanced('{', '}', str);
24377
24378 if (!m)
24379 return str.split(',');
24380
24381 var pre = m.pre;
24382 var body = m.body;
24383 var post = m.post;
24384 var p = pre.split(',');
24385
24386 p[p.length-1] += '{' + body + '}';
24387 var postParts = parseCommaParts(post);
24388 if (post.length) {
24389 p[p.length-1] += postParts.shift();
24390 p.push.apply(p, postParts);
24391 }
24392
24393 parts.push.apply(parts, p);
24394
24395 return parts;
24396}
24397
24398function expandTop(str) {
24399 if (!str)
24400 return [];
24401
24402 // I don't know why Bash 4.3 does this, but it does.
24403 // Anything starting with {} will have the first two bytes preserved
24404 // but *only* at the top level, so {},a}b will not expand to anything,
24405 // but a{},b}c will be expanded to [a}c,abc].
24406 // One could argue that this is a bug in Bash, but since the goal of
24407 // this module is to match Bash's rules, we escape a leading {}
24408 if (str.substr(0, 2) === '{}') {
24409 str = '\\{\\}' + str.substr(2);
24410 }
24411
24412 return expand(escapeBraces(str), true).map(unescapeBraces);
24413}
24414
24415function identity(e) {
24416 return e;
24417}
24418
24419function embrace(str) {
24420 return '{' + str + '}';
24421}
24422function isPadded(el) {
24423 return /^-?0\d/.test(el);
24424}
24425
24426function lte(i, y) {
24427 return i <= y;
24428}
24429function gte(i, y) {
24430 return i >= y;
24431}
24432
24433function expand(str, isTop) {
24434 var expansions = [];
24435
24436 var m = balanced('{', '}', str);
24437 if (!m || /\$$/.test(m.pre)) return [str];
24438
24439 var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
24440 var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
24441 var isSequence = isNumericSequence || isAlphaSequence;
24442 var isOptions = /^(.*,)+(.+)?$/.test(m.body);
24443 if (!isSequence && !isOptions) {
24444 // {a},b}
24445 if (m.post.match(/,.*\}/)) {
24446 str = m.pre + '{' + m.body + escClose + m.post;
24447 return expand(str);
24448 }
24449 return [str];
24450 }
24451
24452 var n;
24453 if (isSequence) {
24454 n = m.body.split(/\.\./);
24455 } else {
24456 n = parseCommaParts(m.body);
24457 if (n.length === 1) {
24458 // x{{a,b}}y ==> x{a}y x{b}y
24459 n = expand(n[0], false).map(embrace);
24460 if (n.length === 1) {
24461 var post = m.post.length
24462 ? expand(m.post, false)
24463 : [''];
24464 return post.map(function(p) {
24465 return m.pre + n[0] + p;
24466 });
24467 }
24468 }
24469 }
24470
24471 // at this point, n is the parts, and we know it's not a comma set
24472 // with a single entry.
24473
24474 // no need to expand pre, since it is guaranteed to be free of brace-sets
24475 var pre = m.pre;
24476 var post = m.post.length
24477 ? expand(m.post, false)
24478 : [''];
24479
24480 var N;
24481
24482 if (isSequence) {
24483 var x = numeric(n[0]);
24484 var y = numeric(n[1]);
24485 var width = Math.max(n[0].length, n[1].length)
24486 var incr = n.length == 3
24487 ? Math.abs(numeric(n[2]))
24488 : 1;
24489 var test = lte;
24490 var reverse = y < x;
24491 if (reverse) {
24492 incr *= -1;
24493 test = gte;
24494 }
24495 var pad = n.some(isPadded);
24496
24497 N = [];
24498
24499 for (var i = x; test(i, y); i += incr) {
24500 var c;
24501 if (isAlphaSequence) {
24502 c = String.fromCharCode(i);
24503 if (c === '\\')
24504 c = '';
24505 } else {
24506 c = String(i);
24507 if (pad) {
24508 var need = width - c.length;
24509 if (need > 0) {
24510 var z = new Array(need + 1).join('0');
24511 if (i < 0)
24512 c = '-' + z + c.slice(1);
24513 else
24514 c = z + c;
24515 }
24516 }
24517 }
24518 N.push(c);
24519 }
24520 } else {
24521 N = concatMap(n, function(el) { return expand(el, false) });
24522 }
24523
24524 for (var j = 0; j < N.length; j++) {
24525 for (var k = 0; k < post.length; k++) {
24526 var expansion = pre + N[j] + post[k];
24527 if (!isTop || isSequence || expansion)
24528 expansions.push(expansion);
24529 }
24530 }
24531
24532 return expansions;
24533}
24534
24535
24536},{"balanced-match":117,"concat-map":123}],120:[function(require,module,exports){
24537
24538},{}],121:[function(require,module,exports){
24539(function (global){
24540/*!
24541 * The buffer module from node.js, for the browser.
24542 *
24543 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
24544 * @license MIT
24545 */
24546/* eslint-disable no-proto */
24547
24548'use strict'
24549
24550var base64 = require('base64-js')
24551var ieee754 = require('ieee754')
24552var isArray = require('isarray')
24553
24554exports.Buffer = Buffer
24555exports.SlowBuffer = SlowBuffer
24556exports.INSPECT_MAX_BYTES = 50
24557
24558/**
24559 * If `Buffer.TYPED_ARRAY_SUPPORT`:
24560 * === true Use Uint8Array implementation (fastest)
24561 * === false Use Object implementation (most compatible, even IE6)
24562 *
24563 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
24564 * Opera 11.6+, iOS 4.2+.
24565 *
24566 * Due to various browser bugs, sometimes the Object implementation will be used even
24567 * when the browser supports typed arrays.
24568 *
24569 * Note:
24570 *
24571 * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
24572 * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
24573 *
24574 * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
24575 *
24576 * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
24577 * incorrect length in some situations.
24578
24579 * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
24580 * get the Object implementation, which is slower but behaves correctly.
24581 */
24582Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
24583 ? global.TYPED_ARRAY_SUPPORT
24584 : typedArraySupport()
24585
24586/*
24587 * Export kMaxLength after typed array support is determined.
24588 */
24589exports.kMaxLength = kMaxLength()
24590
24591function typedArraySupport () {
24592 try {
24593 var arr = new Uint8Array(1)
24594 arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
24595 return arr.foo() === 42 && // typed array instances can be augmented
24596 typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
24597 arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
24598 } catch (e) {
24599 return false
24600 }
24601}
24602
24603function kMaxLength () {
24604 return Buffer.TYPED_ARRAY_SUPPORT
24605 ? 0x7fffffff
24606 : 0x3fffffff
24607}
24608
24609function createBuffer (that, length) {
24610 if (kMaxLength() < length) {
24611 throw new RangeError('Invalid typed array length')
24612 }
24613 if (Buffer.TYPED_ARRAY_SUPPORT) {
24614 // Return an augmented `Uint8Array` instance, for best performance
24615 that = new Uint8Array(length)
24616 that.__proto__ = Buffer.prototype
24617 } else {
24618 // Fallback: Return an object instance of the Buffer class
24619 if (that === null) {
24620 that = new Buffer(length)
24621 }
24622 that.length = length
24623 }
24624
24625 return that
24626}
24627
24628/**
24629 * The Buffer constructor returns instances of `Uint8Array` that have their
24630 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
24631 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
24632 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
24633 * returns a single octet.
24634 *
24635 * The `Uint8Array` prototype remains unmodified.
24636 */
24637
24638function Buffer (arg, encodingOrOffset, length) {
24639 if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
24640 return new Buffer(arg, encodingOrOffset, length)
24641 }
24642
24643 // Common case.
24644 if (typeof arg === 'number') {
24645 if (typeof encodingOrOffset === 'string') {
24646 throw new Error(
24647 'If encoding is specified then the first argument must be a string'
24648 )
24649 }
24650 return allocUnsafe(this, arg)
24651 }
24652 return from(this, arg, encodingOrOffset, length)
24653}
24654
24655Buffer.poolSize = 8192 // not used by this implementation
24656
24657// TODO: Legacy, not needed anymore. Remove in next major version.
24658Buffer._augment = function (arr) {
24659 arr.__proto__ = Buffer.prototype
24660 return arr
24661}
24662
24663function from (that, value, encodingOrOffset, length) {
24664 if (typeof value === 'number') {
24665 throw new TypeError('"value" argument must not be a number')
24666 }
24667
24668 if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
24669 return fromArrayBuffer(that, value, encodingOrOffset, length)
24670 }
24671
24672 if (typeof value === 'string') {
24673 return fromString(that, value, encodingOrOffset)
24674 }
24675
24676 return fromObject(that, value)
24677}
24678
24679/**
24680 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
24681 * if value is a number.
24682 * Buffer.from(str[, encoding])
24683 * Buffer.from(array)
24684 * Buffer.from(buffer)
24685 * Buffer.from(arrayBuffer[, byteOffset[, length]])
24686 **/
24687Buffer.from = function (value, encodingOrOffset, length) {
24688 return from(null, value, encodingOrOffset, length)
24689}
24690
24691if (Buffer.TYPED_ARRAY_SUPPORT) {
24692 Buffer.prototype.__proto__ = Uint8Array.prototype
24693 Buffer.__proto__ = Uint8Array
24694 if (typeof Symbol !== 'undefined' && Symbol.species &&
24695 Buffer[Symbol.species] === Buffer) {
24696 // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
24697 Object.defineProperty(Buffer, Symbol.species, {
24698 value: null,
24699 configurable: true
24700 })
24701 }
24702}
24703
24704function assertSize (size) {
24705 if (typeof size !== 'number') {
24706 throw new TypeError('"size" argument must be a number')
24707 } else if (size < 0) {
24708 throw new RangeError('"size" argument must not be negative')
24709 }
24710}
24711
24712function alloc (that, size, fill, encoding) {
24713 assertSize(size)
24714 if (size <= 0) {
24715 return createBuffer(that, size)
24716 }
24717 if (fill !== undefined) {
24718 // Only pay attention to encoding if it's a string. This
24719 // prevents accidentally sending in a number that would
24720 // be interpretted as a start offset.
24721 return typeof encoding === 'string'
24722 ? createBuffer(that, size).fill(fill, encoding)
24723 : createBuffer(that, size).fill(fill)
24724 }
24725 return createBuffer(that, size)
24726}
24727
24728/**
24729 * Creates a new filled Buffer instance.
24730 * alloc(size[, fill[, encoding]])
24731 **/
24732Buffer.alloc = function (size, fill, encoding) {
24733 return alloc(null, size, fill, encoding)
24734}
24735
24736function allocUnsafe (that, size) {
24737 assertSize(size)
24738 that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
24739 if (!Buffer.TYPED_ARRAY_SUPPORT) {
24740 for (var i = 0; i < size; ++i) {
24741 that[i] = 0
24742 }
24743 }
24744 return that
24745}
24746
24747/**
24748 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
24749 * */
24750Buffer.allocUnsafe = function (size) {
24751 return allocUnsafe(null, size)
24752}
24753/**
24754 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
24755 */
24756Buffer.allocUnsafeSlow = function (size) {
24757 return allocUnsafe(null, size)
24758}
24759
24760function fromString (that, string, encoding) {
24761 if (typeof encoding !== 'string' || encoding === '') {
24762 encoding = 'utf8'
24763 }
24764
24765 if (!Buffer.isEncoding(encoding)) {
24766 throw new TypeError('"encoding" must be a valid string encoding')
24767 }
24768
24769 var length = byteLength(string, encoding) | 0
24770 that = createBuffer(that, length)
24771
24772 var actual = that.write(string, encoding)
24773
24774 if (actual !== length) {
24775 // Writing a hex string, for example, that contains invalid characters will
24776 // cause everything after the first invalid character to be ignored. (e.g.
24777 // 'abxxcd' will be treated as 'ab')
24778 that = that.slice(0, actual)
24779 }
24780
24781 return that
24782}
24783
24784function fromArrayLike (that, array) {
24785 var length = array.length < 0 ? 0 : checked(array.length) | 0
24786 that = createBuffer(that, length)
24787 for (var i = 0; i < length; i += 1) {
24788 that[i] = array[i] & 255
24789 }
24790 return that
24791}
24792
24793function fromArrayBuffer (that, array, byteOffset, length) {
24794 array.byteLength // this throws if `array` is not a valid ArrayBuffer
24795
24796 if (byteOffset < 0 || array.byteLength < byteOffset) {
24797 throw new RangeError('\'offset\' is out of bounds')
24798 }
24799
24800 if (array.byteLength < byteOffset + (length || 0)) {
24801 throw new RangeError('\'length\' is out of bounds')
24802 }
24803
24804 if (byteOffset === undefined && length === undefined) {
24805 array = new Uint8Array(array)
24806 } else if (length === undefined) {
24807 array = new Uint8Array(array, byteOffset)
24808 } else {
24809 array = new Uint8Array(array, byteOffset, length)
24810 }
24811
24812 if (Buffer.TYPED_ARRAY_SUPPORT) {
24813 // Return an augmented `Uint8Array` instance, for best performance
24814 that = array
24815 that.__proto__ = Buffer.prototype
24816 } else {
24817 // Fallback: Return an object instance of the Buffer class
24818 that = fromArrayLike(that, array)
24819 }
24820 return that
24821}
24822
24823function fromObject (that, obj) {
24824 if (Buffer.isBuffer(obj)) {
24825 var len = checked(obj.length) | 0
24826 that = createBuffer(that, len)
24827
24828 if (that.length === 0) {
24829 return that
24830 }
24831
24832 obj.copy(that, 0, 0, len)
24833 return that
24834 }
24835
24836 if (obj) {
24837 if ((typeof ArrayBuffer !== 'undefined' &&
24838 obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
24839 if (typeof obj.length !== 'number' || isnan(obj.length)) {
24840 return createBuffer(that, 0)
24841 }
24842 return fromArrayLike(that, obj)
24843 }
24844
24845 if (obj.type === 'Buffer' && isArray(obj.data)) {
24846 return fromArrayLike(that, obj.data)
24847 }
24848 }
24849
24850 throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
24851}
24852
24853function checked (length) {
24854 // Note: cannot use `length < kMaxLength()` here because that fails when
24855 // length is NaN (which is otherwise coerced to zero.)
24856 if (length >= kMaxLength()) {
24857 throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
24858 'size: 0x' + kMaxLength().toString(16) + ' bytes')
24859 }
24860 return length | 0
24861}
24862
24863function SlowBuffer (length) {
24864 if (+length != length) { // eslint-disable-line eqeqeq
24865 length = 0
24866 }
24867 return Buffer.alloc(+length)
24868}
24869
24870Buffer.isBuffer = function isBuffer (b) {
24871 return !!(b != null && b._isBuffer)
24872}
24873
24874Buffer.compare = function compare (a, b) {
24875 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
24876 throw new TypeError('Arguments must be Buffers')
24877 }
24878
24879 if (a === b) return 0
24880
24881 var x = a.length
24882 var y = b.length
24883
24884 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
24885 if (a[i] !== b[i]) {
24886 x = a[i]
24887 y = b[i]
24888 break
24889 }
24890 }
24891
24892 if (x < y) return -1
24893 if (y < x) return 1
24894 return 0
24895}
24896
24897Buffer.isEncoding = function isEncoding (encoding) {
24898 switch (String(encoding).toLowerCase()) {
24899 case 'hex':
24900 case 'utf8':
24901 case 'utf-8':
24902 case 'ascii':
24903 case 'latin1':
24904 case 'binary':
24905 case 'base64':
24906 case 'ucs2':
24907 case 'ucs-2':
24908 case 'utf16le':
24909 case 'utf-16le':
24910 return true
24911 default:
24912 return false
24913 }
24914}
24915
24916Buffer.concat = function concat (list, length) {
24917 if (!isArray(list)) {
24918 throw new TypeError('"list" argument must be an Array of Buffers')
24919 }
24920
24921 if (list.length === 0) {
24922 return Buffer.alloc(0)
24923 }
24924
24925 var i
24926 if (length === undefined) {
24927 length = 0
24928 for (i = 0; i < list.length; ++i) {
24929 length += list[i].length
24930 }
24931 }
24932
24933 var buffer = Buffer.allocUnsafe(length)
24934 var pos = 0
24935 for (i = 0; i < list.length; ++i) {
24936 var buf = list[i]
24937 if (!Buffer.isBuffer(buf)) {
24938 throw new TypeError('"list" argument must be an Array of Buffers')
24939 }
24940 buf.copy(buffer, pos)
24941 pos += buf.length
24942 }
24943 return buffer
24944}
24945
24946function byteLength (string, encoding) {
24947 if (Buffer.isBuffer(string)) {
24948 return string.length
24949 }
24950 if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
24951 (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
24952 return string.byteLength
24953 }
24954 if (typeof string !== 'string') {
24955 string = '' + string
24956 }
24957
24958 var len = string.length
24959 if (len === 0) return 0
24960
24961 // Use a for loop to avoid recursion
24962 var loweredCase = false
24963 for (;;) {
24964 switch (encoding) {
24965 case 'ascii':
24966 case 'latin1':
24967 case 'binary':
24968 return len
24969 case 'utf8':
24970 case 'utf-8':
24971 case undefined:
24972 return utf8ToBytes(string).length
24973 case 'ucs2':
24974 case 'ucs-2':
24975 case 'utf16le':
24976 case 'utf-16le':
24977 return len * 2
24978 case 'hex':
24979 return len >>> 1
24980 case 'base64':
24981 return base64ToBytes(string).length
24982 default:
24983 if (loweredCase) return utf8ToBytes(string).length // assume utf8
24984 encoding = ('' + encoding).toLowerCase()
24985 loweredCase = true
24986 }
24987 }
24988}
24989Buffer.byteLength = byteLength
24990
24991function slowToString (encoding, start, end) {
24992 var loweredCase = false
24993
24994 // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
24995 // property of a typed array.
24996
24997 // This behaves neither like String nor Uint8Array in that we set start/end
24998 // to their upper/lower bounds if the value passed is out of range.
24999 // undefined is handled specially as per ECMA-262 6th Edition,
25000 // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
25001 if (start === undefined || start < 0) {
25002 start = 0
25003 }
25004 // Return early if start > this.length. Done here to prevent potential uint32
25005 // coercion fail below.
25006 if (start > this.length) {
25007 return ''
25008 }
25009
25010 if (end === undefined || end > this.length) {
25011 end = this.length
25012 }
25013
25014 if (end <= 0) {
25015 return ''
25016 }
25017
25018 // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
25019 end >>>= 0
25020 start >>>= 0
25021
25022 if (end <= start) {
25023 return ''
25024 }
25025
25026 if (!encoding) encoding = 'utf8'
25027
25028 while (true) {
25029 switch (encoding) {
25030 case 'hex':
25031 return hexSlice(this, start, end)
25032
25033 case 'utf8':
25034 case 'utf-8':
25035 return utf8Slice(this, start, end)
25036
25037 case 'ascii':
25038 return asciiSlice(this, start, end)
25039
25040 case 'latin1':
25041 case 'binary':
25042 return latin1Slice(this, start, end)
25043
25044 case 'base64':
25045 return base64Slice(this, start, end)
25046
25047 case 'ucs2':
25048 case 'ucs-2':
25049 case 'utf16le':
25050 case 'utf-16le':
25051 return utf16leSlice(this, start, end)
25052
25053 default:
25054 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
25055 encoding = (encoding + '').toLowerCase()
25056 loweredCase = true
25057 }
25058 }
25059}
25060
25061// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
25062// Buffer instances.
25063Buffer.prototype._isBuffer = true
25064
25065function swap (b, n, m) {
25066 var i = b[n]
25067 b[n] = b[m]
25068 b[m] = i
25069}
25070
25071Buffer.prototype.swap16 = function swap16 () {
25072 var len = this.length
25073 if (len % 2 !== 0) {
25074 throw new RangeError('Buffer size must be a multiple of 16-bits')
25075 }
25076 for (var i = 0; i < len; i += 2) {
25077 swap(this, i, i + 1)
25078 }
25079 return this
25080}
25081
25082Buffer.prototype.swap32 = function swap32 () {
25083 var len = this.length
25084 if (len % 4 !== 0) {
25085 throw new RangeError('Buffer size must be a multiple of 32-bits')
25086 }
25087 for (var i = 0; i < len; i += 4) {
25088 swap(this, i, i + 3)
25089 swap(this, i + 1, i + 2)
25090 }
25091 return this
25092}
25093
25094Buffer.prototype.swap64 = function swap64 () {
25095 var len = this.length
25096 if (len % 8 !== 0) {
25097 throw new RangeError('Buffer size must be a multiple of 64-bits')
25098 }
25099 for (var i = 0; i < len; i += 8) {
25100 swap(this, i, i + 7)
25101 swap(this, i + 1, i + 6)
25102 swap(this, i + 2, i + 5)
25103 swap(this, i + 3, i + 4)
25104 }
25105 return this
25106}
25107
25108Buffer.prototype.toString = function toString () {
25109 var length = this.length | 0
25110 if (length === 0) return ''
25111 if (arguments.length === 0) return utf8Slice(this, 0, length)
25112 return slowToString.apply(this, arguments)
25113}
25114
25115Buffer.prototype.equals = function equals (b) {
25116 if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
25117 if (this === b) return true
25118 return Buffer.compare(this, b) === 0
25119}
25120
25121Buffer.prototype.inspect = function inspect () {
25122 var str = ''
25123 var max = exports.INSPECT_MAX_BYTES
25124 if (this.length > 0) {
25125 str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
25126 if (this.length > max) str += ' ... '
25127 }
25128 return '<Buffer ' + str + '>'
25129}
25130
25131Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
25132 if (!Buffer.isBuffer(target)) {
25133 throw new TypeError('Argument must be a Buffer')
25134 }
25135
25136 if (start === undefined) {
25137 start = 0
25138 }
25139 if (end === undefined) {
25140 end = target ? target.length : 0
25141 }
25142 if (thisStart === undefined) {
25143 thisStart = 0
25144 }
25145 if (thisEnd === undefined) {
25146 thisEnd = this.length
25147 }
25148
25149 if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
25150 throw new RangeError('out of range index')
25151 }
25152
25153 if (thisStart >= thisEnd && start >= end) {
25154 return 0
25155 }
25156 if (thisStart >= thisEnd) {
25157 return -1
25158 }
25159 if (start >= end) {
25160 return 1
25161 }
25162
25163 start >>>= 0
25164 end >>>= 0
25165 thisStart >>>= 0
25166 thisEnd >>>= 0
25167
25168 if (this === target) return 0
25169
25170 var x = thisEnd - thisStart
25171 var y = end - start
25172 var len = Math.min(x, y)
25173
25174 var thisCopy = this.slice(thisStart, thisEnd)
25175 var targetCopy = target.slice(start, end)
25176
25177 for (var i = 0; i < len; ++i) {
25178 if (thisCopy[i] !== targetCopy[i]) {
25179 x = thisCopy[i]
25180 y = targetCopy[i]
25181 break
25182 }
25183 }
25184
25185 if (x < y) return -1
25186 if (y < x) return 1
25187 return 0
25188}
25189
25190// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
25191// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
25192//
25193// Arguments:
25194// - buffer - a Buffer to search
25195// - val - a string, Buffer, or number
25196// - byteOffset - an index into `buffer`; will be clamped to an int32
25197// - encoding - an optional encoding, relevant is val is a string
25198// - dir - true for indexOf, false for lastIndexOf
25199function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
25200 // Empty buffer means no match
25201 if (buffer.length === 0) return -1
25202
25203 // Normalize byteOffset
25204 if (typeof byteOffset === 'string') {
25205 encoding = byteOffset
25206 byteOffset = 0
25207 } else if (byteOffset > 0x7fffffff) {
25208 byteOffset = 0x7fffffff
25209 } else if (byteOffset < -0x80000000) {
25210 byteOffset = -0x80000000
25211 }
25212 byteOffset = +byteOffset // Coerce to Number.
25213 if (isNaN(byteOffset)) {
25214 // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
25215 byteOffset = dir ? 0 : (buffer.length - 1)
25216 }
25217
25218 // Normalize byteOffset: negative offsets start from the end of the buffer
25219 if (byteOffset < 0) byteOffset = buffer.length + byteOffset
25220 if (byteOffset >= buffer.length) {
25221 if (dir) return -1
25222 else byteOffset = buffer.length - 1
25223 } else if (byteOffset < 0) {
25224 if (dir) byteOffset = 0
25225 else return -1
25226 }
25227
25228 // Normalize val
25229 if (typeof val === 'string') {
25230 val = Buffer.from(val, encoding)
25231 }
25232
25233 // Finally, search either indexOf (if dir is true) or lastIndexOf
25234 if (Buffer.isBuffer(val)) {
25235 // Special case: looking for empty string/buffer always fails
25236 if (val.length === 0) {
25237 return -1
25238 }
25239 return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
25240 } else if (typeof val === 'number') {
25241 val = val & 0xFF // Search for a byte value [0-255]
25242 if (Buffer.TYPED_ARRAY_SUPPORT &&
25243 typeof Uint8Array.prototype.indexOf === 'function') {
25244 if (dir) {
25245 return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
25246 } else {
25247 return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
25248 }
25249 }
25250 return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
25251 }
25252
25253 throw new TypeError('val must be string, number or Buffer')
25254}
25255
25256function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
25257 var indexSize = 1
25258 var arrLength = arr.length
25259 var valLength = val.length
25260
25261 if (encoding !== undefined) {
25262 encoding = String(encoding).toLowerCase()
25263 if (encoding === 'ucs2' || encoding === 'ucs-2' ||
25264 encoding === 'utf16le' || encoding === 'utf-16le') {
25265 if (arr.length < 2 || val.length < 2) {
25266 return -1
25267 }
25268 indexSize = 2
25269 arrLength /= 2
25270 valLength /= 2
25271 byteOffset /= 2
25272 }
25273 }
25274
25275 function read (buf, i) {
25276 if (indexSize === 1) {
25277 return buf[i]
25278 } else {
25279 return buf.readUInt16BE(i * indexSize)
25280 }
25281 }
25282
25283 var i
25284 if (dir) {
25285 var foundIndex = -1
25286 for (i = byteOffset; i < arrLength; i++) {
25287 if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
25288 if (foundIndex === -1) foundIndex = i
25289 if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
25290 } else {
25291 if (foundIndex !== -1) i -= i - foundIndex
25292 foundIndex = -1
25293 }
25294 }
25295 } else {
25296 if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
25297 for (i = byteOffset; i >= 0; i--) {
25298 var found = true
25299 for (var j = 0; j < valLength; j++) {
25300 if (read(arr, i + j) !== read(val, j)) {
25301 found = false
25302 break
25303 }
25304 }
25305 if (found) return i
25306 }
25307 }
25308
25309 return -1
25310}
25311
25312Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
25313 return this.indexOf(val, byteOffset, encoding) !== -1
25314}
25315
25316Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
25317 return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
25318}
25319
25320Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
25321 return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
25322}
25323
25324function hexWrite (buf, string, offset, length) {
25325 offset = Number(offset) || 0
25326 var remaining = buf.length - offset
25327 if (!length) {
25328 length = remaining
25329 } else {
25330 length = Number(length)
25331 if (length > remaining) {
25332 length = remaining
25333 }
25334 }
25335
25336 // must be an even number of digits
25337 var strLen = string.length
25338 if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
25339
25340 if (length > strLen / 2) {
25341 length = strLen / 2
25342 }
25343 for (var i = 0; i < length; ++i) {
25344 var parsed = parseInt(string.substr(i * 2, 2), 16)
25345 if (isNaN(parsed)) return i
25346 buf[offset + i] = parsed
25347 }
25348 return i
25349}
25350
25351function utf8Write (buf, string, offset, length) {
25352 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
25353}
25354
25355function asciiWrite (buf, string, offset, length) {
25356 return blitBuffer(asciiToBytes(string), buf, offset, length)
25357}
25358
25359function latin1Write (buf, string, offset, length) {
25360 return asciiWrite(buf, string, offset, length)
25361}
25362
25363function base64Write (buf, string, offset, length) {
25364 return blitBuffer(base64ToBytes(string), buf, offset, length)
25365}
25366
25367function ucs2Write (buf, string, offset, length) {
25368 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
25369}
25370
25371Buffer.prototype.write = function write (string, offset, length, encoding) {
25372 // Buffer#write(string)
25373 if (offset === undefined) {
25374 encoding = 'utf8'
25375 length = this.length
25376 offset = 0
25377 // Buffer#write(string, encoding)
25378 } else if (length === undefined && typeof offset === 'string') {
25379 encoding = offset
25380 length = this.length
25381 offset = 0
25382 // Buffer#write(string, offset[, length][, encoding])
25383 } else if (isFinite(offset)) {
25384 offset = offset | 0
25385 if (isFinite(length)) {
25386 length = length | 0
25387 if (encoding === undefined) encoding = 'utf8'
25388 } else {
25389 encoding = length
25390 length = undefined
25391 }
25392 // legacy write(string, encoding, offset, length) - remove in v0.13
25393 } else {
25394 throw new Error(
25395 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
25396 )
25397 }
25398
25399 var remaining = this.length - offset
25400 if (length === undefined || length > remaining) length = remaining
25401
25402 if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
25403 throw new RangeError('Attempt to write outside buffer bounds')
25404 }
25405
25406 if (!encoding) encoding = 'utf8'
25407
25408 var loweredCase = false
25409 for (;;) {
25410 switch (encoding) {
25411 case 'hex':
25412 return hexWrite(this, string, offset, length)
25413
25414 case 'utf8':
25415 case 'utf-8':
25416 return utf8Write(this, string, offset, length)
25417
25418 case 'ascii':
25419 return asciiWrite(this, string, offset, length)
25420
25421 case 'latin1':
25422 case 'binary':
25423 return latin1Write(this, string, offset, length)
25424
25425 case 'base64':
25426 // Warning: maxLength not taken into account in base64Write
25427 return base64Write(this, string, offset, length)
25428
25429 case 'ucs2':
25430 case 'ucs-2':
25431 case 'utf16le':
25432 case 'utf-16le':
25433 return ucs2Write(this, string, offset, length)
25434
25435 default:
25436 if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
25437 encoding = ('' + encoding).toLowerCase()
25438 loweredCase = true
25439 }
25440 }
25441}
25442
25443Buffer.prototype.toJSON = function toJSON () {
25444 return {
25445 type: 'Buffer',
25446 data: Array.prototype.slice.call(this._arr || this, 0)
25447 }
25448}
25449
25450function base64Slice (buf, start, end) {
25451 if (start === 0 && end === buf.length) {
25452 return base64.fromByteArray(buf)
25453 } else {
25454 return base64.fromByteArray(buf.slice(start, end))
25455 }
25456}
25457
25458function utf8Slice (buf, start, end) {
25459 end = Math.min(buf.length, end)
25460 var res = []
25461
25462 var i = start
25463 while (i < end) {
25464 var firstByte = buf[i]
25465 var codePoint = null
25466 var bytesPerSequence = (firstByte > 0xEF) ? 4
25467 : (firstByte > 0xDF) ? 3
25468 : (firstByte > 0xBF) ? 2
25469 : 1
25470
25471 if (i + bytesPerSequence <= end) {
25472 var secondByte, thirdByte, fourthByte, tempCodePoint
25473
25474 switch (bytesPerSequence) {
25475 case 1:
25476 if (firstByte < 0x80) {
25477 codePoint = firstByte
25478 }
25479 break
25480 case 2:
25481 secondByte = buf[i + 1]
25482 if ((secondByte & 0xC0) === 0x80) {
25483 tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
25484 if (tempCodePoint > 0x7F) {
25485 codePoint = tempCodePoint
25486 }
25487 }
25488 break
25489 case 3:
25490 secondByte = buf[i + 1]
25491 thirdByte = buf[i + 2]
25492 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
25493 tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
25494 if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
25495 codePoint = tempCodePoint
25496 }
25497 }
25498 break
25499 case 4:
25500 secondByte = buf[i + 1]
25501 thirdByte = buf[i + 2]
25502 fourthByte = buf[i + 3]
25503 if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
25504 tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
25505 if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
25506 codePoint = tempCodePoint
25507 }
25508 }
25509 }
25510 }
25511
25512 if (codePoint === null) {
25513 // we did not generate a valid codePoint so insert a
25514 // replacement char (U+FFFD) and advance only 1 byte
25515 codePoint = 0xFFFD
25516 bytesPerSequence = 1
25517 } else if (codePoint > 0xFFFF) {
25518 // encode to utf16 (surrogate pair dance)
25519 codePoint -= 0x10000
25520 res.push(codePoint >>> 10 & 0x3FF | 0xD800)
25521 codePoint = 0xDC00 | codePoint & 0x3FF
25522 }
25523
25524 res.push(codePoint)
25525 i += bytesPerSequence
25526 }
25527
25528 return decodeCodePointsArray(res)
25529}
25530
25531// Based on http://stackoverflow.com/a/22747272/680742, the browser with
25532// the lowest limit is Chrome, with 0x10000 args.
25533// We go 1 magnitude less, for safety
25534var MAX_ARGUMENTS_LENGTH = 0x1000
25535
25536function decodeCodePointsArray (codePoints) {
25537 var len = codePoints.length
25538 if (len <= MAX_ARGUMENTS_LENGTH) {
25539 return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
25540 }
25541
25542 // Decode in chunks to avoid "call stack size exceeded".
25543 var res = ''
25544 var i = 0
25545 while (i < len) {
25546 res += String.fromCharCode.apply(
25547 String,
25548 codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
25549 )
25550 }
25551 return res
25552}
25553
25554function asciiSlice (buf, start, end) {
25555 var ret = ''
25556 end = Math.min(buf.length, end)
25557
25558 for (var i = start; i < end; ++i) {
25559 ret += String.fromCharCode(buf[i] & 0x7F)
25560 }
25561 return ret
25562}
25563
25564function latin1Slice (buf, start, end) {
25565 var ret = ''
25566 end = Math.min(buf.length, end)
25567
25568 for (var i = start; i < end; ++i) {
25569 ret += String.fromCharCode(buf[i])
25570 }
25571 return ret
25572}
25573
25574function hexSlice (buf, start, end) {
25575 var len = buf.length
25576
25577 if (!start || start < 0) start = 0
25578 if (!end || end < 0 || end > len) end = len
25579
25580 var out = ''
25581 for (var i = start; i < end; ++i) {
25582 out += toHex(buf[i])
25583 }
25584 return out
25585}
25586
25587function utf16leSlice (buf, start, end) {
25588 var bytes = buf.slice(start, end)
25589 var res = ''
25590 for (var i = 0; i < bytes.length; i += 2) {
25591 res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
25592 }
25593 return res
25594}
25595
25596Buffer.prototype.slice = function slice (start, end) {
25597 var len = this.length
25598 start = ~~start
25599 end = end === undefined ? len : ~~end
25600
25601 if (start < 0) {
25602 start += len
25603 if (start < 0) start = 0
25604 } else if (start > len) {
25605 start = len
25606 }
25607
25608 if (end < 0) {
25609 end += len
25610 if (end < 0) end = 0
25611 } else if (end > len) {
25612 end = len
25613 }
25614
25615 if (end < start) end = start
25616
25617 var newBuf
25618 if (Buffer.TYPED_ARRAY_SUPPORT) {
25619 newBuf = this.subarray(start, end)
25620 newBuf.__proto__ = Buffer.prototype
25621 } else {
25622 var sliceLen = end - start
25623 newBuf = new Buffer(sliceLen, undefined)
25624 for (var i = 0; i < sliceLen; ++i) {
25625 newBuf[i] = this[i + start]
25626 }
25627 }
25628
25629 return newBuf
25630}
25631
25632/*
25633 * Need to make sure that buffer isn't trying to write out of bounds.
25634 */
25635function checkOffset (offset, ext, length) {
25636 if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
25637 if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
25638}
25639
25640Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
25641 offset = offset | 0
25642 byteLength = byteLength | 0
25643 if (!noAssert) checkOffset(offset, byteLength, this.length)
25644
25645 var val = this[offset]
25646 var mul = 1
25647 var i = 0
25648 while (++i < byteLength && (mul *= 0x100)) {
25649 val += this[offset + i] * mul
25650 }
25651
25652 return val
25653}
25654
25655Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
25656 offset = offset | 0
25657 byteLength = byteLength | 0
25658 if (!noAssert) {
25659 checkOffset(offset, byteLength, this.length)
25660 }
25661
25662 var val = this[offset + --byteLength]
25663 var mul = 1
25664 while (byteLength > 0 && (mul *= 0x100)) {
25665 val += this[offset + --byteLength] * mul
25666 }
25667
25668 return val
25669}
25670
25671Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
25672 if (!noAssert) checkOffset(offset, 1, this.length)
25673 return this[offset]
25674}
25675
25676Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
25677 if (!noAssert) checkOffset(offset, 2, this.length)
25678 return this[offset] | (this[offset + 1] << 8)
25679}
25680
25681Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
25682 if (!noAssert) checkOffset(offset, 2, this.length)
25683 return (this[offset] << 8) | this[offset + 1]
25684}
25685
25686Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
25687 if (!noAssert) checkOffset(offset, 4, this.length)
25688
25689 return ((this[offset]) |
25690 (this[offset + 1] << 8) |
25691 (this[offset + 2] << 16)) +
25692 (this[offset + 3] * 0x1000000)
25693}
25694
25695Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
25696 if (!noAssert) checkOffset(offset, 4, this.length)
25697
25698 return (this[offset] * 0x1000000) +
25699 ((this[offset + 1] << 16) |
25700 (this[offset + 2] << 8) |
25701 this[offset + 3])
25702}
25703
25704Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
25705 offset = offset | 0
25706 byteLength = byteLength | 0
25707 if (!noAssert) checkOffset(offset, byteLength, this.length)
25708
25709 var val = this[offset]
25710 var mul = 1
25711 var i = 0
25712 while (++i < byteLength && (mul *= 0x100)) {
25713 val += this[offset + i] * mul
25714 }
25715 mul *= 0x80
25716
25717 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
25718
25719 return val
25720}
25721
25722Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
25723 offset = offset | 0
25724 byteLength = byteLength | 0
25725 if (!noAssert) checkOffset(offset, byteLength, this.length)
25726
25727 var i = byteLength
25728 var mul = 1
25729 var val = this[offset + --i]
25730 while (i > 0 && (mul *= 0x100)) {
25731 val += this[offset + --i] * mul
25732 }
25733 mul *= 0x80
25734
25735 if (val >= mul) val -= Math.pow(2, 8 * byteLength)
25736
25737 return val
25738}
25739
25740Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
25741 if (!noAssert) checkOffset(offset, 1, this.length)
25742 if (!(this[offset] & 0x80)) return (this[offset])
25743 return ((0xff - this[offset] + 1) * -1)
25744}
25745
25746Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
25747 if (!noAssert) checkOffset(offset, 2, this.length)
25748 var val = this[offset] | (this[offset + 1] << 8)
25749 return (val & 0x8000) ? val | 0xFFFF0000 : val
25750}
25751
25752Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
25753 if (!noAssert) checkOffset(offset, 2, this.length)
25754 var val = this[offset + 1] | (this[offset] << 8)
25755 return (val & 0x8000) ? val | 0xFFFF0000 : val
25756}
25757
25758Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
25759 if (!noAssert) checkOffset(offset, 4, this.length)
25760
25761 return (this[offset]) |
25762 (this[offset + 1] << 8) |
25763 (this[offset + 2] << 16) |
25764 (this[offset + 3] << 24)
25765}
25766
25767Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
25768 if (!noAssert) checkOffset(offset, 4, this.length)
25769
25770 return (this[offset] << 24) |
25771 (this[offset + 1] << 16) |
25772 (this[offset + 2] << 8) |
25773 (this[offset + 3])
25774}
25775
25776Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
25777 if (!noAssert) checkOffset(offset, 4, this.length)
25778 return ieee754.read(this, offset, true, 23, 4)
25779}
25780
25781Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
25782 if (!noAssert) checkOffset(offset, 4, this.length)
25783 return ieee754.read(this, offset, false, 23, 4)
25784}
25785
25786Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
25787 if (!noAssert) checkOffset(offset, 8, this.length)
25788 return ieee754.read(this, offset, true, 52, 8)
25789}
25790
25791Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
25792 if (!noAssert) checkOffset(offset, 8, this.length)
25793 return ieee754.read(this, offset, false, 52, 8)
25794}
25795
25796function checkInt (buf, value, offset, ext, max, min) {
25797 if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
25798 if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
25799 if (offset + ext > buf.length) throw new RangeError('Index out of range')
25800}
25801
25802Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
25803 value = +value
25804 offset = offset | 0
25805 byteLength = byteLength | 0
25806 if (!noAssert) {
25807 var maxBytes = Math.pow(2, 8 * byteLength) - 1
25808 checkInt(this, value, offset, byteLength, maxBytes, 0)
25809 }
25810
25811 var mul = 1
25812 var i = 0
25813 this[offset] = value & 0xFF
25814 while (++i < byteLength && (mul *= 0x100)) {
25815 this[offset + i] = (value / mul) & 0xFF
25816 }
25817
25818 return offset + byteLength
25819}
25820
25821Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
25822 value = +value
25823 offset = offset | 0
25824 byteLength = byteLength | 0
25825 if (!noAssert) {
25826 var maxBytes = Math.pow(2, 8 * byteLength) - 1
25827 checkInt(this, value, offset, byteLength, maxBytes, 0)
25828 }
25829
25830 var i = byteLength - 1
25831 var mul = 1
25832 this[offset + i] = value & 0xFF
25833 while (--i >= 0 && (mul *= 0x100)) {
25834 this[offset + i] = (value / mul) & 0xFF
25835 }
25836
25837 return offset + byteLength
25838}
25839
25840Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
25841 value = +value
25842 offset = offset | 0
25843 if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
25844 if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
25845 this[offset] = (value & 0xff)
25846 return offset + 1
25847}
25848
25849function objectWriteUInt16 (buf, value, offset, littleEndian) {
25850 if (value < 0) value = 0xffff + value + 1
25851 for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
25852 buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
25853 (littleEndian ? i : 1 - i) * 8
25854 }
25855}
25856
25857Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
25858 value = +value
25859 offset = offset | 0
25860 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
25861 if (Buffer.TYPED_ARRAY_SUPPORT) {
25862 this[offset] = (value & 0xff)
25863 this[offset + 1] = (value >>> 8)
25864 } else {
25865 objectWriteUInt16(this, value, offset, true)
25866 }
25867 return offset + 2
25868}
25869
25870Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
25871 value = +value
25872 offset = offset | 0
25873 if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
25874 if (Buffer.TYPED_ARRAY_SUPPORT) {
25875 this[offset] = (value >>> 8)
25876 this[offset + 1] = (value & 0xff)
25877 } else {
25878 objectWriteUInt16(this, value, offset, false)
25879 }
25880 return offset + 2
25881}
25882
25883function objectWriteUInt32 (buf, value, offset, littleEndian) {
25884 if (value < 0) value = 0xffffffff + value + 1
25885 for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
25886 buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
25887 }
25888}
25889
25890Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
25891 value = +value
25892 offset = offset | 0
25893 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
25894 if (Buffer.TYPED_ARRAY_SUPPORT) {
25895 this[offset + 3] = (value >>> 24)
25896 this[offset + 2] = (value >>> 16)
25897 this[offset + 1] = (value >>> 8)
25898 this[offset] = (value & 0xff)
25899 } else {
25900 objectWriteUInt32(this, value, offset, true)
25901 }
25902 return offset + 4
25903}
25904
25905Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
25906 value = +value
25907 offset = offset | 0
25908 if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
25909 if (Buffer.TYPED_ARRAY_SUPPORT) {
25910 this[offset] = (value >>> 24)
25911 this[offset + 1] = (value >>> 16)
25912 this[offset + 2] = (value >>> 8)
25913 this[offset + 3] = (value & 0xff)
25914 } else {
25915 objectWriteUInt32(this, value, offset, false)
25916 }
25917 return offset + 4
25918}
25919
25920Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
25921 value = +value
25922 offset = offset | 0
25923 if (!noAssert) {
25924 var limit = Math.pow(2, 8 * byteLength - 1)
25925
25926 checkInt(this, value, offset, byteLength, limit - 1, -limit)
25927 }
25928
25929 var i = 0
25930 var mul = 1
25931 var sub = 0
25932 this[offset] = value & 0xFF
25933 while (++i < byteLength && (mul *= 0x100)) {
25934 if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
25935 sub = 1
25936 }
25937 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
25938 }
25939
25940 return offset + byteLength
25941}
25942
25943Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
25944 value = +value
25945 offset = offset | 0
25946 if (!noAssert) {
25947 var limit = Math.pow(2, 8 * byteLength - 1)
25948
25949 checkInt(this, value, offset, byteLength, limit - 1, -limit)
25950 }
25951
25952 var i = byteLength - 1
25953 var mul = 1
25954 var sub = 0
25955 this[offset + i] = value & 0xFF
25956 while (--i >= 0 && (mul *= 0x100)) {
25957 if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
25958 sub = 1
25959 }
25960 this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
25961 }
25962
25963 return offset + byteLength
25964}
25965
25966Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
25967 value = +value
25968 offset = offset | 0
25969 if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
25970 if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
25971 if (value < 0) value = 0xff + value + 1
25972 this[offset] = (value & 0xff)
25973 return offset + 1
25974}
25975
25976Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
25977 value = +value
25978 offset = offset | 0
25979 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
25980 if (Buffer.TYPED_ARRAY_SUPPORT) {
25981 this[offset] = (value & 0xff)
25982 this[offset + 1] = (value >>> 8)
25983 } else {
25984 objectWriteUInt16(this, value, offset, true)
25985 }
25986 return offset + 2
25987}
25988
25989Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
25990 value = +value
25991 offset = offset | 0
25992 if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
25993 if (Buffer.TYPED_ARRAY_SUPPORT) {
25994 this[offset] = (value >>> 8)
25995 this[offset + 1] = (value & 0xff)
25996 } else {
25997 objectWriteUInt16(this, value, offset, false)
25998 }
25999 return offset + 2
26000}
26001
26002Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
26003 value = +value
26004 offset = offset | 0
26005 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
26006 if (Buffer.TYPED_ARRAY_SUPPORT) {
26007 this[offset] = (value & 0xff)
26008 this[offset + 1] = (value >>> 8)
26009 this[offset + 2] = (value >>> 16)
26010 this[offset + 3] = (value >>> 24)
26011 } else {
26012 objectWriteUInt32(this, value, offset, true)
26013 }
26014 return offset + 4
26015}
26016
26017Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
26018 value = +value
26019 offset = offset | 0
26020 if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
26021 if (value < 0) value = 0xffffffff + value + 1
26022 if (Buffer.TYPED_ARRAY_SUPPORT) {
26023 this[offset] = (value >>> 24)
26024 this[offset + 1] = (value >>> 16)
26025 this[offset + 2] = (value >>> 8)
26026 this[offset + 3] = (value & 0xff)
26027 } else {
26028 objectWriteUInt32(this, value, offset, false)
26029 }
26030 return offset + 4
26031}
26032
26033function checkIEEE754 (buf, value, offset, ext, max, min) {
26034 if (offset + ext > buf.length) throw new RangeError('Index out of range')
26035 if (offset < 0) throw new RangeError('Index out of range')
26036}
26037
26038function writeFloat (buf, value, offset, littleEndian, noAssert) {
26039 if (!noAssert) {
26040 checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
26041 }
26042 ieee754.write(buf, value, offset, littleEndian, 23, 4)
26043 return offset + 4
26044}
26045
26046Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
26047 return writeFloat(this, value, offset, true, noAssert)
26048}
26049
26050Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
26051 return writeFloat(this, value, offset, false, noAssert)
26052}
26053
26054function writeDouble (buf, value, offset, littleEndian, noAssert) {
26055 if (!noAssert) {
26056 checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
26057 }
26058 ieee754.write(buf, value, offset, littleEndian, 52, 8)
26059 return offset + 8
26060}
26061
26062Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
26063 return writeDouble(this, value, offset, true, noAssert)
26064}
26065
26066Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
26067 return writeDouble(this, value, offset, false, noAssert)
26068}
26069
26070// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
26071Buffer.prototype.copy = function copy (target, targetStart, start, end) {
26072 if (!start) start = 0
26073 if (!end && end !== 0) end = this.length
26074 if (targetStart >= target.length) targetStart = target.length
26075 if (!targetStart) targetStart = 0
26076 if (end > 0 && end < start) end = start
26077
26078 // Copy 0 bytes; we're done
26079 if (end === start) return 0
26080 if (target.length === 0 || this.length === 0) return 0
26081
26082 // Fatal error conditions
26083 if (targetStart < 0) {
26084 throw new RangeError('targetStart out of bounds')
26085 }
26086 if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
26087 if (end < 0) throw new RangeError('sourceEnd out of bounds')
26088
26089 // Are we oob?
26090 if (end > this.length) end = this.length
26091 if (target.length - targetStart < end - start) {
26092 end = target.length - targetStart + start
26093 }
26094
26095 var len = end - start
26096 var i
26097
26098 if (this === target && start < targetStart && targetStart < end) {
26099 // descending copy from end
26100 for (i = len - 1; i >= 0; --i) {
26101 target[i + targetStart] = this[i + start]
26102 }
26103 } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
26104 // ascending copy from start
26105 for (i = 0; i < len; ++i) {
26106 target[i + targetStart] = this[i + start]
26107 }
26108 } else {
26109 Uint8Array.prototype.set.call(
26110 target,
26111 this.subarray(start, start + len),
26112 targetStart
26113 )
26114 }
26115
26116 return len
26117}
26118
26119// Usage:
26120// buffer.fill(number[, offset[, end]])
26121// buffer.fill(buffer[, offset[, end]])
26122// buffer.fill(string[, offset[, end]][, encoding])
26123Buffer.prototype.fill = function fill (val, start, end, encoding) {
26124 // Handle string cases:
26125 if (typeof val === 'string') {
26126 if (typeof start === 'string') {
26127 encoding = start
26128 start = 0
26129 end = this.length
26130 } else if (typeof end === 'string') {
26131 encoding = end
26132 end = this.length
26133 }
26134 if (val.length === 1) {
26135 var code = val.charCodeAt(0)
26136 if (code < 256) {
26137 val = code
26138 }
26139 }
26140 if (encoding !== undefined && typeof encoding !== 'string') {
26141 throw new TypeError('encoding must be a string')
26142 }
26143 if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
26144 throw new TypeError('Unknown encoding: ' + encoding)
26145 }
26146 } else if (typeof val === 'number') {
26147 val = val & 255
26148 }
26149
26150 // Invalid ranges are not set to a default, so can range check early.
26151 if (start < 0 || this.length < start || this.length < end) {
26152 throw new RangeError('Out of range index')
26153 }
26154
26155 if (end <= start) {
26156 return this
26157 }
26158
26159 start = start >>> 0
26160 end = end === undefined ? this.length : end >>> 0
26161
26162 if (!val) val = 0
26163
26164 var i
26165 if (typeof val === 'number') {
26166 for (i = start; i < end; ++i) {
26167 this[i] = val
26168 }
26169 } else {
26170 var bytes = Buffer.isBuffer(val)
26171 ? val
26172 : utf8ToBytes(new Buffer(val, encoding).toString())
26173 var len = bytes.length
26174 for (i = 0; i < end - start; ++i) {
26175 this[i + start] = bytes[i % len]
26176 }
26177 }
26178
26179 return this
26180}
26181
26182// HELPER FUNCTIONS
26183// ================
26184
26185var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
26186
26187function base64clean (str) {
26188 // Node strips out invalid characters like \n and \t from the string, base64-js does not
26189 str = stringtrim(str).replace(INVALID_BASE64_RE, '')
26190 // Node converts strings with length < 2 to ''
26191 if (str.length < 2) return ''
26192 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
26193 while (str.length % 4 !== 0) {
26194 str = str + '='
26195 }
26196 return str
26197}
26198
26199function stringtrim (str) {
26200 if (str.trim) return str.trim()
26201 return str.replace(/^\s+|\s+$/g, '')
26202}
26203
26204function toHex (n) {
26205 if (n < 16) return '0' + n.toString(16)
26206 return n.toString(16)
26207}
26208
26209function utf8ToBytes (string, units) {
26210 units = units || Infinity
26211 var codePoint
26212 var length = string.length
26213 var leadSurrogate = null
26214 var bytes = []
26215
26216 for (var i = 0; i < length; ++i) {
26217 codePoint = string.charCodeAt(i)
26218
26219 // is surrogate component
26220 if (codePoint > 0xD7FF && codePoint < 0xE000) {
26221 // last char was a lead
26222 if (!leadSurrogate) {
26223 // no lead yet
26224 if (codePoint > 0xDBFF) {
26225 // unexpected trail
26226 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
26227 continue
26228 } else if (i + 1 === length) {
26229 // unpaired lead
26230 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
26231 continue
26232 }
26233
26234 // valid lead
26235 leadSurrogate = codePoint
26236
26237 continue
26238 }
26239
26240 // 2 leads in a row
26241 if (codePoint < 0xDC00) {
26242 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
26243 leadSurrogate = codePoint
26244 continue
26245 }
26246
26247 // valid surrogate pair
26248 codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
26249 } else if (leadSurrogate) {
26250 // valid bmp char, but last char was a lead
26251 if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
26252 }
26253
26254 leadSurrogate = null
26255
26256 // encode utf8
26257 if (codePoint < 0x80) {
26258 if ((units -= 1) < 0) break
26259 bytes.push(codePoint)
26260 } else if (codePoint < 0x800) {
26261 if ((units -= 2) < 0) break
26262 bytes.push(
26263 codePoint >> 0x6 | 0xC0,
26264 codePoint & 0x3F | 0x80
26265 )
26266 } else if (codePoint < 0x10000) {
26267 if ((units -= 3) < 0) break
26268 bytes.push(
26269 codePoint >> 0xC | 0xE0,
26270 codePoint >> 0x6 & 0x3F | 0x80,
26271 codePoint & 0x3F | 0x80
26272 )
26273 } else if (codePoint < 0x110000) {
26274 if ((units -= 4) < 0) break
26275 bytes.push(
26276 codePoint >> 0x12 | 0xF0,
26277 codePoint >> 0xC & 0x3F | 0x80,
26278 codePoint >> 0x6 & 0x3F | 0x80,
26279 codePoint & 0x3F | 0x80
26280 )
26281 } else {
26282 throw new Error('Invalid code point')
26283 }
26284 }
26285
26286 return bytes
26287}
26288
26289function asciiToBytes (str) {
26290 var byteArray = []
26291 for (var i = 0; i < str.length; ++i) {
26292 // Node's code seems to be doing this and not & 0x7F..
26293 byteArray.push(str.charCodeAt(i) & 0xFF)
26294 }
26295 return byteArray
26296}
26297
26298function utf16leToBytes (str, units) {
26299 var c, hi, lo
26300 var byteArray = []
26301 for (var i = 0; i < str.length; ++i) {
26302 if ((units -= 2) < 0) break
26303
26304 c = str.charCodeAt(i)
26305 hi = c >> 8
26306 lo = c % 256
26307 byteArray.push(lo)
26308 byteArray.push(hi)
26309 }
26310
26311 return byteArray
26312}
26313
26314function base64ToBytes (str) {
26315 return base64.toByteArray(base64clean(str))
26316}
26317
26318function blitBuffer (src, dst, offset, length) {
26319 for (var i = 0; i < length; ++i) {
26320 if ((i + offset >= dst.length) || (i >= src.length)) break
26321 dst[i + offset] = src[i]
26322 }
26323 return i
26324}
26325
26326function isnan (val) {
26327 return val !== val // eslint-disable-line no-self-compare
26328}
26329
26330}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
26331},{"base64-js":118,"ieee754":244,"isarray":247}],122:[function(require,module,exports){
26332(function (process){
26333'use strict';
26334var escapeStringRegexp = require('escape-string-regexp');
26335var ansiStyles = require('ansi-styles');
26336var stripAnsi = require('strip-ansi');
26337var hasAnsi = require('has-ansi');
26338var supportsColor = require('supports-color');
26339var defineProps = Object.defineProperties;
26340var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM);
26341
26342function Chalk(options) {
26343 // detect mode if not set manually
26344 this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled;
26345}
26346
26347// use bright blue on Windows as the normal blue color is illegible
26348if (isSimpleWindowsTerm) {
26349 ansiStyles.blue.open = '\u001b[94m';
26350}
26351
26352var styles = (function () {
26353 var ret = {};
26354
26355 Object.keys(ansiStyles).forEach(function (key) {
26356 ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
26357
26358 ret[key] = {
26359 get: function () {
26360 return build.call(this, this._styles.concat(key));
26361 }
26362 };
26363 });
26364
26365 return ret;
26366})();
26367
26368var proto = defineProps(function chalk() {}, styles);
26369
26370function build(_styles) {
26371 var builder = function () {
26372 return applyStyle.apply(builder, arguments);
26373 };
26374
26375 builder._styles = _styles;
26376 builder.enabled = this.enabled;
26377 // __proto__ is used because we must return a function, but there is
26378 // no way to create a function with a different prototype.
26379 /* eslint-disable no-proto */
26380 builder.__proto__ = proto;
26381
26382 return builder;
26383}
26384
26385function applyStyle() {
26386 // support varags, but simply cast to string in case there's only one arg
26387 var args = arguments;
26388 var argsLen = args.length;
26389 var str = argsLen !== 0 && String(arguments[0]);
26390
26391 if (argsLen > 1) {
26392 // don't slice `arguments`, it prevents v8 optimizations
26393 for (var a = 1; a < argsLen; a++) {
26394 str += ' ' + args[a];
26395 }
26396 }
26397
26398 if (!this.enabled || !str) {
26399 return str;
26400 }
26401
26402 var nestedStyles = this._styles;
26403 var i = nestedStyles.length;
26404
26405 // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
26406 // see https://github.com/chalk/chalk/issues/58
26407 // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
26408 var originalDim = ansiStyles.dim.open;
26409 if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) {
26410 ansiStyles.dim.open = '';
26411 }
26412
26413 while (i--) {
26414 var code = ansiStyles[nestedStyles[i]];
26415
26416 // Replace any instances already present with a re-opening code
26417 // otherwise only the part of the string until said closing code
26418 // will be colored, and the rest will simply be 'plain'.
26419 str = code.open + str.replace(code.closeRe, code.open) + code.close;
26420 }
26421
26422 // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue.
26423 ansiStyles.dim.open = originalDim;
26424
26425 return str;
26426}
26427
26428function init() {
26429 var ret = {};
26430
26431 Object.keys(styles).forEach(function (name) {
26432 ret[name] = {
26433 get: function () {
26434 return build.call(this, [name]);
26435 }
26436 };
26437 });
26438
26439 return ret;
26440}
26441
26442defineProps(Chalk.prototype, init());
26443
26444module.exports = new Chalk();
26445module.exports.styles = ansiStyles;
26446module.exports.hasColor = hasAnsi;
26447module.exports.stripColor = stripAnsi;
26448module.exports.supportsColor = supportsColor;
26449
26450}).call(this,require('_process'))
26451},{"_process":471,"ansi-styles":2,"escape-string-regexp":236,"has-ansi":243,"strip-ansi":485,"supports-color":486}],123:[function(require,module,exports){
26452module.exports = function (xs, fn) {
26453 var res = [];
26454 for (var i = 0; i < xs.length; i++) {
26455 var x = fn(xs[i], i);
26456 if (isArray(x)) res.push.apply(res, x);
26457 else res.push(x);
26458 }
26459 return res;
26460};
26461
26462var isArray = Array.isArray || function (xs) {
26463 return Object.prototype.toString.call(xs) === '[object Array]';
26464};
26465
26466},{}],124:[function(require,module,exports){
26467(function (Buffer){
26468'use strict';
26469var fs = require('fs');
26470var path = require('path');
26471
26472var commentRx = /^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/mg;
26473var mapFileCommentRx =
26474 //Example (Extra space between slashes added to solve Safari bug. Exclude space in production):
26475 // / /# sourceMappingURL=foo.js.map
26476 /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/mg
26477
26478function decodeBase64(base64) {
26479 return new Buffer(base64, 'base64').toString();
26480}
26481
26482function stripComment(sm) {
26483 return sm.split(',').pop();
26484}
26485
26486function readFromFileMap(sm, dir) {
26487 // NOTE: this will only work on the server since it attempts to read the map file
26488
26489 mapFileCommentRx.lastIndex = 0;
26490 var r = mapFileCommentRx.exec(sm);
26491
26492 // for some odd reason //# .. captures in 1 and /* .. */ in 2
26493 var filename = r[1] || r[2];
26494 var filepath = path.resolve(dir, filename);
26495
26496 try {
26497 return fs.readFileSync(filepath, 'utf8');
26498 } catch (e) {
26499 throw new Error('An error occurred while trying to read the map file at ' + filepath + '\n' + e);
26500 }
26501}
26502
26503function Converter (sm, opts) {
26504 opts = opts || {};
26505
26506 if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir);
26507 if (opts.hasComment) sm = stripComment(sm);
26508 if (opts.isEncoded) sm = decodeBase64(sm);
26509 if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm);
26510
26511 this.sourcemap = sm;
26512}
26513
26514Converter.prototype.toJSON = function (space) {
26515 return JSON.stringify(this.sourcemap, null, space);
26516};
26517
26518Converter.prototype.toBase64 = function () {
26519 var json = this.toJSON();
26520 return new Buffer(json).toString('base64');
26521};
26522
26523Converter.prototype.toComment = function (options) {
26524 var base64 = this.toBase64();
26525 var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
26526 return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
26527};
26528
26529// returns copy instead of original
26530Converter.prototype.toObject = function () {
26531 return JSON.parse(this.toJSON());
26532};
26533
26534Converter.prototype.addProperty = function (key, value) {
26535 if (this.sourcemap.hasOwnProperty(key)) throw new Error('property %s already exists on the sourcemap, use set property instead');
26536 return this.setProperty(key, value);
26537};
26538
26539Converter.prototype.setProperty = function (key, value) {
26540 this.sourcemap[key] = value;
26541 return this;
26542};
26543
26544Converter.prototype.getProperty = function (key) {
26545 return this.sourcemap[key];
26546};
26547
26548exports.fromObject = function (obj) {
26549 return new Converter(obj);
26550};
26551
26552exports.fromJSON = function (json) {
26553 return new Converter(json, { isJSON: true });
26554};
26555
26556exports.fromBase64 = function (base64) {
26557 return new Converter(base64, { isEncoded: true });
26558};
26559
26560exports.fromComment = function (comment) {
26561 comment = comment
26562 .replace(/^\/\*/g, '//')
26563 .replace(/\*\/$/g, '');
26564
26565 return new Converter(comment, { isEncoded: true, hasComment: true });
26566};
26567
26568exports.fromMapFileComment = function (comment, dir) {
26569 return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true });
26570};
26571
26572// Finds last sourcemap comment in file or returns null if none was found
26573exports.fromSource = function (content) {
26574 var m = content.match(commentRx);
26575 return m ? exports.fromComment(m.pop()) : null;
26576};
26577
26578// Finds last sourcemap comment in file or returns null if none was found
26579exports.fromMapFileSource = function (content, dir) {
26580 var m = content.match(mapFileCommentRx);
26581 return m ? exports.fromMapFileComment(m.pop(), dir) : null;
26582};
26583
26584exports.removeComments = function (src) {
26585 return src.replace(commentRx, '');
26586};
26587
26588exports.removeMapFileComments = function (src) {
26589 return src.replace(mapFileCommentRx, '');
26590};
26591
26592exports.generateMapFileComment = function (file, options) {
26593 var data = 'sourceMappingURL=' + file;
26594 return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
26595};
26596
26597Object.defineProperty(exports, 'commentRegex', {
26598 get: function getCommentRegex () {
26599 return commentRx;
26600 }
26601});
26602
26603Object.defineProperty(exports, 'mapFileCommentRegex', {
26604 get: function getMapFileCommentRegex () {
26605 return mapFileCommentRx;
26606 }
26607});
26608
26609}).call(this,require("buffer").Buffer)
26610},{"buffer":121,"fs":120,"path":469}],125:[function(require,module,exports){
26611require('../modules/web.dom.iterable');
26612require('../modules/es6.string.iterator');
26613module.exports = require('../modules/core.get-iterator');
26614},{"../modules/core.get-iterator":214,"../modules/es6.string.iterator":223,"../modules/web.dom.iterable":230}],126:[function(require,module,exports){
26615var core = require('../../modules/_core')
26616 , $JSON = core.JSON || (core.JSON = {stringify: JSON.stringify});
26617module.exports = function stringify(it){ // eslint-disable-line no-unused-vars
26618 return $JSON.stringify.apply($JSON, arguments);
26619};
26620},{"../../modules/_core":154}],127:[function(require,module,exports){
26621require('../modules/es6.object.to-string');
26622require('../modules/es6.string.iterator');
26623require('../modules/web.dom.iterable');
26624require('../modules/es6.map');
26625require('../modules/es7.map.to-json');
26626module.exports = require('../modules/_core').Map;
26627},{"../modules/_core":154,"../modules/es6.map":216,"../modules/es6.object.to-string":222,"../modules/es6.string.iterator":223,"../modules/es7.map.to-json":227,"../modules/web.dom.iterable":230}],128:[function(require,module,exports){
26628require('../../modules/es6.number.max-safe-integer');
26629module.exports = 0x1fffffffffffff;
26630},{"../../modules/es6.number.max-safe-integer":217}],129:[function(require,module,exports){
26631require('../../modules/es6.object.assign');
26632module.exports = require('../../modules/_core').Object.assign;
26633},{"../../modules/_core":154,"../../modules/es6.object.assign":218}],130:[function(require,module,exports){
26634require('../../modules/es6.object.create');
26635var $Object = require('../../modules/_core').Object;
26636module.exports = function create(P, D){
26637 return $Object.create(P, D);
26638};
26639},{"../../modules/_core":154,"../../modules/es6.object.create":219}],131:[function(require,module,exports){
26640require('../../modules/es6.symbol');
26641module.exports = require('../../modules/_core').Object.getOwnPropertySymbols;
26642},{"../../modules/_core":154,"../../modules/es6.symbol":224}],132:[function(require,module,exports){
26643require('../../modules/es6.object.keys');
26644module.exports = require('../../modules/_core').Object.keys;
26645},{"../../modules/_core":154,"../../modules/es6.object.keys":220}],133:[function(require,module,exports){
26646require('../../modules/es6.object.set-prototype-of');
26647module.exports = require('../../modules/_core').Object.setPrototypeOf;
26648},{"../../modules/_core":154,"../../modules/es6.object.set-prototype-of":221}],134:[function(require,module,exports){
26649require('../../modules/es6.symbol');
26650module.exports = require('../../modules/_core').Symbol['for'];
26651},{"../../modules/_core":154,"../../modules/es6.symbol":224}],135:[function(require,module,exports){
26652require('../../modules/es6.symbol');
26653require('../../modules/es6.object.to-string');
26654require('../../modules/es7.symbol.async-iterator');
26655require('../../modules/es7.symbol.observable');
26656module.exports = require('../../modules/_core').Symbol;
26657},{"../../modules/_core":154,"../../modules/es6.object.to-string":222,"../../modules/es6.symbol":224,"../../modules/es7.symbol.async-iterator":228,"../../modules/es7.symbol.observable":229}],136:[function(require,module,exports){
26658require('../../modules/es6.string.iterator');
26659require('../../modules/web.dom.iterable');
26660module.exports = require('../../modules/_wks-ext').f('iterator');
26661},{"../../modules/_wks-ext":211,"../../modules/es6.string.iterator":223,"../../modules/web.dom.iterable":230}],137:[function(require,module,exports){
26662require('../modules/es6.object.to-string');
26663require('../modules/web.dom.iterable');
26664require('../modules/es6.weak-map');
26665module.exports = require('../modules/_core').WeakMap;
26666},{"../modules/_core":154,"../modules/es6.object.to-string":222,"../modules/es6.weak-map":225,"../modules/web.dom.iterable":230}],138:[function(require,module,exports){
26667require('../modules/es6.object.to-string');
26668require('../modules/web.dom.iterable');
26669require('../modules/es6.weak-set');
26670module.exports = require('../modules/_core').WeakSet;
26671},{"../modules/_core":154,"../modules/es6.object.to-string":222,"../modules/es6.weak-set":226,"../modules/web.dom.iterable":230}],139:[function(require,module,exports){
26672module.exports = function(it){
26673 if(typeof it != 'function')throw TypeError(it + ' is not a function!');
26674 return it;
26675};
26676},{}],140:[function(require,module,exports){
26677module.exports = function(){ /* empty */ };
26678},{}],141:[function(require,module,exports){
26679module.exports = function(it, Constructor, name, forbiddenField){
26680 if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){
26681 throw TypeError(name + ': incorrect invocation!');
26682 } return it;
26683};
26684},{}],142:[function(require,module,exports){
26685var isObject = require('./_is-object');
26686module.exports = function(it){
26687 if(!isObject(it))throw TypeError(it + ' is not an object!');
26688 return it;
26689};
26690},{"./_is-object":172}],143:[function(require,module,exports){
26691var forOf = require('./_for-of');
26692
26693module.exports = function(iter, ITERATOR){
26694 var result = [];
26695 forOf(iter, false, result.push, result, ITERATOR);
26696 return result;
26697};
26698
26699},{"./_for-of":163}],144:[function(require,module,exports){
26700// false -> Array#indexOf
26701// true -> Array#includes
26702var toIObject = require('./_to-iobject')
26703 , toLength = require('./_to-length')
26704 , toIndex = require('./_to-index');
26705module.exports = function(IS_INCLUDES){
26706 return function($this, el, fromIndex){
26707 var O = toIObject($this)
26708 , length = toLength(O.length)
26709 , index = toIndex(fromIndex, length)
26710 , value;
26711 // Array#includes uses SameValueZero equality algorithm
26712 if(IS_INCLUDES && el != el)while(length > index){
26713 value = O[index++];
26714 if(value != value)return true;
26715 // Array#toIndex ignores holes, Array#includes - not
26716 } else for(;length > index; index++)if(IS_INCLUDES || index in O){
26717 if(O[index] === el)return IS_INCLUDES || index || 0;
26718 } return !IS_INCLUDES && -1;
26719 };
26720};
26721},{"./_to-index":203,"./_to-iobject":205,"./_to-length":206}],145:[function(require,module,exports){
26722// 0 -> Array#forEach
26723// 1 -> Array#map
26724// 2 -> Array#filter
26725// 3 -> Array#some
26726// 4 -> Array#every
26727// 5 -> Array#find
26728// 6 -> Array#findIndex
26729var ctx = require('./_ctx')
26730 , IObject = require('./_iobject')
26731 , toObject = require('./_to-object')
26732 , toLength = require('./_to-length')
26733 , asc = require('./_array-species-create');
26734module.exports = function(TYPE, $create){
26735 var IS_MAP = TYPE == 1
26736 , IS_FILTER = TYPE == 2
26737 , IS_SOME = TYPE == 3
26738 , IS_EVERY = TYPE == 4
26739 , IS_FIND_INDEX = TYPE == 6
26740 , NO_HOLES = TYPE == 5 || IS_FIND_INDEX
26741 , create = $create || asc;
26742 return function($this, callbackfn, that){
26743 var O = toObject($this)
26744 , self = IObject(O)
26745 , f = ctx(callbackfn, that, 3)
26746 , length = toLength(self.length)
26747 , index = 0
26748 , result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined
26749 , val, res;
26750 for(;length > index; index++)if(NO_HOLES || index in self){
26751 val = self[index];
26752 res = f(val, index, O);
26753 if(TYPE){
26754 if(IS_MAP)result[index] = res; // map
26755 else if(res)switch(TYPE){
26756 case 3: return true; // some
26757 case 5: return val; // find
26758 case 6: return index; // findIndex
26759 case 2: result.push(val); // filter
26760 } else if(IS_EVERY)return false; // every
26761 }
26762 }
26763 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
26764 };
26765};
26766},{"./_array-species-create":147,"./_ctx":155,"./_iobject":169,"./_to-length":206,"./_to-object":207}],146:[function(require,module,exports){
26767var isObject = require('./_is-object')
26768 , isArray = require('./_is-array')
26769 , SPECIES = require('./_wks')('species');
26770
26771module.exports = function(original){
26772 var C;
26773 if(isArray(original)){
26774 C = original.constructor;
26775 // cross-realm fallback
26776 if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined;
26777 if(isObject(C)){
26778 C = C[SPECIES];
26779 if(C === null)C = undefined;
26780 }
26781 } return C === undefined ? Array : C;
26782};
26783},{"./_is-array":171,"./_is-object":172,"./_wks":212}],147:[function(require,module,exports){
26784// 9.4.2.3 ArraySpeciesCreate(originalArray, length)
26785var speciesConstructor = require('./_array-species-constructor');
26786
26787module.exports = function(original, length){
26788 return new (speciesConstructor(original))(length);
26789};
26790},{"./_array-species-constructor":146}],148:[function(require,module,exports){
26791// getting tag from 19.1.3.6 Object.prototype.toString()
26792var cof = require('./_cof')
26793 , TAG = require('./_wks')('toStringTag')
26794 // ES3 wrong here
26795 , ARG = cof(function(){ return arguments; }()) == 'Arguments';
26796
26797// fallback for IE11 Script Access Denied error
26798var tryGet = function(it, key){
26799 try {
26800 return it[key];
26801 } catch(e){ /* empty */ }
26802};
26803
26804module.exports = function(it){
26805 var O, T, B;
26806 return it === undefined ? 'Undefined' : it === null ? 'Null'
26807 // @@toStringTag case
26808 : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
26809 // builtinTag case
26810 : ARG ? cof(O)
26811 // ES3 arguments fallback
26812 : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
26813};
26814},{"./_cof":149,"./_wks":212}],149:[function(require,module,exports){
26815var toString = {}.toString;
26816
26817module.exports = function(it){
26818 return toString.call(it).slice(8, -1);
26819};
26820},{}],150:[function(require,module,exports){
26821'use strict';
26822var dP = require('./_object-dp').f
26823 , create = require('./_object-create')
26824 , redefineAll = require('./_redefine-all')
26825 , ctx = require('./_ctx')
26826 , anInstance = require('./_an-instance')
26827 , defined = require('./_defined')
26828 , forOf = require('./_for-of')
26829 , $iterDefine = require('./_iter-define')
26830 , step = require('./_iter-step')
26831 , setSpecies = require('./_set-species')
26832 , DESCRIPTORS = require('./_descriptors')
26833 , fastKey = require('./_meta').fastKey
26834 , SIZE = DESCRIPTORS ? '_s' : 'size';
26835
26836var getEntry = function(that, key){
26837 // fast case
26838 var index = fastKey(key), entry;
26839 if(index !== 'F')return that._i[index];
26840 // frozen object case
26841 for(entry = that._f; entry; entry = entry.n){
26842 if(entry.k == key)return entry;
26843 }
26844};
26845
26846module.exports = {
26847 getConstructor: function(wrapper, NAME, IS_MAP, ADDER){
26848 var C = wrapper(function(that, iterable){
26849 anInstance(that, C, NAME, '_i');
26850 that._i = create(null); // index
26851 that._f = undefined; // first entry
26852 that._l = undefined; // last entry
26853 that[SIZE] = 0; // size
26854 if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
26855 });
26856 redefineAll(C.prototype, {
26857 // 23.1.3.1 Map.prototype.clear()
26858 // 23.2.3.2 Set.prototype.clear()
26859 clear: function clear(){
26860 for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){
26861 entry.r = true;
26862 if(entry.p)entry.p = entry.p.n = undefined;
26863 delete data[entry.i];
26864 }
26865 that._f = that._l = undefined;
26866 that[SIZE] = 0;
26867 },
26868 // 23.1.3.3 Map.prototype.delete(key)
26869 // 23.2.3.4 Set.prototype.delete(value)
26870 'delete': function(key){
26871 var that = this
26872 , entry = getEntry(that, key);
26873 if(entry){
26874 var next = entry.n
26875 , prev = entry.p;
26876 delete that._i[entry.i];
26877 entry.r = true;
26878 if(prev)prev.n = next;
26879 if(next)next.p = prev;
26880 if(that._f == entry)that._f = next;
26881 if(that._l == entry)that._l = prev;
26882 that[SIZE]--;
26883 } return !!entry;
26884 },
26885 // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
26886 // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
26887 forEach: function forEach(callbackfn /*, that = undefined */){
26888 anInstance(this, C, 'forEach');
26889 var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3)
26890 , entry;
26891 while(entry = entry ? entry.n : this._f){
26892 f(entry.v, entry.k, this);
26893 // revert to the last existing entry
26894 while(entry && entry.r)entry = entry.p;
26895 }
26896 },
26897 // 23.1.3.7 Map.prototype.has(key)
26898 // 23.2.3.7 Set.prototype.has(value)
26899 has: function has(key){
26900 return !!getEntry(this, key);
26901 }
26902 });
26903 if(DESCRIPTORS)dP(C.prototype, 'size', {
26904 get: function(){
26905 return defined(this[SIZE]);
26906 }
26907 });
26908 return C;
26909 },
26910 def: function(that, key, value){
26911 var entry = getEntry(that, key)
26912 , prev, index;
26913 // change existing entry
26914 if(entry){
26915 entry.v = value;
26916 // create new entry
26917 } else {
26918 that._l = entry = {
26919 i: index = fastKey(key, true), // <- index
26920 k: key, // <- key
26921 v: value, // <- value
26922 p: prev = that._l, // <- previous entry
26923 n: undefined, // <- next entry
26924 r: false // <- removed
26925 };
26926 if(!that._f)that._f = entry;
26927 if(prev)prev.n = entry;
26928 that[SIZE]++;
26929 // add to index
26930 if(index !== 'F')that._i[index] = entry;
26931 } return that;
26932 },
26933 getEntry: getEntry,
26934 setStrong: function(C, NAME, IS_MAP){
26935 // add .keys, .values, .entries, [@@iterator]
26936 // 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
26937 $iterDefine(C, NAME, function(iterated, kind){
26938 this._t = iterated; // target
26939 this._k = kind; // kind
26940 this._l = undefined; // previous
26941 }, function(){
26942 var that = this
26943 , kind = that._k
26944 , entry = that._l;
26945 // revert to the last existing entry
26946 while(entry && entry.r)entry = entry.p;
26947 // get next entry
26948 if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){
26949 // or finish the iteration
26950 that._t = undefined;
26951 return step(1);
26952 }
26953 // return step by kind
26954 if(kind == 'keys' )return step(0, entry.k);
26955 if(kind == 'values')return step(0, entry.v);
26956 return step(0, [entry.k, entry.v]);
26957 }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true);
26958
26959 // add [@@species], 23.1.2.2, 23.2.2.2
26960 setSpecies(NAME);
26961 }
26962};
26963},{"./_an-instance":141,"./_ctx":155,"./_defined":156,"./_descriptors":157,"./_for-of":163,"./_iter-define":175,"./_iter-step":176,"./_meta":180,"./_object-create":182,"./_object-dp":183,"./_redefine-all":195,"./_set-species":198}],151:[function(require,module,exports){
26964// https://github.com/DavidBruant/Map-Set.prototype.toJSON
26965var classof = require('./_classof')
26966 , from = require('./_array-from-iterable');
26967module.exports = function(NAME){
26968 return function toJSON(){
26969 if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic");
26970 return from(this);
26971 };
26972};
26973},{"./_array-from-iterable":143,"./_classof":148}],152:[function(require,module,exports){
26974'use strict';
26975var redefineAll = require('./_redefine-all')
26976 , getWeak = require('./_meta').getWeak
26977 , anObject = require('./_an-object')
26978 , isObject = require('./_is-object')
26979 , anInstance = require('./_an-instance')
26980 , forOf = require('./_for-of')
26981 , createArrayMethod = require('./_array-methods')
26982 , $has = require('./_has')
26983 , arrayFind = createArrayMethod(5)
26984 , arrayFindIndex = createArrayMethod(6)
26985 , id = 0;
26986
26987// fallback for uncaught frozen keys
26988var uncaughtFrozenStore = function(that){
26989 return that._l || (that._l = new UncaughtFrozenStore);
26990};
26991var UncaughtFrozenStore = function(){
26992 this.a = [];
26993};
26994var findUncaughtFrozen = function(store, key){
26995 return arrayFind(store.a, function(it){
26996 return it[0] === key;
26997 });
26998};
26999UncaughtFrozenStore.prototype = {
27000 get: function(key){
27001 var entry = findUncaughtFrozen(this, key);
27002 if(entry)return entry[1];
27003 },
27004 has: function(key){
27005 return !!findUncaughtFrozen(this, key);
27006 },
27007 set: function(key, value){
27008 var entry = findUncaughtFrozen(this, key);
27009 if(entry)entry[1] = value;
27010 else this.a.push([key, value]);
27011 },
27012 'delete': function(key){
27013 var index = arrayFindIndex(this.a, function(it){
27014 return it[0] === key;
27015 });
27016 if(~index)this.a.splice(index, 1);
27017 return !!~index;
27018 }
27019};
27020
27021module.exports = {
27022 getConstructor: function(wrapper, NAME, IS_MAP, ADDER){
27023 var C = wrapper(function(that, iterable){
27024 anInstance(that, C, NAME, '_i');
27025 that._i = id++; // collection id
27026 that._l = undefined; // leak store for uncaught frozen objects
27027 if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
27028 });
27029 redefineAll(C.prototype, {
27030 // 23.3.3.2 WeakMap.prototype.delete(key)
27031 // 23.4.3.3 WeakSet.prototype.delete(value)
27032 'delete': function(key){
27033 if(!isObject(key))return false;
27034 var data = getWeak(key);
27035 if(data === true)return uncaughtFrozenStore(this)['delete'](key);
27036 return data && $has(data, this._i) && delete data[this._i];
27037 },
27038 // 23.3.3.4 WeakMap.prototype.has(key)
27039 // 23.4.3.4 WeakSet.prototype.has(value)
27040 has: function has(key){
27041 if(!isObject(key))return false;
27042 var data = getWeak(key);
27043 if(data === true)return uncaughtFrozenStore(this).has(key);
27044 return data && $has(data, this._i);
27045 }
27046 });
27047 return C;
27048 },
27049 def: function(that, key, value){
27050 var data = getWeak(anObject(key), true);
27051 if(data === true)uncaughtFrozenStore(that).set(key, value);
27052 else data[that._i] = value;
27053 return that;
27054 },
27055 ufstore: uncaughtFrozenStore
27056};
27057},{"./_an-instance":141,"./_an-object":142,"./_array-methods":145,"./_for-of":163,"./_has":165,"./_is-object":172,"./_meta":180,"./_redefine-all":195}],153:[function(require,module,exports){
27058'use strict';
27059var global = require('./_global')
27060 , $export = require('./_export')
27061 , meta = require('./_meta')
27062 , fails = require('./_fails')
27063 , hide = require('./_hide')
27064 , redefineAll = require('./_redefine-all')
27065 , forOf = require('./_for-of')
27066 , anInstance = require('./_an-instance')
27067 , isObject = require('./_is-object')
27068 , setToStringTag = require('./_set-to-string-tag')
27069 , dP = require('./_object-dp').f
27070 , each = require('./_array-methods')(0)
27071 , DESCRIPTORS = require('./_descriptors');
27072
27073module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){
27074 var Base = global[NAME]
27075 , C = Base
27076 , ADDER = IS_MAP ? 'set' : 'add'
27077 , proto = C && C.prototype
27078 , O = {};
27079 if(!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){
27080 new C().entries().next();
27081 }))){
27082 // create collection constructor
27083 C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
27084 redefineAll(C.prototype, methods);
27085 meta.NEED = true;
27086 } else {
27087 C = wrapper(function(target, iterable){
27088 anInstance(target, C, NAME, '_c');
27089 target._c = new Base;
27090 if(iterable != undefined)forOf(iterable, IS_MAP, target[ADDER], target);
27091 });
27092 each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','),function(KEY){
27093 var IS_ADDER = KEY == 'add' || KEY == 'set';
27094 if(KEY in proto && !(IS_WEAK && KEY == 'clear'))hide(C.prototype, KEY, function(a, b){
27095 anInstance(this, C, KEY);
27096 if(!IS_ADDER && IS_WEAK && !isObject(a))return KEY == 'get' ? undefined : false;
27097 var result = this._c[KEY](a === 0 ? 0 : a, b);
27098 return IS_ADDER ? this : result;
27099 });
27100 });
27101 if('size' in proto)dP(C.prototype, 'size', {
27102 get: function(){
27103 return this._c.size;
27104 }
27105 });
27106 }
27107
27108 setToStringTag(C, NAME);
27109
27110 O[NAME] = C;
27111 $export($export.G + $export.W + $export.F, O);
27112
27113 if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP);
27114
27115 return C;
27116};
27117},{"./_an-instance":141,"./_array-methods":145,"./_descriptors":157,"./_export":161,"./_fails":162,"./_for-of":163,"./_global":164,"./_hide":166,"./_is-object":172,"./_meta":180,"./_object-dp":183,"./_redefine-all":195,"./_set-to-string-tag":199}],154:[function(require,module,exports){
27118var core = module.exports = {version: '2.4.0'};
27119if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
27120},{}],155:[function(require,module,exports){
27121// optional / simple context binding
27122var aFunction = require('./_a-function');
27123module.exports = function(fn, that, length){
27124 aFunction(fn);
27125 if(that === undefined)return fn;
27126 switch(length){
27127 case 1: return function(a){
27128 return fn.call(that, a);
27129 };
27130 case 2: return function(a, b){
27131 return fn.call(that, a, b);
27132 };
27133 case 3: return function(a, b, c){
27134 return fn.call(that, a, b, c);
27135 };
27136 }
27137 return function(/* ...args */){
27138 return fn.apply(that, arguments);
27139 };
27140};
27141},{"./_a-function":139}],156:[function(require,module,exports){
27142// 7.2.1 RequireObjectCoercible(argument)
27143module.exports = function(it){
27144 if(it == undefined)throw TypeError("Can't call method on " + it);
27145 return it;
27146};
27147},{}],157:[function(require,module,exports){
27148// Thank's IE8 for his funny defineProperty
27149module.exports = !require('./_fails')(function(){
27150 return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
27151});
27152},{"./_fails":162}],158:[function(require,module,exports){
27153var isObject = require('./_is-object')
27154 , document = require('./_global').document
27155 // in old IE typeof document.createElement is 'object'
27156 , is = isObject(document) && isObject(document.createElement);
27157module.exports = function(it){
27158 return is ? document.createElement(it) : {};
27159};
27160},{"./_global":164,"./_is-object":172}],159:[function(require,module,exports){
27161// IE 8- don't enum bug keys
27162module.exports = (
27163 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
27164).split(',');
27165},{}],160:[function(require,module,exports){
27166// all enumerable object keys, includes symbols
27167var getKeys = require('./_object-keys')
27168 , gOPS = require('./_object-gops')
27169 , pIE = require('./_object-pie');
27170module.exports = function(it){
27171 var result = getKeys(it)
27172 , getSymbols = gOPS.f;
27173 if(getSymbols){
27174 var symbols = getSymbols(it)
27175 , isEnum = pIE.f
27176 , i = 0
27177 , key;
27178 while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key);
27179 } return result;
27180};
27181},{"./_object-gops":188,"./_object-keys":191,"./_object-pie":192}],161:[function(require,module,exports){
27182var global = require('./_global')
27183 , core = require('./_core')
27184 , ctx = require('./_ctx')
27185 , hide = require('./_hide')
27186 , PROTOTYPE = 'prototype';
27187
27188var $export = function(type, name, source){
27189 var IS_FORCED = type & $export.F
27190 , IS_GLOBAL = type & $export.G
27191 , IS_STATIC = type & $export.S
27192 , IS_PROTO = type & $export.P
27193 , IS_BIND = type & $export.B
27194 , IS_WRAP = type & $export.W
27195 , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
27196 , expProto = exports[PROTOTYPE]
27197 , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
27198 , key, own, out;
27199 if(IS_GLOBAL)source = name;
27200 for(key in source){
27201 // contains in native
27202 own = !IS_FORCED && target && target[key] !== undefined;
27203 if(own && key in exports)continue;
27204 // export native or passed
27205 out = own ? target[key] : source[key];
27206 // prevent global pollution for namespaces
27207 exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
27208 // bind timers to global for call from export context
27209 : IS_BIND && own ? ctx(out, global)
27210 // wrap global constructors for prevent change them in library
27211 : IS_WRAP && target[key] == out ? (function(C){
27212 var F = function(a, b, c){
27213 if(this instanceof C){
27214 switch(arguments.length){
27215 case 0: return new C;
27216 case 1: return new C(a);
27217 case 2: return new C(a, b);
27218 } return new C(a, b, c);
27219 } return C.apply(this, arguments);
27220 };
27221 F[PROTOTYPE] = C[PROTOTYPE];
27222 return F;
27223 // make static versions for prototype methods
27224 })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
27225 // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
27226 if(IS_PROTO){
27227 (exports.virtual || (exports.virtual = {}))[key] = out;
27228 // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
27229 if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);
27230 }
27231 }
27232};
27233// type bitmap
27234$export.F = 1; // forced
27235$export.G = 2; // global
27236$export.S = 4; // static
27237$export.P = 8; // proto
27238$export.B = 16; // bind
27239$export.W = 32; // wrap
27240$export.U = 64; // safe
27241$export.R = 128; // real proto method for `library`
27242module.exports = $export;
27243},{"./_core":154,"./_ctx":155,"./_global":164,"./_hide":166}],162:[function(require,module,exports){
27244module.exports = function(exec){
27245 try {
27246 return !!exec();
27247 } catch(e){
27248 return true;
27249 }
27250};
27251},{}],163:[function(require,module,exports){
27252var ctx = require('./_ctx')
27253 , call = require('./_iter-call')
27254 , isArrayIter = require('./_is-array-iter')
27255 , anObject = require('./_an-object')
27256 , toLength = require('./_to-length')
27257 , getIterFn = require('./core.get-iterator-method')
27258 , BREAK = {}
27259 , RETURN = {};
27260var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){
27261 var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable)
27262 , f = ctx(fn, that, entries ? 2 : 1)
27263 , index = 0
27264 , length, step, iterator, result;
27265 if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');
27266 // fast case for arrays with default iterator
27267 if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){
27268 result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
27269 if(result === BREAK || result === RETURN)return result;
27270 } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){
27271 result = call(iterator, f, step.value, entries);
27272 if(result === BREAK || result === RETURN)return result;
27273 }
27274};
27275exports.BREAK = BREAK;
27276exports.RETURN = RETURN;
27277},{"./_an-object":142,"./_ctx":155,"./_is-array-iter":170,"./_iter-call":173,"./_to-length":206,"./core.get-iterator-method":213}],164:[function(require,module,exports){
27278// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
27279var global = module.exports = typeof window != 'undefined' && window.Math == Math
27280 ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
27281if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
27282},{}],165:[function(require,module,exports){
27283var hasOwnProperty = {}.hasOwnProperty;
27284module.exports = function(it, key){
27285 return hasOwnProperty.call(it, key);
27286};
27287},{}],166:[function(require,module,exports){
27288var dP = require('./_object-dp')
27289 , createDesc = require('./_property-desc');
27290module.exports = require('./_descriptors') ? function(object, key, value){
27291 return dP.f(object, key, createDesc(1, value));
27292} : function(object, key, value){
27293 object[key] = value;
27294 return object;
27295};
27296},{"./_descriptors":157,"./_object-dp":183,"./_property-desc":194}],167:[function(require,module,exports){
27297module.exports = require('./_global').document && document.documentElement;
27298},{"./_global":164}],168:[function(require,module,exports){
27299module.exports = !require('./_descriptors') && !require('./_fails')(function(){
27300 return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;
27301});
27302},{"./_descriptors":157,"./_dom-create":158,"./_fails":162}],169:[function(require,module,exports){
27303// fallback for non-array-like ES3 and non-enumerable old V8 strings
27304var cof = require('./_cof');
27305module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){
27306 return cof(it) == 'String' ? it.split('') : Object(it);
27307};
27308},{"./_cof":149}],170:[function(require,module,exports){
27309// check on default Array iterator
27310var Iterators = require('./_iterators')
27311 , ITERATOR = require('./_wks')('iterator')
27312 , ArrayProto = Array.prototype;
27313
27314module.exports = function(it){
27315 return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
27316};
27317},{"./_iterators":177,"./_wks":212}],171:[function(require,module,exports){
27318// 7.2.2 IsArray(argument)
27319var cof = require('./_cof');
27320module.exports = Array.isArray || function isArray(arg){
27321 return cof(arg) == 'Array';
27322};
27323},{"./_cof":149}],172:[function(require,module,exports){
27324module.exports = function(it){
27325 return typeof it === 'object' ? it !== null : typeof it === 'function';
27326};
27327},{}],173:[function(require,module,exports){
27328// call something on iterator step with safe closing on error
27329var anObject = require('./_an-object');
27330module.exports = function(iterator, fn, value, entries){
27331 try {
27332 return entries ? fn(anObject(value)[0], value[1]) : fn(value);
27333 // 7.4.6 IteratorClose(iterator, completion)
27334 } catch(e){
27335 var ret = iterator['return'];
27336 if(ret !== undefined)anObject(ret.call(iterator));
27337 throw e;
27338 }
27339};
27340},{"./_an-object":142}],174:[function(require,module,exports){
27341'use strict';
27342var create = require('./_object-create')
27343 , descriptor = require('./_property-desc')
27344 , setToStringTag = require('./_set-to-string-tag')
27345 , IteratorPrototype = {};
27346
27347// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
27348require('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function(){ return this; });
27349
27350module.exports = function(Constructor, NAME, next){
27351 Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)});
27352 setToStringTag(Constructor, NAME + ' Iterator');
27353};
27354},{"./_hide":166,"./_object-create":182,"./_property-desc":194,"./_set-to-string-tag":199,"./_wks":212}],175:[function(require,module,exports){
27355'use strict';
27356var LIBRARY = require('./_library')
27357 , $export = require('./_export')
27358 , redefine = require('./_redefine')
27359 , hide = require('./_hide')
27360 , has = require('./_has')
27361 , Iterators = require('./_iterators')
27362 , $iterCreate = require('./_iter-create')
27363 , setToStringTag = require('./_set-to-string-tag')
27364 , getPrototypeOf = require('./_object-gpo')
27365 , ITERATOR = require('./_wks')('iterator')
27366 , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next`
27367 , FF_ITERATOR = '@@iterator'
27368 , KEYS = 'keys'
27369 , VALUES = 'values';
27370
27371var returnThis = function(){ return this; };
27372
27373module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){
27374 $iterCreate(Constructor, NAME, next);
27375 var getMethod = function(kind){
27376 if(!BUGGY && kind in proto)return proto[kind];
27377 switch(kind){
27378 case KEYS: return function keys(){ return new Constructor(this, kind); };
27379 case VALUES: return function values(){ return new Constructor(this, kind); };
27380 } return function entries(){ return new Constructor(this, kind); };
27381 };
27382 var TAG = NAME + ' Iterator'
27383 , DEF_VALUES = DEFAULT == VALUES
27384 , VALUES_BUG = false
27385 , proto = Base.prototype
27386 , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
27387 , $default = $native || getMethod(DEFAULT)
27388 , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined
27389 , $anyNative = NAME == 'Array' ? proto.entries || $native : $native
27390 , methods, key, IteratorPrototype;
27391 // Fix native
27392 if($anyNative){
27393 IteratorPrototype = getPrototypeOf($anyNative.call(new Base));
27394 if(IteratorPrototype !== Object.prototype){
27395 // Set @@toStringTag to native iterators
27396 setToStringTag(IteratorPrototype, TAG, true);
27397 // fix for some old engines
27398 if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis);
27399 }
27400 }
27401 // fix Array#{values, @@iterator}.name in V8 / FF
27402 if(DEF_VALUES && $native && $native.name !== VALUES){
27403 VALUES_BUG = true;
27404 $default = function values(){ return $native.call(this); };
27405 }
27406 // Define iterator
27407 if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){
27408 hide(proto, ITERATOR, $default);
27409 }
27410 // Plug for library
27411 Iterators[NAME] = $default;
27412 Iterators[TAG] = returnThis;
27413 if(DEFAULT){
27414 methods = {
27415 values: DEF_VALUES ? $default : getMethod(VALUES),
27416 keys: IS_SET ? $default : getMethod(KEYS),
27417 entries: $entries
27418 };
27419 if(FORCED)for(key in methods){
27420 if(!(key in proto))redefine(proto, key, methods[key]);
27421 } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
27422 }
27423 return methods;
27424};
27425},{"./_export":161,"./_has":165,"./_hide":166,"./_iter-create":174,"./_iterators":177,"./_library":179,"./_object-gpo":189,"./_redefine":196,"./_set-to-string-tag":199,"./_wks":212}],176:[function(require,module,exports){
27426module.exports = function(done, value){
27427 return {value: value, done: !!done};
27428};
27429},{}],177:[function(require,module,exports){
27430module.exports = {};
27431},{}],178:[function(require,module,exports){
27432var getKeys = require('./_object-keys')
27433 , toIObject = require('./_to-iobject');
27434module.exports = function(object, el){
27435 var O = toIObject(object)
27436 , keys = getKeys(O)
27437 , length = keys.length
27438 , index = 0
27439 , key;
27440 while(length > index)if(O[key = keys[index++]] === el)return key;
27441};
27442},{"./_object-keys":191,"./_to-iobject":205}],179:[function(require,module,exports){
27443module.exports = true;
27444},{}],180:[function(require,module,exports){
27445var META = require('./_uid')('meta')
27446 , isObject = require('./_is-object')
27447 , has = require('./_has')
27448 , setDesc = require('./_object-dp').f
27449 , id = 0;
27450var isExtensible = Object.isExtensible || function(){
27451 return true;
27452};
27453var FREEZE = !require('./_fails')(function(){
27454 return isExtensible(Object.preventExtensions({}));
27455});
27456var setMeta = function(it){
27457 setDesc(it, META, {value: {
27458 i: 'O' + ++id, // object ID
27459 w: {} // weak collections IDs
27460 }});
27461};
27462var fastKey = function(it, create){
27463 // return primitive with prefix
27464 if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
27465 if(!has(it, META)){
27466 // can't set metadata to uncaught frozen object
27467 if(!isExtensible(it))return 'F';
27468 // not necessary to add metadata
27469 if(!create)return 'E';
27470 // add missing metadata
27471 setMeta(it);
27472 // return object ID
27473 } return it[META].i;
27474};
27475var getWeak = function(it, create){
27476 if(!has(it, META)){
27477 // can't set metadata to uncaught frozen object
27478 if(!isExtensible(it))return true;
27479 // not necessary to add metadata
27480 if(!create)return false;
27481 // add missing metadata
27482 setMeta(it);
27483 // return hash weak collections IDs
27484 } return it[META].w;
27485};
27486// add metadata on freeze-family methods calling
27487var onFreeze = function(it){
27488 if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it);
27489 return it;
27490};
27491var meta = module.exports = {
27492 KEY: META,
27493 NEED: false,
27494 fastKey: fastKey,
27495 getWeak: getWeak,
27496 onFreeze: onFreeze
27497};
27498},{"./_fails":162,"./_has":165,"./_is-object":172,"./_object-dp":183,"./_uid":209}],181:[function(require,module,exports){
27499'use strict';
27500// 19.1.2.1 Object.assign(target, source, ...)
27501var getKeys = require('./_object-keys')
27502 , gOPS = require('./_object-gops')
27503 , pIE = require('./_object-pie')
27504 , toObject = require('./_to-object')
27505 , IObject = require('./_iobject')
27506 , $assign = Object.assign;
27507
27508// should work with symbols and should have deterministic property order (V8 bug)
27509module.exports = !$assign || require('./_fails')(function(){
27510 var A = {}
27511 , B = {}
27512 , S = Symbol()
27513 , K = 'abcdefghijklmnopqrst';
27514 A[S] = 7;
27515 K.split('').forEach(function(k){ B[k] = k; });
27516 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
27517}) ? function assign(target, source){ // eslint-disable-line no-unused-vars
27518 var T = toObject(target)
27519 , aLen = arguments.length
27520 , index = 1
27521 , getSymbols = gOPS.f
27522 , isEnum = pIE.f;
27523 while(aLen > index){
27524 var S = IObject(arguments[index++])
27525 , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S)
27526 , length = keys.length
27527 , j = 0
27528 , key;
27529 while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key];
27530 } return T;
27531} : $assign;
27532},{"./_fails":162,"./_iobject":169,"./_object-gops":188,"./_object-keys":191,"./_object-pie":192,"./_to-object":207}],182:[function(require,module,exports){
27533// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
27534var anObject = require('./_an-object')
27535 , dPs = require('./_object-dps')
27536 , enumBugKeys = require('./_enum-bug-keys')
27537 , IE_PROTO = require('./_shared-key')('IE_PROTO')
27538 , Empty = function(){ /* empty */ }
27539 , PROTOTYPE = 'prototype';
27540
27541// Create object with fake `null` prototype: use iframe Object with cleared prototype
27542var createDict = function(){
27543 // Thrash, waste and sodomy: IE GC bug
27544 var iframe = require('./_dom-create')('iframe')
27545 , i = enumBugKeys.length
27546 , lt = '<'
27547 , gt = '>'
27548 , iframeDocument;
27549 iframe.style.display = 'none';
27550 require('./_html').appendChild(iframe);
27551 iframe.src = 'javascript:'; // eslint-disable-line no-script-url
27552 // createDict = iframe.contentWindow.Object;
27553 // html.removeChild(iframe);
27554 iframeDocument = iframe.contentWindow.document;
27555 iframeDocument.open();
27556 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
27557 iframeDocument.close();
27558 createDict = iframeDocument.F;
27559 while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]];
27560 return createDict();
27561};
27562
27563module.exports = Object.create || function create(O, Properties){
27564 var result;
27565 if(O !== null){
27566 Empty[PROTOTYPE] = anObject(O);
27567 result = new Empty;
27568 Empty[PROTOTYPE] = null;
27569 // add "__proto__" for Object.getPrototypeOf polyfill
27570 result[IE_PROTO] = O;
27571 } else result = createDict();
27572 return Properties === undefined ? result : dPs(result, Properties);
27573};
27574
27575},{"./_an-object":142,"./_dom-create":158,"./_enum-bug-keys":159,"./_html":167,"./_object-dps":184,"./_shared-key":200}],183:[function(require,module,exports){
27576var anObject = require('./_an-object')
27577 , IE8_DOM_DEFINE = require('./_ie8-dom-define')
27578 , toPrimitive = require('./_to-primitive')
27579 , dP = Object.defineProperty;
27580
27581exports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){
27582 anObject(O);
27583 P = toPrimitive(P, true);
27584 anObject(Attributes);
27585 if(IE8_DOM_DEFINE)try {
27586 return dP(O, P, Attributes);
27587 } catch(e){ /* empty */ }
27588 if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');
27589 if('value' in Attributes)O[P] = Attributes.value;
27590 return O;
27591};
27592},{"./_an-object":142,"./_descriptors":157,"./_ie8-dom-define":168,"./_to-primitive":208}],184:[function(require,module,exports){
27593var dP = require('./_object-dp')
27594 , anObject = require('./_an-object')
27595 , getKeys = require('./_object-keys');
27596
27597module.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties){
27598 anObject(O);
27599 var keys = getKeys(Properties)
27600 , length = keys.length
27601 , i = 0
27602 , P;
27603 while(length > i)dP.f(O, P = keys[i++], Properties[P]);
27604 return O;
27605};
27606},{"./_an-object":142,"./_descriptors":157,"./_object-dp":183,"./_object-keys":191}],185:[function(require,module,exports){
27607var pIE = require('./_object-pie')
27608 , createDesc = require('./_property-desc')
27609 , toIObject = require('./_to-iobject')
27610 , toPrimitive = require('./_to-primitive')
27611 , has = require('./_has')
27612 , IE8_DOM_DEFINE = require('./_ie8-dom-define')
27613 , gOPD = Object.getOwnPropertyDescriptor;
27614
27615exports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P){
27616 O = toIObject(O);
27617 P = toPrimitive(P, true);
27618 if(IE8_DOM_DEFINE)try {
27619 return gOPD(O, P);
27620 } catch(e){ /* empty */ }
27621 if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]);
27622};
27623},{"./_descriptors":157,"./_has":165,"./_ie8-dom-define":168,"./_object-pie":192,"./_property-desc":194,"./_to-iobject":205,"./_to-primitive":208}],186:[function(require,module,exports){
27624// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
27625var toIObject = require('./_to-iobject')
27626 , gOPN = require('./_object-gopn').f
27627 , toString = {}.toString;
27628
27629var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
27630 ? Object.getOwnPropertyNames(window) : [];
27631
27632var getWindowNames = function(it){
27633 try {
27634 return gOPN(it);
27635 } catch(e){
27636 return windowNames.slice();
27637 }
27638};
27639
27640module.exports.f = function getOwnPropertyNames(it){
27641 return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
27642};
27643
27644},{"./_object-gopn":187,"./_to-iobject":205}],187:[function(require,module,exports){
27645// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
27646var $keys = require('./_object-keys-internal')
27647 , hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');
27648
27649exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){
27650 return $keys(O, hiddenKeys);
27651};
27652},{"./_enum-bug-keys":159,"./_object-keys-internal":190}],188:[function(require,module,exports){
27653exports.f = Object.getOwnPropertySymbols;
27654},{}],189:[function(require,module,exports){
27655// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
27656var has = require('./_has')
27657 , toObject = require('./_to-object')
27658 , IE_PROTO = require('./_shared-key')('IE_PROTO')
27659 , ObjectProto = Object.prototype;
27660
27661module.exports = Object.getPrototypeOf || function(O){
27662 O = toObject(O);
27663 if(has(O, IE_PROTO))return O[IE_PROTO];
27664 if(typeof O.constructor == 'function' && O instanceof O.constructor){
27665 return O.constructor.prototype;
27666 } return O instanceof Object ? ObjectProto : null;
27667};
27668},{"./_has":165,"./_shared-key":200,"./_to-object":207}],190:[function(require,module,exports){
27669var has = require('./_has')
27670 , toIObject = require('./_to-iobject')
27671 , arrayIndexOf = require('./_array-includes')(false)
27672 , IE_PROTO = require('./_shared-key')('IE_PROTO');
27673
27674module.exports = function(object, names){
27675 var O = toIObject(object)
27676 , i = 0
27677 , result = []
27678 , key;
27679 for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);
27680 // Don't enum bug & hidden keys
27681 while(names.length > i)if(has(O, key = names[i++])){
27682 ~arrayIndexOf(result, key) || result.push(key);
27683 }
27684 return result;
27685};
27686},{"./_array-includes":144,"./_has":165,"./_shared-key":200,"./_to-iobject":205}],191:[function(require,module,exports){
27687// 19.1.2.14 / 15.2.3.14 Object.keys(O)
27688var $keys = require('./_object-keys-internal')
27689 , enumBugKeys = require('./_enum-bug-keys');
27690
27691module.exports = Object.keys || function keys(O){
27692 return $keys(O, enumBugKeys);
27693};
27694},{"./_enum-bug-keys":159,"./_object-keys-internal":190}],192:[function(require,module,exports){
27695exports.f = {}.propertyIsEnumerable;
27696},{}],193:[function(require,module,exports){
27697// most Object methods by ES6 should accept primitives
27698var $export = require('./_export')
27699 , core = require('./_core')
27700 , fails = require('./_fails');
27701module.exports = function(KEY, exec){
27702 var fn = (core.Object || {})[KEY] || Object[KEY]
27703 , exp = {};
27704 exp[KEY] = exec(fn);
27705 $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
27706};
27707},{"./_core":154,"./_export":161,"./_fails":162}],194:[function(require,module,exports){
27708module.exports = function(bitmap, value){
27709 return {
27710 enumerable : !(bitmap & 1),
27711 configurable: !(bitmap & 2),
27712 writable : !(bitmap & 4),
27713 value : value
27714 };
27715};
27716},{}],195:[function(require,module,exports){
27717var hide = require('./_hide');
27718module.exports = function(target, src, safe){
27719 for(var key in src){
27720 if(safe && target[key])target[key] = src[key];
27721 else hide(target, key, src[key]);
27722 } return target;
27723};
27724},{"./_hide":166}],196:[function(require,module,exports){
27725module.exports = require('./_hide');
27726},{"./_hide":166}],197:[function(require,module,exports){
27727// Works with __proto__ only. Old v8 can't work with null proto objects.
27728/* eslint-disable no-proto */
27729var isObject = require('./_is-object')
27730 , anObject = require('./_an-object');
27731var check = function(O, proto){
27732 anObject(O);
27733 if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!");
27734};
27735module.exports = {
27736 set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
27737 function(test, buggy, set){
27738 try {
27739 set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);
27740 set(test, []);
27741 buggy = !(test instanceof Array);
27742 } catch(e){ buggy = true; }
27743 return function setPrototypeOf(O, proto){
27744 check(O, proto);
27745 if(buggy)O.__proto__ = proto;
27746 else set(O, proto);
27747 return O;
27748 };
27749 }({}, false) : undefined),
27750 check: check
27751};
27752},{"./_an-object":142,"./_ctx":155,"./_is-object":172,"./_object-gopd":185}],198:[function(require,module,exports){
27753'use strict';
27754var global = require('./_global')
27755 , core = require('./_core')
27756 , dP = require('./_object-dp')
27757 , DESCRIPTORS = require('./_descriptors')
27758 , SPECIES = require('./_wks')('species');
27759
27760module.exports = function(KEY){
27761 var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
27762 if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, {
27763 configurable: true,
27764 get: function(){ return this; }
27765 });
27766};
27767},{"./_core":154,"./_descriptors":157,"./_global":164,"./_object-dp":183,"./_wks":212}],199:[function(require,module,exports){
27768var def = require('./_object-dp').f
27769 , has = require('./_has')
27770 , TAG = require('./_wks')('toStringTag');
27771
27772module.exports = function(it, tag, stat){
27773 if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag});
27774};
27775},{"./_has":165,"./_object-dp":183,"./_wks":212}],200:[function(require,module,exports){
27776var shared = require('./_shared')('keys')
27777 , uid = require('./_uid');
27778module.exports = function(key){
27779 return shared[key] || (shared[key] = uid(key));
27780};
27781},{"./_shared":201,"./_uid":209}],201:[function(require,module,exports){
27782var global = require('./_global')
27783 , SHARED = '__core-js_shared__'
27784 , store = global[SHARED] || (global[SHARED] = {});
27785module.exports = function(key){
27786 return store[key] || (store[key] = {});
27787};
27788},{"./_global":164}],202:[function(require,module,exports){
27789var toInteger = require('./_to-integer')
27790 , defined = require('./_defined');
27791// true -> String#at
27792// false -> String#codePointAt
27793module.exports = function(TO_STRING){
27794 return function(that, pos){
27795 var s = String(defined(that))
27796 , i = toInteger(pos)
27797 , l = s.length
27798 , a, b;
27799 if(i < 0 || i >= l)return TO_STRING ? '' : undefined;
27800 a = s.charCodeAt(i);
27801 return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
27802 ? TO_STRING ? s.charAt(i) : a
27803 : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
27804 };
27805};
27806},{"./_defined":156,"./_to-integer":204}],203:[function(require,module,exports){
27807var toInteger = require('./_to-integer')
27808 , max = Math.max
27809 , min = Math.min;
27810module.exports = function(index, length){
27811 index = toInteger(index);
27812 return index < 0 ? max(index + length, 0) : min(index, length);
27813};
27814},{"./_to-integer":204}],204:[function(require,module,exports){
27815// 7.1.4 ToInteger
27816var ceil = Math.ceil
27817 , floor = Math.floor;
27818module.exports = function(it){
27819 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
27820};
27821},{}],205:[function(require,module,exports){
27822// to indexed object, toObject with fallback for non-array-like ES3 strings
27823var IObject = require('./_iobject')
27824 , defined = require('./_defined');
27825module.exports = function(it){
27826 return IObject(defined(it));
27827};
27828},{"./_defined":156,"./_iobject":169}],206:[function(require,module,exports){
27829// 7.1.15 ToLength
27830var toInteger = require('./_to-integer')
27831 , min = Math.min;
27832module.exports = function(it){
27833 return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
27834};
27835},{"./_to-integer":204}],207:[function(require,module,exports){
27836// 7.1.13 ToObject(argument)
27837var defined = require('./_defined');
27838module.exports = function(it){
27839 return Object(defined(it));
27840};
27841},{"./_defined":156}],208:[function(require,module,exports){
27842// 7.1.1 ToPrimitive(input [, PreferredType])
27843var isObject = require('./_is-object');
27844// instead of the ES6 spec version, we didn't implement @@toPrimitive case
27845// and the second argument - flag - preferred type is a string
27846module.exports = function(it, S){
27847 if(!isObject(it))return it;
27848 var fn, val;
27849 if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
27850 if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;
27851 if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;
27852 throw TypeError("Can't convert object to primitive value");
27853};
27854},{"./_is-object":172}],209:[function(require,module,exports){
27855var id = 0
27856 , px = Math.random();
27857module.exports = function(key){
27858 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
27859};
27860},{}],210:[function(require,module,exports){
27861var global = require('./_global')
27862 , core = require('./_core')
27863 , LIBRARY = require('./_library')
27864 , wksExt = require('./_wks-ext')
27865 , defineProperty = require('./_object-dp').f;
27866module.exports = function(name){
27867 var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
27868 if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)});
27869};
27870},{"./_core":154,"./_global":164,"./_library":179,"./_object-dp":183,"./_wks-ext":211}],211:[function(require,module,exports){
27871exports.f = require('./_wks');
27872},{"./_wks":212}],212:[function(require,module,exports){
27873var store = require('./_shared')('wks')
27874 , uid = require('./_uid')
27875 , Symbol = require('./_global').Symbol
27876 , USE_SYMBOL = typeof Symbol == 'function';
27877
27878var $exports = module.exports = function(name){
27879 return store[name] || (store[name] =
27880 USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
27881};
27882
27883$exports.store = store;
27884},{"./_global":164,"./_shared":201,"./_uid":209}],213:[function(require,module,exports){
27885var classof = require('./_classof')
27886 , ITERATOR = require('./_wks')('iterator')
27887 , Iterators = require('./_iterators');
27888module.exports = require('./_core').getIteratorMethod = function(it){
27889 if(it != undefined)return it[ITERATOR]
27890 || it['@@iterator']
27891 || Iterators[classof(it)];
27892};
27893},{"./_classof":148,"./_core":154,"./_iterators":177,"./_wks":212}],214:[function(require,module,exports){
27894var anObject = require('./_an-object')
27895 , get = require('./core.get-iterator-method');
27896module.exports = require('./_core').getIterator = function(it){
27897 var iterFn = get(it);
27898 if(typeof iterFn != 'function')throw TypeError(it + ' is not iterable!');
27899 return anObject(iterFn.call(it));
27900};
27901},{"./_an-object":142,"./_core":154,"./core.get-iterator-method":213}],215:[function(require,module,exports){
27902'use strict';
27903var addToUnscopables = require('./_add-to-unscopables')
27904 , step = require('./_iter-step')
27905 , Iterators = require('./_iterators')
27906 , toIObject = require('./_to-iobject');
27907
27908// 22.1.3.4 Array.prototype.entries()
27909// 22.1.3.13 Array.prototype.keys()
27910// 22.1.3.29 Array.prototype.values()
27911// 22.1.3.30 Array.prototype[@@iterator]()
27912module.exports = require('./_iter-define')(Array, 'Array', function(iterated, kind){
27913 this._t = toIObject(iterated); // target
27914 this._i = 0; // next index
27915 this._k = kind; // kind
27916// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
27917}, function(){
27918 var O = this._t
27919 , kind = this._k
27920 , index = this._i++;
27921 if(!O || index >= O.length){
27922 this._t = undefined;
27923 return step(1);
27924 }
27925 if(kind == 'keys' )return step(0, index);
27926 if(kind == 'values')return step(0, O[index]);
27927 return step(0, [index, O[index]]);
27928}, 'values');
27929
27930// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
27931Iterators.Arguments = Iterators.Array;
27932
27933addToUnscopables('keys');
27934addToUnscopables('values');
27935addToUnscopables('entries');
27936},{"./_add-to-unscopables":140,"./_iter-define":175,"./_iter-step":176,"./_iterators":177,"./_to-iobject":205}],216:[function(require,module,exports){
27937'use strict';
27938var strong = require('./_collection-strong');
27939
27940// 23.1 Map Objects
27941module.exports = require('./_collection')('Map', function(get){
27942 return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
27943}, {
27944 // 23.1.3.6 Map.prototype.get(key)
27945 get: function get(key){
27946 var entry = strong.getEntry(this, key);
27947 return entry && entry.v;
27948 },
27949 // 23.1.3.9 Map.prototype.set(key, value)
27950 set: function set(key, value){
27951 return strong.def(this, key === 0 ? 0 : key, value);
27952 }
27953}, strong, true);
27954},{"./_collection":153,"./_collection-strong":150}],217:[function(require,module,exports){
27955// 20.1.2.6 Number.MAX_SAFE_INTEGER
27956var $export = require('./_export');
27957
27958$export($export.S, 'Number', {MAX_SAFE_INTEGER: 0x1fffffffffffff});
27959},{"./_export":161}],218:[function(require,module,exports){
27960// 19.1.3.1 Object.assign(target, source)
27961var $export = require('./_export');
27962
27963$export($export.S + $export.F, 'Object', {assign: require('./_object-assign')});
27964},{"./_export":161,"./_object-assign":181}],219:[function(require,module,exports){
27965var $export = require('./_export')
27966// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
27967$export($export.S, 'Object', {create: require('./_object-create')});
27968},{"./_export":161,"./_object-create":182}],220:[function(require,module,exports){
27969// 19.1.2.14 Object.keys(O)
27970var toObject = require('./_to-object')
27971 , $keys = require('./_object-keys');
27972
27973require('./_object-sap')('keys', function(){
27974 return function keys(it){
27975 return $keys(toObject(it));
27976 };
27977});
27978},{"./_object-keys":191,"./_object-sap":193,"./_to-object":207}],221:[function(require,module,exports){
27979// 19.1.3.19 Object.setPrototypeOf(O, proto)
27980var $export = require('./_export');
27981$export($export.S, 'Object', {setPrototypeOf: require('./_set-proto').set});
27982},{"./_export":161,"./_set-proto":197}],222:[function(require,module,exports){
27983arguments[4][120][0].apply(exports,arguments)
27984},{"dup":120}],223:[function(require,module,exports){
27985'use strict';
27986var $at = require('./_string-at')(true);
27987
27988// 21.1.3.27 String.prototype[@@iterator]()
27989require('./_iter-define')(String, 'String', function(iterated){
27990 this._t = String(iterated); // target
27991 this._i = 0; // next index
27992// 21.1.5.2.1 %StringIteratorPrototype%.next()
27993}, function(){
27994 var O = this._t
27995 , index = this._i
27996 , point;
27997 if(index >= O.length)return {value: undefined, done: true};
27998 point = $at(O, index);
27999 this._i += point.length;
28000 return {value: point, done: false};
28001});
28002},{"./_iter-define":175,"./_string-at":202}],224:[function(require,module,exports){
28003'use strict';
28004// ECMAScript 6 symbols shim
28005var global = require('./_global')
28006 , has = require('./_has')
28007 , DESCRIPTORS = require('./_descriptors')
28008 , $export = require('./_export')
28009 , redefine = require('./_redefine')
28010 , META = require('./_meta').KEY
28011 , $fails = require('./_fails')
28012 , shared = require('./_shared')
28013 , setToStringTag = require('./_set-to-string-tag')
28014 , uid = require('./_uid')
28015 , wks = require('./_wks')
28016 , wksExt = require('./_wks-ext')
28017 , wksDefine = require('./_wks-define')
28018 , keyOf = require('./_keyof')
28019 , enumKeys = require('./_enum-keys')
28020 , isArray = require('./_is-array')
28021 , anObject = require('./_an-object')
28022 , toIObject = require('./_to-iobject')
28023 , toPrimitive = require('./_to-primitive')
28024 , createDesc = require('./_property-desc')
28025 , _create = require('./_object-create')
28026 , gOPNExt = require('./_object-gopn-ext')
28027 , $GOPD = require('./_object-gopd')
28028 , $DP = require('./_object-dp')
28029 , $keys = require('./_object-keys')
28030 , gOPD = $GOPD.f
28031 , dP = $DP.f
28032 , gOPN = gOPNExt.f
28033 , $Symbol = global.Symbol
28034 , $JSON = global.JSON
28035 , _stringify = $JSON && $JSON.stringify
28036 , PROTOTYPE = 'prototype'
28037 , HIDDEN = wks('_hidden')
28038 , TO_PRIMITIVE = wks('toPrimitive')
28039 , isEnum = {}.propertyIsEnumerable
28040 , SymbolRegistry = shared('symbol-registry')
28041 , AllSymbols = shared('symbols')
28042 , OPSymbols = shared('op-symbols')
28043 , ObjectProto = Object[PROTOTYPE]
28044 , USE_NATIVE = typeof $Symbol == 'function'
28045 , QObject = global.QObject;
28046// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
28047var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
28048
28049// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
28050var setSymbolDesc = DESCRIPTORS && $fails(function(){
28051 return _create(dP({}, 'a', {
28052 get: function(){ return dP(this, 'a', {value: 7}).a; }
28053 })).a != 7;
28054}) ? function(it, key, D){
28055 var protoDesc = gOPD(ObjectProto, key);
28056 if(protoDesc)delete ObjectProto[key];
28057 dP(it, key, D);
28058 if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc);
28059} : dP;
28060
28061var wrap = function(tag){
28062 var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
28063 sym._k = tag;
28064 return sym;
28065};
28066
28067var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){
28068 return typeof it == 'symbol';
28069} : function(it){
28070 return it instanceof $Symbol;
28071};
28072
28073var $defineProperty = function defineProperty(it, key, D){
28074 if(it === ObjectProto)$defineProperty(OPSymbols, key, D);
28075 anObject(it);
28076 key = toPrimitive(key, true);
28077 anObject(D);
28078 if(has(AllSymbols, key)){
28079 if(!D.enumerable){
28080 if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {}));
28081 it[HIDDEN][key] = true;
28082 } else {
28083 if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false;
28084 D = _create(D, {enumerable: createDesc(0, false)});
28085 } return setSymbolDesc(it, key, D);
28086 } return dP(it, key, D);
28087};
28088var $defineProperties = function defineProperties(it, P){
28089 anObject(it);
28090 var keys = enumKeys(P = toIObject(P))
28091 , i = 0
28092 , l = keys.length
28093 , key;
28094 while(l > i)$defineProperty(it, key = keys[i++], P[key]);
28095 return it;
28096};
28097var $create = function create(it, P){
28098 return P === undefined ? _create(it) : $defineProperties(_create(it), P);
28099};
28100var $propertyIsEnumerable = function propertyIsEnumerable(key){
28101 var E = isEnum.call(this, key = toPrimitive(key, true));
28102 if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false;
28103 return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
28104};
28105var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){
28106 it = toIObject(it);
28107 key = toPrimitive(key, true);
28108 if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return;
28109 var D = gOPD(it, key);
28110 if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true;
28111 return D;
28112};
28113var $getOwnPropertyNames = function getOwnPropertyNames(it){
28114 var names = gOPN(toIObject(it))
28115 , result = []
28116 , i = 0
28117 , key;
28118 while(names.length > i){
28119 if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key);
28120 } return result;
28121};
28122var $getOwnPropertySymbols = function getOwnPropertySymbols(it){
28123 var IS_OP = it === ObjectProto
28124 , names = gOPN(IS_OP ? OPSymbols : toIObject(it))
28125 , result = []
28126 , i = 0
28127 , key;
28128 while(names.length > i){
28129 if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]);
28130 } return result;
28131};
28132
28133// 19.4.1.1 Symbol([description])
28134if(!USE_NATIVE){
28135 $Symbol = function Symbol(){
28136 if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!');
28137 var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
28138 var $set = function(value){
28139 if(this === ObjectProto)$set.call(OPSymbols, value);
28140 if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false;
28141 setSymbolDesc(this, tag, createDesc(1, value));
28142 };
28143 if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set});
28144 return wrap(tag);
28145 };
28146 redefine($Symbol[PROTOTYPE], 'toString', function toString(){
28147 return this._k;
28148 });
28149
28150 $GOPD.f = $getOwnPropertyDescriptor;
28151 $DP.f = $defineProperty;
28152 require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;
28153 require('./_object-pie').f = $propertyIsEnumerable;
28154 require('./_object-gops').f = $getOwnPropertySymbols;
28155
28156 if(DESCRIPTORS && !require('./_library')){
28157 redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
28158 }
28159
28160 wksExt.f = function(name){
28161 return wrap(wks(name));
28162 }
28163}
28164
28165$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol});
28166
28167for(var symbols = (
28168 // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
28169 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
28170).split(','), i = 0; symbols.length > i; )wks(symbols[i++]);
28171
28172for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]);
28173
28174$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
28175 // 19.4.2.1 Symbol.for(key)
28176 'for': function(key){
28177 return has(SymbolRegistry, key += '')
28178 ? SymbolRegistry[key]
28179 : SymbolRegistry[key] = $Symbol(key);
28180 },
28181 // 19.4.2.5 Symbol.keyFor(sym)
28182 keyFor: function keyFor(key){
28183 if(isSymbol(key))return keyOf(SymbolRegistry, key);
28184 throw TypeError(key + ' is not a symbol!');
28185 },
28186 useSetter: function(){ setter = true; },
28187 useSimple: function(){ setter = false; }
28188});
28189
28190$export($export.S + $export.F * !USE_NATIVE, 'Object', {
28191 // 19.1.2.2 Object.create(O [, Properties])
28192 create: $create,
28193 // 19.1.2.4 Object.defineProperty(O, P, Attributes)
28194 defineProperty: $defineProperty,
28195 // 19.1.2.3 Object.defineProperties(O, Properties)
28196 defineProperties: $defineProperties,
28197 // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
28198 getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
28199 // 19.1.2.7 Object.getOwnPropertyNames(O)
28200 getOwnPropertyNames: $getOwnPropertyNames,
28201 // 19.1.2.8 Object.getOwnPropertySymbols(O)
28202 getOwnPropertySymbols: $getOwnPropertySymbols
28203});
28204
28205// 24.3.2 JSON.stringify(value [, replacer [, space]])
28206$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){
28207 var S = $Symbol();
28208 // MS Edge converts symbol values to JSON as {}
28209 // WebKit converts symbol values to JSON as null
28210 // V8 throws on boxed symbols
28211 return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}';
28212})), 'JSON', {
28213 stringify: function stringify(it){
28214 if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined
28215 var args = [it]
28216 , i = 1
28217 , replacer, $replacer;
28218 while(arguments.length > i)args.push(arguments[i++]);
28219 replacer = args[1];
28220 if(typeof replacer == 'function')$replacer = replacer;
28221 if($replacer || !isArray(replacer))replacer = function(key, value){
28222 if($replacer)value = $replacer.call(this, key, value);
28223 if(!isSymbol(value))return value;
28224 };
28225 args[1] = replacer;
28226 return _stringify.apply($JSON, args);
28227 }
28228});
28229
28230// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
28231$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
28232// 19.4.3.5 Symbol.prototype[@@toStringTag]
28233setToStringTag($Symbol, 'Symbol');
28234// 20.2.1.9 Math[@@toStringTag]
28235setToStringTag(Math, 'Math', true);
28236// 24.3.3 JSON[@@toStringTag]
28237setToStringTag(global.JSON, 'JSON', true);
28238},{"./_an-object":142,"./_descriptors":157,"./_enum-keys":160,"./_export":161,"./_fails":162,"./_global":164,"./_has":165,"./_hide":166,"./_is-array":171,"./_keyof":178,"./_library":179,"./_meta":180,"./_object-create":182,"./_object-dp":183,"./_object-gopd":185,"./_object-gopn":187,"./_object-gopn-ext":186,"./_object-gops":188,"./_object-keys":191,"./_object-pie":192,"./_property-desc":194,"./_redefine":196,"./_set-to-string-tag":199,"./_shared":201,"./_to-iobject":205,"./_to-primitive":208,"./_uid":209,"./_wks":212,"./_wks-define":210,"./_wks-ext":211}],225:[function(require,module,exports){
28239'use strict';
28240var each = require('./_array-methods')(0)
28241 , redefine = require('./_redefine')
28242 , meta = require('./_meta')
28243 , assign = require('./_object-assign')
28244 , weak = require('./_collection-weak')
28245 , isObject = require('./_is-object')
28246 , getWeak = meta.getWeak
28247 , isExtensible = Object.isExtensible
28248 , uncaughtFrozenStore = weak.ufstore
28249 , tmp = {}
28250 , InternalMap;
28251
28252var wrapper = function(get){
28253 return function WeakMap(){
28254 return get(this, arguments.length > 0 ? arguments[0] : undefined);
28255 };
28256};
28257
28258var methods = {
28259 // 23.3.3.3 WeakMap.prototype.get(key)
28260 get: function get(key){
28261 if(isObject(key)){
28262 var data = getWeak(key);
28263 if(data === true)return uncaughtFrozenStore(this).get(key);
28264 return data ? data[this._i] : undefined;
28265 }
28266 },
28267 // 23.3.3.5 WeakMap.prototype.set(key, value)
28268 set: function set(key, value){
28269 return weak.def(this, key, value);
28270 }
28271};
28272
28273// 23.3 WeakMap Objects
28274var $WeakMap = module.exports = require('./_collection')('WeakMap', wrapper, methods, weak, true, true);
28275
28276// IE11 WeakMap frozen keys fix
28277if(new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7){
28278 InternalMap = weak.getConstructor(wrapper);
28279 assign(InternalMap.prototype, methods);
28280 meta.NEED = true;
28281 each(['delete', 'has', 'get', 'set'], function(key){
28282 var proto = $WeakMap.prototype
28283 , method = proto[key];
28284 redefine(proto, key, function(a, b){
28285 // store frozen objects on internal weakmap shim
28286 if(isObject(a) && !isExtensible(a)){
28287 if(!this._f)this._f = new InternalMap;
28288 var result = this._f[key](a, b);
28289 return key == 'set' ? this : result;
28290 // store all the rest on native weakmap
28291 } return method.call(this, a, b);
28292 });
28293 });
28294}
28295},{"./_array-methods":145,"./_collection":153,"./_collection-weak":152,"./_is-object":172,"./_meta":180,"./_object-assign":181,"./_redefine":196}],226:[function(require,module,exports){
28296'use strict';
28297var weak = require('./_collection-weak');
28298
28299// 23.4 WeakSet Objects
28300require('./_collection')('WeakSet', function(get){
28301 return function WeakSet(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); };
28302}, {
28303 // 23.4.3.1 WeakSet.prototype.add(value)
28304 add: function add(value){
28305 return weak.def(this, value, true);
28306 }
28307}, weak, false, true);
28308},{"./_collection":153,"./_collection-weak":152}],227:[function(require,module,exports){
28309// https://github.com/DavidBruant/Map-Set.prototype.toJSON
28310var $export = require('./_export');
28311
28312$export($export.P + $export.R, 'Map', {toJSON: require('./_collection-to-json')('Map')});
28313},{"./_collection-to-json":151,"./_export":161}],228:[function(require,module,exports){
28314require('./_wks-define')('asyncIterator');
28315},{"./_wks-define":210}],229:[function(require,module,exports){
28316require('./_wks-define')('observable');
28317},{"./_wks-define":210}],230:[function(require,module,exports){
28318require('./es6.array.iterator');
28319var global = require('./_global')
28320 , hide = require('./_hide')
28321 , Iterators = require('./_iterators')
28322 , TO_STRING_TAG = require('./_wks')('toStringTag');
28323
28324for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){
28325 var NAME = collections[i]
28326 , Collection = global[NAME]
28327 , proto = Collection && Collection.prototype;
28328 if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME);
28329 Iterators[NAME] = Iterators.Array;
28330}
28331},{"./_global":164,"./_hide":166,"./_iterators":177,"./_wks":212,"./es6.array.iterator":215}],231:[function(require,module,exports){
28332module.exports = require('./src/node');
28333
28334},{"./src/node":234}],232:[function(require,module,exports){
28335(function (process){
28336/**
28337 * This is the web browser implementation of `debug()`.
28338 *
28339 * Expose `debug()` as the module.
28340 */
28341
28342exports = module.exports = require('./debug');
28343exports.log = log;
28344exports.formatArgs = formatArgs;
28345exports.save = save;
28346exports.load = load;
28347exports.useColors = useColors;
28348exports.storage = 'undefined' != typeof chrome
28349 && 'undefined' != typeof chrome.storage
28350 ? chrome.storage.local
28351 : localstorage();
28352
28353/**
28354 * Colors.
28355 */
28356
28357exports.colors = [
28358 'lightseagreen',
28359 'forestgreen',
28360 'goldenrod',
28361 'dodgerblue',
28362 'darkorchid',
28363 'crimson'
28364];
28365
28366/**
28367 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
28368 * and the Firebug extension (any Firefox version) are known
28369 * to support "%c" CSS customizations.
28370 *
28371 * TODO: add a `localStorage` variable to explicitly enable/disable colors
28372 */
28373
28374function useColors() {
28375 // NB: In an Electron preload script, document will be defined but not fully
28376 // initialized. Since we know we're in Chrome, we'll just detect this case
28377 // explicitly
28378 if (typeof window !== 'undefined' && window && typeof window.process !== 'undefined' && window.process.type === 'renderer') {
28379 return true;
28380 }
28381
28382 // is webkit? http://stackoverflow.com/a/16459606/376773
28383 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
28384 return (typeof document !== 'undefined' && document && 'WebkitAppearance' in document.documentElement.style) ||
28385 // is firebug? http://stackoverflow.com/a/398120/376773
28386 (typeof window !== 'undefined' && window && window.console && (console.firebug || (console.exception && console.table))) ||
28387 // is firefox >= v31?
28388 // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
28389 (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
28390 // double check webkit in userAgent just in case we are in a worker
28391 (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
28392}
28393
28394/**
28395 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
28396 */
28397
28398exports.formatters.j = function(v) {
28399 try {
28400 return JSON.stringify(v);
28401 } catch (err) {
28402 return '[UnexpectedJSONParseError]: ' + err.message;
28403 }
28404};
28405
28406
28407/**
28408 * Colorize log arguments if enabled.
28409 *
28410 * @api public
28411 */
28412
28413function formatArgs(args) {
28414 var useColors = this.useColors;
28415
28416 args[0] = (useColors ? '%c' : '')
28417 + this.namespace
28418 + (useColors ? ' %c' : ' ')
28419 + args[0]
28420 + (useColors ? '%c ' : ' ')
28421 + '+' + exports.humanize(this.diff);
28422
28423 if (!useColors) return;
28424
28425 var c = 'color: ' + this.color;
28426 args.splice(1, 0, c, 'color: inherit')
28427
28428 // the final "%c" is somewhat tricky, because there could be other
28429 // arguments passed either before or after the %c, so we need to
28430 // figure out the correct index to insert the CSS into
28431 var index = 0;
28432 var lastC = 0;
28433 args[0].replace(/%[a-zA-Z%]/g, function(match) {
28434 if ('%%' === match) return;
28435 index++;
28436 if ('%c' === match) {
28437 // we only are interested in the *last* %c
28438 // (the user may have provided their own)
28439 lastC = index;
28440 }
28441 });
28442
28443 args.splice(lastC, 0, c);
28444}
28445
28446/**
28447 * Invokes `console.log()` when available.
28448 * No-op when `console.log` is not a "function".
28449 *
28450 * @api public
28451 */
28452
28453function log() {
28454 // this hackery is required for IE8/9, where
28455 // the `console.log` function doesn't have 'apply'
28456 return 'object' === typeof console
28457 && console.log
28458 && Function.prototype.apply.call(console.log, console, arguments);
28459}
28460
28461/**
28462 * Save `namespaces`.
28463 *
28464 * @param {String} namespaces
28465 * @api private
28466 */
28467
28468function save(namespaces) {
28469 try {
28470 if (null == namespaces) {
28471 exports.storage.removeItem('debug');
28472 } else {
28473 exports.storage.debug = namespaces;
28474 }
28475 } catch(e) {}
28476}
28477
28478/**
28479 * Load `namespaces`.
28480 *
28481 * @return {String} returns the previously persisted debug modes
28482 * @api private
28483 */
28484
28485function load() {
28486 try {
28487 return exports.storage.debug;
28488 } catch(e) {}
28489
28490 // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
28491 if (typeof process !== 'undefined' && 'env' in process) {
28492 return process.env.DEBUG;
28493 }
28494}
28495
28496/**
28497 * Enable namespaces listed in `localStorage.debug` initially.
28498 */
28499
28500exports.enable(load());
28501
28502/**
28503 * Localstorage attempts to return the localstorage.
28504 *
28505 * This is necessary because safari throws
28506 * when a user disables cookies/localstorage
28507 * and you attempt to access it.
28508 *
28509 * @return {LocalStorage}
28510 * @api private
28511 */
28512
28513function localstorage() {
28514 try {
28515 return window.localStorage;
28516 } catch (e) {}
28517}
28518
28519}).call(this,require('_process'))
28520},{"./debug":233,"_process":471}],233:[function(require,module,exports){
28521
28522/**
28523 * This is the common logic for both the Node.js and web browser
28524 * implementations of `debug()`.
28525 *
28526 * Expose `debug()` as the module.
28527 */
28528
28529exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
28530exports.coerce = coerce;
28531exports.disable = disable;
28532exports.enable = enable;
28533exports.enabled = enabled;
28534exports.humanize = require('ms');
28535
28536/**
28537 * The currently active debug mode names, and names to skip.
28538 */
28539
28540exports.names = [];
28541exports.skips = [];
28542
28543/**
28544 * Map of special "%n" handling functions, for the debug "format" argument.
28545 *
28546 * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
28547 */
28548
28549exports.formatters = {};
28550
28551/**
28552 * Previous log timestamp.
28553 */
28554
28555var prevTime;
28556
28557/**
28558 * Select a color.
28559 * @param {String} namespace
28560 * @return {Number}
28561 * @api private
28562 */
28563
28564function selectColor(namespace) {
28565 var hash = 0, i;
28566
28567 for (i in namespace) {
28568 hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
28569 hash |= 0; // Convert to 32bit integer
28570 }
28571
28572 return exports.colors[Math.abs(hash) % exports.colors.length];
28573}
28574
28575/**
28576 * Create a debugger with the given `namespace`.
28577 *
28578 * @param {String} namespace
28579 * @return {Function}
28580 * @api public
28581 */
28582
28583function createDebug(namespace) {
28584
28585 function debug() {
28586 // disabled?
28587 if (!debug.enabled) return;
28588
28589 var self = debug;
28590
28591 // set `diff` timestamp
28592 var curr = +new Date();
28593 var ms = curr - (prevTime || curr);
28594 self.diff = ms;
28595 self.prev = prevTime;
28596 self.curr = curr;
28597 prevTime = curr;
28598
28599 // turn the `arguments` into a proper Array
28600 var args = new Array(arguments.length);
28601 for (var i = 0; i < args.length; i++) {
28602 args[i] = arguments[i];
28603 }
28604
28605 args[0] = exports.coerce(args[0]);
28606
28607 if ('string' !== typeof args[0]) {
28608 // anything else let's inspect with %O
28609 args.unshift('%O');
28610 }
28611
28612 // apply any `formatters` transformations
28613 var index = 0;
28614 args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
28615 // if we encounter an escaped % then don't increase the array index
28616 if (match === '%%') return match;
28617 index++;
28618 var formatter = exports.formatters[format];
28619 if ('function' === typeof formatter) {
28620 var val = args[index];
28621 match = formatter.call(self, val);
28622
28623 // now we need to remove `args[index]` since it's inlined in the `format`
28624 args.splice(index, 1);
28625 index--;
28626 }
28627 return match;
28628 });
28629
28630 // apply env-specific formatting (colors, etc.)
28631 exports.formatArgs.call(self, args);
28632
28633 var logFn = debug.log || exports.log || console.log.bind(console);
28634 logFn.apply(self, args);
28635 }
28636
28637 debug.namespace = namespace;
28638 debug.enabled = exports.enabled(namespace);
28639 debug.useColors = exports.useColors();
28640 debug.color = selectColor(namespace);
28641
28642 // env-specific initialization logic for debug instances
28643 if ('function' === typeof exports.init) {
28644 exports.init(debug);
28645 }
28646
28647 return debug;
28648}
28649
28650/**
28651 * Enables a debug mode by namespaces. This can include modes
28652 * separated by a colon and wildcards.
28653 *
28654 * @param {String} namespaces
28655 * @api public
28656 */
28657
28658function enable(namespaces) {
28659 exports.save(namespaces);
28660
28661 exports.names = [];
28662 exports.skips = [];
28663
28664 var split = (namespaces || '').split(/[\s,]+/);
28665 var len = split.length;
28666
28667 for (var i = 0; i < len; i++) {
28668 if (!split[i]) continue; // ignore empty strings
28669 namespaces = split[i].replace(/\*/g, '.*?');
28670 if (namespaces[0] === '-') {
28671 exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
28672 } else {
28673 exports.names.push(new RegExp('^' + namespaces + '$'));
28674 }
28675 }
28676}
28677
28678/**
28679 * Disable debug output.
28680 *
28681 * @api public
28682 */
28683
28684function disable() {
28685 exports.enable('');
28686}
28687
28688/**
28689 * Returns true if the given mode name is enabled, false otherwise.
28690 *
28691 * @param {String} name
28692 * @return {Boolean}
28693 * @api public
28694 */
28695
28696function enabled(name) {
28697 var i, len;
28698 for (i = 0, len = exports.skips.length; i < len; i++) {
28699 if (exports.skips[i].test(name)) {
28700 return false;
28701 }
28702 }
28703 for (i = 0, len = exports.names.length; i < len; i++) {
28704 if (exports.names[i].test(name)) {
28705 return true;
28706 }
28707 }
28708 return false;
28709}
28710
28711/**
28712 * Coerce `val`.
28713 *
28714 * @param {Mixed} val
28715 * @return {Mixed}
28716 * @api private
28717 */
28718
28719function coerce(val) {
28720 if (val instanceof Error) return val.stack || val.message;
28721 return val;
28722}
28723
28724},{"ms":467}],234:[function(require,module,exports){
28725(function (process){
28726/**
28727 * Module dependencies.
28728 */
28729
28730var tty = require('tty');
28731var util = require('util');
28732
28733/**
28734 * This is the Node.js implementation of `debug()`.
28735 *
28736 * Expose `debug()` as the module.
28737 */
28738
28739exports = module.exports = require('./debug');
28740exports.init = init;
28741exports.log = log;
28742exports.formatArgs = formatArgs;
28743exports.save = save;
28744exports.load = load;
28745exports.useColors = useColors;
28746
28747/**
28748 * Colors.
28749 */
28750
28751exports.colors = [6, 2, 3, 4, 5, 1];
28752
28753/**
28754 * Build up the default `inspectOpts` object from the environment variables.
28755 *
28756 * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
28757 */
28758
28759exports.inspectOpts = Object.keys(process.env).filter(function (key) {
28760 return /^debug_/i.test(key);
28761}).reduce(function (obj, key) {
28762 // camel-case
28763 var prop = key
28764 .substring(6)
28765 .toLowerCase()
28766 .replace(/_([a-z])/, function (_, k) { return k.toUpperCase() });
28767
28768 // coerce string value into JS value
28769 var val = process.env[key];
28770 if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
28771 else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
28772 else if (val === 'null') val = null;
28773 else val = Number(val);
28774
28775 obj[prop] = val;
28776 return obj;
28777}, {});
28778
28779/**
28780 * The file descriptor to write the `debug()` calls to.
28781 * Set the `DEBUG_FD` env variable to override with another value. i.e.:
28782 *
28783 * $ DEBUG_FD=3 node script.js 3>debug.log
28784 */
28785
28786var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
28787
28788if (1 !== fd && 2 !== fd) {
28789 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)')()
28790}
28791
28792var stream = 1 === fd ? process.stdout :
28793 2 === fd ? process.stderr :
28794 createWritableStdioStream(fd);
28795
28796/**
28797 * Is stdout a TTY? Colored output is enabled when `true`.
28798 */
28799
28800function useColors() {
28801 return 'colors' in exports.inspectOpts
28802 ? Boolean(exports.inspectOpts.colors)
28803 : tty.isatty(fd);
28804}
28805
28806/**
28807 * Map %o to `util.inspect()`, all on a single line.
28808 */
28809
28810exports.formatters.o = function(v) {
28811 this.inspectOpts.colors = this.useColors;
28812 return util.inspect(v, this.inspectOpts)
28813 .replace(/\s*\n\s*/g, ' ');
28814};
28815
28816/**
28817 * Map %o to `util.inspect()`, allowing multiple lines if needed.
28818 */
28819
28820exports.formatters.O = function(v) {
28821 this.inspectOpts.colors = this.useColors;
28822 return util.inspect(v, this.inspectOpts);
28823};
28824
28825/**
28826 * Adds ANSI color escape codes if enabled.
28827 *
28828 * @api public
28829 */
28830
28831function formatArgs(args) {
28832 var name = this.namespace;
28833 var useColors = this.useColors;
28834
28835 if (useColors) {
28836 var c = this.color;
28837 var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
28838
28839 args[0] = prefix + args[0].split('\n').join('\n' + prefix);
28840 args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
28841 } else {
28842 args[0] = new Date().toUTCString()
28843 + ' ' + name + ' ' + args[0];
28844 }
28845}
28846
28847/**
28848 * Invokes `util.format()` with the specified arguments and writes to `stream`.
28849 */
28850
28851function log() {
28852 return stream.write(util.format.apply(util, arguments) + '\n');
28853}
28854
28855/**
28856 * Save `namespaces`.
28857 *
28858 * @param {String} namespaces
28859 * @api private
28860 */
28861
28862function save(namespaces) {
28863 if (null == namespaces) {
28864 // If you set a process.env field to null or undefined, it gets cast to the
28865 // string 'null' or 'undefined'. Just delete instead.
28866 delete process.env.DEBUG;
28867 } else {
28868 process.env.DEBUG = namespaces;
28869 }
28870}
28871
28872/**
28873 * Load `namespaces`.
28874 *
28875 * @return {String} returns the previously persisted debug modes
28876 * @api private
28877 */
28878
28879function load() {
28880 return process.env.DEBUG;
28881}
28882
28883/**
28884 * Copied from `node/src/node.js`.
28885 *
28886 * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
28887 * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
28888 */
28889
28890function createWritableStdioStream (fd) {
28891 var stream;
28892 var tty_wrap = process.binding('tty_wrap');
28893
28894 // Note stream._type is used for test-module-load-list.js
28895
28896 switch (tty_wrap.guessHandleType(fd)) {
28897 case 'TTY':
28898 stream = new tty.WriteStream(fd);
28899 stream._type = 'tty';
28900
28901 // Hack to have stream not keep the event loop alive.
28902 // See https://github.com/joyent/node/issues/1726
28903 if (stream._handle && stream._handle.unref) {
28904 stream._handle.unref();
28905 }
28906 break;
28907
28908 case 'FILE':
28909 var fs = require('fs');
28910 stream = new fs.SyncWriteStream(fd, { autoClose: false });
28911 stream._type = 'fs';
28912 break;
28913
28914 case 'PIPE':
28915 case 'TCP':
28916 var net = require('net');
28917 stream = new net.Socket({
28918 fd: fd,
28919 readable: false,
28920 writable: true
28921 });
28922
28923 // FIXME Should probably have an option in net.Socket to create a
28924 // stream from an existing fd which is writable only. But for now
28925 // we'll just add this hack and set the `readable` member to false.
28926 // Test: ./node test/fixtures/echo.js < /etc/passwd
28927 stream.readable = false;
28928 stream.read = null;
28929 stream._type = 'pipe';
28930
28931 // FIXME Hack to have stream not keep the event loop alive.
28932 // See https://github.com/joyent/node/issues/1726
28933 if (stream._handle && stream._handle.unref) {
28934 stream._handle.unref();
28935 }
28936 break;
28937
28938 default:
28939 // Probably an error on in uv_guess_handle()
28940 throw new Error('Implement me. Unknown stream file type!');
28941 }
28942
28943 // For supporting legacy API we put the FD here.
28944 stream.fd = fd;
28945
28946 stream._isStdio = true;
28947
28948 return stream;
28949}
28950
28951/**
28952 * Init logic for `debug` instances.
28953 *
28954 * Create a new `inspectOpts` object in case `useColors` is set
28955 * differently for a particular `debug` instance.
28956 */
28957
28958function init (debug) {
28959 debug.inspectOpts = util._extend({}, exports.inspectOpts);
28960}
28961
28962/**
28963 * Enable namespaces listed in `process.env.DEBUG` initially.
28964 */
28965
28966exports.enable(load());
28967
28968}).call(this,require('_process'))
28969},{"./debug":233,"_process":471,"fs":120,"net":120,"tty":489,"util":492}],235:[function(require,module,exports){
28970/* eslint-disable guard-for-in */
28971'use strict';
28972var repeating = require('repeating');
28973
28974// detect either spaces or tabs but not both to properly handle tabs
28975// for indentation and spaces for alignment
28976var INDENT_RE = /^(?:( )+|\t+)/;
28977
28978function getMostUsed(indents) {
28979 var result = 0;
28980 var maxUsed = 0;
28981 var maxWeight = 0;
28982
28983 for (var n in indents) {
28984 var indent = indents[n];
28985 var u = indent[0];
28986 var w = indent[1];
28987
28988 if (u > maxUsed || u === maxUsed && w > maxWeight) {
28989 maxUsed = u;
28990 maxWeight = w;
28991 result = Number(n);
28992 }
28993 }
28994
28995 return result;
28996}
28997
28998module.exports = function (str) {
28999 if (typeof str !== 'string') {
29000 throw new TypeError('Expected a string');
29001 }
29002
29003 // used to see if tabs or spaces are the most used
29004 var tabs = 0;
29005 var spaces = 0;
29006
29007 // remember the size of previous line's indentation
29008 var prev = 0;
29009
29010 // remember how many indents/unindents as occurred for a given size
29011 // and how much lines follow a given indentation
29012 //
29013 // indents = {
29014 // 3: [1, 0],
29015 // 4: [1, 5],
29016 // 5: [1, 0],
29017 // 12: [1, 0],
29018 // }
29019 var indents = {};
29020
29021 // pointer to the array of last used indent
29022 var current;
29023
29024 // whether the last action was an indent (opposed to an unindent)
29025 var isIndent;
29026
29027 str.split(/\n/g).forEach(function (line) {
29028 if (!line) {
29029 // ignore empty lines
29030 return;
29031 }
29032
29033 var indent;
29034 var matches = line.match(INDENT_RE);
29035
29036 if (!matches) {
29037 indent = 0;
29038 } else {
29039 indent = matches[0].length;
29040
29041 if (matches[1]) {
29042 spaces++;
29043 } else {
29044 tabs++;
29045 }
29046 }
29047
29048 var diff = indent - prev;
29049 prev = indent;
29050
29051 if (diff) {
29052 // an indent or unindent has been detected
29053
29054 isIndent = diff > 0;
29055
29056 current = indents[isIndent ? diff : -diff];
29057
29058 if (current) {
29059 current[0]++;
29060 } else {
29061 current = indents[diff] = [1, 0];
29062 }
29063 } else if (current) {
29064 // if the last action was an indent, increment the weight
29065 current[1] += Number(isIndent);
29066 }
29067 });
29068
29069 var amount = getMostUsed(indents);
29070
29071 var type;
29072 var actual;
29073 if (!amount) {
29074 type = null;
29075 actual = '';
29076 } else if (spaces >= tabs) {
29077 type = 'space';
29078 actual = repeating(' ', amount);
29079 } else {
29080 type = 'tab';
29081 actual = repeating('\t', amount);
29082 }
29083
29084 return {
29085 amount: amount,
29086 type: type,
29087 indent: actual
29088 };
29089};
29090
29091},{"repeating":472}],236:[function(require,module,exports){
29092'use strict';
29093
29094var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
29095
29096module.exports = function (str) {
29097 if (typeof str !== 'string') {
29098 throw new TypeError('Expected a string');
29099 }
29100
29101 return str.replace(matchOperatorsRe, '\\$&');
29102};
29103
29104},{}],237:[function(require,module,exports){
29105/*
29106 Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
29107
29108 Redistribution and use in source and binary forms, with or without
29109 modification, are permitted provided that the following conditions are met:
29110
29111 * Redistributions of source code must retain the above copyright
29112 notice, this list of conditions and the following disclaimer.
29113 * Redistributions in binary form must reproduce the above copyright
29114 notice, this list of conditions and the following disclaimer in the
29115 documentation and/or other materials provided with the distribution.
29116
29117 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
29118 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29119 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29120 ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
29121 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29122 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29123 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29124 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29125 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29126 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29127*/
29128
29129(function () {
29130 'use strict';
29131
29132 function isExpression(node) {
29133 if (node == null) { return false; }
29134 switch (node.type) {
29135 case 'ArrayExpression':
29136 case 'AssignmentExpression':
29137 case 'BinaryExpression':
29138 case 'CallExpression':
29139 case 'ConditionalExpression':
29140 case 'FunctionExpression':
29141 case 'Identifier':
29142 case 'Literal':
29143 case 'LogicalExpression':
29144 case 'MemberExpression':
29145 case 'NewExpression':
29146 case 'ObjectExpression':
29147 case 'SequenceExpression':
29148 case 'ThisExpression':
29149 case 'UnaryExpression':
29150 case 'UpdateExpression':
29151 return true;
29152 }
29153 return false;
29154 }
29155
29156 function isIterationStatement(node) {
29157 if (node == null) { return false; }
29158 switch (node.type) {
29159 case 'DoWhileStatement':
29160 case 'ForInStatement':
29161 case 'ForStatement':
29162 case 'WhileStatement':
29163 return true;
29164 }
29165 return false;
29166 }
29167
29168 function isStatement(node) {
29169 if (node == null) { return false; }
29170 switch (node.type) {
29171 case 'BlockStatement':
29172 case 'BreakStatement':
29173 case 'ContinueStatement':
29174 case 'DebuggerStatement':
29175 case 'DoWhileStatement':
29176 case 'EmptyStatement':
29177 case 'ExpressionStatement':
29178 case 'ForInStatement':
29179 case 'ForStatement':
29180 case 'IfStatement':
29181 case 'LabeledStatement':
29182 case 'ReturnStatement':
29183 case 'SwitchStatement':
29184 case 'ThrowStatement':
29185 case 'TryStatement':
29186 case 'VariableDeclaration':
29187 case 'WhileStatement':
29188 case 'WithStatement':
29189 return true;
29190 }
29191 return false;
29192 }
29193
29194 function isSourceElement(node) {
29195 return isStatement(node) || node != null && node.type === 'FunctionDeclaration';
29196 }
29197
29198 function trailingStatement(node) {
29199 switch (node.type) {
29200 case 'IfStatement':
29201 if (node.alternate != null) {
29202 return node.alternate;
29203 }
29204 return node.consequent;
29205
29206 case 'LabeledStatement':
29207 case 'ForStatement':
29208 case 'ForInStatement':
29209 case 'WhileStatement':
29210 case 'WithStatement':
29211 return node.body;
29212 }
29213 return null;
29214 }
29215
29216 function isProblematicIfStatement(node) {
29217 var current;
29218
29219 if (node.type !== 'IfStatement') {
29220 return false;
29221 }
29222 if (node.alternate == null) {
29223 return false;
29224 }
29225 current = node.consequent;
29226 do {
29227 if (current.type === 'IfStatement') {
29228 if (current.alternate == null) {
29229 return true;
29230 }
29231 }
29232 current = trailingStatement(current);
29233 } while (current);
29234
29235 return false;
29236 }
29237
29238 module.exports = {
29239 isExpression: isExpression,
29240 isStatement: isStatement,
29241 isIterationStatement: isIterationStatement,
29242 isSourceElement: isSourceElement,
29243 isProblematicIfStatement: isProblematicIfStatement,
29244
29245 trailingStatement: trailingStatement
29246 };
29247}());
29248/* vim: set sw=4 ts=4 et tw=80 : */
29249
29250},{}],238:[function(require,module,exports){
29251/*
29252 Copyright (C) 2013-2014 Yusuke Suzuki <utatane.tea@gmail.com>
29253 Copyright (C) 2014 Ivan Nikulin <ifaaan@gmail.com>
29254
29255 Redistribution and use in source and binary forms, with or without
29256 modification, are permitted provided that the following conditions are met:
29257
29258 * Redistributions of source code must retain the above copyright
29259 notice, this list of conditions and the following disclaimer.
29260 * Redistributions in binary form must reproduce the above copyright
29261 notice, this list of conditions and the following disclaimer in the
29262 documentation and/or other materials provided with the distribution.
29263
29264 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29265 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29266 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29267 ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
29268 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29269 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29270 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29271 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29272 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29273 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29274*/
29275
29276(function () {
29277 'use strict';
29278
29279 var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch;
29280
29281 // See `tools/generate-identifier-regex.js`.
29282 ES5Regex = {
29283 // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierStart:
29284 NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
29285 // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierPart:
29286 NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/
29287 };
29288
29289 ES6Regex = {
29290 // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierStart:
29291 NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/,
29292 // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierPart:
29293 NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
29294 };
29295
29296 function isDecimalDigit(ch) {
29297 return 0x30 <= ch && ch <= 0x39; // 0..9
29298 }
29299
29300 function isHexDigit(ch) {
29301 return 0x30 <= ch && ch <= 0x39 || // 0..9
29302 0x61 <= ch && ch <= 0x66 || // a..f
29303 0x41 <= ch && ch <= 0x46; // A..F
29304 }
29305
29306 function isOctalDigit(ch) {
29307 return ch >= 0x30 && ch <= 0x37; // 0..7
29308 }
29309
29310 // 7.2 White Space
29311
29312 NON_ASCII_WHITESPACES = [
29313 0x1680, 0x180E,
29314 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A,
29315 0x202F, 0x205F,
29316 0x3000,
29317 0xFEFF
29318 ];
29319
29320 function isWhiteSpace(ch) {
29321 return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 ||
29322 ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0;
29323 }
29324
29325 // 7.3 Line Terminators
29326
29327 function isLineTerminator(ch) {
29328 return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;
29329 }
29330
29331 // 7.6 Identifier Names and Identifiers
29332
29333 function fromCodePoint(cp) {
29334 if (cp <= 0xFFFF) { return String.fromCharCode(cp); }
29335 var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800);
29336 var cu2 = String.fromCharCode(((cp - 0x10000) % 0x400) + 0xDC00);
29337 return cu1 + cu2;
29338 }
29339
29340 IDENTIFIER_START = new Array(0x80);
29341 for(ch = 0; ch < 0x80; ++ch) {
29342 IDENTIFIER_START[ch] =
29343 ch >= 0x61 && ch <= 0x7A || // a..z
29344 ch >= 0x41 && ch <= 0x5A || // A..Z
29345 ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore)
29346 }
29347
29348 IDENTIFIER_PART = new Array(0x80);
29349 for(ch = 0; ch < 0x80; ++ch) {
29350 IDENTIFIER_PART[ch] =
29351 ch >= 0x61 && ch <= 0x7A || // a..z
29352 ch >= 0x41 && ch <= 0x5A || // A..Z
29353 ch >= 0x30 && ch <= 0x39 || // 0..9
29354 ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore)
29355 }
29356
29357 function isIdentifierStartES5(ch) {
29358 return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));
29359 }
29360
29361 function isIdentifierPartES5(ch) {
29362 return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));
29363 }
29364
29365 function isIdentifierStartES6(ch) {
29366 return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));
29367 }
29368
29369 function isIdentifierPartES6(ch) {
29370 return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));
29371 }
29372
29373 module.exports = {
29374 isDecimalDigit: isDecimalDigit,
29375 isHexDigit: isHexDigit,
29376 isOctalDigit: isOctalDigit,
29377 isWhiteSpace: isWhiteSpace,
29378 isLineTerminator: isLineTerminator,
29379 isIdentifierStartES5: isIdentifierStartES5,
29380 isIdentifierPartES5: isIdentifierPartES5,
29381 isIdentifierStartES6: isIdentifierStartES6,
29382 isIdentifierPartES6: isIdentifierPartES6
29383 };
29384}());
29385/* vim: set sw=4 ts=4 et tw=80 : */
29386
29387},{}],239:[function(require,module,exports){
29388/*
29389 Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
29390
29391 Redistribution and use in source and binary forms, with or without
29392 modification, are permitted provided that the following conditions are met:
29393
29394 * Redistributions of source code must retain the above copyright
29395 notice, this list of conditions and the following disclaimer.
29396 * Redistributions in binary form must reproduce the above copyright
29397 notice, this list of conditions and the following disclaimer in the
29398 documentation and/or other materials provided with the distribution.
29399
29400 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29401 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29402 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29403 ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
29404 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29405 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29406 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29407 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29408 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29409 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29410*/
29411
29412(function () {
29413 'use strict';
29414
29415 var code = require('./code');
29416
29417 function isStrictModeReservedWordES6(id) {
29418 switch (id) {
29419 case 'implements':
29420 case 'interface':
29421 case 'package':
29422 case 'private':
29423 case 'protected':
29424 case 'public':
29425 case 'static':
29426 case 'let':
29427 return true;
29428 default:
29429 return false;
29430 }
29431 }
29432
29433 function isKeywordES5(id, strict) {
29434 // yield should not be treated as keyword under non-strict mode.
29435 if (!strict && id === 'yield') {
29436 return false;
29437 }
29438 return isKeywordES6(id, strict);
29439 }
29440
29441 function isKeywordES6(id, strict) {
29442 if (strict && isStrictModeReservedWordES6(id)) {
29443 return true;
29444 }
29445
29446 switch (id.length) {
29447 case 2:
29448 return (id === 'if') || (id === 'in') || (id === 'do');
29449 case 3:
29450 return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try');
29451 case 4:
29452 return (id === 'this') || (id === 'else') || (id === 'case') ||
29453 (id === 'void') || (id === 'with') || (id === 'enum');
29454 case 5:
29455 return (id === 'while') || (id === 'break') || (id === 'catch') ||
29456 (id === 'throw') || (id === 'const') || (id === 'yield') ||
29457 (id === 'class') || (id === 'super');
29458 case 6:
29459 return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
29460 (id === 'switch') || (id === 'export') || (id === 'import');
29461 case 7:
29462 return (id === 'default') || (id === 'finally') || (id === 'extends');
29463 case 8:
29464 return (id === 'function') || (id === 'continue') || (id === 'debugger');
29465 case 10:
29466 return (id === 'instanceof');
29467 default:
29468 return false;
29469 }
29470 }
29471
29472 function isReservedWordES5(id, strict) {
29473 return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict);
29474 }
29475
29476 function isReservedWordES6(id, strict) {
29477 return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict);
29478 }
29479
29480 function isRestrictedWord(id) {
29481 return id === 'eval' || id === 'arguments';
29482 }
29483
29484 function isIdentifierNameES5(id) {
29485 var i, iz, ch;
29486
29487 if (id.length === 0) { return false; }
29488
29489 ch = id.charCodeAt(0);
29490 if (!code.isIdentifierStartES5(ch)) {
29491 return false;
29492 }
29493
29494 for (i = 1, iz = id.length; i < iz; ++i) {
29495 ch = id.charCodeAt(i);
29496 if (!code.isIdentifierPartES5(ch)) {
29497 return false;
29498 }
29499 }
29500 return true;
29501 }
29502
29503 function decodeUtf16(lead, trail) {
29504 return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
29505 }
29506
29507 function isIdentifierNameES6(id) {
29508 var i, iz, ch, lowCh, check;
29509
29510 if (id.length === 0) { return false; }
29511
29512 check = code.isIdentifierStartES6;
29513 for (i = 0, iz = id.length; i < iz; ++i) {
29514 ch = id.charCodeAt(i);
29515 if (0xD800 <= ch && ch <= 0xDBFF) {
29516 ++i;
29517 if (i >= iz) { return false; }
29518 lowCh = id.charCodeAt(i);
29519 if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) {
29520 return false;
29521 }
29522 ch = decodeUtf16(ch, lowCh);
29523 }
29524 if (!check(ch)) {
29525 return false;
29526 }
29527 check = code.isIdentifierPartES6;
29528 }
29529 return true;
29530 }
29531
29532 function isIdentifierES5(id, strict) {
29533 return isIdentifierNameES5(id) && !isReservedWordES5(id, strict);
29534 }
29535
29536 function isIdentifierES6(id, strict) {
29537 return isIdentifierNameES6(id) && !isReservedWordES6(id, strict);
29538 }
29539
29540 module.exports = {
29541 isKeywordES5: isKeywordES5,
29542 isKeywordES6: isKeywordES6,
29543 isReservedWordES5: isReservedWordES5,
29544 isReservedWordES6: isReservedWordES6,
29545 isRestrictedWord: isRestrictedWord,
29546 isIdentifierNameES5: isIdentifierNameES5,
29547 isIdentifierNameES6: isIdentifierNameES6,
29548 isIdentifierES5: isIdentifierES5,
29549 isIdentifierES6: isIdentifierES6
29550 };
29551}());
29552/* vim: set sw=4 ts=4 et tw=80 : */
29553
29554},{"./code":238}],240:[function(require,module,exports){
29555/*
29556 Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
29557
29558 Redistribution and use in source and binary forms, with or without
29559 modification, are permitted provided that the following conditions are met:
29560
29561 * Redistributions of source code must retain the above copyright
29562 notice, this list of conditions and the following disclaimer.
29563 * Redistributions in binary form must reproduce the above copyright
29564 notice, this list of conditions and the following disclaimer in the
29565 documentation and/or other materials provided with the distribution.
29566
29567 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29568 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29569 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29570 ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
29571 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29572 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29573 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29574 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29575 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29576 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29577*/
29578
29579
29580(function () {
29581 'use strict';
29582
29583 exports.ast = require('./ast');
29584 exports.code = require('./code');
29585 exports.keyword = require('./keyword');
29586}());
29587/* vim: set sw=4 ts=4 et tw=80 : */
29588
29589},{"./ast":237,"./code":238,"./keyword":239}],241:[function(require,module,exports){
29590module.exports={
29591 "builtin": {
29592 "Array": false,
29593 "ArrayBuffer": false,
29594 "Boolean": false,
29595 "constructor": false,
29596 "DataView": false,
29597 "Date": false,
29598 "decodeURI": false,
29599 "decodeURIComponent": false,
29600 "encodeURI": false,
29601 "encodeURIComponent": false,
29602 "Error": false,
29603 "escape": false,
29604 "eval": false,
29605 "EvalError": false,
29606 "Float32Array": false,
29607 "Float64Array": false,
29608 "Function": false,
29609 "hasOwnProperty": false,
29610 "Infinity": false,
29611 "Int16Array": false,
29612 "Int32Array": false,
29613 "Int8Array": false,
29614 "isFinite": false,
29615 "isNaN": false,
29616 "isPrototypeOf": false,
29617 "JSON": false,
29618 "Map": false,
29619 "Math": false,
29620 "NaN": false,
29621 "Number": false,
29622 "Object": false,
29623 "parseFloat": false,
29624 "parseInt": false,
29625 "Promise": false,
29626 "propertyIsEnumerable": false,
29627 "Proxy": false,
29628 "RangeError": false,
29629 "ReferenceError": false,
29630 "Reflect": false,
29631 "RegExp": false,
29632 "Set": false,
29633 "String": false,
29634 "Symbol": false,
29635 "SyntaxError": false,
29636 "System": false,
29637 "toLocaleString": false,
29638 "toString": false,
29639 "TypeError": false,
29640 "Uint16Array": false,
29641 "Uint32Array": false,
29642 "Uint8Array": false,
29643 "Uint8ClampedArray": false,
29644 "undefined": false,
29645 "unescape": false,
29646 "URIError": false,
29647 "valueOf": false,
29648 "WeakMap": false,
29649 "WeakSet": false
29650 },
29651 "es5": {
29652 "Array": false,
29653 "Boolean": false,
29654 "constructor": false,
29655 "Date": false,
29656 "decodeURI": false,
29657 "decodeURIComponent": false,
29658 "encodeURI": false,
29659 "encodeURIComponent": false,
29660 "Error": false,
29661 "escape": false,
29662 "eval": false,
29663 "EvalError": false,
29664 "Function": false,
29665 "hasOwnProperty": false,
29666 "Infinity": false,
29667 "isFinite": false,
29668 "isNaN": false,
29669 "isPrototypeOf": false,
29670 "JSON": false,
29671 "Math": false,
29672 "NaN": false,
29673 "Number": false,
29674 "Object": false,
29675 "parseFloat": false,
29676 "parseInt": false,
29677 "propertyIsEnumerable": false,
29678 "RangeError": false,
29679 "ReferenceError": false,
29680 "RegExp": false,
29681 "String": false,
29682 "SyntaxError": false,
29683 "toLocaleString": false,
29684 "toString": false,
29685 "TypeError": false,
29686 "undefined": false,
29687 "unescape": false,
29688 "URIError": false,
29689 "valueOf": false
29690 },
29691 "es6": {
29692 "Array": false,
29693 "ArrayBuffer": false,
29694 "Boolean": false,
29695 "constructor": false,
29696 "DataView": false,
29697 "Date": false,
29698 "decodeURI": false,
29699 "decodeURIComponent": false,
29700 "encodeURI": false,
29701 "encodeURIComponent": false,
29702 "Error": false,
29703 "escape": false,
29704 "eval": false,
29705 "EvalError": false,
29706 "Float32Array": false,
29707 "Float64Array": false,
29708 "Function": false,
29709 "hasOwnProperty": false,
29710 "Infinity": false,
29711 "Int16Array": false,
29712 "Int32Array": false,
29713 "Int8Array": false,
29714 "isFinite": false,
29715 "isNaN": false,
29716 "isPrototypeOf": false,
29717 "JSON": false,
29718 "Map": false,
29719 "Math": false,
29720 "NaN": false,
29721 "Number": false,
29722 "Object": false,
29723 "parseFloat": false,
29724 "parseInt": false,
29725 "Promise": false,
29726 "propertyIsEnumerable": false,
29727 "Proxy": false,
29728 "RangeError": false,
29729 "ReferenceError": false,
29730 "Reflect": false,
29731 "RegExp": false,
29732 "Set": false,
29733 "String": false,
29734 "Symbol": false,
29735 "SyntaxError": false,
29736 "System": false,
29737 "toLocaleString": false,
29738 "toString": false,
29739 "TypeError": false,
29740 "Uint16Array": false,
29741 "Uint32Array": false,
29742 "Uint8Array": false,
29743 "Uint8ClampedArray": false,
29744 "undefined": false,
29745 "unescape": false,
29746 "URIError": false,
29747 "valueOf": false,
29748 "WeakMap": false,
29749 "WeakSet": false
29750 },
29751 "browser": {
29752 "addEventListener": false,
29753 "alert": false,
29754 "AnalyserNode": false,
29755 "Animation": false,
29756 "AnimationEffectReadOnly": false,
29757 "AnimationEffectTiming": false,
29758 "AnimationEffectTimingReadOnly": false,
29759 "AnimationEvent": false,
29760 "AnimationPlaybackEvent": false,
29761 "AnimationTimeline": false,
29762 "applicationCache": false,
29763 "ApplicationCache": false,
29764 "ApplicationCacheErrorEvent": false,
29765 "atob": false,
29766 "Attr": false,
29767 "Audio": false,
29768 "AudioBuffer": false,
29769 "AudioBufferSourceNode": false,
29770 "AudioContext": false,
29771 "AudioDestinationNode": false,
29772 "AudioListener": false,
29773 "AudioNode": false,
29774 "AudioParam": false,
29775 "AudioProcessingEvent": false,
29776 "AutocompleteErrorEvent": false,
29777 "BarProp": false,
29778 "BatteryManager": false,
29779 "BeforeUnloadEvent": false,
29780 "BiquadFilterNode": false,
29781 "Blob": false,
29782 "blur": false,
29783 "btoa": false,
29784 "Cache": false,
29785 "caches": false,
29786 "CacheStorage": false,
29787 "cancelAnimationFrame": false,
29788 "CanvasGradient": false,
29789 "CanvasPattern": false,
29790 "CanvasRenderingContext2D": false,
29791 "CDATASection": false,
29792 "ChannelMergerNode": false,
29793 "ChannelSplitterNode": false,
29794 "CharacterData": false,
29795 "clearInterval": false,
29796 "clearTimeout": false,
29797 "clientInformation": false,
29798 "ClientRect": false,
29799 "ClientRectList": false,
29800 "ClipboardEvent": false,
29801 "close": false,
29802 "closed": false,
29803 "CloseEvent": false,
29804 "Comment": false,
29805 "CompositionEvent": false,
29806 "confirm": false,
29807 "console": false,
29808 "ConvolverNode": false,
29809 "Credential": false,
29810 "CredentialsContainer": false,
29811 "crypto": false,
29812 "Crypto": false,
29813 "CryptoKey": false,
29814 "CSS": false,
29815 "CSSAnimation": false,
29816 "CSSFontFaceRule": false,
29817 "CSSImportRule": false,
29818 "CSSKeyframeRule": false,
29819 "CSSKeyframesRule": false,
29820 "CSSMediaRule": false,
29821 "CSSPageRule": false,
29822 "CSSRule": false,
29823 "CSSRuleList": false,
29824 "CSSStyleDeclaration": false,
29825 "CSSStyleRule": false,
29826 "CSSStyleSheet": false,
29827 "CSSSupportsRule": false,
29828 "CSSTransition": false,
29829 "CSSUnknownRule": false,
29830 "CSSViewportRule": false,
29831 "customElements": false,
29832 "CustomEvent": false,
29833 "DataTransfer": false,
29834 "DataTransferItem": false,
29835 "DataTransferItemList": false,
29836 "Debug": false,
29837 "defaultStatus": false,
29838 "defaultstatus": false,
29839 "DelayNode": false,
29840 "DeviceMotionEvent": false,
29841 "DeviceOrientationEvent": false,
29842 "devicePixelRatio": false,
29843 "dispatchEvent": false,
29844 "document": false,
29845 "Document": false,
29846 "DocumentFragment": false,
29847 "DocumentTimeline": false,
29848 "DocumentType": false,
29849 "DOMError": false,
29850 "DOMException": false,
29851 "DOMImplementation": false,
29852 "DOMParser": false,
29853 "DOMSettableTokenList": false,
29854 "DOMStringList": false,
29855 "DOMStringMap": false,
29856 "DOMTokenList": false,
29857 "DragEvent": false,
29858 "DynamicsCompressorNode": false,
29859 "Element": false,
29860 "ElementTimeControl": false,
29861 "ErrorEvent": false,
29862 "event": false,
29863 "Event": false,
29864 "EventSource": false,
29865 "EventTarget": false,
29866 "external": false,
29867 "FederatedCredential": false,
29868 "fetch": false,
29869 "File": false,
29870 "FileError": false,
29871 "FileList": false,
29872 "FileReader": false,
29873 "find": false,
29874 "focus": false,
29875 "FocusEvent": false,
29876 "FontFace": false,
29877 "FormData": false,
29878 "frameElement": false,
29879 "frames": false,
29880 "GainNode": false,
29881 "Gamepad": false,
29882 "GamepadButton": false,
29883 "GamepadEvent": false,
29884 "getComputedStyle": false,
29885 "getSelection": false,
29886 "HashChangeEvent": false,
29887 "Headers": false,
29888 "history": false,
29889 "History": false,
29890 "HTMLAllCollection": false,
29891 "HTMLAnchorElement": false,
29892 "HTMLAppletElement": false,
29893 "HTMLAreaElement": false,
29894 "HTMLAudioElement": false,
29895 "HTMLBaseElement": false,
29896 "HTMLBlockquoteElement": false,
29897 "HTMLBodyElement": false,
29898 "HTMLBRElement": false,
29899 "HTMLButtonElement": false,
29900 "HTMLCanvasElement": false,
29901 "HTMLCollection": false,
29902 "HTMLContentElement": false,
29903 "HTMLDataListElement": false,
29904 "HTMLDetailsElement": false,
29905 "HTMLDialogElement": false,
29906 "HTMLDirectoryElement": false,
29907 "HTMLDivElement": false,
29908 "HTMLDListElement": false,
29909 "HTMLDocument": false,
29910 "HTMLElement": false,
29911 "HTMLEmbedElement": false,
29912 "HTMLFieldSetElement": false,
29913 "HTMLFontElement": false,
29914 "HTMLFormControlsCollection": false,
29915 "HTMLFormElement": false,
29916 "HTMLFrameElement": false,
29917 "HTMLFrameSetElement": false,
29918 "HTMLHeadElement": false,
29919 "HTMLHeadingElement": false,
29920 "HTMLHRElement": false,
29921 "HTMLHtmlElement": false,
29922 "HTMLIFrameElement": false,
29923 "HTMLImageElement": false,
29924 "HTMLInputElement": false,
29925 "HTMLIsIndexElement": false,
29926 "HTMLKeygenElement": false,
29927 "HTMLLabelElement": false,
29928 "HTMLLayerElement": false,
29929 "HTMLLegendElement": false,
29930 "HTMLLIElement": false,
29931 "HTMLLinkElement": false,
29932 "HTMLMapElement": false,
29933 "HTMLMarqueeElement": false,
29934 "HTMLMediaElement": false,
29935 "HTMLMenuElement": false,
29936 "HTMLMetaElement": false,
29937 "HTMLMeterElement": false,
29938 "HTMLModElement": false,
29939 "HTMLObjectElement": false,
29940 "HTMLOListElement": false,
29941 "HTMLOptGroupElement": false,
29942 "HTMLOptionElement": false,
29943 "HTMLOptionsCollection": false,
29944 "HTMLOutputElement": false,
29945 "HTMLParagraphElement": false,
29946 "HTMLParamElement": false,
29947 "HTMLPictureElement": false,
29948 "HTMLPreElement": false,
29949 "HTMLProgressElement": false,
29950 "HTMLQuoteElement": false,
29951 "HTMLScriptElement": false,
29952 "HTMLSelectElement": false,
29953 "HTMLShadowElement": false,
29954 "HTMLSourceElement": false,
29955 "HTMLSpanElement": false,
29956 "HTMLStyleElement": false,
29957 "HTMLTableCaptionElement": false,
29958 "HTMLTableCellElement": false,
29959 "HTMLTableColElement": false,
29960 "HTMLTableElement": false,
29961 "HTMLTableRowElement": false,
29962 "HTMLTableSectionElement": false,
29963 "HTMLTemplateElement": false,
29964 "HTMLTextAreaElement": false,
29965 "HTMLTitleElement": false,
29966 "HTMLTrackElement": false,
29967 "HTMLUListElement": false,
29968 "HTMLUnknownElement": false,
29969 "HTMLVideoElement": false,
29970 "IDBCursor": false,
29971 "IDBCursorWithValue": false,
29972 "IDBDatabase": false,
29973 "IDBEnvironment": false,
29974 "IDBFactory": false,
29975 "IDBIndex": false,
29976 "IDBKeyRange": false,
29977 "IDBObjectStore": false,
29978 "IDBOpenDBRequest": false,
29979 "IDBRequest": false,
29980 "IDBTransaction": false,
29981 "IDBVersionChangeEvent": false,
29982 "Image": false,
29983 "ImageBitmap": false,
29984 "ImageData": false,
29985 "indexedDB": false,
29986 "innerHeight": false,
29987 "innerWidth": false,
29988 "InputEvent": false,
29989 "InputMethodContext": false,
29990 "IntersectionObserver": false,
29991 "IntersectionObserverEntry": false,
29992 "Intl": false,
29993 "KeyboardEvent": false,
29994 "KeyframeEffect": false,
29995 "KeyframeEffectReadOnly": false,
29996 "length": false,
29997 "localStorage": false,
29998 "location": false,
29999 "Location": false,
30000 "locationbar": false,
30001 "matchMedia": false,
30002 "MediaElementAudioSourceNode": false,
30003 "MediaEncryptedEvent": false,
30004 "MediaError": false,
30005 "MediaKeyError": false,
30006 "MediaKeyEvent": false,
30007 "MediaKeyMessageEvent": false,
30008 "MediaKeys": false,
30009 "MediaKeySession": false,
30010 "MediaKeyStatusMap": false,
30011 "MediaKeySystemAccess": false,
30012 "MediaList": false,
30013 "MediaQueryList": false,
30014 "MediaQueryListEvent": false,
30015 "MediaSource": false,
30016 "MediaRecorder": false,
30017 "MediaStream": false,
30018 "MediaStreamAudioDestinationNode": false,
30019 "MediaStreamAudioSourceNode": false,
30020 "MediaStreamEvent": false,
30021 "MediaStreamTrack": false,
30022 "menubar": false,
30023 "MessageChannel": false,
30024 "MessageEvent": false,
30025 "MessagePort": false,
30026 "MIDIAccess": false,
30027 "MIDIConnectionEvent": false,
30028 "MIDIInput": false,
30029 "MIDIInputMap": false,
30030 "MIDIMessageEvent": false,
30031 "MIDIOutput": false,
30032 "MIDIOutputMap": false,
30033 "MIDIPort": false,
30034 "MimeType": false,
30035 "MimeTypeArray": false,
30036 "MouseEvent": false,
30037 "moveBy": false,
30038 "moveTo": false,
30039 "MutationEvent": false,
30040 "MutationObserver": false,
30041 "MutationRecord": false,
30042 "name": false,
30043 "NamedNodeMap": false,
30044 "navigator": false,
30045 "Navigator": false,
30046 "Node": false,
30047 "NodeFilter": false,
30048 "NodeIterator": false,
30049 "NodeList": false,
30050 "Notification": false,
30051 "OfflineAudioCompletionEvent": false,
30052 "OfflineAudioContext": false,
30053 "offscreenBuffering": false,
30054 "onbeforeunload": true,
30055 "onblur": true,
30056 "onerror": true,
30057 "onfocus": true,
30058 "onload": true,
30059 "onresize": true,
30060 "onunload": true,
30061 "open": false,
30062 "openDatabase": false,
30063 "opener": false,
30064 "opera": false,
30065 "Option": false,
30066 "OscillatorNode": false,
30067 "outerHeight": false,
30068 "outerWidth": false,
30069 "PageTransitionEvent": false,
30070 "pageXOffset": false,
30071 "pageYOffset": false,
30072 "parent": false,
30073 "PasswordCredential": false,
30074 "Path2D": false,
30075 "performance": false,
30076 "Performance": false,
30077 "PerformanceEntry": false,
30078 "PerformanceMark": false,
30079 "PerformanceMeasure": false,
30080 "PerformanceNavigation": false,
30081 "PerformanceResourceTiming": false,
30082 "PerformanceTiming": false,
30083 "PeriodicWave": false,
30084 "Permissions": false,
30085 "PermissionStatus": false,
30086 "personalbar": false,
30087 "Plugin": false,
30088 "PluginArray": false,
30089 "PopStateEvent": false,
30090 "postMessage": false,
30091 "print": false,
30092 "ProcessingInstruction": false,
30093 "ProgressEvent": false,
30094 "PromiseRejectionEvent": false,
30095 "prompt": false,
30096 "PushManager": false,
30097 "PushSubscription": false,
30098 "RadioNodeList": false,
30099 "Range": false,
30100 "ReadableByteStream": false,
30101 "ReadableStream": false,
30102 "removeEventListener": false,
30103 "Request": false,
30104 "requestAnimationFrame": false,
30105 "requestIdleCallback": false,
30106 "resizeBy": false,
30107 "resizeTo": false,
30108 "Response": false,
30109 "RTCIceCandidate": false,
30110 "RTCSessionDescription": false,
30111 "RTCPeerConnection": false,
30112 "screen": false,
30113 "Screen": false,
30114 "screenLeft": false,
30115 "ScreenOrientation": false,
30116 "screenTop": false,
30117 "screenX": false,
30118 "screenY": false,
30119 "ScriptProcessorNode": false,
30120 "scroll": false,
30121 "scrollbars": false,
30122 "scrollBy": false,
30123 "scrollTo": false,
30124 "scrollX": false,
30125 "scrollY": false,
30126 "SecurityPolicyViolationEvent": false,
30127 "Selection": false,
30128 "self": false,
30129 "ServiceWorker": false,
30130 "ServiceWorkerContainer": false,
30131 "ServiceWorkerRegistration": false,
30132 "sessionStorage": false,
30133 "setInterval": false,
30134 "setTimeout": false,
30135 "ShadowRoot": false,
30136 "SharedKeyframeList": false,
30137 "SharedWorker": false,
30138 "showModalDialog": false,
30139 "SiteBoundCredential": false,
30140 "speechSynthesis": false,
30141 "SpeechSynthesisEvent": false,
30142 "SpeechSynthesisUtterance": false,
30143 "status": false,
30144 "statusbar": false,
30145 "stop": false,
30146 "Storage": false,
30147 "StorageEvent": false,
30148 "styleMedia": false,
30149 "StyleSheet": false,
30150 "StyleSheetList": false,
30151 "SubtleCrypto": false,
30152 "SVGAElement": false,
30153 "SVGAltGlyphDefElement": false,
30154 "SVGAltGlyphElement": false,
30155 "SVGAltGlyphItemElement": false,
30156 "SVGAngle": false,
30157 "SVGAnimateColorElement": false,
30158 "SVGAnimatedAngle": false,
30159 "SVGAnimatedBoolean": false,
30160 "SVGAnimatedEnumeration": false,
30161 "SVGAnimatedInteger": false,
30162 "SVGAnimatedLength": false,
30163 "SVGAnimatedLengthList": false,
30164 "SVGAnimatedNumber": false,
30165 "SVGAnimatedNumberList": false,
30166 "SVGAnimatedPathData": false,
30167 "SVGAnimatedPoints": false,
30168 "SVGAnimatedPreserveAspectRatio": false,
30169 "SVGAnimatedRect": false,
30170 "SVGAnimatedString": false,
30171 "SVGAnimatedTransformList": false,
30172 "SVGAnimateElement": false,
30173 "SVGAnimateMotionElement": false,
30174 "SVGAnimateTransformElement": false,
30175 "SVGAnimationElement": false,
30176 "SVGCircleElement": false,
30177 "SVGClipPathElement": false,
30178 "SVGColor": false,
30179 "SVGColorProfileElement": false,
30180 "SVGColorProfileRule": false,
30181 "SVGComponentTransferFunctionElement": false,
30182 "SVGCSSRule": false,
30183 "SVGCursorElement": false,
30184 "SVGDefsElement": false,
30185 "SVGDescElement": false,
30186 "SVGDiscardElement": false,
30187 "SVGDocument": false,
30188 "SVGElement": false,
30189 "SVGElementInstance": false,
30190 "SVGElementInstanceList": false,
30191 "SVGEllipseElement": false,
30192 "SVGEvent": false,
30193 "SVGExternalResourcesRequired": false,
30194 "SVGFEBlendElement": false,
30195 "SVGFEColorMatrixElement": false,
30196 "SVGFEComponentTransferElement": false,
30197 "SVGFECompositeElement": false,
30198 "SVGFEConvolveMatrixElement": false,
30199 "SVGFEDiffuseLightingElement": false,
30200 "SVGFEDisplacementMapElement": false,
30201 "SVGFEDistantLightElement": false,
30202 "SVGFEDropShadowElement": false,
30203 "SVGFEFloodElement": false,
30204 "SVGFEFuncAElement": false,
30205 "SVGFEFuncBElement": false,
30206 "SVGFEFuncGElement": false,
30207 "SVGFEFuncRElement": false,
30208 "SVGFEGaussianBlurElement": false,
30209 "SVGFEImageElement": false,
30210 "SVGFEMergeElement": false,
30211 "SVGFEMergeNodeElement": false,
30212 "SVGFEMorphologyElement": false,
30213 "SVGFEOffsetElement": false,
30214 "SVGFEPointLightElement": false,
30215 "SVGFESpecularLightingElement": false,
30216 "SVGFESpotLightElement": false,
30217 "SVGFETileElement": false,
30218 "SVGFETurbulenceElement": false,
30219 "SVGFilterElement": false,
30220 "SVGFilterPrimitiveStandardAttributes": false,
30221 "SVGFitToViewBox": false,
30222 "SVGFontElement": false,
30223 "SVGFontFaceElement": false,
30224 "SVGFontFaceFormatElement": false,
30225 "SVGFontFaceNameElement": false,
30226 "SVGFontFaceSrcElement": false,
30227 "SVGFontFaceUriElement": false,
30228 "SVGForeignObjectElement": false,
30229 "SVGGElement": false,
30230 "SVGGeometryElement": false,
30231 "SVGGlyphElement": false,
30232 "SVGGlyphRefElement": false,
30233 "SVGGradientElement": false,
30234 "SVGGraphicsElement": false,
30235 "SVGHKernElement": false,
30236 "SVGICCColor": false,
30237 "SVGImageElement": false,
30238 "SVGLangSpace": false,
30239 "SVGLength": false,
30240 "SVGLengthList": false,
30241 "SVGLinearGradientElement": false,
30242 "SVGLineElement": false,
30243 "SVGLocatable": false,
30244 "SVGMarkerElement": false,
30245 "SVGMaskElement": false,
30246 "SVGMatrix": false,
30247 "SVGMetadataElement": false,
30248 "SVGMissingGlyphElement": false,
30249 "SVGMPathElement": false,
30250 "SVGNumber": false,
30251 "SVGNumberList": false,
30252 "SVGPaint": false,
30253 "SVGPathElement": false,
30254 "SVGPathSeg": false,
30255 "SVGPathSegArcAbs": false,
30256 "SVGPathSegArcRel": false,
30257 "SVGPathSegClosePath": false,
30258 "SVGPathSegCurvetoCubicAbs": false,
30259 "SVGPathSegCurvetoCubicRel": false,
30260 "SVGPathSegCurvetoCubicSmoothAbs": false,
30261 "SVGPathSegCurvetoCubicSmoothRel": false,
30262 "SVGPathSegCurvetoQuadraticAbs": false,
30263 "SVGPathSegCurvetoQuadraticRel": false,
30264 "SVGPathSegCurvetoQuadraticSmoothAbs": false,
30265 "SVGPathSegCurvetoQuadraticSmoothRel": false,
30266 "SVGPathSegLinetoAbs": false,
30267 "SVGPathSegLinetoHorizontalAbs": false,
30268 "SVGPathSegLinetoHorizontalRel": false,
30269 "SVGPathSegLinetoRel": false,
30270 "SVGPathSegLinetoVerticalAbs": false,
30271 "SVGPathSegLinetoVerticalRel": false,
30272 "SVGPathSegList": false,
30273 "SVGPathSegMovetoAbs": false,
30274 "SVGPathSegMovetoRel": false,
30275 "SVGPatternElement": false,
30276 "SVGPoint": false,
30277 "SVGPointList": false,
30278 "SVGPolygonElement": false,
30279 "SVGPolylineElement": false,
30280 "SVGPreserveAspectRatio": false,
30281 "SVGRadialGradientElement": false,
30282 "SVGRect": false,
30283 "SVGRectElement": false,
30284 "SVGRenderingIntent": false,
30285 "SVGScriptElement": false,
30286 "SVGSetElement": false,
30287 "SVGStopElement": false,
30288 "SVGStringList": false,
30289 "SVGStylable": false,
30290 "SVGStyleElement": false,
30291 "SVGSVGElement": false,
30292 "SVGSwitchElement": false,
30293 "SVGSymbolElement": false,
30294 "SVGTests": false,
30295 "SVGTextContentElement": false,
30296 "SVGTextElement": false,
30297 "SVGTextPathElement": false,
30298 "SVGTextPositioningElement": false,
30299 "SVGTitleElement": false,
30300 "SVGTransform": false,
30301 "SVGTransformable": false,
30302 "SVGTransformList": false,
30303 "SVGTRefElement": false,
30304 "SVGTSpanElement": false,
30305 "SVGUnitTypes": false,
30306 "SVGURIReference": false,
30307 "SVGUseElement": false,
30308 "SVGViewElement": false,
30309 "SVGViewSpec": false,
30310 "SVGVKernElement": false,
30311 "SVGZoomAndPan": false,
30312 "SVGZoomEvent": false,
30313 "Text": false,
30314 "TextDecoder": false,
30315 "TextEncoder": false,
30316 "TextEvent": false,
30317 "TextMetrics": false,
30318 "TextTrack": false,
30319 "TextTrackCue": false,
30320 "TextTrackCueList": false,
30321 "TextTrackList": false,
30322 "TimeEvent": false,
30323 "TimeRanges": false,
30324 "toolbar": false,
30325 "top": false,
30326 "Touch": false,
30327 "TouchEvent": false,
30328 "TouchList": false,
30329 "TrackEvent": false,
30330 "TransitionEvent": false,
30331 "TreeWalker": false,
30332 "UIEvent": false,
30333 "URL": false,
30334 "URLSearchParams": false,
30335 "ValidityState": false,
30336 "VTTCue": false,
30337 "WaveShaperNode": false,
30338 "WebGLActiveInfo": false,
30339 "WebGLBuffer": false,
30340 "WebGLContextEvent": false,
30341 "WebGLFramebuffer": false,
30342 "WebGLProgram": false,
30343 "WebGLRenderbuffer": false,
30344 "WebGLRenderingContext": false,
30345 "WebGLShader": false,
30346 "WebGLShaderPrecisionFormat": false,
30347 "WebGLTexture": false,
30348 "WebGLUniformLocation": false,
30349 "WebSocket": false,
30350 "WheelEvent": false,
30351 "window": false,
30352 "Window": false,
30353 "Worker": false,
30354 "XDomainRequest": false,
30355 "XMLDocument": false,
30356 "XMLHttpRequest": false,
30357 "XMLHttpRequestEventTarget": false,
30358 "XMLHttpRequestProgressEvent": false,
30359 "XMLHttpRequestUpload": false,
30360 "XMLSerializer": false,
30361 "XPathEvaluator": false,
30362 "XPathException": false,
30363 "XPathExpression": false,
30364 "XPathNamespace": false,
30365 "XPathNSResolver": false,
30366 "XPathResult": false,
30367 "XSLTProcessor": false
30368 },
30369 "worker": {
30370 "applicationCache": false,
30371 "atob": false,
30372 "Blob": false,
30373 "BroadcastChannel": false,
30374 "btoa": false,
30375 "Cache": false,
30376 "caches": false,
30377 "clearInterval": false,
30378 "clearTimeout": false,
30379 "close": true,
30380 "console": false,
30381 "fetch": false,
30382 "FileReaderSync": false,
30383 "FormData": false,
30384 "Headers": false,
30385 "IDBCursor": false,
30386 "IDBCursorWithValue": false,
30387 "IDBDatabase": false,
30388 "IDBFactory": false,
30389 "IDBIndex": false,
30390 "IDBKeyRange": false,
30391 "IDBObjectStore": false,
30392 "IDBOpenDBRequest": false,
30393 "IDBRequest": false,
30394 "IDBTransaction": false,
30395 "IDBVersionChangeEvent": false,
30396 "ImageData": false,
30397 "importScripts": true,
30398 "indexedDB": false,
30399 "location": false,
30400 "MessageChannel": false,
30401 "MessagePort": false,
30402 "name": false,
30403 "navigator": false,
30404 "Notification": false,
30405 "onclose": true,
30406 "onconnect": true,
30407 "onerror": true,
30408 "onlanguagechange": true,
30409 "onmessage": true,
30410 "onoffline": true,
30411 "ononline": true,
30412 "onrejectionhandled": true,
30413 "onunhandledrejection": true,
30414 "performance": false,
30415 "Performance": false,
30416 "PerformanceEntry": false,
30417 "PerformanceMark": false,
30418 "PerformanceMeasure": false,
30419 "PerformanceNavigation": false,
30420 "PerformanceResourceTiming": false,
30421 "PerformanceTiming": false,
30422 "postMessage": true,
30423 "Promise": false,
30424 "Request": false,
30425 "Response": false,
30426 "self": true,
30427 "ServiceWorkerRegistration": false,
30428 "setInterval": false,
30429 "setTimeout": false,
30430 "TextDecoder": false,
30431 "TextEncoder": false,
30432 "URL": false,
30433 "URLSearchParams": false,
30434 "WebSocket": false,
30435 "Worker": false,
30436 "XMLHttpRequest": false
30437 },
30438 "node": {
30439 "__dirname": false,
30440 "__filename": false,
30441 "arguments": false,
30442 "Buffer": false,
30443 "clearImmediate": false,
30444 "clearInterval": false,
30445 "clearTimeout": false,
30446 "console": false,
30447 "exports": true,
30448 "GLOBAL": false,
30449 "global": false,
30450 "Intl": false,
30451 "module": false,
30452 "process": false,
30453 "require": false,
30454 "root": false,
30455 "setImmediate": false,
30456 "setInterval": false,
30457 "setTimeout": false
30458 },
30459 "commonjs": {
30460 "exports": true,
30461 "module": false,
30462 "require": false,
30463 "global": false
30464 },
30465 "amd": {
30466 "define": false,
30467 "require": false
30468 },
30469 "mocha": {
30470 "after": false,
30471 "afterEach": false,
30472 "before": false,
30473 "beforeEach": false,
30474 "context": false,
30475 "describe": false,
30476 "it": false,
30477 "mocha": false,
30478 "run": false,
30479 "setup": false,
30480 "specify": false,
30481 "suite": false,
30482 "suiteSetup": false,
30483 "suiteTeardown": false,
30484 "teardown": false,
30485 "test": false,
30486 "xcontext": false,
30487 "xdescribe": false,
30488 "xit": false,
30489 "xspecify": false
30490 },
30491 "jasmine": {
30492 "afterAll": false,
30493 "afterEach": false,
30494 "beforeAll": false,
30495 "beforeEach": false,
30496 "describe": false,
30497 "expect": false,
30498 "fail": false,
30499 "fdescribe": false,
30500 "fit": false,
30501 "it": false,
30502 "jasmine": false,
30503 "pending": false,
30504 "runs": false,
30505 "spyOn": false,
30506 "waits": false,
30507 "waitsFor": false,
30508 "xdescribe": false,
30509 "xit": false
30510 },
30511 "jest": {
30512 "afterAll": false,
30513 "afterEach": false,
30514 "beforeAll": false,
30515 "beforeEach": false,
30516 "check": false,
30517 "describe": false,
30518 "expect": false,
30519 "gen": false,
30520 "it": false,
30521 "fdescribe": false,
30522 "fit": false,
30523 "jest": false,
30524 "pit": false,
30525 "require": false,
30526 "test": false,
30527 "xdescribe": false,
30528 "xit": false,
30529 "xtest": false
30530 },
30531 "qunit": {
30532 "asyncTest": false,
30533 "deepEqual": false,
30534 "equal": false,
30535 "expect": false,
30536 "module": false,
30537 "notDeepEqual": false,
30538 "notEqual": false,
30539 "notOk": false,
30540 "notPropEqual": false,
30541 "notStrictEqual": false,
30542 "ok": false,
30543 "propEqual": false,
30544 "QUnit": false,
30545 "raises": false,
30546 "start": false,
30547 "stop": false,
30548 "strictEqual": false,
30549 "test": false,
30550 "throws": false
30551 },
30552 "phantomjs": {
30553 "console": true,
30554 "exports": true,
30555 "phantom": true,
30556 "require": true,
30557 "WebPage": true
30558 },
30559 "couch": {
30560 "emit": false,
30561 "exports": false,
30562 "getRow": false,
30563 "log": false,
30564 "module": false,
30565 "provides": false,
30566 "require": false,
30567 "respond": false,
30568 "send": false,
30569 "start": false,
30570 "sum": false
30571 },
30572 "rhino": {
30573 "defineClass": false,
30574 "deserialize": false,
30575 "gc": false,
30576 "help": false,
30577 "importClass": false,
30578 "importPackage": false,
30579 "java": false,
30580 "load": false,
30581 "loadClass": false,
30582 "Packages": false,
30583 "print": false,
30584 "quit": false,
30585 "readFile": false,
30586 "readUrl": false,
30587 "runCommand": false,
30588 "seal": false,
30589 "serialize": false,
30590 "spawn": false,
30591 "sync": false,
30592 "toint32": false,
30593 "version": false
30594 },
30595 "nashorn": {
30596 "__DIR__": false,
30597 "__FILE__": false,
30598 "__LINE__": false,
30599 "com": false,
30600 "edu": false,
30601 "exit": false,
30602 "Java": false,
30603 "java": false,
30604 "javafx": false,
30605 "JavaImporter": false,
30606 "javax": false,
30607 "JSAdapter": false,
30608 "load": false,
30609 "loadWithNewGlobal": false,
30610 "org": false,
30611 "Packages": false,
30612 "print": false,
30613 "quit": false
30614 },
30615 "wsh": {
30616 "ActiveXObject": true,
30617 "Enumerator": true,
30618 "GetObject": true,
30619 "ScriptEngine": true,
30620 "ScriptEngineBuildVersion": true,
30621 "ScriptEngineMajorVersion": true,
30622 "ScriptEngineMinorVersion": true,
30623 "VBArray": true,
30624 "WScript": true,
30625 "WSH": true,
30626 "XDomainRequest": true
30627 },
30628 "jquery": {
30629 "$": false,
30630 "jQuery": false
30631 },
30632 "yui": {
30633 "Y": false,
30634 "YUI": false,
30635 "YUI_config": false
30636 },
30637 "shelljs": {
30638 "cat": false,
30639 "cd": false,
30640 "chmod": false,
30641 "config": false,
30642 "cp": false,
30643 "dirs": false,
30644 "echo": false,
30645 "env": false,
30646 "error": false,
30647 "exec": false,
30648 "exit": false,
30649 "find": false,
30650 "grep": false,
30651 "ls": false,
30652 "ln": false,
30653 "mkdir": false,
30654 "mv": false,
30655 "popd": false,
30656 "pushd": false,
30657 "pwd": false,
30658 "rm": false,
30659 "sed": false,
30660 "set": false,
30661 "target": false,
30662 "tempdir": false,
30663 "test": false,
30664 "touch": false,
30665 "which": false
30666 },
30667 "prototypejs": {
30668 "$": false,
30669 "$$": false,
30670 "$A": false,
30671 "$break": false,
30672 "$continue": false,
30673 "$F": false,
30674 "$H": false,
30675 "$R": false,
30676 "$w": false,
30677 "Abstract": false,
30678 "Ajax": false,
30679 "Autocompleter": false,
30680 "Builder": false,
30681 "Class": false,
30682 "Control": false,
30683 "Draggable": false,
30684 "Draggables": false,
30685 "Droppables": false,
30686 "Effect": false,
30687 "Element": false,
30688 "Enumerable": false,
30689 "Event": false,
30690 "Field": false,
30691 "Form": false,
30692 "Hash": false,
30693 "Insertion": false,
30694 "ObjectRange": false,
30695 "PeriodicalExecuter": false,
30696 "Position": false,
30697 "Prototype": false,
30698 "Scriptaculous": false,
30699 "Selector": false,
30700 "Sortable": false,
30701 "SortableObserver": false,
30702 "Sound": false,
30703 "Template": false,
30704 "Toggle": false,
30705 "Try": false
30706 },
30707 "meteor": {
30708 "$": false,
30709 "_": false,
30710 "Accounts": false,
30711 "AccountsClient": false,
30712 "AccountsServer": false,
30713 "AccountsCommon": false,
30714 "App": false,
30715 "Assets": false,
30716 "Blaze": false,
30717 "check": false,
30718 "Cordova": false,
30719 "DDP": false,
30720 "DDPServer": false,
30721 "DDPRateLimiter": false,
30722 "Deps": false,
30723 "EJSON": false,
30724 "Email": false,
30725 "HTTP": false,
30726 "Log": false,
30727 "Match": false,
30728 "Meteor": false,
30729 "Mongo": false,
30730 "MongoInternals": false,
30731 "Npm": false,
30732 "Package": false,
30733 "Plugin": false,
30734 "process": false,
30735 "Random": false,
30736 "ReactiveDict": false,
30737 "ReactiveVar": false,
30738 "Router": false,
30739 "ServiceConfiguration": false,
30740 "Session": false,
30741 "share": false,
30742 "Spacebars": false,
30743 "Template": false,
30744 "Tinytest": false,
30745 "Tracker": false,
30746 "UI": false,
30747 "Utils": false,
30748 "WebApp": false,
30749 "WebAppInternals": false
30750 },
30751 "mongo": {
30752 "_isWindows": false,
30753 "_rand": false,
30754 "BulkWriteResult": false,
30755 "cat": false,
30756 "cd": false,
30757 "connect": false,
30758 "db": false,
30759 "getHostName": false,
30760 "getMemInfo": false,
30761 "hostname": false,
30762 "ISODate": false,
30763 "listFiles": false,
30764 "load": false,
30765 "ls": false,
30766 "md5sumFile": false,
30767 "mkdir": false,
30768 "Mongo": false,
30769 "NumberInt": false,
30770 "NumberLong": false,
30771 "ObjectId": false,
30772 "PlanCache": false,
30773 "print": false,
30774 "printjson": false,
30775 "pwd": false,
30776 "quit": false,
30777 "removeFile": false,
30778 "rs": false,
30779 "sh": false,
30780 "UUID": false,
30781 "version": false,
30782 "WriteResult": false
30783 },
30784 "applescript": {
30785 "$": false,
30786 "Application": false,
30787 "Automation": false,
30788 "console": false,
30789 "delay": false,
30790 "Library": false,
30791 "ObjC": false,
30792 "ObjectSpecifier": false,
30793 "Path": false,
30794 "Progress": false,
30795 "Ref": false
30796 },
30797 "serviceworker": {
30798 "caches": false,
30799 "Cache": false,
30800 "CacheStorage": false,
30801 "Client": false,
30802 "clients": false,
30803 "Clients": false,
30804 "ExtendableEvent": false,
30805 "ExtendableMessageEvent": false,
30806 "FetchEvent": false,
30807 "importScripts": false,
30808 "registration": false,
30809 "self": false,
30810 "ServiceWorker": false,
30811 "ServiceWorkerContainer": false,
30812 "ServiceWorkerGlobalScope": false,
30813 "ServiceWorkerMessageEvent": false,
30814 "ServiceWorkerRegistration": false,
30815 "skipWaiting": false,
30816 "WindowClient": false
30817 },
30818 "atomtest": {
30819 "advanceClock": false,
30820 "fakeClearInterval": false,
30821 "fakeClearTimeout": false,
30822 "fakeSetInterval": false,
30823 "fakeSetTimeout": false,
30824 "resetTimeouts": false,
30825 "waitsForPromise": false
30826 },
30827 "embertest": {
30828 "andThen": false,
30829 "click": false,
30830 "currentPath": false,
30831 "currentRouteName": false,
30832 "currentURL": false,
30833 "fillIn": false,
30834 "find": false,
30835 "findWithAssert": false,
30836 "keyEvent": false,
30837 "pauseTest": false,
30838 "triggerEvent": false,
30839 "visit": false
30840 },
30841 "protractor": {
30842 "$": false,
30843 "$$": false,
30844 "browser": false,
30845 "By": false,
30846 "by": false,
30847 "DartObject": false,
30848 "element": false,
30849 "protractor": false
30850 },
30851 "shared-node-browser": {
30852 "clearInterval": false,
30853 "clearTimeout": false,
30854 "console": false,
30855 "setInterval": false,
30856 "setTimeout": false
30857 },
30858 "webextensions": {
30859 "browser": false,
30860 "chrome": false,
30861 "opr": false
30862 },
30863 "greasemonkey": {
30864 "GM_addStyle": false,
30865 "GM_deleteValue": false,
30866 "GM_getResourceText": false,
30867 "GM_getResourceURL": false,
30868 "GM_getValue": false,
30869 "GM_info": false,
30870 "GM_listValues": false,
30871 "GM_log": false,
30872 "GM_openInTab": false,
30873 "GM_registerMenuCommand": false,
30874 "GM_setClipboard": false,
30875 "GM_setValue": false,
30876 "GM_xmlhttpRequest": false,
30877 "unsafeWindow": false
30878 }
30879}
30880
30881},{}],242:[function(require,module,exports){
30882module.exports = require('./globals.json');
30883
30884},{"./globals.json":241}],243:[function(require,module,exports){
30885'use strict';
30886var ansiRegex = require('ansi-regex');
30887var re = new RegExp(ansiRegex().source); // remove the `g` flag
30888module.exports = re.test.bind(re);
30889
30890},{"ansi-regex":1}],244:[function(require,module,exports){
30891exports.read = function (buffer, offset, isLE, mLen, nBytes) {
30892 var e, m
30893 var eLen = nBytes * 8 - mLen - 1
30894 var eMax = (1 << eLen) - 1
30895 var eBias = eMax >> 1
30896 var nBits = -7
30897 var i = isLE ? (nBytes - 1) : 0
30898 var d = isLE ? -1 : 1
30899 var s = buffer[offset + i]
30900
30901 i += d
30902
30903 e = s & ((1 << (-nBits)) - 1)
30904 s >>= (-nBits)
30905 nBits += eLen
30906 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
30907
30908 m = e & ((1 << (-nBits)) - 1)
30909 e >>= (-nBits)
30910 nBits += mLen
30911 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
30912
30913 if (e === 0) {
30914 e = 1 - eBias
30915 } else if (e === eMax) {
30916 return m ? NaN : ((s ? -1 : 1) * Infinity)
30917 } else {
30918 m = m + Math.pow(2, mLen)
30919 e = e - eBias
30920 }
30921 return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
30922}
30923
30924exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
30925 var e, m, c
30926 var eLen = nBytes * 8 - mLen - 1
30927 var eMax = (1 << eLen) - 1
30928 var eBias = eMax >> 1
30929 var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
30930 var i = isLE ? 0 : (nBytes - 1)
30931 var d = isLE ? 1 : -1
30932 var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
30933
30934 value = Math.abs(value)
30935
30936 if (isNaN(value) || value === Infinity) {
30937 m = isNaN(value) ? 1 : 0
30938 e = eMax
30939 } else {
30940 e = Math.floor(Math.log(value) / Math.LN2)
30941 if (value * (c = Math.pow(2, -e)) < 1) {
30942 e--
30943 c *= 2
30944 }
30945 if (e + eBias >= 1) {
30946 value += rt / c
30947 } else {
30948 value += rt * Math.pow(2, 1 - eBias)
30949 }
30950 if (value * c >= 2) {
30951 e++
30952 c /= 2
30953 }
30954
30955 if (e + eBias >= eMax) {
30956 m = 0
30957 e = eMax
30958 } else if (e + eBias >= 1) {
30959 m = (value * c - 1) * Math.pow(2, mLen)
30960 e = e + eBias
30961 } else {
30962 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
30963 e = 0
30964 }
30965 }
30966
30967 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
30968
30969 e = (e << mLen) | m
30970 eLen += mLen
30971 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
30972
30973 buffer[offset + i - d] |= s * 128
30974}
30975
30976},{}],245:[function(require,module,exports){
30977(function (process){
30978/**
30979 * Copyright 2013-2015, Facebook, Inc.
30980 * All rights reserved.
30981 *
30982 * This source code is licensed under the BSD-style license found in the
30983 * LICENSE file in the root directory of this source tree. An additional grant
30984 * of patent rights can be found in the PATENTS file in the same directory.
30985 */
30986
30987'use strict';
30988
30989/**
30990 * Use invariant() to assert state which your program assumes to be true.
30991 *
30992 * Provide sprintf-style format (only %s is supported) and arguments
30993 * to provide information about what broke and what you were
30994 * expecting.
30995 *
30996 * The invariant message will be stripped in production, but the invariant
30997 * will remain to ensure logic does not differ in production.
30998 */
30999
31000var invariant = function(condition, format, a, b, c, d, e, f) {
31001 if (process.env.NODE_ENV !== 'production') {
31002 if (format === undefined) {
31003 throw new Error('invariant requires an error message argument');
31004 }
31005 }
31006
31007 if (!condition) {
31008 var error;
31009 if (format === undefined) {
31010 error = new Error(
31011 'Minified exception occurred; use the non-minified dev environment ' +
31012 'for the full error message and additional helpful warnings.'
31013 );
31014 } else {
31015 var args = [a, b, c, d, e, f];
31016 var argIndex = 0;
31017 error = new Error(
31018 format.replace(/%s/g, function() { return args[argIndex++]; })
31019 );
31020 error.name = 'Invariant Violation';
31021 }
31022
31023 error.framesToPop = 1; // we don't care about invariant's own frame
31024 throw error;
31025 }
31026};
31027
31028module.exports = invariant;
31029
31030}).call(this,require('_process'))
31031},{"_process":471}],246:[function(require,module,exports){
31032'use strict';
31033var numberIsNan = require('number-is-nan');
31034
31035module.exports = Number.isFinite || function (val) {
31036 return !(typeof val !== 'number' || numberIsNan(val) || val === Infinity || val === -Infinity);
31037};
31038
31039},{"number-is-nan":468}],247:[function(require,module,exports){
31040var toString = {}.toString;
31041
31042module.exports = Array.isArray || function (arr) {
31043 return toString.call(arr) == '[object Array]';
31044};
31045
31046},{}],248:[function(require,module,exports){
31047// Copyright 2014, 2015, 2016, 2017 Simon Lydell
31048// License: MIT. (See LICENSE.)
31049
31050Object.defineProperty(exports, "__esModule", {
31051 value: true
31052})
31053
31054// This regex comes from regex.coffee, and is inserted here by generate-index.js
31055// (run `npm run build`).
31056exports.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
31057
31058exports.matchToToken = function(match) {
31059 var token = {type: "invalid", value: match[0]}
31060 if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4])
31061 else if (match[ 5]) token.type = "comment"
31062 else if (match[ 6]) token.type = "comment", token.closed = !!match[7]
31063 else if (match[ 8]) token.type = "regex"
31064 else if (match[ 9]) token.type = "number"
31065 else if (match[10]) token.type = "name"
31066 else if (match[11]) token.type = "punctuator"
31067 else if (match[12]) token.type = "whitespace"
31068 return token
31069}
31070
31071},{}],249:[function(require,module,exports){
31072(function (global){
31073/*! https://mths.be/jsesc v1.3.0 by @mathias */
31074;(function(root) {
31075
31076 // Detect free variables `exports`
31077 var freeExports = typeof exports == 'object' && exports;
31078
31079 // Detect free variable `module`
31080 var freeModule = typeof module == 'object' && module &&
31081 module.exports == freeExports && module;
31082
31083 // Detect free variable `global`, from Node.js or Browserified code,
31084 // and use it as `root`
31085 var freeGlobal = typeof global == 'object' && global;
31086 if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
31087 root = freeGlobal;
31088 }
31089
31090 /*--------------------------------------------------------------------------*/
31091
31092 var object = {};
31093 var hasOwnProperty = object.hasOwnProperty;
31094 var forOwn = function(object, callback) {
31095 var key;
31096 for (key in object) {
31097 if (hasOwnProperty.call(object, key)) {
31098 callback(key, object[key]);
31099 }
31100 }
31101 };
31102
31103 var extend = function(destination, source) {
31104 if (!source) {
31105 return destination;
31106 }
31107 forOwn(source, function(key, value) {
31108 destination[key] = value;
31109 });
31110 return destination;
31111 };
31112
31113 var forEach = function(array, callback) {
31114 var length = array.length;
31115 var index = -1;
31116 while (++index < length) {
31117 callback(array[index]);
31118 }
31119 };
31120
31121 var toString = object.toString;
31122 var isArray = function(value) {
31123 return toString.call(value) == '[object Array]';
31124 };
31125 var isObject = function(value) {
31126 // This is a very simple check, but it’s good enough for what we need.
31127 return toString.call(value) == '[object Object]';
31128 };
31129 var isString = function(value) {
31130 return typeof value == 'string' ||
31131 toString.call(value) == '[object String]';
31132 };
31133 var isNumber = function(value) {
31134 return typeof value == 'number' ||
31135 toString.call(value) == '[object Number]';
31136 };
31137 var isFunction = function(value) {
31138 // In a perfect world, the `typeof` check would be sufficient. However,
31139 // in Chrome 1–12, `typeof /x/ == 'object'`, and in IE 6–8
31140 // `typeof alert == 'object'` and similar for other host objects.
31141 return typeof value == 'function' ||
31142 toString.call(value) == '[object Function]';
31143 };
31144 var isMap = function(value) {
31145 return toString.call(value) == '[object Map]';
31146 };
31147 var isSet = function(value) {
31148 return toString.call(value) == '[object Set]';
31149 };
31150
31151 /*--------------------------------------------------------------------------*/
31152
31153 // https://mathiasbynens.be/notes/javascript-escapes#single
31154 var singleEscapes = {
31155 '"': '\\"',
31156 '\'': '\\\'',
31157 '\\': '\\\\',
31158 '\b': '\\b',
31159 '\f': '\\f',
31160 '\n': '\\n',
31161 '\r': '\\r',
31162 '\t': '\\t'
31163 // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'.
31164 // '\v': '\\x0B'
31165 };
31166 var regexSingleEscape = /["'\\\b\f\n\r\t]/;
31167
31168 var regexDigit = /[0-9]/;
31169 var regexWhitelist = /[ !#-&\(-\[\]-~]/;
31170
31171 var jsesc = function(argument, options) {
31172 // Handle options
31173 var defaults = {
31174 'escapeEverything': false,
31175 'escapeEtago': false,
31176 'quotes': 'single',
31177 'wrap': false,
31178 'es6': false,
31179 'json': false,
31180 'compact': true,
31181 'lowercaseHex': false,
31182 'numbers': 'decimal',
31183 'indent': '\t',
31184 '__indent__': '',
31185 '__inline1__': false,
31186 '__inline2__': false
31187 };
31188 var json = options && options.json;
31189 if (json) {
31190 defaults.quotes = 'double';
31191 defaults.wrap = true;
31192 }
31193 options = extend(defaults, options);
31194 if (options.quotes != 'single' && options.quotes != 'double') {
31195 options.quotes = 'single';
31196 }
31197 var quote = options.quotes == 'double' ? '"' : '\'';
31198 var compact = options.compact;
31199 var indent = options.indent;
31200 var lowercaseHex = options.lowercaseHex;
31201 var oldIndent = '';
31202 var inline1 = options.__inline1__;
31203 var inline2 = options.__inline2__;
31204 var newLine = compact ? '' : '\n';
31205 var result;
31206 var isEmpty = true;
31207 var useBinNumbers = options.numbers == 'binary';
31208 var useOctNumbers = options.numbers == 'octal';
31209 var useDecNumbers = options.numbers == 'decimal';
31210 var useHexNumbers = options.numbers == 'hexadecimal';
31211
31212 if (json && argument && isFunction(argument.toJSON)) {
31213 argument = argument.toJSON();
31214 }
31215
31216 if (!isString(argument)) {
31217 if (isMap(argument)) {
31218 if (argument.size == 0) {
31219 return 'new Map()';
31220 }
31221 if (!compact) {
31222 options.__inline1__ = true;
31223 }
31224 return 'new Map(' + jsesc(Array.from(argument), options) + ')';
31225 }
31226 if (isSet(argument)) {
31227 if (argument.size == 0) {
31228 return 'new Set()';
31229 }
31230 return 'new Set(' + jsesc(Array.from(argument), options) + ')';
31231 }
31232 if (isArray(argument)) {
31233 result = [];
31234 options.wrap = true;
31235 if (inline1) {
31236 options.__inline1__ = false;
31237 options.__inline2__ = true;
31238 } else {
31239 oldIndent = options.__indent__;
31240 indent += oldIndent;
31241 options.__indent__ = indent;
31242 }
31243 forEach(argument, function(value) {
31244 isEmpty = false;
31245 if (inline2) {
31246 options.__inline2__ = false;
31247 }
31248 result.push(
31249 (compact || inline2 ? '' : indent) +
31250 jsesc(value, options)
31251 );
31252 });
31253 if (isEmpty) {
31254 return '[]';
31255 }
31256 if (inline2) {
31257 return '[' + result.join(', ') + ']';
31258 }
31259 return '[' + newLine + result.join(',' + newLine) + newLine +
31260 (compact ? '' : oldIndent) + ']';
31261 } else if (isNumber(argument)) {
31262 if (json) {
31263 // Some number values (e.g. `Infinity`) cannot be represented in JSON.
31264 return JSON.stringify(argument);
31265 }
31266 if (useDecNumbers) {
31267 return String(argument);
31268 }
31269 if (useHexNumbers) {
31270 var tmp = argument.toString(16);
31271 if (!lowercaseHex) {
31272 tmp = tmp.toUpperCase();
31273 }
31274 return '0x' + tmp;
31275 }
31276 if (useBinNumbers) {
31277 return '0b' + argument.toString(2);
31278 }
31279 if (useOctNumbers) {
31280 return '0o' + argument.toString(8);
31281 }
31282 } else if (!isObject(argument)) {
31283 if (json) {
31284 // For some values (e.g. `undefined`, `function` objects),
31285 // `JSON.stringify(value)` returns `undefined` (which isn’t valid
31286 // JSON) instead of `'null'`.
31287 return JSON.stringify(argument) || 'null';
31288 }
31289 return String(argument);
31290 } else { // it’s an object
31291 result = [];
31292 options.wrap = true;
31293 oldIndent = options.__indent__;
31294 indent += oldIndent;
31295 options.__indent__ = indent;
31296 forOwn(argument, function(key, value) {
31297 isEmpty = false;
31298 result.push(
31299 (compact ? '' : indent) +
31300 jsesc(key, options) + ':' +
31301 (compact ? '' : ' ') +
31302 jsesc(value, options)
31303 );
31304 });
31305 if (isEmpty) {
31306 return '{}';
31307 }
31308 return '{' + newLine + result.join(',' + newLine) + newLine +
31309 (compact ? '' : oldIndent) + '}';
31310 }
31311 }
31312
31313 var string = argument;
31314 // Loop over each code unit in the string and escape it
31315 var index = -1;
31316 var length = string.length;
31317 var first;
31318 var second;
31319 var codePoint;
31320 result = '';
31321 while (++index < length) {
31322 var character = string.charAt(index);
31323 if (options.es6) {
31324 first = string.charCodeAt(index);
31325 if ( // check if it’s the start of a surrogate pair
31326 first >= 0xD800 && first <= 0xDBFF && // high surrogate
31327 length > index + 1 // there is a next code unit
31328 ) {
31329 second = string.charCodeAt(index + 1);
31330 if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate
31331 // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
31332 codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
31333 var hexadecimal = codePoint.toString(16);
31334 if (!lowercaseHex) {
31335 hexadecimal = hexadecimal.toUpperCase();
31336 }
31337 result += '\\u{' + hexadecimal + '}';
31338 index++;
31339 continue;
31340 }
31341 }
31342 }
31343 if (!options.escapeEverything) {
31344 if (regexWhitelist.test(character)) {
31345 // It’s a printable ASCII character that is not `"`, `'` or `\`,
31346 // so don’t escape it.
31347 result += character;
31348 continue;
31349 }
31350 if (character == '"') {
31351 result += quote == character ? '\\"' : character;
31352 continue;
31353 }
31354 if (character == '\'') {
31355 result += quote == character ? '\\\'' : character;
31356 continue;
31357 }
31358 }
31359 if (
31360 character == '\0' &&
31361 !json &&
31362 !regexDigit.test(string.charAt(index + 1))
31363 ) {
31364 result += '\\0';
31365 continue;
31366 }
31367 if (regexSingleEscape.test(character)) {
31368 // no need for a `hasOwnProperty` check here
31369 result += singleEscapes[character];
31370 continue;
31371 }
31372 var charCode = character.charCodeAt(0);
31373 var hexadecimal = charCode.toString(16);
31374 if (!lowercaseHex) {
31375 hexadecimal = hexadecimal.toUpperCase();
31376 }
31377 var longhand = hexadecimal.length > 2 || json;
31378 var escaped = '\\' + (longhand ? 'u' : 'x') +
31379 ('0000' + hexadecimal).slice(longhand ? -4 : -2);
31380 result += escaped;
31381 continue;
31382 }
31383 if (options.wrap) {
31384 result = quote + result + quote;
31385 }
31386 if (options.escapeEtago) {
31387 // https://mathiasbynens.be/notes/etago
31388 return result.replace(/<\/(script|style)/gi, '<\\/$1');
31389 }
31390 return result;
31391 };
31392
31393 jsesc.version = '1.3.0';
31394
31395 /*--------------------------------------------------------------------------*/
31396
31397 // Some AMD build optimizers, like r.js, check for specific condition patterns
31398 // like the following:
31399 if (
31400 typeof define == 'function' &&
31401 typeof define.amd == 'object' &&
31402 define.amd
31403 ) {
31404 define(function() {
31405 return jsesc;
31406 });
31407 } else if (freeExports && !freeExports.nodeType) {
31408 if (freeModule) { // in Node.js or RingoJS v0.8.0+
31409 freeModule.exports = jsesc;
31410 } else { // in Narwhal or RingoJS v0.7.0-
31411 freeExports.jsesc = jsesc;
31412 }
31413 } else { // in Rhino or a web browser
31414 root.jsesc = jsesc;
31415 }
31416
31417}(this));
31418
31419}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
31420},{}],250:[function(require,module,exports){
31421// json5.js
31422// Modern JSON. See README.md for details.
31423//
31424// This file is based directly off of Douglas Crockford's json_parse.js:
31425// https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js
31426
31427var JSON5 = (typeof exports === 'object' ? exports : {});
31428
31429JSON5.parse = (function () {
31430 "use strict";
31431
31432// This is a function that can parse a JSON5 text, producing a JavaScript
31433// data structure. It is a simple, recursive descent parser. It does not use
31434// eval or regular expressions, so it can be used as a model for implementing
31435// a JSON5 parser in other languages.
31436
31437// We are defining the function inside of another function to avoid creating
31438// global variables.
31439
31440 var at, // The index of the current character
31441 lineNumber, // The current line number
31442 columnNumber, // The current column number
31443 ch, // The current character
31444 escapee = {
31445 "'": "'",
31446 '"': '"',
31447 '\\': '\\',
31448 '/': '/',
31449 '\n': '', // Replace escaped newlines in strings w/ empty string
31450 b: '\b',
31451 f: '\f',
31452 n: '\n',
31453 r: '\r',
31454 t: '\t'
31455 },
31456 ws = [
31457 ' ',
31458 '\t',
31459 '\r',
31460 '\n',
31461 '\v',
31462 '\f',
31463 '\xA0',
31464 '\uFEFF'
31465 ],
31466 text,
31467
31468 renderChar = function (chr) {
31469 return chr === '' ? 'EOF' : "'" + chr + "'";
31470 },
31471
31472 error = function (m) {
31473
31474// Call error when something is wrong.
31475
31476 var error = new SyntaxError();
31477 // 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
31478 error.message = m + " at line " + lineNumber + " column " + columnNumber + " of the JSON5 data. Still to read: " + JSON.stringify(text.substring(at - 1, at + 19));
31479 error.at = at;
31480 // These two property names have been chosen to agree with the ones in Gecko, the only popular
31481 // environment which seems to supply this info on JSON.parse
31482 error.lineNumber = lineNumber;
31483 error.columnNumber = columnNumber;
31484 throw error;
31485 },
31486
31487 next = function (c) {
31488
31489// If a c parameter is provided, verify that it matches the current character.
31490
31491 if (c && c !== ch) {
31492 error("Expected " + renderChar(c) + " instead of " + renderChar(ch));
31493 }
31494
31495// Get the next character. When there are no more characters,
31496// return the empty string.
31497
31498 ch = text.charAt(at);
31499 at++;
31500 columnNumber++;
31501 if (ch === '\n' || ch === '\r' && peek() !== '\n') {
31502 lineNumber++;
31503 columnNumber = 0;
31504 }
31505 return ch;
31506 },
31507
31508 peek = function () {
31509
31510// Get the next character without consuming it or
31511// assigning it to the ch varaible.
31512
31513 return text.charAt(at);
31514 },
31515
31516 identifier = function () {
31517
31518// Parse an identifier. Normally, reserved words are disallowed here, but we
31519// only use this for unquoted object keys, where reserved words are allowed,
31520// so we don't check for those here. References:
31521// - http://es5.github.com/#x7.6
31522// - https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Core_Language_Features#Variables
31523// - http://docstore.mik.ua/orelly/webprog/jscript/ch02_07.htm
31524// TODO Identifiers can have Unicode "letters" in them; add support for those.
31525
31526 var key = ch;
31527
31528 // Identifiers must start with a letter, _ or $.
31529 if ((ch !== '_' && ch !== '$') &&
31530 (ch < 'a' || ch > 'z') &&
31531 (ch < 'A' || ch > 'Z')) {
31532 error("Bad identifier as unquoted key");
31533 }
31534
31535 // Subsequent characters can contain digits.
31536 while (next() && (
31537 ch === '_' || ch === '$' ||
31538 (ch >= 'a' && ch <= 'z') ||
31539 (ch >= 'A' && ch <= 'Z') ||
31540 (ch >= '0' && ch <= '9'))) {
31541 key += ch;
31542 }
31543
31544 return key;
31545 },
31546
31547 number = function () {
31548
31549// Parse a number value.
31550
31551 var number,
31552 sign = '',
31553 string = '',
31554 base = 10;
31555
31556 if (ch === '-' || ch === '+') {
31557 sign = ch;
31558 next(ch);
31559 }
31560
31561 // support for Infinity (could tweak to allow other words):
31562 if (ch === 'I') {
31563 number = word();
31564 if (typeof number !== 'number' || isNaN(number)) {
31565 error('Unexpected word for number');
31566 }
31567 return (sign === '-') ? -number : number;
31568 }
31569
31570 // support for NaN
31571 if (ch === 'N' ) {
31572 number = word();
31573 if (!isNaN(number)) {
31574 error('expected word to be NaN');
31575 }
31576 // ignore sign as -NaN also is NaN
31577 return number;
31578 }
31579
31580 if (ch === '0') {
31581 string += ch;
31582 next();
31583 if (ch === 'x' || ch === 'X') {
31584 string += ch;
31585 next();
31586 base = 16;
31587 } else if (ch >= '0' && ch <= '9') {
31588 error('Octal literal');
31589 }
31590 }
31591
31592 switch (base) {
31593 case 10:
31594 while (ch >= '0' && ch <= '9' ) {
31595 string += ch;
31596 next();
31597 }
31598 if (ch === '.') {
31599 string += '.';
31600 while (next() && ch >= '0' && ch <= '9') {
31601 string += ch;
31602 }
31603 }
31604 if (ch === 'e' || ch === 'E') {
31605 string += ch;
31606 next();
31607 if (ch === '-' || ch === '+') {
31608 string += ch;
31609 next();
31610 }
31611 while (ch >= '0' && ch <= '9') {
31612 string += ch;
31613 next();
31614 }
31615 }
31616 break;
31617 case 16:
31618 while (ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'F' || ch >= 'a' && ch <= 'f') {
31619 string += ch;
31620 next();
31621 }
31622 break;
31623 }
31624
31625 if(sign === '-') {
31626 number = -string;
31627 } else {
31628 number = +string;
31629 }
31630
31631 if (!isFinite(number)) {
31632 error("Bad number");
31633 } else {
31634 return number;
31635 }
31636 },
31637
31638 string = function () {
31639
31640// Parse a string value.
31641
31642 var hex,
31643 i,
31644 string = '',
31645 delim, // double quote or single quote
31646 uffff;
31647
31648// When parsing for string values, we must look for ' or " and \ characters.
31649
31650 if (ch === '"' || ch === "'") {
31651 delim = ch;
31652 while (next()) {
31653 if (ch === delim) {
31654 next();
31655 return string;
31656 } else if (ch === '\\') {
31657 next();
31658 if (ch === 'u') {
31659 uffff = 0;
31660 for (i = 0; i < 4; i += 1) {
31661 hex = parseInt(next(), 16);
31662 if (!isFinite(hex)) {
31663 break;
31664 }
31665 uffff = uffff * 16 + hex;
31666 }
31667 string += String.fromCharCode(uffff);
31668 } else if (ch === '\r') {
31669 if (peek() === '\n') {
31670 next();
31671 }
31672 } else if (typeof escapee[ch] === 'string') {
31673 string += escapee[ch];
31674 } else {
31675 break;
31676 }
31677 } else if (ch === '\n') {
31678 // unescaped newlines are invalid; see:
31679 // https://github.com/aseemk/json5/issues/24
31680 // TODO this feels special-cased; are there other
31681 // invalid unescaped chars?
31682 break;
31683 } else {
31684 string += ch;
31685 }
31686 }
31687 }
31688 error("Bad string");
31689 },
31690
31691 inlineComment = function () {
31692
31693// Skip an inline comment, assuming this is one. The current character should
31694// be the second / character in the // pair that begins this inline comment.
31695// To finish the inline comment, we look for a newline or the end of the text.
31696
31697 if (ch !== '/') {
31698 error("Not an inline comment");
31699 }
31700
31701 do {
31702 next();
31703 if (ch === '\n' || ch === '\r') {
31704 next();
31705 return;
31706 }
31707 } while (ch);
31708 },
31709
31710 blockComment = function () {
31711
31712// Skip a block comment, assuming this is one. The current character should be
31713// the * character in the /* pair that begins this block comment.
31714// To finish the block comment, we look for an ending */ pair of characters,
31715// but we also watch for the end of text before the comment is terminated.
31716
31717 if (ch !== '*') {
31718 error("Not a block comment");
31719 }
31720
31721 do {
31722 next();
31723 while (ch === '*') {
31724 next('*');
31725 if (ch === '/') {
31726 next('/');
31727 return;
31728 }
31729 }
31730 } while (ch);
31731
31732 error("Unterminated block comment");
31733 },
31734
31735 comment = function () {
31736
31737// Skip a comment, whether inline or block-level, assuming this is one.
31738// Comments always begin with a / character.
31739
31740 if (ch !== '/') {
31741 error("Not a comment");
31742 }
31743
31744 next('/');
31745
31746 if (ch === '/') {
31747 inlineComment();
31748 } else if (ch === '*') {
31749 blockComment();
31750 } else {
31751 error("Unrecognized comment");
31752 }
31753 },
31754
31755 white = function () {
31756
31757// Skip whitespace and comments.
31758// Note that we're detecting comments by only a single / character.
31759// This works since regular expressions are not valid JSON(5), but this will
31760// break if there are other valid values that begin with a / character!
31761
31762 while (ch) {
31763 if (ch === '/') {
31764 comment();
31765 } else if (ws.indexOf(ch) >= 0) {
31766 next();
31767 } else {
31768 return;
31769 }
31770 }
31771 },
31772
31773 word = function () {
31774
31775// true, false, or null.
31776
31777 switch (ch) {
31778 case 't':
31779 next('t');
31780 next('r');
31781 next('u');
31782 next('e');
31783 return true;
31784 case 'f':
31785 next('f');
31786 next('a');
31787 next('l');
31788 next('s');
31789 next('e');
31790 return false;
31791 case 'n':
31792 next('n');
31793 next('u');
31794 next('l');
31795 next('l');
31796 return null;
31797 case 'I':
31798 next('I');
31799 next('n');
31800 next('f');
31801 next('i');
31802 next('n');
31803 next('i');
31804 next('t');
31805 next('y');
31806 return Infinity;
31807 case 'N':
31808 next( 'N' );
31809 next( 'a' );
31810 next( 'N' );
31811 return NaN;
31812 }
31813 error("Unexpected " + renderChar(ch));
31814 },
31815
31816 value, // Place holder for the value function.
31817
31818 array = function () {
31819
31820// Parse an array value.
31821
31822 var array = [];
31823
31824 if (ch === '[') {
31825 next('[');
31826 white();
31827 while (ch) {
31828 if (ch === ']') {
31829 next(']');
31830 return array; // Potentially empty array
31831 }
31832 // ES5 allows omitting elements in arrays, e.g. [,] and
31833 // [,null]. We don't allow this in JSON5.
31834 if (ch === ',') {
31835 error("Missing array element");
31836 } else {
31837 array.push(value());
31838 }
31839 white();
31840 // If there's no comma after this value, this needs to
31841 // be the end of the array.
31842 if (ch !== ',') {
31843 next(']');
31844 return array;
31845 }
31846 next(',');
31847 white();
31848 }
31849 }
31850 error("Bad array");
31851 },
31852
31853 object = function () {
31854
31855// Parse an object value.
31856
31857 var key,
31858 object = {};
31859
31860 if (ch === '{') {
31861 next('{');
31862 white();
31863 while (ch) {
31864 if (ch === '}') {
31865 next('}');
31866 return object; // Potentially empty object
31867 }
31868
31869 // Keys can be unquoted. If they are, they need to be
31870 // valid JS identifiers.
31871 if (ch === '"' || ch === "'") {
31872 key = string();
31873 } else {
31874 key = identifier();
31875 }
31876
31877 white();
31878 next(':');
31879 object[key] = value();
31880 white();
31881 // If there's no comma after this pair, this needs to be
31882 // the end of the object.
31883 if (ch !== ',') {
31884 next('}');
31885 return object;
31886 }
31887 next(',');
31888 white();
31889 }
31890 }
31891 error("Bad object");
31892 };
31893
31894 value = function () {
31895
31896// Parse a JSON value. It could be an object, an array, a string, a number,
31897// or a word.
31898
31899 white();
31900 switch (ch) {
31901 case '{':
31902 return object();
31903 case '[':
31904 return array();
31905 case '"':
31906 case "'":
31907 return string();
31908 case '-':
31909 case '+':
31910 case '.':
31911 return number();
31912 default:
31913 return ch >= '0' && ch <= '9' ? number() : word();
31914 }
31915 };
31916
31917// Return the json_parse function. It will have access to all of the above
31918// functions and variables.
31919
31920 return function (source, reviver) {
31921 var result;
31922
31923 text = String(source);
31924 at = 0;
31925 lineNumber = 1;
31926 columnNumber = 1;
31927 ch = ' ';
31928 result = value();
31929 white();
31930 if (ch) {
31931 error("Syntax error");
31932 }
31933
31934// If there is a reviver function, we recursively walk the new structure,
31935// passing each name/value pair to the reviver function for possible
31936// transformation, starting with a temporary root object that holds the result
31937// in an empty key. If there is not a reviver function, we simply return the
31938// result.
31939
31940 return typeof reviver === 'function' ? (function walk(holder, key) {
31941 var k, v, value = holder[key];
31942 if (value && typeof value === 'object') {
31943 for (k in value) {
31944 if (Object.prototype.hasOwnProperty.call(value, k)) {
31945 v = walk(value, k);
31946 if (v !== undefined) {
31947 value[k] = v;
31948 } else {
31949 delete value[k];
31950 }
31951 }
31952 }
31953 }
31954 return reviver.call(holder, key, value);
31955 }({'': result}, '')) : result;
31956 };
31957}());
31958
31959// JSON5 stringify will not quote keys where appropriate
31960JSON5.stringify = function (obj, replacer, space) {
31961 if (replacer && (typeof(replacer) !== "function" && !isArray(replacer))) {
31962 throw new Error('Replacer must be a function or an array');
31963 }
31964 var getReplacedValueOrUndefined = function(holder, key, isTopLevel) {
31965 var value = holder[key];
31966
31967 // Replace the value with its toJSON value first, if possible
31968 if (value && value.toJSON && typeof value.toJSON === "function") {
31969 value = value.toJSON();
31970 }
31971
31972 // If the user-supplied replacer if a function, call it. If it's an array, check objects' string keys for
31973 // presence in the array (removing the key/value pair from the resulting JSON if the key is missing).
31974 if (typeof(replacer) === "function") {
31975 return replacer.call(holder, key, value);
31976 } else if(replacer) {
31977 if (isTopLevel || isArray(holder) || replacer.indexOf(key) >= 0) {
31978 return value;
31979 } else {
31980 return undefined;
31981 }
31982 } else {
31983 return value;
31984 }
31985 };
31986
31987 function isWordChar(c) {
31988 return (c >= 'a' && c <= 'z') ||
31989 (c >= 'A' && c <= 'Z') ||
31990 (c >= '0' && c <= '9') ||
31991 c === '_' || c === '$';
31992 }
31993
31994 function isWordStart(c) {
31995 return (c >= 'a' && c <= 'z') ||
31996 (c >= 'A' && c <= 'Z') ||
31997 c === '_' || c === '$';
31998 }
31999
32000 function isWord(key) {
32001 if (typeof key !== 'string') {
32002 return false;
32003 }
32004 if (!isWordStart(key[0])) {
32005 return false;
32006 }
32007 var i = 1, length = key.length;
32008 while (i < length) {
32009 if (!isWordChar(key[i])) {
32010 return false;
32011 }
32012 i++;
32013 }
32014 return true;
32015 }
32016
32017 // export for use in tests
32018 JSON5.isWord = isWord;
32019
32020 // polyfills
32021 function isArray(obj) {
32022 if (Array.isArray) {
32023 return Array.isArray(obj);
32024 } else {
32025 return Object.prototype.toString.call(obj) === '[object Array]';
32026 }
32027 }
32028
32029 function isDate(obj) {
32030 return Object.prototype.toString.call(obj) === '[object Date]';
32031 }
32032
32033 var objStack = [];
32034 function checkForCircular(obj) {
32035 for (var i = 0; i < objStack.length; i++) {
32036 if (objStack[i] === obj) {
32037 throw new TypeError("Converting circular structure to JSON");
32038 }
32039 }
32040 }
32041
32042 function makeIndent(str, num, noNewLine) {
32043 if (!str) {
32044 return "";
32045 }
32046 // indentation no more than 10 chars
32047 if (str.length > 10) {
32048 str = str.substring(0, 10);
32049 }
32050
32051 var indent = noNewLine ? "" : "\n";
32052 for (var i = 0; i < num; i++) {
32053 indent += str;
32054 }
32055
32056 return indent;
32057 }
32058
32059 var indentStr;
32060 if (space) {
32061 if (typeof space === "string") {
32062 indentStr = space;
32063 } else if (typeof space === "number" && space >= 0) {
32064 indentStr = makeIndent(" ", space, true);
32065 } else {
32066 // ignore space parameter
32067 }
32068 }
32069
32070 // Copied from Crokford's implementation of JSON
32071 // See https://github.com/douglascrockford/JSON-js/blob/e39db4b7e6249f04a195e7dd0840e610cc9e941e/json2.js#L195
32072 // Begin
32073 var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
32074 escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
32075 meta = { // table of character substitutions
32076 '\b': '\\b',
32077 '\t': '\\t',
32078 '\n': '\\n',
32079 '\f': '\\f',
32080 '\r': '\\r',
32081 '"' : '\\"',
32082 '\\': '\\\\'
32083 };
32084 function escapeString(string) {
32085
32086// If the string contains no control characters, no quote characters, and no
32087// backslash characters, then we can safely slap some quotes around it.
32088// Otherwise we must also replace the offending characters with safe escape
32089// sequences.
32090 escapable.lastIndex = 0;
32091 return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
32092 var c = meta[a];
32093 return typeof c === 'string' ?
32094 c :
32095 '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
32096 }) + '"' : '"' + string + '"';
32097 }
32098 // End
32099
32100 function internalStringify(holder, key, isTopLevel) {
32101 var buffer, res;
32102
32103 // Replace the value, if necessary
32104 var obj_part = getReplacedValueOrUndefined(holder, key, isTopLevel);
32105
32106 if (obj_part && !isDate(obj_part)) {
32107 // unbox objects
32108 // don't unbox dates, since will turn it into number
32109 obj_part = obj_part.valueOf();
32110 }
32111 switch(typeof obj_part) {
32112 case "boolean":
32113 return obj_part.toString();
32114
32115 case "number":
32116 if (isNaN(obj_part) || !isFinite(obj_part)) {
32117 return "null";
32118 }
32119 return obj_part.toString();
32120
32121 case "string":
32122 return escapeString(obj_part.toString());
32123
32124 case "object":
32125 if (obj_part === null) {
32126 return "null";
32127 } else if (isArray(obj_part)) {
32128 checkForCircular(obj_part);
32129 buffer = "[";
32130 objStack.push(obj_part);
32131
32132 for (var i = 0; i < obj_part.length; i++) {
32133 res = internalStringify(obj_part, i, false);
32134 buffer += makeIndent(indentStr, objStack.length);
32135 if (res === null || typeof res === "undefined") {
32136 buffer += "null";
32137 } else {
32138 buffer += res;
32139 }
32140 if (i < obj_part.length-1) {
32141 buffer += ",";
32142 } else if (indentStr) {
32143 buffer += "\n";
32144 }
32145 }
32146 objStack.pop();
32147 if (obj_part.length) {
32148 buffer += makeIndent(indentStr, objStack.length, true)
32149 }
32150 buffer += "]";
32151 } else {
32152 checkForCircular(obj_part);
32153 buffer = "{";
32154 var nonEmpty = false;
32155 objStack.push(obj_part);
32156 for (var prop in obj_part) {
32157 if (obj_part.hasOwnProperty(prop)) {
32158 var value = internalStringify(obj_part, prop, false);
32159 isTopLevel = false;
32160 if (typeof value !== "undefined" && value !== null) {
32161 buffer += makeIndent(indentStr, objStack.length);
32162 nonEmpty = true;
32163 key = isWord(prop) ? prop : escapeString(prop);
32164 buffer += key + ":" + (indentStr ? ' ' : '') + value + ",";
32165 }
32166 }
32167 }
32168 objStack.pop();
32169 if (nonEmpty) {
32170 buffer = buffer.substring(0, buffer.length-1) + makeIndent(indentStr, objStack.length) + "}";
32171 } else {
32172 buffer = '{}';
32173 }
32174 }
32175 return buffer;
32176 default:
32177 // functions and undefined should be ignored
32178 return undefined;
32179 }
32180 }
32181
32182 // special case...when undefined is used inside of
32183 // a compound object/array, return null.
32184 // but when top-level, return undefined
32185 var topLevelHolder = {"":obj};
32186 if (obj === undefined) {
32187 return getReplacedValueOrUndefined(topLevelHolder, '', true);
32188 }
32189 return internalStringify(topLevelHolder, '', true);
32190};
32191
32192},{}],251:[function(require,module,exports){
32193var getNative = require('./_getNative'),
32194 root = require('./_root');
32195
32196/* Built-in method references that are verified to be native. */
32197var DataView = getNative(root, 'DataView');
32198
32199module.exports = DataView;
32200
32201},{"./_getNative":355,"./_root":399}],252:[function(require,module,exports){
32202var hashClear = require('./_hashClear'),
32203 hashDelete = require('./_hashDelete'),
32204 hashGet = require('./_hashGet'),
32205 hashHas = require('./_hashHas'),
32206 hashSet = require('./_hashSet');
32207
32208/**
32209 * Creates a hash object.
32210 *
32211 * @private
32212 * @constructor
32213 * @param {Array} [entries] The key-value pairs to cache.
32214 */
32215function Hash(entries) {
32216 var index = -1,
32217 length = entries == null ? 0 : entries.length;
32218
32219 this.clear();
32220 while (++index < length) {
32221 var entry = entries[index];
32222 this.set(entry[0], entry[1]);
32223 }
32224}
32225
32226// Add methods to `Hash`.
32227Hash.prototype.clear = hashClear;
32228Hash.prototype['delete'] = hashDelete;
32229Hash.prototype.get = hashGet;
32230Hash.prototype.has = hashHas;
32231Hash.prototype.set = hashSet;
32232
32233module.exports = Hash;
32234
32235},{"./_hashClear":363,"./_hashDelete":364,"./_hashGet":365,"./_hashHas":366,"./_hashSet":367}],253:[function(require,module,exports){
32236var listCacheClear = require('./_listCacheClear'),
32237 listCacheDelete = require('./_listCacheDelete'),
32238 listCacheGet = require('./_listCacheGet'),
32239 listCacheHas = require('./_listCacheHas'),
32240 listCacheSet = require('./_listCacheSet');
32241
32242/**
32243 * Creates an list cache object.
32244 *
32245 * @private
32246 * @constructor
32247 * @param {Array} [entries] The key-value pairs to cache.
32248 */
32249function ListCache(entries) {
32250 var index = -1,
32251 length = entries == null ? 0 : entries.length;
32252
32253 this.clear();
32254 while (++index < length) {
32255 var entry = entries[index];
32256 this.set(entry[0], entry[1]);
32257 }
32258}
32259
32260// Add methods to `ListCache`.
32261ListCache.prototype.clear = listCacheClear;
32262ListCache.prototype['delete'] = listCacheDelete;
32263ListCache.prototype.get = listCacheGet;
32264ListCache.prototype.has = listCacheHas;
32265ListCache.prototype.set = listCacheSet;
32266
32267module.exports = ListCache;
32268
32269},{"./_listCacheClear":379,"./_listCacheDelete":380,"./_listCacheGet":381,"./_listCacheHas":382,"./_listCacheSet":383}],254:[function(require,module,exports){
32270var getNative = require('./_getNative'),
32271 root = require('./_root');
32272
32273/* Built-in method references that are verified to be native. */
32274var Map = getNative(root, 'Map');
32275
32276module.exports = Map;
32277
32278},{"./_getNative":355,"./_root":399}],255:[function(require,module,exports){
32279var mapCacheClear = require('./_mapCacheClear'),
32280 mapCacheDelete = require('./_mapCacheDelete'),
32281 mapCacheGet = require('./_mapCacheGet'),
32282 mapCacheHas = require('./_mapCacheHas'),
32283 mapCacheSet = require('./_mapCacheSet');
32284
32285/**
32286 * Creates a map cache object to store key-value pairs.
32287 *
32288 * @private
32289 * @constructor
32290 * @param {Array} [entries] The key-value pairs to cache.
32291 */
32292function MapCache(entries) {
32293 var index = -1,
32294 length = entries == null ? 0 : entries.length;
32295
32296 this.clear();
32297 while (++index < length) {
32298 var entry = entries[index];
32299 this.set(entry[0], entry[1]);
32300 }
32301}
32302
32303// Add methods to `MapCache`.
32304MapCache.prototype.clear = mapCacheClear;
32305MapCache.prototype['delete'] = mapCacheDelete;
32306MapCache.prototype.get = mapCacheGet;
32307MapCache.prototype.has = mapCacheHas;
32308MapCache.prototype.set = mapCacheSet;
32309
32310module.exports = MapCache;
32311
32312},{"./_mapCacheClear":384,"./_mapCacheDelete":385,"./_mapCacheGet":386,"./_mapCacheHas":387,"./_mapCacheSet":388}],256:[function(require,module,exports){
32313var getNative = require('./_getNative'),
32314 root = require('./_root');
32315
32316/* Built-in method references that are verified to be native. */
32317var Promise = getNative(root, 'Promise');
32318
32319module.exports = Promise;
32320
32321},{"./_getNative":355,"./_root":399}],257:[function(require,module,exports){
32322var getNative = require('./_getNative'),
32323 root = require('./_root');
32324
32325/* Built-in method references that are verified to be native. */
32326var Set = getNative(root, 'Set');
32327
32328module.exports = Set;
32329
32330},{"./_getNative":355,"./_root":399}],258:[function(require,module,exports){
32331var MapCache = require('./_MapCache'),
32332 setCacheAdd = require('./_setCacheAdd'),
32333 setCacheHas = require('./_setCacheHas');
32334
32335/**
32336 *
32337 * Creates an array cache object to store unique values.
32338 *
32339 * @private
32340 * @constructor
32341 * @param {Array} [values] The values to cache.
32342 */
32343function SetCache(values) {
32344 var index = -1,
32345 length = values == null ? 0 : values.length;
32346
32347 this.__data__ = new MapCache;
32348 while (++index < length) {
32349 this.add(values[index]);
32350 }
32351}
32352
32353// Add methods to `SetCache`.
32354SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
32355SetCache.prototype.has = setCacheHas;
32356
32357module.exports = SetCache;
32358
32359},{"./_MapCache":255,"./_setCacheAdd":400,"./_setCacheHas":401}],259:[function(require,module,exports){
32360var ListCache = require('./_ListCache'),
32361 stackClear = require('./_stackClear'),
32362 stackDelete = require('./_stackDelete'),
32363 stackGet = require('./_stackGet'),
32364 stackHas = require('./_stackHas'),
32365 stackSet = require('./_stackSet');
32366
32367/**
32368 * Creates a stack cache object to store key-value pairs.
32369 *
32370 * @private
32371 * @constructor
32372 * @param {Array} [entries] The key-value pairs to cache.
32373 */
32374function Stack(entries) {
32375 var data = this.__data__ = new ListCache(entries);
32376 this.size = data.size;
32377}
32378
32379// Add methods to `Stack`.
32380Stack.prototype.clear = stackClear;
32381Stack.prototype['delete'] = stackDelete;
32382Stack.prototype.get = stackGet;
32383Stack.prototype.has = stackHas;
32384Stack.prototype.set = stackSet;
32385
32386module.exports = Stack;
32387
32388},{"./_ListCache":253,"./_stackClear":405,"./_stackDelete":406,"./_stackGet":407,"./_stackHas":408,"./_stackSet":409}],260:[function(require,module,exports){
32389var root = require('./_root');
32390
32391/** Built-in value references. */
32392var Symbol = root.Symbol;
32393
32394module.exports = Symbol;
32395
32396},{"./_root":399}],261:[function(require,module,exports){
32397var root = require('./_root');
32398
32399/** Built-in value references. */
32400var Uint8Array = root.Uint8Array;
32401
32402module.exports = Uint8Array;
32403
32404},{"./_root":399}],262:[function(require,module,exports){
32405var getNative = require('./_getNative'),
32406 root = require('./_root');
32407
32408/* Built-in method references that are verified to be native. */
32409var WeakMap = getNative(root, 'WeakMap');
32410
32411module.exports = WeakMap;
32412
32413},{"./_getNative":355,"./_root":399}],263:[function(require,module,exports){
32414/**
32415 * Adds the key-value `pair` to `map`.
32416 *
32417 * @private
32418 * @param {Object} map The map to modify.
32419 * @param {Array} pair The key-value pair to add.
32420 * @returns {Object} Returns `map`.
32421 */
32422function addMapEntry(map, pair) {
32423 // Don't return `map.set` because it's not chainable in IE 11.
32424 map.set(pair[0], pair[1]);
32425 return map;
32426}
32427
32428module.exports = addMapEntry;
32429
32430},{}],264:[function(require,module,exports){
32431/**
32432 * Adds `value` to `set`.
32433 *
32434 * @private
32435 * @param {Object} set The set to modify.
32436 * @param {*} value The value to add.
32437 * @returns {Object} Returns `set`.
32438 */
32439function addSetEntry(set, value) {
32440 // Don't return `set.add` because it's not chainable in IE 11.
32441 set.add(value);
32442 return set;
32443}
32444
32445module.exports = addSetEntry;
32446
32447},{}],265:[function(require,module,exports){
32448/**
32449 * A faster alternative to `Function#apply`, this function invokes `func`
32450 * with the `this` binding of `thisArg` and the arguments of `args`.
32451 *
32452 * @private
32453 * @param {Function} func The function to invoke.
32454 * @param {*} thisArg The `this` binding of `func`.
32455 * @param {Array} args The arguments to invoke `func` with.
32456 * @returns {*} Returns the result of `func`.
32457 */
32458function apply(func, thisArg, args) {
32459 switch (args.length) {
32460 case 0: return func.call(thisArg);
32461 case 1: return func.call(thisArg, args[0]);
32462 case 2: return func.call(thisArg, args[0], args[1]);
32463 case 3: return func.call(thisArg, args[0], args[1], args[2]);
32464 }
32465 return func.apply(thisArg, args);
32466}
32467
32468module.exports = apply;
32469
32470},{}],266:[function(require,module,exports){
32471/**
32472 * A specialized version of `_.forEach` for arrays without support for
32473 * iteratee shorthands.
32474 *
32475 * @private
32476 * @param {Array} [array] The array to iterate over.
32477 * @param {Function} iteratee The function invoked per iteration.
32478 * @returns {Array} Returns `array`.
32479 */
32480function arrayEach(array, iteratee) {
32481 var index = -1,
32482 length = array == null ? 0 : array.length;
32483
32484 while (++index < length) {
32485 if (iteratee(array[index], index, array) === false) {
32486 break;
32487 }
32488 }
32489 return array;
32490}
32491
32492module.exports = arrayEach;
32493
32494},{}],267:[function(require,module,exports){
32495/**
32496 * A specialized version of `_.filter` for arrays without support for
32497 * iteratee shorthands.
32498 *
32499 * @private
32500 * @param {Array} [array] The array to iterate over.
32501 * @param {Function} predicate The function invoked per iteration.
32502 * @returns {Array} Returns the new filtered array.
32503 */
32504function arrayFilter(array, predicate) {
32505 var index = -1,
32506 length = array == null ? 0 : array.length,
32507 resIndex = 0,
32508 result = [];
32509
32510 while (++index < length) {
32511 var value = array[index];
32512 if (predicate(value, index, array)) {
32513 result[resIndex++] = value;
32514 }
32515 }
32516 return result;
32517}
32518
32519module.exports = arrayFilter;
32520
32521},{}],268:[function(require,module,exports){
32522var baseIndexOf = require('./_baseIndexOf');
32523
32524/**
32525 * A specialized version of `_.includes` for arrays without support for
32526 * specifying an index to search from.
32527 *
32528 * @private
32529 * @param {Array} [array] The array to inspect.
32530 * @param {*} target The value to search for.
32531 * @returns {boolean} Returns `true` if `target` is found, else `false`.
32532 */
32533function arrayIncludes(array, value) {
32534 var length = array == null ? 0 : array.length;
32535 return !!length && baseIndexOf(array, value, 0) > -1;
32536}
32537
32538module.exports = arrayIncludes;
32539
32540},{"./_baseIndexOf":294}],269:[function(require,module,exports){
32541/**
32542 * This function is like `arrayIncludes` except that it accepts a comparator.
32543 *
32544 * @private
32545 * @param {Array} [array] The array to inspect.
32546 * @param {*} target The value to search for.
32547 * @param {Function} comparator The comparator invoked per element.
32548 * @returns {boolean} Returns `true` if `target` is found, else `false`.
32549 */
32550function arrayIncludesWith(array, value, comparator) {
32551 var index = -1,
32552 length = array == null ? 0 : array.length;
32553
32554 while (++index < length) {
32555 if (comparator(value, array[index])) {
32556 return true;
32557 }
32558 }
32559 return false;
32560}
32561
32562module.exports = arrayIncludesWith;
32563
32564},{}],270:[function(require,module,exports){
32565var baseTimes = require('./_baseTimes'),
32566 isArguments = require('./isArguments'),
32567 isArray = require('./isArray'),
32568 isBuffer = require('./isBuffer'),
32569 isIndex = require('./_isIndex'),
32570 isTypedArray = require('./isTypedArray');
32571
32572/** Used for built-in method references. */
32573var objectProto = Object.prototype;
32574
32575/** Used to check objects for own properties. */
32576var hasOwnProperty = objectProto.hasOwnProperty;
32577
32578/**
32579 * Creates an array of the enumerable property names of the array-like `value`.
32580 *
32581 * @private
32582 * @param {*} value The value to query.
32583 * @param {boolean} inherited Specify returning inherited property names.
32584 * @returns {Array} Returns the array of property names.
32585 */
32586function arrayLikeKeys(value, inherited) {
32587 var isArr = isArray(value),
32588 isArg = !isArr && isArguments(value),
32589 isBuff = !isArr && !isArg && isBuffer(value),
32590 isType = !isArr && !isArg && !isBuff && isTypedArray(value),
32591 skipIndexes = isArr || isArg || isBuff || isType,
32592 result = skipIndexes ? baseTimes(value.length, String) : [],
32593 length = result.length;
32594
32595 for (var key in value) {
32596 if ((inherited || hasOwnProperty.call(value, key)) &&
32597 !(skipIndexes && (
32598 // Safari 9 has enumerable `arguments.length` in strict mode.
32599 key == 'length' ||
32600 // Node.js 0.10 has enumerable non-index properties on buffers.
32601 (isBuff && (key == 'offset' || key == 'parent')) ||
32602 // PhantomJS 2 has enumerable non-index properties on typed arrays.
32603 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
32604 // Skip index properties.
32605 isIndex(key, length)
32606 ))) {
32607 result.push(key);
32608 }
32609 }
32610 return result;
32611}
32612
32613module.exports = arrayLikeKeys;
32614
32615},{"./_baseTimes":318,"./_isIndex":372,"./isArguments":432,"./isArray":433,"./isBuffer":436,"./isTypedArray":446}],271:[function(require,module,exports){
32616/**
32617 * A specialized version of `_.map` for arrays without support for iteratee
32618 * shorthands.
32619 *
32620 * @private
32621 * @param {Array} [array] The array to iterate over.
32622 * @param {Function} iteratee The function invoked per iteration.
32623 * @returns {Array} Returns the new mapped array.
32624 */
32625function arrayMap(array, iteratee) {
32626 var index = -1,
32627 length = array == null ? 0 : array.length,
32628 result = Array(length);
32629
32630 while (++index < length) {
32631 result[index] = iteratee(array[index], index, array);
32632 }
32633 return result;
32634}
32635
32636module.exports = arrayMap;
32637
32638},{}],272:[function(require,module,exports){
32639/**
32640 * Appends the elements of `values` to `array`.
32641 *
32642 * @private
32643 * @param {Array} array The array to modify.
32644 * @param {Array} values The values to append.
32645 * @returns {Array} Returns `array`.
32646 */
32647function arrayPush(array, values) {
32648 var index = -1,
32649 length = values.length,
32650 offset = array.length;
32651
32652 while (++index < length) {
32653 array[offset + index] = values[index];
32654 }
32655 return array;
32656}
32657
32658module.exports = arrayPush;
32659
32660},{}],273:[function(require,module,exports){
32661/**
32662 * A specialized version of `_.reduce` for arrays without support for
32663 * iteratee shorthands.
32664 *
32665 * @private
32666 * @param {Array} [array] The array to iterate over.
32667 * @param {Function} iteratee The function invoked per iteration.
32668 * @param {*} [accumulator] The initial value.
32669 * @param {boolean} [initAccum] Specify using the first element of `array` as
32670 * the initial value.
32671 * @returns {*} Returns the accumulated value.
32672 */
32673function arrayReduce(array, iteratee, accumulator, initAccum) {
32674 var index = -1,
32675 length = array == null ? 0 : array.length;
32676
32677 if (initAccum && length) {
32678 accumulator = array[++index];
32679 }
32680 while (++index < length) {
32681 accumulator = iteratee(accumulator, array[index], index, array);
32682 }
32683 return accumulator;
32684}
32685
32686module.exports = arrayReduce;
32687
32688},{}],274:[function(require,module,exports){
32689/**
32690 * A specialized version of `_.some` for arrays without support for iteratee
32691 * shorthands.
32692 *
32693 * @private
32694 * @param {Array} [array] The array to iterate over.
32695 * @param {Function} predicate The function invoked per iteration.
32696 * @returns {boolean} Returns `true` if any element passes the predicate check,
32697 * else `false`.
32698 */
32699function arraySome(array, predicate) {
32700 var index = -1,
32701 length = array == null ? 0 : array.length;
32702
32703 while (++index < length) {
32704 if (predicate(array[index], index, array)) {
32705 return true;
32706 }
32707 }
32708 return false;
32709}
32710
32711module.exports = arraySome;
32712
32713},{}],275:[function(require,module,exports){
32714var baseAssignValue = require('./_baseAssignValue'),
32715 eq = require('./eq');
32716
32717/**
32718 * This function is like `assignValue` except that it doesn't assign
32719 * `undefined` values.
32720 *
32721 * @private
32722 * @param {Object} object The object to modify.
32723 * @param {string} key The key of the property to assign.
32724 * @param {*} value The value to assign.
32725 */
32726function assignMergeValue(object, key, value) {
32727 if ((value !== undefined && !eq(object[key], value)) ||
32728 (value === undefined && !(key in object))) {
32729 baseAssignValue(object, key, value);
32730 }
32731}
32732
32733module.exports = assignMergeValue;
32734
32735},{"./_baseAssignValue":280,"./eq":421}],276:[function(require,module,exports){
32736var baseAssignValue = require('./_baseAssignValue'),
32737 eq = require('./eq');
32738
32739/** Used for built-in method references. */
32740var objectProto = Object.prototype;
32741
32742/** Used to check objects for own properties. */
32743var hasOwnProperty = objectProto.hasOwnProperty;
32744
32745/**
32746 * Assigns `value` to `key` of `object` if the existing value is not equivalent
32747 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
32748 * for equality comparisons.
32749 *
32750 * @private
32751 * @param {Object} object The object to modify.
32752 * @param {string} key The key of the property to assign.
32753 * @param {*} value The value to assign.
32754 */
32755function assignValue(object, key, value) {
32756 var objValue = object[key];
32757 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
32758 (value === undefined && !(key in object))) {
32759 baseAssignValue(object, key, value);
32760 }
32761}
32762
32763module.exports = assignValue;
32764
32765},{"./_baseAssignValue":280,"./eq":421}],277:[function(require,module,exports){
32766var eq = require('./eq');
32767
32768/**
32769 * Gets the index at which the `key` is found in `array` of key-value pairs.
32770 *
32771 * @private
32772 * @param {Array} array The array to inspect.
32773 * @param {*} key The key to search for.
32774 * @returns {number} Returns the index of the matched value, else `-1`.
32775 */
32776function assocIndexOf(array, key) {
32777 var length = array.length;
32778 while (length--) {
32779 if (eq(array[length][0], key)) {
32780 return length;
32781 }
32782 }
32783 return -1;
32784}
32785
32786module.exports = assocIndexOf;
32787
32788},{"./eq":421}],278:[function(require,module,exports){
32789var copyObject = require('./_copyObject'),
32790 keys = require('./keys');
32791
32792/**
32793 * The base implementation of `_.assign` without support for multiple sources
32794 * or `customizer` functions.
32795 *
32796 * @private
32797 * @param {Object} object The destination object.
32798 * @param {Object} source The source object.
32799 * @returns {Object} Returns `object`.
32800 */
32801function baseAssign(object, source) {
32802 return object && copyObject(source, keys(source), object);
32803}
32804
32805module.exports = baseAssign;
32806
32807},{"./_copyObject":336,"./keys":447}],279:[function(require,module,exports){
32808var copyObject = require('./_copyObject'),
32809 keysIn = require('./keysIn');
32810
32811/**
32812 * The base implementation of `_.assignIn` without support for multiple sources
32813 * or `customizer` functions.
32814 *
32815 * @private
32816 * @param {Object} object The destination object.
32817 * @param {Object} source The source object.
32818 * @returns {Object} Returns `object`.
32819 */
32820function baseAssignIn(object, source) {
32821 return object && copyObject(source, keysIn(source), object);
32822}
32823
32824module.exports = baseAssignIn;
32825
32826},{"./_copyObject":336,"./keysIn":448}],280:[function(require,module,exports){
32827var defineProperty = require('./_defineProperty');
32828
32829/**
32830 * The base implementation of `assignValue` and `assignMergeValue` without
32831 * value checks.
32832 *
32833 * @private
32834 * @param {Object} object The object to modify.
32835 * @param {string} key The key of the property to assign.
32836 * @param {*} value The value to assign.
32837 */
32838function baseAssignValue(object, key, value) {
32839 if (key == '__proto__' && defineProperty) {
32840 defineProperty(object, key, {
32841 'configurable': true,
32842 'enumerable': true,
32843 'value': value,
32844 'writable': true
32845 });
32846 } else {
32847 object[key] = value;
32848 }
32849}
32850
32851module.exports = baseAssignValue;
32852
32853},{"./_defineProperty":346}],281:[function(require,module,exports){
32854/**
32855 * The base implementation of `_.clamp` which doesn't coerce arguments.
32856 *
32857 * @private
32858 * @param {number} number The number to clamp.
32859 * @param {number} [lower] The lower bound.
32860 * @param {number} upper The upper bound.
32861 * @returns {number} Returns the clamped number.
32862 */
32863function baseClamp(number, lower, upper) {
32864 if (number === number) {
32865 if (upper !== undefined) {
32866 number = number <= upper ? number : upper;
32867 }
32868 if (lower !== undefined) {
32869 number = number >= lower ? number : lower;
32870 }
32871 }
32872 return number;
32873}
32874
32875module.exports = baseClamp;
32876
32877},{}],282:[function(require,module,exports){
32878var Stack = require('./_Stack'),
32879 arrayEach = require('./_arrayEach'),
32880 assignValue = require('./_assignValue'),
32881 baseAssign = require('./_baseAssign'),
32882 baseAssignIn = require('./_baseAssignIn'),
32883 cloneBuffer = require('./_cloneBuffer'),
32884 copyArray = require('./_copyArray'),
32885 copySymbols = require('./_copySymbols'),
32886 copySymbolsIn = require('./_copySymbolsIn'),
32887 getAllKeys = require('./_getAllKeys'),
32888 getAllKeysIn = require('./_getAllKeysIn'),
32889 getTag = require('./_getTag'),
32890 initCloneArray = require('./_initCloneArray'),
32891 initCloneByTag = require('./_initCloneByTag'),
32892 initCloneObject = require('./_initCloneObject'),
32893 isArray = require('./isArray'),
32894 isBuffer = require('./isBuffer'),
32895 isObject = require('./isObject'),
32896 keys = require('./keys');
32897
32898/** Used to compose bitmasks for cloning. */
32899var CLONE_DEEP_FLAG = 1,
32900 CLONE_FLAT_FLAG = 2,
32901 CLONE_SYMBOLS_FLAG = 4;
32902
32903/** `Object#toString` result references. */
32904var argsTag = '[object Arguments]',
32905 arrayTag = '[object Array]',
32906 boolTag = '[object Boolean]',
32907 dateTag = '[object Date]',
32908 errorTag = '[object Error]',
32909 funcTag = '[object Function]',
32910 genTag = '[object GeneratorFunction]',
32911 mapTag = '[object Map]',
32912 numberTag = '[object Number]',
32913 objectTag = '[object Object]',
32914 regexpTag = '[object RegExp]',
32915 setTag = '[object Set]',
32916 stringTag = '[object String]',
32917 symbolTag = '[object Symbol]',
32918 weakMapTag = '[object WeakMap]';
32919
32920var arrayBufferTag = '[object ArrayBuffer]',
32921 dataViewTag = '[object DataView]',
32922 float32Tag = '[object Float32Array]',
32923 float64Tag = '[object Float64Array]',
32924 int8Tag = '[object Int8Array]',
32925 int16Tag = '[object Int16Array]',
32926 int32Tag = '[object Int32Array]',
32927 uint8Tag = '[object Uint8Array]',
32928 uint8ClampedTag = '[object Uint8ClampedArray]',
32929 uint16Tag = '[object Uint16Array]',
32930 uint32Tag = '[object Uint32Array]';
32931
32932/** Used to identify `toStringTag` values supported by `_.clone`. */
32933var cloneableTags = {};
32934cloneableTags[argsTag] = cloneableTags[arrayTag] =
32935cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
32936cloneableTags[boolTag] = cloneableTags[dateTag] =
32937cloneableTags[float32Tag] = cloneableTags[float64Tag] =
32938cloneableTags[int8Tag] = cloneableTags[int16Tag] =
32939cloneableTags[int32Tag] = cloneableTags[mapTag] =
32940cloneableTags[numberTag] = cloneableTags[objectTag] =
32941cloneableTags[regexpTag] = cloneableTags[setTag] =
32942cloneableTags[stringTag] = cloneableTags[symbolTag] =
32943cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
32944cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
32945cloneableTags[errorTag] = cloneableTags[funcTag] =
32946cloneableTags[weakMapTag] = false;
32947
32948/**
32949 * The base implementation of `_.clone` and `_.cloneDeep` which tracks
32950 * traversed objects.
32951 *
32952 * @private
32953 * @param {*} value The value to clone.
32954 * @param {boolean} bitmask The bitmask flags.
32955 * 1 - Deep clone
32956 * 2 - Flatten inherited properties
32957 * 4 - Clone symbols
32958 * @param {Function} [customizer] The function to customize cloning.
32959 * @param {string} [key] The key of `value`.
32960 * @param {Object} [object] The parent object of `value`.
32961 * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
32962 * @returns {*} Returns the cloned value.
32963 */
32964function baseClone(value, bitmask, customizer, key, object, stack) {
32965 var result,
32966 isDeep = bitmask & CLONE_DEEP_FLAG,
32967 isFlat = bitmask & CLONE_FLAT_FLAG,
32968 isFull = bitmask & CLONE_SYMBOLS_FLAG;
32969
32970 if (customizer) {
32971 result = object ? customizer(value, key, object, stack) : customizer(value);
32972 }
32973 if (result !== undefined) {
32974 return result;
32975 }
32976 if (!isObject(value)) {
32977 return value;
32978 }
32979 var isArr = isArray(value);
32980 if (isArr) {
32981 result = initCloneArray(value);
32982 if (!isDeep) {
32983 return copyArray(value, result);
32984 }
32985 } else {
32986 var tag = getTag(value),
32987 isFunc = tag == funcTag || tag == genTag;
32988
32989 if (isBuffer(value)) {
32990 return cloneBuffer(value, isDeep);
32991 }
32992 if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
32993 result = (isFlat || isFunc) ? {} : initCloneObject(value);
32994 if (!isDeep) {
32995 return isFlat
32996 ? copySymbolsIn(value, baseAssignIn(result, value))
32997 : copySymbols(value, baseAssign(result, value));
32998 }
32999 } else {
33000 if (!cloneableTags[tag]) {
33001 return object ? value : {};
33002 }
33003 result = initCloneByTag(value, tag, baseClone, isDeep);
33004 }
33005 }
33006 // Check for circular references and return its corresponding clone.
33007 stack || (stack = new Stack);
33008 var stacked = stack.get(value);
33009 if (stacked) {
33010 return stacked;
33011 }
33012 stack.set(value, result);
33013
33014 var keysFunc = isFull
33015 ? (isFlat ? getAllKeysIn : getAllKeys)
33016 : (isFlat ? keysIn : keys);
33017
33018 var props = isArr ? undefined : keysFunc(value);
33019 arrayEach(props || value, function(subValue, key) {
33020 if (props) {
33021 key = subValue;
33022 subValue = value[key];
33023 }
33024 // Recursively populate clone (susceptible to call stack limits).
33025 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
33026 });
33027 return result;
33028}
33029
33030module.exports = baseClone;
33031
33032},{"./_Stack":259,"./_arrayEach":266,"./_assignValue":276,"./_baseAssign":278,"./_baseAssignIn":279,"./_cloneBuffer":326,"./_copyArray":335,"./_copySymbols":337,"./_copySymbolsIn":338,"./_getAllKeys":351,"./_getAllKeysIn":352,"./_getTag":360,"./_initCloneArray":368,"./_initCloneByTag":369,"./_initCloneObject":370,"./isArray":433,"./isBuffer":436,"./isObject":440,"./keys":447}],283:[function(require,module,exports){
33033var isObject = require('./isObject');
33034
33035/** Built-in value references. */
33036var objectCreate = Object.create;
33037
33038/**
33039 * The base implementation of `_.create` without support for assigning
33040 * properties to the created object.
33041 *
33042 * @private
33043 * @param {Object} proto The object to inherit from.
33044 * @returns {Object} Returns the new object.
33045 */
33046var baseCreate = (function() {
33047 function object() {}
33048 return function(proto) {
33049 if (!isObject(proto)) {
33050 return {};
33051 }
33052 if (objectCreate) {
33053 return objectCreate(proto);
33054 }
33055 object.prototype = proto;
33056 var result = new object;
33057 object.prototype = undefined;
33058 return result;
33059 };
33060}());
33061
33062module.exports = baseCreate;
33063
33064},{"./isObject":440}],284:[function(require,module,exports){
33065var baseForOwn = require('./_baseForOwn'),
33066 createBaseEach = require('./_createBaseEach');
33067
33068/**
33069 * The base implementation of `_.forEach` without support for iteratee shorthands.
33070 *
33071 * @private
33072 * @param {Array|Object} collection The collection to iterate over.
33073 * @param {Function} iteratee The function invoked per iteration.
33074 * @returns {Array|Object} Returns `collection`.
33075 */
33076var baseEach = createBaseEach(baseForOwn);
33077
33078module.exports = baseEach;
33079
33080},{"./_baseForOwn":288,"./_createBaseEach":341}],285:[function(require,module,exports){
33081/**
33082 * The base implementation of `_.findIndex` and `_.findLastIndex` without
33083 * support for iteratee shorthands.
33084 *
33085 * @private
33086 * @param {Array} array The array to inspect.
33087 * @param {Function} predicate The function invoked per iteration.
33088 * @param {number} fromIndex The index to search from.
33089 * @param {boolean} [fromRight] Specify iterating from right to left.
33090 * @returns {number} Returns the index of the matched value, else `-1`.
33091 */
33092function baseFindIndex(array, predicate, fromIndex, fromRight) {
33093 var length = array.length,
33094 index = fromIndex + (fromRight ? 1 : -1);
33095
33096 while ((fromRight ? index-- : ++index < length)) {
33097 if (predicate(array[index], index, array)) {
33098 return index;
33099 }
33100 }
33101 return -1;
33102}
33103
33104module.exports = baseFindIndex;
33105
33106},{}],286:[function(require,module,exports){
33107var arrayPush = require('./_arrayPush'),
33108 isFlattenable = require('./_isFlattenable');
33109
33110/**
33111 * The base implementation of `_.flatten` with support for restricting flattening.
33112 *
33113 * @private
33114 * @param {Array} array The array to flatten.
33115 * @param {number} depth The maximum recursion depth.
33116 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
33117 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
33118 * @param {Array} [result=[]] The initial result value.
33119 * @returns {Array} Returns the new flattened array.
33120 */
33121function baseFlatten(array, depth, predicate, isStrict, result) {
33122 var index = -1,
33123 length = array.length;
33124
33125 predicate || (predicate = isFlattenable);
33126 result || (result = []);
33127
33128 while (++index < length) {
33129 var value = array[index];
33130 if (depth > 0 && predicate(value)) {
33131 if (depth > 1) {
33132 // Recursively flatten arrays (susceptible to call stack limits).
33133 baseFlatten(value, depth - 1, predicate, isStrict, result);
33134 } else {
33135 arrayPush(result, value);
33136 }
33137 } else if (!isStrict) {
33138 result[result.length] = value;
33139 }
33140 }
33141 return result;
33142}
33143
33144module.exports = baseFlatten;
33145
33146},{"./_arrayPush":272,"./_isFlattenable":371}],287:[function(require,module,exports){
33147var createBaseFor = require('./_createBaseFor');
33148
33149/**
33150 * The base implementation of `baseForOwn` which iterates over `object`
33151 * properties returned by `keysFunc` and invokes `iteratee` for each property.
33152 * Iteratee functions may exit iteration early by explicitly returning `false`.
33153 *
33154 * @private
33155 * @param {Object} object The object to iterate over.
33156 * @param {Function} iteratee The function invoked per iteration.
33157 * @param {Function} keysFunc The function to get the keys of `object`.
33158 * @returns {Object} Returns `object`.
33159 */
33160var baseFor = createBaseFor();
33161
33162module.exports = baseFor;
33163
33164},{"./_createBaseFor":342}],288:[function(require,module,exports){
33165var baseFor = require('./_baseFor'),
33166 keys = require('./keys');
33167
33168/**
33169 * The base implementation of `_.forOwn` without support for iteratee shorthands.
33170 *
33171 * @private
33172 * @param {Object} object The object to iterate over.
33173 * @param {Function} iteratee The function invoked per iteration.
33174 * @returns {Object} Returns `object`.
33175 */
33176function baseForOwn(object, iteratee) {
33177 return object && baseFor(object, iteratee, keys);
33178}
33179
33180module.exports = baseForOwn;
33181
33182},{"./_baseFor":287,"./keys":447}],289:[function(require,module,exports){
33183var castPath = require('./_castPath'),
33184 toKey = require('./_toKey');
33185
33186/**
33187 * The base implementation of `_.get` without support for default values.
33188 *
33189 * @private
33190 * @param {Object} object The object to query.
33191 * @param {Array|string} path The path of the property to get.
33192 * @returns {*} Returns the resolved value.
33193 */
33194function baseGet(object, path) {
33195 path = castPath(path, object);
33196
33197 var index = 0,
33198 length = path.length;
33199
33200 while (object != null && index < length) {
33201 object = object[toKey(path[index++])];
33202 }
33203 return (index && index == length) ? object : undefined;
33204}
33205
33206module.exports = baseGet;
33207
33208},{"./_castPath":324,"./_toKey":412}],290:[function(require,module,exports){
33209var arrayPush = require('./_arrayPush'),
33210 isArray = require('./isArray');
33211
33212/**
33213 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
33214 * `keysFunc` and `symbolsFunc` to get the enumerable property names and
33215 * symbols of `object`.
33216 *
33217 * @private
33218 * @param {Object} object The object to query.
33219 * @param {Function} keysFunc The function to get the keys of `object`.
33220 * @param {Function} symbolsFunc The function to get the symbols of `object`.
33221 * @returns {Array} Returns the array of property names and symbols.
33222 */
33223function baseGetAllKeys(object, keysFunc, symbolsFunc) {
33224 var result = keysFunc(object);
33225 return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
33226}
33227
33228module.exports = baseGetAllKeys;
33229
33230},{"./_arrayPush":272,"./isArray":433}],291:[function(require,module,exports){
33231var Symbol = require('./_Symbol'),
33232 getRawTag = require('./_getRawTag'),
33233 objectToString = require('./_objectToString');
33234
33235/** `Object#toString` result references. */
33236var nullTag = '[object Null]',
33237 undefinedTag = '[object Undefined]';
33238
33239/** Built-in value references. */
33240var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
33241
33242/**
33243 * The base implementation of `getTag` without fallbacks for buggy environments.
33244 *
33245 * @private
33246 * @param {*} value The value to query.
33247 * @returns {string} Returns the `toStringTag`.
33248 */
33249function baseGetTag(value) {
33250 if (value == null) {
33251 return value === undefined ? undefinedTag : nullTag;
33252 }
33253 return (symToStringTag && symToStringTag in Object(value))
33254 ? getRawTag(value)
33255 : objectToString(value);
33256}
33257
33258module.exports = baseGetTag;
33259
33260},{"./_Symbol":260,"./_getRawTag":357,"./_objectToString":396}],292:[function(require,module,exports){
33261/** Used for built-in method references. */
33262var objectProto = Object.prototype;
33263
33264/** Used to check objects for own properties. */
33265var hasOwnProperty = objectProto.hasOwnProperty;
33266
33267/**
33268 * The base implementation of `_.has` without support for deep paths.
33269 *
33270 * @private
33271 * @param {Object} [object] The object to query.
33272 * @param {Array|string} key The key to check.
33273 * @returns {boolean} Returns `true` if `key` exists, else `false`.
33274 */
33275function baseHas(object, key) {
33276 return object != null && hasOwnProperty.call(object, key);
33277}
33278
33279module.exports = baseHas;
33280
33281},{}],293:[function(require,module,exports){
33282/**
33283 * The base implementation of `_.hasIn` without support for deep paths.
33284 *
33285 * @private
33286 * @param {Object} [object] The object to query.
33287 * @param {Array|string} key The key to check.
33288 * @returns {boolean} Returns `true` if `key` exists, else `false`.
33289 */
33290function baseHasIn(object, key) {
33291 return object != null && key in Object(object);
33292}
33293
33294module.exports = baseHasIn;
33295
33296},{}],294:[function(require,module,exports){
33297var baseFindIndex = require('./_baseFindIndex'),
33298 baseIsNaN = require('./_baseIsNaN'),
33299 strictIndexOf = require('./_strictIndexOf');
33300
33301/**
33302 * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
33303 *
33304 * @private
33305 * @param {Array} array The array to inspect.
33306 * @param {*} value The value to search for.
33307 * @param {number} fromIndex The index to search from.
33308 * @returns {number} Returns the index of the matched value, else `-1`.
33309 */
33310function baseIndexOf(array, value, fromIndex) {
33311 return value === value
33312 ? strictIndexOf(array, value, fromIndex)
33313 : baseFindIndex(array, baseIsNaN, fromIndex);
33314}
33315
33316module.exports = baseIndexOf;
33317
33318},{"./_baseFindIndex":285,"./_baseIsNaN":299,"./_strictIndexOf":410}],295:[function(require,module,exports){
33319var baseGetTag = require('./_baseGetTag'),
33320 isObjectLike = require('./isObjectLike');
33321
33322/** `Object#toString` result references. */
33323var argsTag = '[object Arguments]';
33324
33325/**
33326 * The base implementation of `_.isArguments`.
33327 *
33328 * @private
33329 * @param {*} value The value to check.
33330 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
33331 */
33332function baseIsArguments(value) {
33333 return isObjectLike(value) && baseGetTag(value) == argsTag;
33334}
33335
33336module.exports = baseIsArguments;
33337
33338},{"./_baseGetTag":291,"./isObjectLike":441}],296:[function(require,module,exports){
33339var baseIsEqualDeep = require('./_baseIsEqualDeep'),
33340 isObjectLike = require('./isObjectLike');
33341
33342/**
33343 * The base implementation of `_.isEqual` which supports partial comparisons
33344 * and tracks traversed objects.
33345 *
33346 * @private
33347 * @param {*} value The value to compare.
33348 * @param {*} other The other value to compare.
33349 * @param {boolean} bitmask The bitmask flags.
33350 * 1 - Unordered comparison
33351 * 2 - Partial comparison
33352 * @param {Function} [customizer] The function to customize comparisons.
33353 * @param {Object} [stack] Tracks traversed `value` and `other` objects.
33354 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
33355 */
33356function baseIsEqual(value, other, bitmask, customizer, stack) {
33357 if (value === other) {
33358 return true;
33359 }
33360 if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
33361 return value !== value && other !== other;
33362 }
33363 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
33364}
33365
33366module.exports = baseIsEqual;
33367
33368},{"./_baseIsEqualDeep":297,"./isObjectLike":441}],297:[function(require,module,exports){
33369var Stack = require('./_Stack'),
33370 equalArrays = require('./_equalArrays'),
33371 equalByTag = require('./_equalByTag'),
33372 equalObjects = require('./_equalObjects'),
33373 getTag = require('./_getTag'),
33374 isArray = require('./isArray'),
33375 isBuffer = require('./isBuffer'),
33376 isTypedArray = require('./isTypedArray');
33377
33378/** Used to compose bitmasks for value comparisons. */
33379var COMPARE_PARTIAL_FLAG = 1;
33380
33381/** `Object#toString` result references. */
33382var argsTag = '[object Arguments]',
33383 arrayTag = '[object Array]',
33384 objectTag = '[object Object]';
33385
33386/** Used for built-in method references. */
33387var objectProto = Object.prototype;
33388
33389/** Used to check objects for own properties. */
33390var hasOwnProperty = objectProto.hasOwnProperty;
33391
33392/**
33393 * A specialized version of `baseIsEqual` for arrays and objects which performs
33394 * deep comparisons and tracks traversed objects enabling objects with circular
33395 * references to be compared.
33396 *
33397 * @private
33398 * @param {Object} object The object to compare.
33399 * @param {Object} other The other object to compare.
33400 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
33401 * @param {Function} customizer The function to customize comparisons.
33402 * @param {Function} equalFunc The function to determine equivalents of values.
33403 * @param {Object} [stack] Tracks traversed `object` and `other` objects.
33404 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
33405 */
33406function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
33407 var objIsArr = isArray(object),
33408 othIsArr = isArray(other),
33409 objTag = objIsArr ? arrayTag : getTag(object),
33410 othTag = othIsArr ? arrayTag : getTag(other);
33411
33412 objTag = objTag == argsTag ? objectTag : objTag;
33413 othTag = othTag == argsTag ? objectTag : othTag;
33414
33415 var objIsObj = objTag == objectTag,
33416 othIsObj = othTag == objectTag,
33417 isSameTag = objTag == othTag;
33418
33419 if (isSameTag && isBuffer(object)) {
33420 if (!isBuffer(other)) {
33421 return false;
33422 }
33423 objIsArr = true;
33424 objIsObj = false;
33425 }
33426 if (isSameTag && !objIsObj) {
33427 stack || (stack = new Stack);
33428 return (objIsArr || isTypedArray(object))
33429 ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
33430 : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
33431 }
33432 if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
33433 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
33434 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
33435
33436 if (objIsWrapped || othIsWrapped) {
33437 var objUnwrapped = objIsWrapped ? object.value() : object,
33438 othUnwrapped = othIsWrapped ? other.value() : other;
33439
33440 stack || (stack = new Stack);
33441 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
33442 }
33443 }
33444 if (!isSameTag) {
33445 return false;
33446 }
33447 stack || (stack = new Stack);
33448 return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
33449}
33450
33451module.exports = baseIsEqualDeep;
33452
33453},{"./_Stack":259,"./_equalArrays":347,"./_equalByTag":348,"./_equalObjects":349,"./_getTag":360,"./isArray":433,"./isBuffer":436,"./isTypedArray":446}],298:[function(require,module,exports){
33454var Stack = require('./_Stack'),
33455 baseIsEqual = require('./_baseIsEqual');
33456
33457/** Used to compose bitmasks for value comparisons. */
33458var COMPARE_PARTIAL_FLAG = 1,
33459 COMPARE_UNORDERED_FLAG = 2;
33460
33461/**
33462 * The base implementation of `_.isMatch` without support for iteratee shorthands.
33463 *
33464 * @private
33465 * @param {Object} object The object to inspect.
33466 * @param {Object} source The object of property values to match.
33467 * @param {Array} matchData The property names, values, and compare flags to match.
33468 * @param {Function} [customizer] The function to customize comparisons.
33469 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
33470 */
33471function baseIsMatch(object, source, matchData, customizer) {
33472 var index = matchData.length,
33473 length = index,
33474 noCustomizer = !customizer;
33475
33476 if (object == null) {
33477 return !length;
33478 }
33479 object = Object(object);
33480 while (index--) {
33481 var data = matchData[index];
33482 if ((noCustomizer && data[2])
33483 ? data[1] !== object[data[0]]
33484 : !(data[0] in object)
33485 ) {
33486 return false;
33487 }
33488 }
33489 while (++index < length) {
33490 data = matchData[index];
33491 var key = data[0],
33492 objValue = object[key],
33493 srcValue = data[1];
33494
33495 if (noCustomizer && data[2]) {
33496 if (objValue === undefined && !(key in object)) {
33497 return false;
33498 }
33499 } else {
33500 var stack = new Stack;
33501 if (customizer) {
33502 var result = customizer(objValue, srcValue, key, object, source, stack);
33503 }
33504 if (!(result === undefined
33505 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
33506 : result
33507 )) {
33508 return false;
33509 }
33510 }
33511 }
33512 return true;
33513}
33514
33515module.exports = baseIsMatch;
33516
33517},{"./_Stack":259,"./_baseIsEqual":296}],299:[function(require,module,exports){
33518/**
33519 * The base implementation of `_.isNaN` without support for number objects.
33520 *
33521 * @private
33522 * @param {*} value The value to check.
33523 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
33524 */
33525function baseIsNaN(value) {
33526 return value !== value;
33527}
33528
33529module.exports = baseIsNaN;
33530
33531},{}],300:[function(require,module,exports){
33532var isFunction = require('./isFunction'),
33533 isMasked = require('./_isMasked'),
33534 isObject = require('./isObject'),
33535 toSource = require('./_toSource');
33536
33537/**
33538 * Used to match `RegExp`
33539 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
33540 */
33541var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
33542
33543/** Used to detect host constructors (Safari). */
33544var reIsHostCtor = /^\[object .+?Constructor\]$/;
33545
33546/** Used for built-in method references. */
33547var funcProto = Function.prototype,
33548 objectProto = Object.prototype;
33549
33550/** Used to resolve the decompiled source of functions. */
33551var funcToString = funcProto.toString;
33552
33553/** Used to check objects for own properties. */
33554var hasOwnProperty = objectProto.hasOwnProperty;
33555
33556/** Used to detect if a method is native. */
33557var reIsNative = RegExp('^' +
33558 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
33559 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
33560);
33561
33562/**
33563 * The base implementation of `_.isNative` without bad shim checks.
33564 *
33565 * @private
33566 * @param {*} value The value to check.
33567 * @returns {boolean} Returns `true` if `value` is a native function,
33568 * else `false`.
33569 */
33570function baseIsNative(value) {
33571 if (!isObject(value) || isMasked(value)) {
33572 return false;
33573 }
33574 var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
33575 return pattern.test(toSource(value));
33576}
33577
33578module.exports = baseIsNative;
33579
33580},{"./_isMasked":376,"./_toSource":413,"./isFunction":437,"./isObject":440}],301:[function(require,module,exports){
33581var baseGetTag = require('./_baseGetTag'),
33582 isObjectLike = require('./isObjectLike');
33583
33584/** `Object#toString` result references. */
33585var regexpTag = '[object RegExp]';
33586
33587/**
33588 * The base implementation of `_.isRegExp` without Node.js optimizations.
33589 *
33590 * @private
33591 * @param {*} value The value to check.
33592 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
33593 */
33594function baseIsRegExp(value) {
33595 return isObjectLike(value) && baseGetTag(value) == regexpTag;
33596}
33597
33598module.exports = baseIsRegExp;
33599
33600},{"./_baseGetTag":291,"./isObjectLike":441}],302:[function(require,module,exports){
33601var baseGetTag = require('./_baseGetTag'),
33602 isLength = require('./isLength'),
33603 isObjectLike = require('./isObjectLike');
33604
33605/** `Object#toString` result references. */
33606var argsTag = '[object Arguments]',
33607 arrayTag = '[object Array]',
33608 boolTag = '[object Boolean]',
33609 dateTag = '[object Date]',
33610 errorTag = '[object Error]',
33611 funcTag = '[object Function]',
33612 mapTag = '[object Map]',
33613 numberTag = '[object Number]',
33614 objectTag = '[object Object]',
33615 regexpTag = '[object RegExp]',
33616 setTag = '[object Set]',
33617 stringTag = '[object String]',
33618 weakMapTag = '[object WeakMap]';
33619
33620var arrayBufferTag = '[object ArrayBuffer]',
33621 dataViewTag = '[object DataView]',
33622 float32Tag = '[object Float32Array]',
33623 float64Tag = '[object Float64Array]',
33624 int8Tag = '[object Int8Array]',
33625 int16Tag = '[object Int16Array]',
33626 int32Tag = '[object Int32Array]',
33627 uint8Tag = '[object Uint8Array]',
33628 uint8ClampedTag = '[object Uint8ClampedArray]',
33629 uint16Tag = '[object Uint16Array]',
33630 uint32Tag = '[object Uint32Array]';
33631
33632/** Used to identify `toStringTag` values of typed arrays. */
33633var typedArrayTags = {};
33634typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
33635typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
33636typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
33637typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
33638typedArrayTags[uint32Tag] = true;
33639typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
33640typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
33641typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
33642typedArrayTags[errorTag] = typedArrayTags[funcTag] =
33643typedArrayTags[mapTag] = typedArrayTags[numberTag] =
33644typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
33645typedArrayTags[setTag] = typedArrayTags[stringTag] =
33646typedArrayTags[weakMapTag] = false;
33647
33648/**
33649 * The base implementation of `_.isTypedArray` without Node.js optimizations.
33650 *
33651 * @private
33652 * @param {*} value The value to check.
33653 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
33654 */
33655function baseIsTypedArray(value) {
33656 return isObjectLike(value) &&
33657 isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
33658}
33659
33660module.exports = baseIsTypedArray;
33661
33662},{"./_baseGetTag":291,"./isLength":439,"./isObjectLike":441}],303:[function(require,module,exports){
33663var baseMatches = require('./_baseMatches'),
33664 baseMatchesProperty = require('./_baseMatchesProperty'),
33665 identity = require('./identity'),
33666 isArray = require('./isArray'),
33667 property = require('./property');
33668
33669/**
33670 * The base implementation of `_.iteratee`.
33671 *
33672 * @private
33673 * @param {*} [value=_.identity] The value to convert to an iteratee.
33674 * @returns {Function} Returns the iteratee.
33675 */
33676function baseIteratee(value) {
33677 // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
33678 // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
33679 if (typeof value == 'function') {
33680 return value;
33681 }
33682 if (value == null) {
33683 return identity;
33684 }
33685 if (typeof value == 'object') {
33686 return isArray(value)
33687 ? baseMatchesProperty(value[0], value[1])
33688 : baseMatches(value);
33689 }
33690 return property(value);
33691}
33692
33693module.exports = baseIteratee;
33694
33695},{"./_baseMatches":307,"./_baseMatchesProperty":308,"./identity":430,"./isArray":433,"./property":453}],304:[function(require,module,exports){
33696var isPrototype = require('./_isPrototype'),
33697 nativeKeys = require('./_nativeKeys');
33698
33699/** Used for built-in method references. */
33700var objectProto = Object.prototype;
33701
33702/** Used to check objects for own properties. */
33703var hasOwnProperty = objectProto.hasOwnProperty;
33704
33705/**
33706 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
33707 *
33708 * @private
33709 * @param {Object} object The object to query.
33710 * @returns {Array} Returns the array of property names.
33711 */
33712function baseKeys(object) {
33713 if (!isPrototype(object)) {
33714 return nativeKeys(object);
33715 }
33716 var result = [];
33717 for (var key in Object(object)) {
33718 if (hasOwnProperty.call(object, key) && key != 'constructor') {
33719 result.push(key);
33720 }
33721 }
33722 return result;
33723}
33724
33725module.exports = baseKeys;
33726
33727},{"./_isPrototype":377,"./_nativeKeys":393}],305:[function(require,module,exports){
33728var isObject = require('./isObject'),
33729 isPrototype = require('./_isPrototype'),
33730 nativeKeysIn = require('./_nativeKeysIn');
33731
33732/** Used for built-in method references. */
33733var objectProto = Object.prototype;
33734
33735/** Used to check objects for own properties. */
33736var hasOwnProperty = objectProto.hasOwnProperty;
33737
33738/**
33739 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
33740 *
33741 * @private
33742 * @param {Object} object The object to query.
33743 * @returns {Array} Returns the array of property names.
33744 */
33745function baseKeysIn(object) {
33746 if (!isObject(object)) {
33747 return nativeKeysIn(object);
33748 }
33749 var isProto = isPrototype(object),
33750 result = [];
33751
33752 for (var key in object) {
33753 if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
33754 result.push(key);
33755 }
33756 }
33757 return result;
33758}
33759
33760module.exports = baseKeysIn;
33761
33762},{"./_isPrototype":377,"./_nativeKeysIn":394,"./isObject":440}],306:[function(require,module,exports){
33763var baseEach = require('./_baseEach'),
33764 isArrayLike = require('./isArrayLike');
33765
33766/**
33767 * The base implementation of `_.map` without support for iteratee shorthands.
33768 *
33769 * @private
33770 * @param {Array|Object} collection The collection to iterate over.
33771 * @param {Function} iteratee The function invoked per iteration.
33772 * @returns {Array} Returns the new mapped array.
33773 */
33774function baseMap(collection, iteratee) {
33775 var index = -1,
33776 result = isArrayLike(collection) ? Array(collection.length) : [];
33777
33778 baseEach(collection, function(value, key, collection) {
33779 result[++index] = iteratee(value, key, collection);
33780 });
33781 return result;
33782}
33783
33784module.exports = baseMap;
33785
33786},{"./_baseEach":284,"./isArrayLike":434}],307:[function(require,module,exports){
33787var baseIsMatch = require('./_baseIsMatch'),
33788 getMatchData = require('./_getMatchData'),
33789 matchesStrictComparable = require('./_matchesStrictComparable');
33790
33791/**
33792 * The base implementation of `_.matches` which doesn't clone `source`.
33793 *
33794 * @private
33795 * @param {Object} source The object of property values to match.
33796 * @returns {Function} Returns the new spec function.
33797 */
33798function baseMatches(source) {
33799 var matchData = getMatchData(source);
33800 if (matchData.length == 1 && matchData[0][2]) {
33801 return matchesStrictComparable(matchData[0][0], matchData[0][1]);
33802 }
33803 return function(object) {
33804 return object === source || baseIsMatch(object, source, matchData);
33805 };
33806}
33807
33808module.exports = baseMatches;
33809
33810},{"./_baseIsMatch":298,"./_getMatchData":354,"./_matchesStrictComparable":390}],308:[function(require,module,exports){
33811var baseIsEqual = require('./_baseIsEqual'),
33812 get = require('./get'),
33813 hasIn = require('./hasIn'),
33814 isKey = require('./_isKey'),
33815 isStrictComparable = require('./_isStrictComparable'),
33816 matchesStrictComparable = require('./_matchesStrictComparable'),
33817 toKey = require('./_toKey');
33818
33819/** Used to compose bitmasks for value comparisons. */
33820var COMPARE_PARTIAL_FLAG = 1,
33821 COMPARE_UNORDERED_FLAG = 2;
33822
33823/**
33824 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
33825 *
33826 * @private
33827 * @param {string} path The path of the property to get.
33828 * @param {*} srcValue The value to match.
33829 * @returns {Function} Returns the new spec function.
33830 */
33831function baseMatchesProperty(path, srcValue) {
33832 if (isKey(path) && isStrictComparable(srcValue)) {
33833 return matchesStrictComparable(toKey(path), srcValue);
33834 }
33835 return function(object) {
33836 var objValue = get(object, path);
33837 return (objValue === undefined && objValue === srcValue)
33838 ? hasIn(object, path)
33839 : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
33840 };
33841}
33842
33843module.exports = baseMatchesProperty;
33844
33845},{"./_baseIsEqual":296,"./_isKey":374,"./_isStrictComparable":378,"./_matchesStrictComparable":390,"./_toKey":412,"./get":427,"./hasIn":429}],309:[function(require,module,exports){
33846var Stack = require('./_Stack'),
33847 assignMergeValue = require('./_assignMergeValue'),
33848 baseFor = require('./_baseFor'),
33849 baseMergeDeep = require('./_baseMergeDeep'),
33850 isObject = require('./isObject'),
33851 keysIn = require('./keysIn');
33852
33853/**
33854 * The base implementation of `_.merge` without support for multiple sources.
33855 *
33856 * @private
33857 * @param {Object} object The destination object.
33858 * @param {Object} source The source object.
33859 * @param {number} srcIndex The index of `source`.
33860 * @param {Function} [customizer] The function to customize merged values.
33861 * @param {Object} [stack] Tracks traversed source values and their merged
33862 * counterparts.
33863 */
33864function baseMerge(object, source, srcIndex, customizer, stack) {
33865 if (object === source) {
33866 return;
33867 }
33868 baseFor(source, function(srcValue, key) {
33869 if (isObject(srcValue)) {
33870 stack || (stack = new Stack);
33871 baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
33872 }
33873 else {
33874 var newValue = customizer
33875 ? customizer(object[key], srcValue, (key + ''), object, source, stack)
33876 : undefined;
33877
33878 if (newValue === undefined) {
33879 newValue = srcValue;
33880 }
33881 assignMergeValue(object, key, newValue);
33882 }
33883 }, keysIn);
33884}
33885
33886module.exports = baseMerge;
33887
33888},{"./_Stack":259,"./_assignMergeValue":275,"./_baseFor":287,"./_baseMergeDeep":310,"./isObject":440,"./keysIn":448}],310:[function(require,module,exports){
33889var assignMergeValue = require('./_assignMergeValue'),
33890 cloneBuffer = require('./_cloneBuffer'),
33891 cloneTypedArray = require('./_cloneTypedArray'),
33892 copyArray = require('./_copyArray'),
33893 initCloneObject = require('./_initCloneObject'),
33894 isArguments = require('./isArguments'),
33895 isArray = require('./isArray'),
33896 isArrayLikeObject = require('./isArrayLikeObject'),
33897 isBuffer = require('./isBuffer'),
33898 isFunction = require('./isFunction'),
33899 isObject = require('./isObject'),
33900 isPlainObject = require('./isPlainObject'),
33901 isTypedArray = require('./isTypedArray'),
33902 toPlainObject = require('./toPlainObject');
33903
33904/**
33905 * A specialized version of `baseMerge` for arrays and objects which performs
33906 * deep merges and tracks traversed objects enabling objects with circular
33907 * references to be merged.
33908 *
33909 * @private
33910 * @param {Object} object The destination object.
33911 * @param {Object} source The source object.
33912 * @param {string} key The key of the value to merge.
33913 * @param {number} srcIndex The index of `source`.
33914 * @param {Function} mergeFunc The function to merge values.
33915 * @param {Function} [customizer] The function to customize assigned values.
33916 * @param {Object} [stack] Tracks traversed source values and their merged
33917 * counterparts.
33918 */
33919function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
33920 var objValue = object[key],
33921 srcValue = source[key],
33922 stacked = stack.get(srcValue);
33923
33924 if (stacked) {
33925 assignMergeValue(object, key, stacked);
33926 return;
33927 }
33928 var newValue = customizer
33929 ? customizer(objValue, srcValue, (key + ''), object, source, stack)
33930 : undefined;
33931
33932 var isCommon = newValue === undefined;
33933
33934 if (isCommon) {
33935 var isArr = isArray(srcValue),
33936 isBuff = !isArr && isBuffer(srcValue),
33937 isTyped = !isArr && !isBuff && isTypedArray(srcValue);
33938
33939 newValue = srcValue;
33940 if (isArr || isBuff || isTyped) {
33941 if (isArray(objValue)) {
33942 newValue = objValue;
33943 }
33944 else if (isArrayLikeObject(objValue)) {
33945 newValue = copyArray(objValue);
33946 }
33947 else if (isBuff) {
33948 isCommon = false;
33949 newValue = cloneBuffer(srcValue, true);
33950 }
33951 else if (isTyped) {
33952 isCommon = false;
33953 newValue = cloneTypedArray(srcValue, true);
33954 }
33955 else {
33956 newValue = [];
33957 }
33958 }
33959 else if (isPlainObject(srcValue) || isArguments(srcValue)) {
33960 newValue = objValue;
33961 if (isArguments(objValue)) {
33962 newValue = toPlainObject(objValue);
33963 }
33964 else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
33965 newValue = initCloneObject(srcValue);
33966 }
33967 }
33968 else {
33969 isCommon = false;
33970 }
33971 }
33972 if (isCommon) {
33973 // Recursively merge objects and arrays (susceptible to call stack limits).
33974 stack.set(srcValue, newValue);
33975 mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
33976 stack['delete'](srcValue);
33977 }
33978 assignMergeValue(object, key, newValue);
33979}
33980
33981module.exports = baseMergeDeep;
33982
33983},{"./_assignMergeValue":275,"./_cloneBuffer":326,"./_cloneTypedArray":332,"./_copyArray":335,"./_initCloneObject":370,"./isArguments":432,"./isArray":433,"./isArrayLikeObject":435,"./isBuffer":436,"./isFunction":437,"./isObject":440,"./isPlainObject":442,"./isTypedArray":446,"./toPlainObject":462}],311:[function(require,module,exports){
33984var arrayMap = require('./_arrayMap'),
33985 baseIteratee = require('./_baseIteratee'),
33986 baseMap = require('./_baseMap'),
33987 baseSortBy = require('./_baseSortBy'),
33988 baseUnary = require('./_baseUnary'),
33989 compareMultiple = require('./_compareMultiple'),
33990 identity = require('./identity');
33991
33992/**
33993 * The base implementation of `_.orderBy` without param guards.
33994 *
33995 * @private
33996 * @param {Array|Object} collection The collection to iterate over.
33997 * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
33998 * @param {string[]} orders The sort orders of `iteratees`.
33999 * @returns {Array} Returns the new sorted array.
34000 */
34001function baseOrderBy(collection, iteratees, orders) {
34002 var index = -1;
34003 iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
34004
34005 var result = baseMap(collection, function(value, key, collection) {
34006 var criteria = arrayMap(iteratees, function(iteratee) {
34007 return iteratee(value);
34008 });
34009 return { 'criteria': criteria, 'index': ++index, 'value': value };
34010 });
34011
34012 return baseSortBy(result, function(object, other) {
34013 return compareMultiple(object, other, orders);
34014 });
34015}
34016
34017module.exports = baseOrderBy;
34018
34019},{"./_arrayMap":271,"./_baseIteratee":303,"./_baseMap":306,"./_baseSortBy":317,"./_baseUnary":320,"./_compareMultiple":334,"./identity":430}],312:[function(require,module,exports){
34020/**
34021 * The base implementation of `_.property` without support for deep paths.
34022 *
34023 * @private
34024 * @param {string} key The key of the property to get.
34025 * @returns {Function} Returns the new accessor function.
34026 */
34027function baseProperty(key) {
34028 return function(object) {
34029 return object == null ? undefined : object[key];
34030 };
34031}
34032
34033module.exports = baseProperty;
34034
34035},{}],313:[function(require,module,exports){
34036var baseGet = require('./_baseGet');
34037
34038/**
34039 * A specialized version of `baseProperty` which supports deep paths.
34040 *
34041 * @private
34042 * @param {Array|string} path The path of the property to get.
34043 * @returns {Function} Returns the new accessor function.
34044 */
34045function basePropertyDeep(path) {
34046 return function(object) {
34047 return baseGet(object, path);
34048 };
34049}
34050
34051module.exports = basePropertyDeep;
34052
34053},{"./_baseGet":289}],314:[function(require,module,exports){
34054/** Used as references for various `Number` constants. */
34055var MAX_SAFE_INTEGER = 9007199254740991;
34056
34057/* Built-in method references for those with the same name as other `lodash` methods. */
34058var nativeFloor = Math.floor;
34059
34060/**
34061 * The base implementation of `_.repeat` which doesn't coerce arguments.
34062 *
34063 * @private
34064 * @param {string} string The string to repeat.
34065 * @param {number} n The number of times to repeat the string.
34066 * @returns {string} Returns the repeated string.
34067 */
34068function baseRepeat(string, n) {
34069 var result = '';
34070 if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
34071 return result;
34072 }
34073 // Leverage the exponentiation by squaring algorithm for a faster repeat.
34074 // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
34075 do {
34076 if (n % 2) {
34077 result += string;
34078 }
34079 n = nativeFloor(n / 2);
34080 if (n) {
34081 string += string;
34082 }
34083 } while (n);
34084
34085 return result;
34086}
34087
34088module.exports = baseRepeat;
34089
34090},{}],315:[function(require,module,exports){
34091var identity = require('./identity'),
34092 overRest = require('./_overRest'),
34093 setToString = require('./_setToString');
34094
34095/**
34096 * The base implementation of `_.rest` which doesn't validate or coerce arguments.
34097 *
34098 * @private
34099 * @param {Function} func The function to apply a rest parameter to.
34100 * @param {number} [start=func.length-1] The start position of the rest parameter.
34101 * @returns {Function} Returns the new function.
34102 */
34103function baseRest(func, start) {
34104 return setToString(overRest(func, start, identity), func + '');
34105}
34106
34107module.exports = baseRest;
34108
34109},{"./_overRest":398,"./_setToString":403,"./identity":430}],316:[function(require,module,exports){
34110var constant = require('./constant'),
34111 defineProperty = require('./_defineProperty'),
34112 identity = require('./identity');
34113
34114/**
34115 * The base implementation of `setToString` without support for hot loop shorting.
34116 *
34117 * @private
34118 * @param {Function} func The function to modify.
34119 * @param {Function} string The `toString` result.
34120 * @returns {Function} Returns `func`.
34121 */
34122var baseSetToString = !defineProperty ? identity : function(func, string) {
34123 return defineProperty(func, 'toString', {
34124 'configurable': true,
34125 'enumerable': false,
34126 'value': constant(string),
34127 'writable': true
34128 });
34129};
34130
34131module.exports = baseSetToString;
34132
34133},{"./_defineProperty":346,"./constant":419,"./identity":430}],317:[function(require,module,exports){
34134/**
34135 * The base implementation of `_.sortBy` which uses `comparer` to define the
34136 * sort order of `array` and replaces criteria objects with their corresponding
34137 * values.
34138 *
34139 * @private
34140 * @param {Array} array The array to sort.
34141 * @param {Function} comparer The function to define sort order.
34142 * @returns {Array} Returns `array`.
34143 */
34144function baseSortBy(array, comparer) {
34145 var length = array.length;
34146
34147 array.sort(comparer);
34148 while (length--) {
34149 array[length] = array[length].value;
34150 }
34151 return array;
34152}
34153
34154module.exports = baseSortBy;
34155
34156},{}],318:[function(require,module,exports){
34157/**
34158 * The base implementation of `_.times` without support for iteratee shorthands
34159 * or max array length checks.
34160 *
34161 * @private
34162 * @param {number} n The number of times to invoke `iteratee`.
34163 * @param {Function} iteratee The function invoked per iteration.
34164 * @returns {Array} Returns the array of results.
34165 */
34166function baseTimes(n, iteratee) {
34167 var index = -1,
34168 result = Array(n);
34169
34170 while (++index < n) {
34171 result[index] = iteratee(index);
34172 }
34173 return result;
34174}
34175
34176module.exports = baseTimes;
34177
34178},{}],319:[function(require,module,exports){
34179var Symbol = require('./_Symbol'),
34180 arrayMap = require('./_arrayMap'),
34181 isArray = require('./isArray'),
34182 isSymbol = require('./isSymbol');
34183
34184/** Used as references for various `Number` constants. */
34185var INFINITY = 1 / 0;
34186
34187/** Used to convert symbols to primitives and strings. */
34188var symbolProto = Symbol ? Symbol.prototype : undefined,
34189 symbolToString = symbolProto ? symbolProto.toString : undefined;
34190
34191/**
34192 * The base implementation of `_.toString` which doesn't convert nullish
34193 * values to empty strings.
34194 *
34195 * @private
34196 * @param {*} value The value to process.
34197 * @returns {string} Returns the string.
34198 */
34199function baseToString(value) {
34200 // Exit early for strings to avoid a performance hit in some environments.
34201 if (typeof value == 'string') {
34202 return value;
34203 }
34204 if (isArray(value)) {
34205 // Recursively convert values (susceptible to call stack limits).
34206 return arrayMap(value, baseToString) + '';
34207 }
34208 if (isSymbol(value)) {
34209 return symbolToString ? symbolToString.call(value) : '';
34210 }
34211 var result = (value + '');
34212 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
34213}
34214
34215module.exports = baseToString;
34216
34217},{"./_Symbol":260,"./_arrayMap":271,"./isArray":433,"./isSymbol":445}],320:[function(require,module,exports){
34218/**
34219 * The base implementation of `_.unary` without support for storing metadata.
34220 *
34221 * @private
34222 * @param {Function} func The function to cap arguments for.
34223 * @returns {Function} Returns the new capped function.
34224 */
34225function baseUnary(func) {
34226 return function(value) {
34227 return func(value);
34228 };
34229}
34230
34231module.exports = baseUnary;
34232
34233},{}],321:[function(require,module,exports){
34234var SetCache = require('./_SetCache'),
34235 arrayIncludes = require('./_arrayIncludes'),
34236 arrayIncludesWith = require('./_arrayIncludesWith'),
34237 cacheHas = require('./_cacheHas'),
34238 createSet = require('./_createSet'),
34239 setToArray = require('./_setToArray');
34240
34241/** Used as the size to enable large array optimizations. */
34242var LARGE_ARRAY_SIZE = 200;
34243
34244/**
34245 * The base implementation of `_.uniqBy` without support for iteratee shorthands.
34246 *
34247 * @private
34248 * @param {Array} array The array to inspect.
34249 * @param {Function} [iteratee] The iteratee invoked per element.
34250 * @param {Function} [comparator] The comparator invoked per element.
34251 * @returns {Array} Returns the new duplicate free array.
34252 */
34253function baseUniq(array, iteratee, comparator) {
34254 var index = -1,
34255 includes = arrayIncludes,
34256 length = array.length,
34257 isCommon = true,
34258 result = [],
34259 seen = result;
34260
34261 if (comparator) {
34262 isCommon = false;
34263 includes = arrayIncludesWith;
34264 }
34265 else if (length >= LARGE_ARRAY_SIZE) {
34266 var set = iteratee ? null : createSet(array);
34267 if (set) {
34268 return setToArray(set);
34269 }
34270 isCommon = false;
34271 includes = cacheHas;
34272 seen = new SetCache;
34273 }
34274 else {
34275 seen = iteratee ? [] : result;
34276 }
34277 outer:
34278 while (++index < length) {
34279 var value = array[index],
34280 computed = iteratee ? iteratee(value) : value;
34281
34282 value = (comparator || value !== 0) ? value : 0;
34283 if (isCommon && computed === computed) {
34284 var seenIndex = seen.length;
34285 while (seenIndex--) {
34286 if (seen[seenIndex] === computed) {
34287 continue outer;
34288 }
34289 }
34290 if (iteratee) {
34291 seen.push(computed);
34292 }
34293 result.push(value);
34294 }
34295 else if (!includes(seen, computed, comparator)) {
34296 if (seen !== result) {
34297 seen.push(computed);
34298 }
34299 result.push(value);
34300 }
34301 }
34302 return result;
34303}
34304
34305module.exports = baseUniq;
34306
34307},{"./_SetCache":258,"./_arrayIncludes":268,"./_arrayIncludesWith":269,"./_cacheHas":323,"./_createSet":344,"./_setToArray":402}],322:[function(require,module,exports){
34308var arrayMap = require('./_arrayMap');
34309
34310/**
34311 * The base implementation of `_.values` and `_.valuesIn` which creates an
34312 * array of `object` property values corresponding to the property names
34313 * of `props`.
34314 *
34315 * @private
34316 * @param {Object} object The object to query.
34317 * @param {Array} props The property names to get values for.
34318 * @returns {Object} Returns the array of property values.
34319 */
34320function baseValues(object, props) {
34321 return arrayMap(props, function(key) {
34322 return object[key];
34323 });
34324}
34325
34326module.exports = baseValues;
34327
34328},{"./_arrayMap":271}],323:[function(require,module,exports){
34329/**
34330 * Checks if a `cache` value for `key` exists.
34331 *
34332 * @private
34333 * @param {Object} cache The cache to query.
34334 * @param {string} key The key of the entry to check.
34335 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
34336 */
34337function cacheHas(cache, key) {
34338 return cache.has(key);
34339}
34340
34341module.exports = cacheHas;
34342
34343},{}],324:[function(require,module,exports){
34344var isArray = require('./isArray'),
34345 isKey = require('./_isKey'),
34346 stringToPath = require('./_stringToPath'),
34347 toString = require('./toString');
34348
34349/**
34350 * Casts `value` to a path array if it's not one.
34351 *
34352 * @private
34353 * @param {*} value The value to inspect.
34354 * @param {Object} [object] The object to query keys on.
34355 * @returns {Array} Returns the cast property path array.
34356 */
34357function castPath(value, object) {
34358 if (isArray(value)) {
34359 return value;
34360 }
34361 return isKey(value, object) ? [value] : stringToPath(toString(value));
34362}
34363
34364module.exports = castPath;
34365
34366},{"./_isKey":374,"./_stringToPath":411,"./isArray":433,"./toString":463}],325:[function(require,module,exports){
34367var Uint8Array = require('./_Uint8Array');
34368
34369/**
34370 * Creates a clone of `arrayBuffer`.
34371 *
34372 * @private
34373 * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
34374 * @returns {ArrayBuffer} Returns the cloned array buffer.
34375 */
34376function cloneArrayBuffer(arrayBuffer) {
34377 var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
34378 new Uint8Array(result).set(new Uint8Array(arrayBuffer));
34379 return result;
34380}
34381
34382module.exports = cloneArrayBuffer;
34383
34384},{"./_Uint8Array":261}],326:[function(require,module,exports){
34385var root = require('./_root');
34386
34387/** Detect free variable `exports`. */
34388var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
34389
34390/** Detect free variable `module`. */
34391var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
34392
34393/** Detect the popular CommonJS extension `module.exports`. */
34394var moduleExports = freeModule && freeModule.exports === freeExports;
34395
34396/** Built-in value references. */
34397var Buffer = moduleExports ? root.Buffer : undefined,
34398 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
34399
34400/**
34401 * Creates a clone of `buffer`.
34402 *
34403 * @private
34404 * @param {Buffer} buffer The buffer to clone.
34405 * @param {boolean} [isDeep] Specify a deep clone.
34406 * @returns {Buffer} Returns the cloned buffer.
34407 */
34408function cloneBuffer(buffer, isDeep) {
34409 if (isDeep) {
34410 return buffer.slice();
34411 }
34412 var length = buffer.length,
34413 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
34414
34415 buffer.copy(result);
34416 return result;
34417}
34418
34419module.exports = cloneBuffer;
34420
34421},{"./_root":399}],327:[function(require,module,exports){
34422var cloneArrayBuffer = require('./_cloneArrayBuffer');
34423
34424/**
34425 * Creates a clone of `dataView`.
34426 *
34427 * @private
34428 * @param {Object} dataView The data view to clone.
34429 * @param {boolean} [isDeep] Specify a deep clone.
34430 * @returns {Object} Returns the cloned data view.
34431 */
34432function cloneDataView(dataView, isDeep) {
34433 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
34434 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
34435}
34436
34437module.exports = cloneDataView;
34438
34439},{"./_cloneArrayBuffer":325}],328:[function(require,module,exports){
34440var addMapEntry = require('./_addMapEntry'),
34441 arrayReduce = require('./_arrayReduce'),
34442 mapToArray = require('./_mapToArray');
34443
34444/** Used to compose bitmasks for cloning. */
34445var CLONE_DEEP_FLAG = 1;
34446
34447/**
34448 * Creates a clone of `map`.
34449 *
34450 * @private
34451 * @param {Object} map The map to clone.
34452 * @param {Function} cloneFunc The function to clone values.
34453 * @param {boolean} [isDeep] Specify a deep clone.
34454 * @returns {Object} Returns the cloned map.
34455 */
34456function cloneMap(map, isDeep, cloneFunc) {
34457 var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);
34458 return arrayReduce(array, addMapEntry, new map.constructor);
34459}
34460
34461module.exports = cloneMap;
34462
34463},{"./_addMapEntry":263,"./_arrayReduce":273,"./_mapToArray":389}],329:[function(require,module,exports){
34464/** Used to match `RegExp` flags from their coerced string values. */
34465var reFlags = /\w*$/;
34466
34467/**
34468 * Creates a clone of `regexp`.
34469 *
34470 * @private
34471 * @param {Object} regexp The regexp to clone.
34472 * @returns {Object} Returns the cloned regexp.
34473 */
34474function cloneRegExp(regexp) {
34475 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
34476 result.lastIndex = regexp.lastIndex;
34477 return result;
34478}
34479
34480module.exports = cloneRegExp;
34481
34482},{}],330:[function(require,module,exports){
34483var addSetEntry = require('./_addSetEntry'),
34484 arrayReduce = require('./_arrayReduce'),
34485 setToArray = require('./_setToArray');
34486
34487/** Used to compose bitmasks for cloning. */
34488var CLONE_DEEP_FLAG = 1;
34489
34490/**
34491 * Creates a clone of `set`.
34492 *
34493 * @private
34494 * @param {Object} set The set to clone.
34495 * @param {Function} cloneFunc The function to clone values.
34496 * @param {boolean} [isDeep] Specify a deep clone.
34497 * @returns {Object} Returns the cloned set.
34498 */
34499function cloneSet(set, isDeep, cloneFunc) {
34500 var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);
34501 return arrayReduce(array, addSetEntry, new set.constructor);
34502}
34503
34504module.exports = cloneSet;
34505
34506},{"./_addSetEntry":264,"./_arrayReduce":273,"./_setToArray":402}],331:[function(require,module,exports){
34507var Symbol = require('./_Symbol');
34508
34509/** Used to convert symbols to primitives and strings. */
34510var symbolProto = Symbol ? Symbol.prototype : undefined,
34511 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
34512
34513/**
34514 * Creates a clone of the `symbol` object.
34515 *
34516 * @private
34517 * @param {Object} symbol The symbol object to clone.
34518 * @returns {Object} Returns the cloned symbol object.
34519 */
34520function cloneSymbol(symbol) {
34521 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
34522}
34523
34524module.exports = cloneSymbol;
34525
34526},{"./_Symbol":260}],332:[function(require,module,exports){
34527var cloneArrayBuffer = require('./_cloneArrayBuffer');
34528
34529/**
34530 * Creates a clone of `typedArray`.
34531 *
34532 * @private
34533 * @param {Object} typedArray The typed array to clone.
34534 * @param {boolean} [isDeep] Specify a deep clone.
34535 * @returns {Object} Returns the cloned typed array.
34536 */
34537function cloneTypedArray(typedArray, isDeep) {
34538 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
34539 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
34540}
34541
34542module.exports = cloneTypedArray;
34543
34544},{"./_cloneArrayBuffer":325}],333:[function(require,module,exports){
34545var isSymbol = require('./isSymbol');
34546
34547/**
34548 * Compares values to sort them in ascending order.
34549 *
34550 * @private
34551 * @param {*} value The value to compare.
34552 * @param {*} other The other value to compare.
34553 * @returns {number} Returns the sort order indicator for `value`.
34554 */
34555function compareAscending(value, other) {
34556 if (value !== other) {
34557 var valIsDefined = value !== undefined,
34558 valIsNull = value === null,
34559 valIsReflexive = value === value,
34560 valIsSymbol = isSymbol(value);
34561
34562 var othIsDefined = other !== undefined,
34563 othIsNull = other === null,
34564 othIsReflexive = other === other,
34565 othIsSymbol = isSymbol(other);
34566
34567 if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
34568 (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
34569 (valIsNull && othIsDefined && othIsReflexive) ||
34570 (!valIsDefined && othIsReflexive) ||
34571 !valIsReflexive) {
34572 return 1;
34573 }
34574 if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
34575 (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
34576 (othIsNull && valIsDefined && valIsReflexive) ||
34577 (!othIsDefined && valIsReflexive) ||
34578 !othIsReflexive) {
34579 return -1;
34580 }
34581 }
34582 return 0;
34583}
34584
34585module.exports = compareAscending;
34586
34587},{"./isSymbol":445}],334:[function(require,module,exports){
34588var compareAscending = require('./_compareAscending');
34589
34590/**
34591 * Used by `_.orderBy` to compare multiple properties of a value to another
34592 * and stable sort them.
34593 *
34594 * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
34595 * specify an order of "desc" for descending or "asc" for ascending sort order
34596 * of corresponding values.
34597 *
34598 * @private
34599 * @param {Object} object The object to compare.
34600 * @param {Object} other The other object to compare.
34601 * @param {boolean[]|string[]} orders The order to sort by for each property.
34602 * @returns {number} Returns the sort order indicator for `object`.
34603 */
34604function compareMultiple(object, other, orders) {
34605 var index = -1,
34606 objCriteria = object.criteria,
34607 othCriteria = other.criteria,
34608 length = objCriteria.length,
34609 ordersLength = orders.length;
34610
34611 while (++index < length) {
34612 var result = compareAscending(objCriteria[index], othCriteria[index]);
34613 if (result) {
34614 if (index >= ordersLength) {
34615 return result;
34616 }
34617 var order = orders[index];
34618 return result * (order == 'desc' ? -1 : 1);
34619 }
34620 }
34621 // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
34622 // that causes it, under certain circumstances, to provide the same value for
34623 // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
34624 // for more details.
34625 //
34626 // This also ensures a stable sort in V8 and other engines.
34627 // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
34628 return object.index - other.index;
34629}
34630
34631module.exports = compareMultiple;
34632
34633},{"./_compareAscending":333}],335:[function(require,module,exports){
34634/**
34635 * Copies the values of `source` to `array`.
34636 *
34637 * @private
34638 * @param {Array} source The array to copy values from.
34639 * @param {Array} [array=[]] The array to copy values to.
34640 * @returns {Array} Returns `array`.
34641 */
34642function copyArray(source, array) {
34643 var index = -1,
34644 length = source.length;
34645
34646 array || (array = Array(length));
34647 while (++index < length) {
34648 array[index] = source[index];
34649 }
34650 return array;
34651}
34652
34653module.exports = copyArray;
34654
34655},{}],336:[function(require,module,exports){
34656var assignValue = require('./_assignValue'),
34657 baseAssignValue = require('./_baseAssignValue');
34658
34659/**
34660 * Copies properties of `source` to `object`.
34661 *
34662 * @private
34663 * @param {Object} source The object to copy properties from.
34664 * @param {Array} props The property identifiers to copy.
34665 * @param {Object} [object={}] The object to copy properties to.
34666 * @param {Function} [customizer] The function to customize copied values.
34667 * @returns {Object} Returns `object`.
34668 */
34669function copyObject(source, props, object, customizer) {
34670 var isNew = !object;
34671 object || (object = {});
34672
34673 var index = -1,
34674 length = props.length;
34675
34676 while (++index < length) {
34677 var key = props[index];
34678
34679 var newValue = customizer
34680 ? customizer(object[key], source[key], key, object, source)
34681 : undefined;
34682
34683 if (newValue === undefined) {
34684 newValue = source[key];
34685 }
34686 if (isNew) {
34687 baseAssignValue(object, key, newValue);
34688 } else {
34689 assignValue(object, key, newValue);
34690 }
34691 }
34692 return object;
34693}
34694
34695module.exports = copyObject;
34696
34697},{"./_assignValue":276,"./_baseAssignValue":280}],337:[function(require,module,exports){
34698var copyObject = require('./_copyObject'),
34699 getSymbols = require('./_getSymbols');
34700
34701/**
34702 * Copies own symbols of `source` to `object`.
34703 *
34704 * @private
34705 * @param {Object} source The object to copy symbols from.
34706 * @param {Object} [object={}] The object to copy symbols to.
34707 * @returns {Object} Returns `object`.
34708 */
34709function copySymbols(source, object) {
34710 return copyObject(source, getSymbols(source), object);
34711}
34712
34713module.exports = copySymbols;
34714
34715},{"./_copyObject":336,"./_getSymbols":358}],338:[function(require,module,exports){
34716var copyObject = require('./_copyObject'),
34717 getSymbolsIn = require('./_getSymbolsIn');
34718
34719/**
34720 * Copies own and inherited symbols of `source` to `object`.
34721 *
34722 * @private
34723 * @param {Object} source The object to copy symbols from.
34724 * @param {Object} [object={}] The object to copy symbols to.
34725 * @returns {Object} Returns `object`.
34726 */
34727function copySymbolsIn(source, object) {
34728 return copyObject(source, getSymbolsIn(source), object);
34729}
34730
34731module.exports = copySymbolsIn;
34732
34733},{"./_copyObject":336,"./_getSymbolsIn":359}],339:[function(require,module,exports){
34734var root = require('./_root');
34735
34736/** Used to detect overreaching core-js shims. */
34737var coreJsData = root['__core-js_shared__'];
34738
34739module.exports = coreJsData;
34740
34741},{"./_root":399}],340:[function(require,module,exports){
34742var baseRest = require('./_baseRest'),
34743 isIterateeCall = require('./_isIterateeCall');
34744
34745/**
34746 * Creates a function like `_.assign`.
34747 *
34748 * @private
34749 * @param {Function} assigner The function to assign values.
34750 * @returns {Function} Returns the new assigner function.
34751 */
34752function createAssigner(assigner) {
34753 return baseRest(function(object, sources) {
34754 var index = -1,
34755 length = sources.length,
34756 customizer = length > 1 ? sources[length - 1] : undefined,
34757 guard = length > 2 ? sources[2] : undefined;
34758
34759 customizer = (assigner.length > 3 && typeof customizer == 'function')
34760 ? (length--, customizer)
34761 : undefined;
34762
34763 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
34764 customizer = length < 3 ? undefined : customizer;
34765 length = 1;
34766 }
34767 object = Object(object);
34768 while (++index < length) {
34769 var source = sources[index];
34770 if (source) {
34771 assigner(object, source, index, customizer);
34772 }
34773 }
34774 return object;
34775 });
34776}
34777
34778module.exports = createAssigner;
34779
34780},{"./_baseRest":315,"./_isIterateeCall":373}],341:[function(require,module,exports){
34781var isArrayLike = require('./isArrayLike');
34782
34783/**
34784 * Creates a `baseEach` or `baseEachRight` function.
34785 *
34786 * @private
34787 * @param {Function} eachFunc The function to iterate over a collection.
34788 * @param {boolean} [fromRight] Specify iterating from right to left.
34789 * @returns {Function} Returns the new base function.
34790 */
34791function createBaseEach(eachFunc, fromRight) {
34792 return function(collection, iteratee) {
34793 if (collection == null) {
34794 return collection;
34795 }
34796 if (!isArrayLike(collection)) {
34797 return eachFunc(collection, iteratee);
34798 }
34799 var length = collection.length,
34800 index = fromRight ? length : -1,
34801 iterable = Object(collection);
34802
34803 while ((fromRight ? index-- : ++index < length)) {
34804 if (iteratee(iterable[index], index, iterable) === false) {
34805 break;
34806 }
34807 }
34808 return collection;
34809 };
34810}
34811
34812module.exports = createBaseEach;
34813
34814},{"./isArrayLike":434}],342:[function(require,module,exports){
34815/**
34816 * Creates a base function for methods like `_.forIn` and `_.forOwn`.
34817 *
34818 * @private
34819 * @param {boolean} [fromRight] Specify iterating from right to left.
34820 * @returns {Function} Returns the new base function.
34821 */
34822function createBaseFor(fromRight) {
34823 return function(object, iteratee, keysFunc) {
34824 var index = -1,
34825 iterable = Object(object),
34826 props = keysFunc(object),
34827 length = props.length;
34828
34829 while (length--) {
34830 var key = props[fromRight ? length : ++index];
34831 if (iteratee(iterable[key], key, iterable) === false) {
34832 break;
34833 }
34834 }
34835 return object;
34836 };
34837}
34838
34839module.exports = createBaseFor;
34840
34841},{}],343:[function(require,module,exports){
34842var baseIteratee = require('./_baseIteratee'),
34843 isArrayLike = require('./isArrayLike'),
34844 keys = require('./keys');
34845
34846/**
34847 * Creates a `_.find` or `_.findLast` function.
34848 *
34849 * @private
34850 * @param {Function} findIndexFunc The function to find the collection index.
34851 * @returns {Function} Returns the new find function.
34852 */
34853function createFind(findIndexFunc) {
34854 return function(collection, predicate, fromIndex) {
34855 var iterable = Object(collection);
34856 if (!isArrayLike(collection)) {
34857 var iteratee = baseIteratee(predicate, 3);
34858 collection = keys(collection);
34859 predicate = function(key) { return iteratee(iterable[key], key, iterable); };
34860 }
34861 var index = findIndexFunc(collection, predicate, fromIndex);
34862 return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
34863 };
34864}
34865
34866module.exports = createFind;
34867
34868},{"./_baseIteratee":303,"./isArrayLike":434,"./keys":447}],344:[function(require,module,exports){
34869var Set = require('./_Set'),
34870 noop = require('./noop'),
34871 setToArray = require('./_setToArray');
34872
34873/** Used as references for various `Number` constants. */
34874var INFINITY = 1 / 0;
34875
34876/**
34877 * Creates a set object of `values`.
34878 *
34879 * @private
34880 * @param {Array} values The values to add to the set.
34881 * @returns {Object} Returns the new set.
34882 */
34883var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
34884 return new Set(values);
34885};
34886
34887module.exports = createSet;
34888
34889},{"./_Set":257,"./_setToArray":402,"./noop":452}],345:[function(require,module,exports){
34890var eq = require('./eq');
34891
34892/** Used for built-in method references. */
34893var objectProto = Object.prototype;
34894
34895/** Used to check objects for own properties. */
34896var hasOwnProperty = objectProto.hasOwnProperty;
34897
34898/**
34899 * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
34900 * of source objects to the destination object for all destination properties
34901 * that resolve to `undefined`.
34902 *
34903 * @private
34904 * @param {*} objValue The destination value.
34905 * @param {*} srcValue The source value.
34906 * @param {string} key The key of the property to assign.
34907 * @param {Object} object The parent object of `objValue`.
34908 * @returns {*} Returns the value to assign.
34909 */
34910function customDefaultsAssignIn(objValue, srcValue, key, object) {
34911 if (objValue === undefined ||
34912 (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
34913 return srcValue;
34914 }
34915 return objValue;
34916}
34917
34918module.exports = customDefaultsAssignIn;
34919
34920},{"./eq":421}],346:[function(require,module,exports){
34921var getNative = require('./_getNative');
34922
34923var defineProperty = (function() {
34924 try {
34925 var func = getNative(Object, 'defineProperty');
34926 func({}, '', {});
34927 return func;
34928 } catch (e) {}
34929}());
34930
34931module.exports = defineProperty;
34932
34933},{"./_getNative":355}],347:[function(require,module,exports){
34934var SetCache = require('./_SetCache'),
34935 arraySome = require('./_arraySome'),
34936 cacheHas = require('./_cacheHas');
34937
34938/** Used to compose bitmasks for value comparisons. */
34939var COMPARE_PARTIAL_FLAG = 1,
34940 COMPARE_UNORDERED_FLAG = 2;
34941
34942/**
34943 * A specialized version of `baseIsEqualDeep` for arrays with support for
34944 * partial deep comparisons.
34945 *
34946 * @private
34947 * @param {Array} array The array to compare.
34948 * @param {Array} other The other array to compare.
34949 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
34950 * @param {Function} customizer The function to customize comparisons.
34951 * @param {Function} equalFunc The function to determine equivalents of values.
34952 * @param {Object} stack Tracks traversed `array` and `other` objects.
34953 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
34954 */
34955function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
34956 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
34957 arrLength = array.length,
34958 othLength = other.length;
34959
34960 if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
34961 return false;
34962 }
34963 // Assume cyclic values are equal.
34964 var stacked = stack.get(array);
34965 if (stacked && stack.get(other)) {
34966 return stacked == other;
34967 }
34968 var index = -1,
34969 result = true,
34970 seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
34971
34972 stack.set(array, other);
34973 stack.set(other, array);
34974
34975 // Ignore non-index properties.
34976 while (++index < arrLength) {
34977 var arrValue = array[index],
34978 othValue = other[index];
34979
34980 if (customizer) {
34981 var compared = isPartial
34982 ? customizer(othValue, arrValue, index, other, array, stack)
34983 : customizer(arrValue, othValue, index, array, other, stack);
34984 }
34985 if (compared !== undefined) {
34986 if (compared) {
34987 continue;
34988 }
34989 result = false;
34990 break;
34991 }
34992 // Recursively compare arrays (susceptible to call stack limits).
34993 if (seen) {
34994 if (!arraySome(other, function(othValue, othIndex) {
34995 if (!cacheHas(seen, othIndex) &&
34996 (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
34997 return seen.push(othIndex);
34998 }
34999 })) {
35000 result = false;
35001 break;
35002 }
35003 } else if (!(
35004 arrValue === othValue ||
35005 equalFunc(arrValue, othValue, bitmask, customizer, stack)
35006 )) {
35007 result = false;
35008 break;
35009 }
35010 }
35011 stack['delete'](array);
35012 stack['delete'](other);
35013 return result;
35014}
35015
35016module.exports = equalArrays;
35017
35018},{"./_SetCache":258,"./_arraySome":274,"./_cacheHas":323}],348:[function(require,module,exports){
35019var Symbol = require('./_Symbol'),
35020 Uint8Array = require('./_Uint8Array'),
35021 eq = require('./eq'),
35022 equalArrays = require('./_equalArrays'),
35023 mapToArray = require('./_mapToArray'),
35024 setToArray = require('./_setToArray');
35025
35026/** Used to compose bitmasks for value comparisons. */
35027var COMPARE_PARTIAL_FLAG = 1,
35028 COMPARE_UNORDERED_FLAG = 2;
35029
35030/** `Object#toString` result references. */
35031var boolTag = '[object Boolean]',
35032 dateTag = '[object Date]',
35033 errorTag = '[object Error]',
35034 mapTag = '[object Map]',
35035 numberTag = '[object Number]',
35036 regexpTag = '[object RegExp]',
35037 setTag = '[object Set]',
35038 stringTag = '[object String]',
35039 symbolTag = '[object Symbol]';
35040
35041var arrayBufferTag = '[object ArrayBuffer]',
35042 dataViewTag = '[object DataView]';
35043
35044/** Used to convert symbols to primitives and strings. */
35045var symbolProto = Symbol ? Symbol.prototype : undefined,
35046 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
35047
35048/**
35049 * A specialized version of `baseIsEqualDeep` for comparing objects of
35050 * the same `toStringTag`.
35051 *
35052 * **Note:** This function only supports comparing values with tags of
35053 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
35054 *
35055 * @private
35056 * @param {Object} object The object to compare.
35057 * @param {Object} other The other object to compare.
35058 * @param {string} tag The `toStringTag` of the objects to compare.
35059 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
35060 * @param {Function} customizer The function to customize comparisons.
35061 * @param {Function} equalFunc The function to determine equivalents of values.
35062 * @param {Object} stack Tracks traversed `object` and `other` objects.
35063 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
35064 */
35065function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
35066 switch (tag) {
35067 case dataViewTag:
35068 if ((object.byteLength != other.byteLength) ||
35069 (object.byteOffset != other.byteOffset)) {
35070 return false;
35071 }
35072 object = object.buffer;
35073 other = other.buffer;
35074
35075 case arrayBufferTag:
35076 if ((object.byteLength != other.byteLength) ||
35077 !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
35078 return false;
35079 }
35080 return true;
35081
35082 case boolTag:
35083 case dateTag:
35084 case numberTag:
35085 // Coerce booleans to `1` or `0` and dates to milliseconds.
35086 // Invalid dates are coerced to `NaN`.
35087 return eq(+object, +other);
35088
35089 case errorTag:
35090 return object.name == other.name && object.message == other.message;
35091
35092 case regexpTag:
35093 case stringTag:
35094 // Coerce regexes to strings and treat strings, primitives and objects,
35095 // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
35096 // for more details.
35097 return object == (other + '');
35098
35099 case mapTag:
35100 var convert = mapToArray;
35101
35102 case setTag:
35103 var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
35104 convert || (convert = setToArray);
35105
35106 if (object.size != other.size && !isPartial) {
35107 return false;
35108 }
35109 // Assume cyclic values are equal.
35110 var stacked = stack.get(object);
35111 if (stacked) {
35112 return stacked == other;
35113 }
35114 bitmask |= COMPARE_UNORDERED_FLAG;
35115
35116 // Recursively compare objects (susceptible to call stack limits).
35117 stack.set(object, other);
35118 var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
35119 stack['delete'](object);
35120 return result;
35121
35122 case symbolTag:
35123 if (symbolValueOf) {
35124 return symbolValueOf.call(object) == symbolValueOf.call(other);
35125 }
35126 }
35127 return false;
35128}
35129
35130module.exports = equalByTag;
35131
35132},{"./_Symbol":260,"./_Uint8Array":261,"./_equalArrays":347,"./_mapToArray":389,"./_setToArray":402,"./eq":421}],349:[function(require,module,exports){
35133var getAllKeys = require('./_getAllKeys');
35134
35135/** Used to compose bitmasks for value comparisons. */
35136var COMPARE_PARTIAL_FLAG = 1;
35137
35138/** Used for built-in method references. */
35139var objectProto = Object.prototype;
35140
35141/** Used to check objects for own properties. */
35142var hasOwnProperty = objectProto.hasOwnProperty;
35143
35144/**
35145 * A specialized version of `baseIsEqualDeep` for objects with support for
35146 * partial deep comparisons.
35147 *
35148 * @private
35149 * @param {Object} object The object to compare.
35150 * @param {Object} other The other object to compare.
35151 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
35152 * @param {Function} customizer The function to customize comparisons.
35153 * @param {Function} equalFunc The function to determine equivalents of values.
35154 * @param {Object} stack Tracks traversed `object` and `other` objects.
35155 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
35156 */
35157function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
35158 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
35159 objProps = getAllKeys(object),
35160 objLength = objProps.length,
35161 othProps = getAllKeys(other),
35162 othLength = othProps.length;
35163
35164 if (objLength != othLength && !isPartial) {
35165 return false;
35166 }
35167 var index = objLength;
35168 while (index--) {
35169 var key = objProps[index];
35170 if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
35171 return false;
35172 }
35173 }
35174 // Assume cyclic values are equal.
35175 var stacked = stack.get(object);
35176 if (stacked && stack.get(other)) {
35177 return stacked == other;
35178 }
35179 var result = true;
35180 stack.set(object, other);
35181 stack.set(other, object);
35182
35183 var skipCtor = isPartial;
35184 while (++index < objLength) {
35185 key = objProps[index];
35186 var objValue = object[key],
35187 othValue = other[key];
35188
35189 if (customizer) {
35190 var compared = isPartial
35191 ? customizer(othValue, objValue, key, other, object, stack)
35192 : customizer(objValue, othValue, key, object, other, stack);
35193 }
35194 // Recursively compare objects (susceptible to call stack limits).
35195 if (!(compared === undefined
35196 ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
35197 : compared
35198 )) {
35199 result = false;
35200 break;
35201 }
35202 skipCtor || (skipCtor = key == 'constructor');
35203 }
35204 if (result && !skipCtor) {
35205 var objCtor = object.constructor,
35206 othCtor = other.constructor;
35207
35208 // Non `Object` object instances with different constructors are not equal.
35209 if (objCtor != othCtor &&
35210 ('constructor' in object && 'constructor' in other) &&
35211 !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
35212 typeof othCtor == 'function' && othCtor instanceof othCtor)) {
35213 result = false;
35214 }
35215 }
35216 stack['delete'](object);
35217 stack['delete'](other);
35218 return result;
35219}
35220
35221module.exports = equalObjects;
35222
35223},{"./_getAllKeys":351}],350:[function(require,module,exports){
35224(function (global){
35225/** Detect free variable `global` from Node.js. */
35226var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
35227
35228module.exports = freeGlobal;
35229
35230}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
35231},{}],351:[function(require,module,exports){
35232var baseGetAllKeys = require('./_baseGetAllKeys'),
35233 getSymbols = require('./_getSymbols'),
35234 keys = require('./keys');
35235
35236/**
35237 * Creates an array of own enumerable property names and symbols of `object`.
35238 *
35239 * @private
35240 * @param {Object} object The object to query.
35241 * @returns {Array} Returns the array of property names and symbols.
35242 */
35243function getAllKeys(object) {
35244 return baseGetAllKeys(object, keys, getSymbols);
35245}
35246
35247module.exports = getAllKeys;
35248
35249},{"./_baseGetAllKeys":290,"./_getSymbols":358,"./keys":447}],352:[function(require,module,exports){
35250var baseGetAllKeys = require('./_baseGetAllKeys'),
35251 getSymbolsIn = require('./_getSymbolsIn'),
35252 keysIn = require('./keysIn');
35253
35254/**
35255 * Creates an array of own and inherited enumerable property names and
35256 * symbols of `object`.
35257 *
35258 * @private
35259 * @param {Object} object The object to query.
35260 * @returns {Array} Returns the array of property names and symbols.
35261 */
35262function getAllKeysIn(object) {
35263 return baseGetAllKeys(object, keysIn, getSymbolsIn);
35264}
35265
35266module.exports = getAllKeysIn;
35267
35268},{"./_baseGetAllKeys":290,"./_getSymbolsIn":359,"./keysIn":448}],353:[function(require,module,exports){
35269var isKeyable = require('./_isKeyable');
35270
35271/**
35272 * Gets the data for `map`.
35273 *
35274 * @private
35275 * @param {Object} map The map to query.
35276 * @param {string} key The reference key.
35277 * @returns {*} Returns the map data.
35278 */
35279function getMapData(map, key) {
35280 var data = map.__data__;
35281 return isKeyable(key)
35282 ? data[typeof key == 'string' ? 'string' : 'hash']
35283 : data.map;
35284}
35285
35286module.exports = getMapData;
35287
35288},{"./_isKeyable":375}],354:[function(require,module,exports){
35289var isStrictComparable = require('./_isStrictComparable'),
35290 keys = require('./keys');
35291
35292/**
35293 * Gets the property names, values, and compare flags of `object`.
35294 *
35295 * @private
35296 * @param {Object} object The object to query.
35297 * @returns {Array} Returns the match data of `object`.
35298 */
35299function getMatchData(object) {
35300 var result = keys(object),
35301 length = result.length;
35302
35303 while (length--) {
35304 var key = result[length],
35305 value = object[key];
35306
35307 result[length] = [key, value, isStrictComparable(value)];
35308 }
35309 return result;
35310}
35311
35312module.exports = getMatchData;
35313
35314},{"./_isStrictComparable":378,"./keys":447}],355:[function(require,module,exports){
35315var baseIsNative = require('./_baseIsNative'),
35316 getValue = require('./_getValue');
35317
35318/**
35319 * Gets the native function at `key` of `object`.
35320 *
35321 * @private
35322 * @param {Object} object The object to query.
35323 * @param {string} key The key of the method to get.
35324 * @returns {*} Returns the function if it's native, else `undefined`.
35325 */
35326function getNative(object, key) {
35327 var value = getValue(object, key);
35328 return baseIsNative(value) ? value : undefined;
35329}
35330
35331module.exports = getNative;
35332
35333},{"./_baseIsNative":300,"./_getValue":361}],356:[function(require,module,exports){
35334var overArg = require('./_overArg');
35335
35336/** Built-in value references. */
35337var getPrototype = overArg(Object.getPrototypeOf, Object);
35338
35339module.exports = getPrototype;
35340
35341},{"./_overArg":397}],357:[function(require,module,exports){
35342var Symbol = require('./_Symbol');
35343
35344/** Used for built-in method references. */
35345var objectProto = Object.prototype;
35346
35347/** Used to check objects for own properties. */
35348var hasOwnProperty = objectProto.hasOwnProperty;
35349
35350/**
35351 * Used to resolve the
35352 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
35353 * of values.
35354 */
35355var nativeObjectToString = objectProto.toString;
35356
35357/** Built-in value references. */
35358var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
35359
35360/**
35361 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
35362 *
35363 * @private
35364 * @param {*} value The value to query.
35365 * @returns {string} Returns the raw `toStringTag`.
35366 */
35367function getRawTag(value) {
35368 var isOwn = hasOwnProperty.call(value, symToStringTag),
35369 tag = value[symToStringTag];
35370
35371 try {
35372 value[symToStringTag] = undefined;
35373 var unmasked = true;
35374 } catch (e) {}
35375
35376 var result = nativeObjectToString.call(value);
35377 if (unmasked) {
35378 if (isOwn) {
35379 value[symToStringTag] = tag;
35380 } else {
35381 delete value[symToStringTag];
35382 }
35383 }
35384 return result;
35385}
35386
35387module.exports = getRawTag;
35388
35389},{"./_Symbol":260}],358:[function(require,module,exports){
35390var arrayFilter = require('./_arrayFilter'),
35391 stubArray = require('./stubArray');
35392
35393/** Used for built-in method references. */
35394var objectProto = Object.prototype;
35395
35396/** Built-in value references. */
35397var propertyIsEnumerable = objectProto.propertyIsEnumerable;
35398
35399/* Built-in method references for those with the same name as other `lodash` methods. */
35400var nativeGetSymbols = Object.getOwnPropertySymbols;
35401
35402/**
35403 * Creates an array of the own enumerable symbols of `object`.
35404 *
35405 * @private
35406 * @param {Object} object The object to query.
35407 * @returns {Array} Returns the array of symbols.
35408 */
35409var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
35410 if (object == null) {
35411 return [];
35412 }
35413 object = Object(object);
35414 return arrayFilter(nativeGetSymbols(object), function(symbol) {
35415 return propertyIsEnumerable.call(object, symbol);
35416 });
35417};
35418
35419module.exports = getSymbols;
35420
35421},{"./_arrayFilter":267,"./stubArray":457}],359:[function(require,module,exports){
35422var arrayPush = require('./_arrayPush'),
35423 getPrototype = require('./_getPrototype'),
35424 getSymbols = require('./_getSymbols'),
35425 stubArray = require('./stubArray');
35426
35427/* Built-in method references for those with the same name as other `lodash` methods. */
35428var nativeGetSymbols = Object.getOwnPropertySymbols;
35429
35430/**
35431 * Creates an array of the own and inherited enumerable symbols of `object`.
35432 *
35433 * @private
35434 * @param {Object} object The object to query.
35435 * @returns {Array} Returns the array of symbols.
35436 */
35437var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
35438 var result = [];
35439 while (object) {
35440 arrayPush(result, getSymbols(object));
35441 object = getPrototype(object);
35442 }
35443 return result;
35444};
35445
35446module.exports = getSymbolsIn;
35447
35448},{"./_arrayPush":272,"./_getPrototype":356,"./_getSymbols":358,"./stubArray":457}],360:[function(require,module,exports){
35449var DataView = require('./_DataView'),
35450 Map = require('./_Map'),
35451 Promise = require('./_Promise'),
35452 Set = require('./_Set'),
35453 WeakMap = require('./_WeakMap'),
35454 baseGetTag = require('./_baseGetTag'),
35455 toSource = require('./_toSource');
35456
35457/** `Object#toString` result references. */
35458var mapTag = '[object Map]',
35459 objectTag = '[object Object]',
35460 promiseTag = '[object Promise]',
35461 setTag = '[object Set]',
35462 weakMapTag = '[object WeakMap]';
35463
35464var dataViewTag = '[object DataView]';
35465
35466/** Used to detect maps, sets, and weakmaps. */
35467var dataViewCtorString = toSource(DataView),
35468 mapCtorString = toSource(Map),
35469 promiseCtorString = toSource(Promise),
35470 setCtorString = toSource(Set),
35471 weakMapCtorString = toSource(WeakMap);
35472
35473/**
35474 * Gets the `toStringTag` of `value`.
35475 *
35476 * @private
35477 * @param {*} value The value to query.
35478 * @returns {string} Returns the `toStringTag`.
35479 */
35480var getTag = baseGetTag;
35481
35482// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
35483if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
35484 (Map && getTag(new Map) != mapTag) ||
35485 (Promise && getTag(Promise.resolve()) != promiseTag) ||
35486 (Set && getTag(new Set) != setTag) ||
35487 (WeakMap && getTag(new WeakMap) != weakMapTag)) {
35488 getTag = function(value) {
35489 var result = baseGetTag(value),
35490 Ctor = result == objectTag ? value.constructor : undefined,
35491 ctorString = Ctor ? toSource(Ctor) : '';
35492
35493 if (ctorString) {
35494 switch (ctorString) {
35495 case dataViewCtorString: return dataViewTag;
35496 case mapCtorString: return mapTag;
35497 case promiseCtorString: return promiseTag;
35498 case setCtorString: return setTag;
35499 case weakMapCtorString: return weakMapTag;
35500 }
35501 }
35502 return result;
35503 };
35504}
35505
35506module.exports = getTag;
35507
35508},{"./_DataView":251,"./_Map":254,"./_Promise":256,"./_Set":257,"./_WeakMap":262,"./_baseGetTag":291,"./_toSource":413}],361:[function(require,module,exports){
35509/**
35510 * Gets the value at `key` of `object`.
35511 *
35512 * @private
35513 * @param {Object} [object] The object to query.
35514 * @param {string} key The key of the property to get.
35515 * @returns {*} Returns the property value.
35516 */
35517function getValue(object, key) {
35518 return object == null ? undefined : object[key];
35519}
35520
35521module.exports = getValue;
35522
35523},{}],362:[function(require,module,exports){
35524var castPath = require('./_castPath'),
35525 isArguments = require('./isArguments'),
35526 isArray = require('./isArray'),
35527 isIndex = require('./_isIndex'),
35528 isLength = require('./isLength'),
35529 toKey = require('./_toKey');
35530
35531/**
35532 * Checks if `path` exists on `object`.
35533 *
35534 * @private
35535 * @param {Object} object The object to query.
35536 * @param {Array|string} path The path to check.
35537 * @param {Function} hasFunc The function to check properties.
35538 * @returns {boolean} Returns `true` if `path` exists, else `false`.
35539 */
35540function hasPath(object, path, hasFunc) {
35541 path = castPath(path, object);
35542
35543 var index = -1,
35544 length = path.length,
35545 result = false;
35546
35547 while (++index < length) {
35548 var key = toKey(path[index]);
35549 if (!(result = object != null && hasFunc(object, key))) {
35550 break;
35551 }
35552 object = object[key];
35553 }
35554 if (result || ++index != length) {
35555 return result;
35556 }
35557 length = object == null ? 0 : object.length;
35558 return !!length && isLength(length) && isIndex(key, length) &&
35559 (isArray(object) || isArguments(object));
35560}
35561
35562module.exports = hasPath;
35563
35564},{"./_castPath":324,"./_isIndex":372,"./_toKey":412,"./isArguments":432,"./isArray":433,"./isLength":439}],363:[function(require,module,exports){
35565var nativeCreate = require('./_nativeCreate');
35566
35567/**
35568 * Removes all key-value entries from the hash.
35569 *
35570 * @private
35571 * @name clear
35572 * @memberOf Hash
35573 */
35574function hashClear() {
35575 this.__data__ = nativeCreate ? nativeCreate(null) : {};
35576 this.size = 0;
35577}
35578
35579module.exports = hashClear;
35580
35581},{"./_nativeCreate":392}],364:[function(require,module,exports){
35582/**
35583 * Removes `key` and its value from the hash.
35584 *
35585 * @private
35586 * @name delete
35587 * @memberOf Hash
35588 * @param {Object} hash The hash to modify.
35589 * @param {string} key The key of the value to remove.
35590 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
35591 */
35592function hashDelete(key) {
35593 var result = this.has(key) && delete this.__data__[key];
35594 this.size -= result ? 1 : 0;
35595 return result;
35596}
35597
35598module.exports = hashDelete;
35599
35600},{}],365:[function(require,module,exports){
35601var nativeCreate = require('./_nativeCreate');
35602
35603/** Used to stand-in for `undefined` hash values. */
35604var HASH_UNDEFINED = '__lodash_hash_undefined__';
35605
35606/** Used for built-in method references. */
35607var objectProto = Object.prototype;
35608
35609/** Used to check objects for own properties. */
35610var hasOwnProperty = objectProto.hasOwnProperty;
35611
35612/**
35613 * Gets the hash value for `key`.
35614 *
35615 * @private
35616 * @name get
35617 * @memberOf Hash
35618 * @param {string} key The key of the value to get.
35619 * @returns {*} Returns the entry value.
35620 */
35621function hashGet(key) {
35622 var data = this.__data__;
35623 if (nativeCreate) {
35624 var result = data[key];
35625 return result === HASH_UNDEFINED ? undefined : result;
35626 }
35627 return hasOwnProperty.call(data, key) ? data[key] : undefined;
35628}
35629
35630module.exports = hashGet;
35631
35632},{"./_nativeCreate":392}],366:[function(require,module,exports){
35633var nativeCreate = require('./_nativeCreate');
35634
35635/** Used for built-in method references. */
35636var objectProto = Object.prototype;
35637
35638/** Used to check objects for own properties. */
35639var hasOwnProperty = objectProto.hasOwnProperty;
35640
35641/**
35642 * Checks if a hash value for `key` exists.
35643 *
35644 * @private
35645 * @name has
35646 * @memberOf Hash
35647 * @param {string} key The key of the entry to check.
35648 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
35649 */
35650function hashHas(key) {
35651 var data = this.__data__;
35652 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
35653}
35654
35655module.exports = hashHas;
35656
35657},{"./_nativeCreate":392}],367:[function(require,module,exports){
35658var nativeCreate = require('./_nativeCreate');
35659
35660/** Used to stand-in for `undefined` hash values. */
35661var HASH_UNDEFINED = '__lodash_hash_undefined__';
35662
35663/**
35664 * Sets the hash `key` to `value`.
35665 *
35666 * @private
35667 * @name set
35668 * @memberOf Hash
35669 * @param {string} key The key of the value to set.
35670 * @param {*} value The value to set.
35671 * @returns {Object} Returns the hash instance.
35672 */
35673function hashSet(key, value) {
35674 var data = this.__data__;
35675 this.size += this.has(key) ? 0 : 1;
35676 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
35677 return this;
35678}
35679
35680module.exports = hashSet;
35681
35682},{"./_nativeCreate":392}],368:[function(require,module,exports){
35683/** Used for built-in method references. */
35684var objectProto = Object.prototype;
35685
35686/** Used to check objects for own properties. */
35687var hasOwnProperty = objectProto.hasOwnProperty;
35688
35689/**
35690 * Initializes an array clone.
35691 *
35692 * @private
35693 * @param {Array} array The array to clone.
35694 * @returns {Array} Returns the initialized clone.
35695 */
35696function initCloneArray(array) {
35697 var length = array.length,
35698 result = array.constructor(length);
35699
35700 // Add properties assigned by `RegExp#exec`.
35701 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
35702 result.index = array.index;
35703 result.input = array.input;
35704 }
35705 return result;
35706}
35707
35708module.exports = initCloneArray;
35709
35710},{}],369:[function(require,module,exports){
35711var cloneArrayBuffer = require('./_cloneArrayBuffer'),
35712 cloneDataView = require('./_cloneDataView'),
35713 cloneMap = require('./_cloneMap'),
35714 cloneRegExp = require('./_cloneRegExp'),
35715 cloneSet = require('./_cloneSet'),
35716 cloneSymbol = require('./_cloneSymbol'),
35717 cloneTypedArray = require('./_cloneTypedArray');
35718
35719/** `Object#toString` result references. */
35720var boolTag = '[object Boolean]',
35721 dateTag = '[object Date]',
35722 mapTag = '[object Map]',
35723 numberTag = '[object Number]',
35724 regexpTag = '[object RegExp]',
35725 setTag = '[object Set]',
35726 stringTag = '[object String]',
35727 symbolTag = '[object Symbol]';
35728
35729var arrayBufferTag = '[object ArrayBuffer]',
35730 dataViewTag = '[object DataView]',
35731 float32Tag = '[object Float32Array]',
35732 float64Tag = '[object Float64Array]',
35733 int8Tag = '[object Int8Array]',
35734 int16Tag = '[object Int16Array]',
35735 int32Tag = '[object Int32Array]',
35736 uint8Tag = '[object Uint8Array]',
35737 uint8ClampedTag = '[object Uint8ClampedArray]',
35738 uint16Tag = '[object Uint16Array]',
35739 uint32Tag = '[object Uint32Array]';
35740
35741/**
35742 * Initializes an object clone based on its `toStringTag`.
35743 *
35744 * **Note:** This function only supports cloning values with tags of
35745 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
35746 *
35747 * @private
35748 * @param {Object} object The object to clone.
35749 * @param {string} tag The `toStringTag` of the object to clone.
35750 * @param {Function} cloneFunc The function to clone values.
35751 * @param {boolean} [isDeep] Specify a deep clone.
35752 * @returns {Object} Returns the initialized clone.
35753 */
35754function initCloneByTag(object, tag, cloneFunc, isDeep) {
35755 var Ctor = object.constructor;
35756 switch (tag) {
35757 case arrayBufferTag:
35758 return cloneArrayBuffer(object);
35759
35760 case boolTag:
35761 case dateTag:
35762 return new Ctor(+object);
35763
35764 case dataViewTag:
35765 return cloneDataView(object, isDeep);
35766
35767 case float32Tag: case float64Tag:
35768 case int8Tag: case int16Tag: case int32Tag:
35769 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
35770 return cloneTypedArray(object, isDeep);
35771
35772 case mapTag:
35773 return cloneMap(object, isDeep, cloneFunc);
35774
35775 case numberTag:
35776 case stringTag:
35777 return new Ctor(object);
35778
35779 case regexpTag:
35780 return cloneRegExp(object);
35781
35782 case setTag:
35783 return cloneSet(object, isDeep, cloneFunc);
35784
35785 case symbolTag:
35786 return cloneSymbol(object);
35787 }
35788}
35789
35790module.exports = initCloneByTag;
35791
35792},{"./_cloneArrayBuffer":325,"./_cloneDataView":327,"./_cloneMap":328,"./_cloneRegExp":329,"./_cloneSet":330,"./_cloneSymbol":331,"./_cloneTypedArray":332}],370:[function(require,module,exports){
35793var baseCreate = require('./_baseCreate'),
35794 getPrototype = require('./_getPrototype'),
35795 isPrototype = require('./_isPrototype');
35796
35797/**
35798 * Initializes an object clone.
35799 *
35800 * @private
35801 * @param {Object} object The object to clone.
35802 * @returns {Object} Returns the initialized clone.
35803 */
35804function initCloneObject(object) {
35805 return (typeof object.constructor == 'function' && !isPrototype(object))
35806 ? baseCreate(getPrototype(object))
35807 : {};
35808}
35809
35810module.exports = initCloneObject;
35811
35812},{"./_baseCreate":283,"./_getPrototype":356,"./_isPrototype":377}],371:[function(require,module,exports){
35813var Symbol = require('./_Symbol'),
35814 isArguments = require('./isArguments'),
35815 isArray = require('./isArray');
35816
35817/** Built-in value references. */
35818var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;
35819
35820/**
35821 * Checks if `value` is a flattenable `arguments` object or array.
35822 *
35823 * @private
35824 * @param {*} value The value to check.
35825 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
35826 */
35827function isFlattenable(value) {
35828 return isArray(value) || isArguments(value) ||
35829 !!(spreadableSymbol && value && value[spreadableSymbol]);
35830}
35831
35832module.exports = isFlattenable;
35833
35834},{"./_Symbol":260,"./isArguments":432,"./isArray":433}],372:[function(require,module,exports){
35835/** Used as references for various `Number` constants. */
35836var MAX_SAFE_INTEGER = 9007199254740991;
35837
35838/** Used to detect unsigned integer values. */
35839var reIsUint = /^(?:0|[1-9]\d*)$/;
35840
35841/**
35842 * Checks if `value` is a valid array-like index.
35843 *
35844 * @private
35845 * @param {*} value The value to check.
35846 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
35847 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
35848 */
35849function isIndex(value, length) {
35850 length = length == null ? MAX_SAFE_INTEGER : length;
35851 return !!length &&
35852 (typeof value == 'number' || reIsUint.test(value)) &&
35853 (value > -1 && value % 1 == 0 && value < length);
35854}
35855
35856module.exports = isIndex;
35857
35858},{}],373:[function(require,module,exports){
35859var eq = require('./eq'),
35860 isArrayLike = require('./isArrayLike'),
35861 isIndex = require('./_isIndex'),
35862 isObject = require('./isObject');
35863
35864/**
35865 * Checks if the given arguments are from an iteratee call.
35866 *
35867 * @private
35868 * @param {*} value The potential iteratee value argument.
35869 * @param {*} index The potential iteratee index or key argument.
35870 * @param {*} object The potential iteratee object argument.
35871 * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
35872 * else `false`.
35873 */
35874function isIterateeCall(value, index, object) {
35875 if (!isObject(object)) {
35876 return false;
35877 }
35878 var type = typeof index;
35879 if (type == 'number'
35880 ? (isArrayLike(object) && isIndex(index, object.length))
35881 : (type == 'string' && index in object)
35882 ) {
35883 return eq(object[index], value);
35884 }
35885 return false;
35886}
35887
35888module.exports = isIterateeCall;
35889
35890},{"./_isIndex":372,"./eq":421,"./isArrayLike":434,"./isObject":440}],374:[function(require,module,exports){
35891var isArray = require('./isArray'),
35892 isSymbol = require('./isSymbol');
35893
35894/** Used to match property names within property paths. */
35895var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
35896 reIsPlainProp = /^\w*$/;
35897
35898/**
35899 * Checks if `value` is a property name and not a property path.
35900 *
35901 * @private
35902 * @param {*} value The value to check.
35903 * @param {Object} [object] The object to query keys on.
35904 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
35905 */
35906function isKey(value, object) {
35907 if (isArray(value)) {
35908 return false;
35909 }
35910 var type = typeof value;
35911 if (type == 'number' || type == 'symbol' || type == 'boolean' ||
35912 value == null || isSymbol(value)) {
35913 return true;
35914 }
35915 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
35916 (object != null && value in Object(object));
35917}
35918
35919module.exports = isKey;
35920
35921},{"./isArray":433,"./isSymbol":445}],375:[function(require,module,exports){
35922/**
35923 * Checks if `value` is suitable for use as unique object key.
35924 *
35925 * @private
35926 * @param {*} value The value to check.
35927 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
35928 */
35929function isKeyable(value) {
35930 var type = typeof value;
35931 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
35932 ? (value !== '__proto__')
35933 : (value === null);
35934}
35935
35936module.exports = isKeyable;
35937
35938},{}],376:[function(require,module,exports){
35939var coreJsData = require('./_coreJsData');
35940
35941/** Used to detect methods masquerading as native. */
35942var maskSrcKey = (function() {
35943 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
35944 return uid ? ('Symbol(src)_1.' + uid) : '';
35945}());
35946
35947/**
35948 * Checks if `func` has its source masked.
35949 *
35950 * @private
35951 * @param {Function} func The function to check.
35952 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
35953 */
35954function isMasked(func) {
35955 return !!maskSrcKey && (maskSrcKey in func);
35956}
35957
35958module.exports = isMasked;
35959
35960},{"./_coreJsData":339}],377:[function(require,module,exports){
35961/** Used for built-in method references. */
35962var objectProto = Object.prototype;
35963
35964/**
35965 * Checks if `value` is likely a prototype object.
35966 *
35967 * @private
35968 * @param {*} value The value to check.
35969 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
35970 */
35971function isPrototype(value) {
35972 var Ctor = value && value.constructor,
35973 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
35974
35975 return value === proto;
35976}
35977
35978module.exports = isPrototype;
35979
35980},{}],378:[function(require,module,exports){
35981var isObject = require('./isObject');
35982
35983/**
35984 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
35985 *
35986 * @private
35987 * @param {*} value The value to check.
35988 * @returns {boolean} Returns `true` if `value` if suitable for strict
35989 * equality comparisons, else `false`.
35990 */
35991function isStrictComparable(value) {
35992 return value === value && !isObject(value);
35993}
35994
35995module.exports = isStrictComparable;
35996
35997},{"./isObject":440}],379:[function(require,module,exports){
35998/**
35999 * Removes all key-value entries from the list cache.
36000 *
36001 * @private
36002 * @name clear
36003 * @memberOf ListCache
36004 */
36005function listCacheClear() {
36006 this.__data__ = [];
36007 this.size = 0;
36008}
36009
36010module.exports = listCacheClear;
36011
36012},{}],380:[function(require,module,exports){
36013var assocIndexOf = require('./_assocIndexOf');
36014
36015/** Used for built-in method references. */
36016var arrayProto = Array.prototype;
36017
36018/** Built-in value references. */
36019var splice = arrayProto.splice;
36020
36021/**
36022 * Removes `key` and its value from the list cache.
36023 *
36024 * @private
36025 * @name delete
36026 * @memberOf ListCache
36027 * @param {string} key The key of the value to remove.
36028 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
36029 */
36030function listCacheDelete(key) {
36031 var data = this.__data__,
36032 index = assocIndexOf(data, key);
36033
36034 if (index < 0) {
36035 return false;
36036 }
36037 var lastIndex = data.length - 1;
36038 if (index == lastIndex) {
36039 data.pop();
36040 } else {
36041 splice.call(data, index, 1);
36042 }
36043 --this.size;
36044 return true;
36045}
36046
36047module.exports = listCacheDelete;
36048
36049},{"./_assocIndexOf":277}],381:[function(require,module,exports){
36050var assocIndexOf = require('./_assocIndexOf');
36051
36052/**
36053 * Gets the list cache value for `key`.
36054 *
36055 * @private
36056 * @name get
36057 * @memberOf ListCache
36058 * @param {string} key The key of the value to get.
36059 * @returns {*} Returns the entry value.
36060 */
36061function listCacheGet(key) {
36062 var data = this.__data__,
36063 index = assocIndexOf(data, key);
36064
36065 return index < 0 ? undefined : data[index][1];
36066}
36067
36068module.exports = listCacheGet;
36069
36070},{"./_assocIndexOf":277}],382:[function(require,module,exports){
36071var assocIndexOf = require('./_assocIndexOf');
36072
36073/**
36074 * Checks if a list cache value for `key` exists.
36075 *
36076 * @private
36077 * @name has
36078 * @memberOf ListCache
36079 * @param {string} key The key of the entry to check.
36080 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
36081 */
36082function listCacheHas(key) {
36083 return assocIndexOf(this.__data__, key) > -1;
36084}
36085
36086module.exports = listCacheHas;
36087
36088},{"./_assocIndexOf":277}],383:[function(require,module,exports){
36089var assocIndexOf = require('./_assocIndexOf');
36090
36091/**
36092 * Sets the list cache `key` to `value`.
36093 *
36094 * @private
36095 * @name set
36096 * @memberOf ListCache
36097 * @param {string} key The key of the value to set.
36098 * @param {*} value The value to set.
36099 * @returns {Object} Returns the list cache instance.
36100 */
36101function listCacheSet(key, value) {
36102 var data = this.__data__,
36103 index = assocIndexOf(data, key);
36104
36105 if (index < 0) {
36106 ++this.size;
36107 data.push([key, value]);
36108 } else {
36109 data[index][1] = value;
36110 }
36111 return this;
36112}
36113
36114module.exports = listCacheSet;
36115
36116},{"./_assocIndexOf":277}],384:[function(require,module,exports){
36117var Hash = require('./_Hash'),
36118 ListCache = require('./_ListCache'),
36119 Map = require('./_Map');
36120
36121/**
36122 * Removes all key-value entries from the map.
36123 *
36124 * @private
36125 * @name clear
36126 * @memberOf MapCache
36127 */
36128function mapCacheClear() {
36129 this.size = 0;
36130 this.__data__ = {
36131 'hash': new Hash,
36132 'map': new (Map || ListCache),
36133 'string': new Hash
36134 };
36135}
36136
36137module.exports = mapCacheClear;
36138
36139},{"./_Hash":252,"./_ListCache":253,"./_Map":254}],385:[function(require,module,exports){
36140var getMapData = require('./_getMapData');
36141
36142/**
36143 * Removes `key` and its value from the map.
36144 *
36145 * @private
36146 * @name delete
36147 * @memberOf MapCache
36148 * @param {string} key The key of the value to remove.
36149 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
36150 */
36151function mapCacheDelete(key) {
36152 var result = getMapData(this, key)['delete'](key);
36153 this.size -= result ? 1 : 0;
36154 return result;
36155}
36156
36157module.exports = mapCacheDelete;
36158
36159},{"./_getMapData":353}],386:[function(require,module,exports){
36160var getMapData = require('./_getMapData');
36161
36162/**
36163 * Gets the map value for `key`.
36164 *
36165 * @private
36166 * @name get
36167 * @memberOf MapCache
36168 * @param {string} key The key of the value to get.
36169 * @returns {*} Returns the entry value.
36170 */
36171function mapCacheGet(key) {
36172 return getMapData(this, key).get(key);
36173}
36174
36175module.exports = mapCacheGet;
36176
36177},{"./_getMapData":353}],387:[function(require,module,exports){
36178var getMapData = require('./_getMapData');
36179
36180/**
36181 * Checks if a map value for `key` exists.
36182 *
36183 * @private
36184 * @name has
36185 * @memberOf MapCache
36186 * @param {string} key The key of the entry to check.
36187 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
36188 */
36189function mapCacheHas(key) {
36190 return getMapData(this, key).has(key);
36191}
36192
36193module.exports = mapCacheHas;
36194
36195},{"./_getMapData":353}],388:[function(require,module,exports){
36196var getMapData = require('./_getMapData');
36197
36198/**
36199 * Sets the map `key` to `value`.
36200 *
36201 * @private
36202 * @name set
36203 * @memberOf MapCache
36204 * @param {string} key The key of the value to set.
36205 * @param {*} value The value to set.
36206 * @returns {Object} Returns the map cache instance.
36207 */
36208function mapCacheSet(key, value) {
36209 var data = getMapData(this, key),
36210 size = data.size;
36211
36212 data.set(key, value);
36213 this.size += data.size == size ? 0 : 1;
36214 return this;
36215}
36216
36217module.exports = mapCacheSet;
36218
36219},{"./_getMapData":353}],389:[function(require,module,exports){
36220/**
36221 * Converts `map` to its key-value pairs.
36222 *
36223 * @private
36224 * @param {Object} map The map to convert.
36225 * @returns {Array} Returns the key-value pairs.
36226 */
36227function mapToArray(map) {
36228 var index = -1,
36229 result = Array(map.size);
36230
36231 map.forEach(function(value, key) {
36232 result[++index] = [key, value];
36233 });
36234 return result;
36235}
36236
36237module.exports = mapToArray;
36238
36239},{}],390:[function(require,module,exports){
36240/**
36241 * A specialized version of `matchesProperty` for source values suitable
36242 * for strict equality comparisons, i.e. `===`.
36243 *
36244 * @private
36245 * @param {string} key The key of the property to get.
36246 * @param {*} srcValue The value to match.
36247 * @returns {Function} Returns the new spec function.
36248 */
36249function matchesStrictComparable(key, srcValue) {
36250 return function(object) {
36251 if (object == null) {
36252 return false;
36253 }
36254 return object[key] === srcValue &&
36255 (srcValue !== undefined || (key in Object(object)));
36256 };
36257}
36258
36259module.exports = matchesStrictComparable;
36260
36261},{}],391:[function(require,module,exports){
36262var memoize = require('./memoize');
36263
36264/** Used as the maximum memoize cache size. */
36265var MAX_MEMOIZE_SIZE = 500;
36266
36267/**
36268 * A specialized version of `_.memoize` which clears the memoized function's
36269 * cache when it exceeds `MAX_MEMOIZE_SIZE`.
36270 *
36271 * @private
36272 * @param {Function} func The function to have its output memoized.
36273 * @returns {Function} Returns the new memoized function.
36274 */
36275function memoizeCapped(func) {
36276 var result = memoize(func, function(key) {
36277 if (cache.size === MAX_MEMOIZE_SIZE) {
36278 cache.clear();
36279 }
36280 return key;
36281 });
36282
36283 var cache = result.cache;
36284 return result;
36285}
36286
36287module.exports = memoizeCapped;
36288
36289},{"./memoize":450}],392:[function(require,module,exports){
36290var getNative = require('./_getNative');
36291
36292/* Built-in method references that are verified to be native. */
36293var nativeCreate = getNative(Object, 'create');
36294
36295module.exports = nativeCreate;
36296
36297},{"./_getNative":355}],393:[function(require,module,exports){
36298var overArg = require('./_overArg');
36299
36300/* Built-in method references for those with the same name as other `lodash` methods. */
36301var nativeKeys = overArg(Object.keys, Object);
36302
36303module.exports = nativeKeys;
36304
36305},{"./_overArg":397}],394:[function(require,module,exports){
36306/**
36307 * This function is like
36308 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
36309 * except that it includes inherited enumerable properties.
36310 *
36311 * @private
36312 * @param {Object} object The object to query.
36313 * @returns {Array} Returns the array of property names.
36314 */
36315function nativeKeysIn(object) {
36316 var result = [];
36317 if (object != null) {
36318 for (var key in Object(object)) {
36319 result.push(key);
36320 }
36321 }
36322 return result;
36323}
36324
36325module.exports = nativeKeysIn;
36326
36327},{}],395:[function(require,module,exports){
36328var freeGlobal = require('./_freeGlobal');
36329
36330/** Detect free variable `exports`. */
36331var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
36332
36333/** Detect free variable `module`. */
36334var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
36335
36336/** Detect the popular CommonJS extension `module.exports`. */
36337var moduleExports = freeModule && freeModule.exports === freeExports;
36338
36339/** Detect free variable `process` from Node.js. */
36340var freeProcess = moduleExports && freeGlobal.process;
36341
36342/** Used to access faster Node.js helpers. */
36343var nodeUtil = (function() {
36344 try {
36345 return freeProcess && freeProcess.binding && freeProcess.binding('util');
36346 } catch (e) {}
36347}());
36348
36349module.exports = nodeUtil;
36350
36351},{"./_freeGlobal":350}],396:[function(require,module,exports){
36352/** Used for built-in method references. */
36353var objectProto = Object.prototype;
36354
36355/**
36356 * Used to resolve the
36357 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
36358 * of values.
36359 */
36360var nativeObjectToString = objectProto.toString;
36361
36362/**
36363 * Converts `value` to a string using `Object.prototype.toString`.
36364 *
36365 * @private
36366 * @param {*} value The value to convert.
36367 * @returns {string} Returns the converted string.
36368 */
36369function objectToString(value) {
36370 return nativeObjectToString.call(value);
36371}
36372
36373module.exports = objectToString;
36374
36375},{}],397:[function(require,module,exports){
36376/**
36377 * Creates a unary function that invokes `func` with its argument transformed.
36378 *
36379 * @private
36380 * @param {Function} func The function to wrap.
36381 * @param {Function} transform The argument transform.
36382 * @returns {Function} Returns the new function.
36383 */
36384function overArg(func, transform) {
36385 return function(arg) {
36386 return func(transform(arg));
36387 };
36388}
36389
36390module.exports = overArg;
36391
36392},{}],398:[function(require,module,exports){
36393var apply = require('./_apply');
36394
36395/* Built-in method references for those with the same name as other `lodash` methods. */
36396var nativeMax = Math.max;
36397
36398/**
36399 * A specialized version of `baseRest` which transforms the rest array.
36400 *
36401 * @private
36402 * @param {Function} func The function to apply a rest parameter to.
36403 * @param {number} [start=func.length-1] The start position of the rest parameter.
36404 * @param {Function} transform The rest array transform.
36405 * @returns {Function} Returns the new function.
36406 */
36407function overRest(func, start, transform) {
36408 start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
36409 return function() {
36410 var args = arguments,
36411 index = -1,
36412 length = nativeMax(args.length - start, 0),
36413 array = Array(length);
36414
36415 while (++index < length) {
36416 array[index] = args[start + index];
36417 }
36418 index = -1;
36419 var otherArgs = Array(start + 1);
36420 while (++index < start) {
36421 otherArgs[index] = args[index];
36422 }
36423 otherArgs[start] = transform(array);
36424 return apply(func, this, otherArgs);
36425 };
36426}
36427
36428module.exports = overRest;
36429
36430},{"./_apply":265}],399:[function(require,module,exports){
36431var freeGlobal = require('./_freeGlobal');
36432
36433/** Detect free variable `self`. */
36434var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
36435
36436/** Used as a reference to the global object. */
36437var root = freeGlobal || freeSelf || Function('return this')();
36438
36439module.exports = root;
36440
36441},{"./_freeGlobal":350}],400:[function(require,module,exports){
36442/** Used to stand-in for `undefined` hash values. */
36443var HASH_UNDEFINED = '__lodash_hash_undefined__';
36444
36445/**
36446 * Adds `value` to the array cache.
36447 *
36448 * @private
36449 * @name add
36450 * @memberOf SetCache
36451 * @alias push
36452 * @param {*} value The value to cache.
36453 * @returns {Object} Returns the cache instance.
36454 */
36455function setCacheAdd(value) {
36456 this.__data__.set(value, HASH_UNDEFINED);
36457 return this;
36458}
36459
36460module.exports = setCacheAdd;
36461
36462},{}],401:[function(require,module,exports){
36463/**
36464 * Checks if `value` is in the array cache.
36465 *
36466 * @private
36467 * @name has
36468 * @memberOf SetCache
36469 * @param {*} value The value to search for.
36470 * @returns {number} Returns `true` if `value` is found, else `false`.
36471 */
36472function setCacheHas(value) {
36473 return this.__data__.has(value);
36474}
36475
36476module.exports = setCacheHas;
36477
36478},{}],402:[function(require,module,exports){
36479/**
36480 * Converts `set` to an array of its values.
36481 *
36482 * @private
36483 * @param {Object} set The set to convert.
36484 * @returns {Array} Returns the values.
36485 */
36486function setToArray(set) {
36487 var index = -1,
36488 result = Array(set.size);
36489
36490 set.forEach(function(value) {
36491 result[++index] = value;
36492 });
36493 return result;
36494}
36495
36496module.exports = setToArray;
36497
36498},{}],403:[function(require,module,exports){
36499var baseSetToString = require('./_baseSetToString'),
36500 shortOut = require('./_shortOut');
36501
36502/**
36503 * Sets the `toString` method of `func` to return `string`.
36504 *
36505 * @private
36506 * @param {Function} func The function to modify.
36507 * @param {Function} string The `toString` result.
36508 * @returns {Function} Returns `func`.
36509 */
36510var setToString = shortOut(baseSetToString);
36511
36512module.exports = setToString;
36513
36514},{"./_baseSetToString":316,"./_shortOut":404}],404:[function(require,module,exports){
36515/** Used to detect hot functions by number of calls within a span of milliseconds. */
36516var HOT_COUNT = 800,
36517 HOT_SPAN = 16;
36518
36519/* Built-in method references for those with the same name as other `lodash` methods. */
36520var nativeNow = Date.now;
36521
36522/**
36523 * Creates a function that'll short out and invoke `identity` instead
36524 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
36525 * milliseconds.
36526 *
36527 * @private
36528 * @param {Function} func The function to restrict.
36529 * @returns {Function} Returns the new shortable function.
36530 */
36531function shortOut(func) {
36532 var count = 0,
36533 lastCalled = 0;
36534
36535 return function() {
36536 var stamp = nativeNow(),
36537 remaining = HOT_SPAN - (stamp - lastCalled);
36538
36539 lastCalled = stamp;
36540 if (remaining > 0) {
36541 if (++count >= HOT_COUNT) {
36542 return arguments[0];
36543 }
36544 } else {
36545 count = 0;
36546 }
36547 return func.apply(undefined, arguments);
36548 };
36549}
36550
36551module.exports = shortOut;
36552
36553},{}],405:[function(require,module,exports){
36554var ListCache = require('./_ListCache');
36555
36556/**
36557 * Removes all key-value entries from the stack.
36558 *
36559 * @private
36560 * @name clear
36561 * @memberOf Stack
36562 */
36563function stackClear() {
36564 this.__data__ = new ListCache;
36565 this.size = 0;
36566}
36567
36568module.exports = stackClear;
36569
36570},{"./_ListCache":253}],406:[function(require,module,exports){
36571/**
36572 * Removes `key` and its value from the stack.
36573 *
36574 * @private
36575 * @name delete
36576 * @memberOf Stack
36577 * @param {string} key The key of the value to remove.
36578 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
36579 */
36580function stackDelete(key) {
36581 var data = this.__data__,
36582 result = data['delete'](key);
36583
36584 this.size = data.size;
36585 return result;
36586}
36587
36588module.exports = stackDelete;
36589
36590},{}],407:[function(require,module,exports){
36591/**
36592 * Gets the stack value for `key`.
36593 *
36594 * @private
36595 * @name get
36596 * @memberOf Stack
36597 * @param {string} key The key of the value to get.
36598 * @returns {*} Returns the entry value.
36599 */
36600function stackGet(key) {
36601 return this.__data__.get(key);
36602}
36603
36604module.exports = stackGet;
36605
36606},{}],408:[function(require,module,exports){
36607/**
36608 * Checks if a stack value for `key` exists.
36609 *
36610 * @private
36611 * @name has
36612 * @memberOf Stack
36613 * @param {string} key The key of the entry to check.
36614 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
36615 */
36616function stackHas(key) {
36617 return this.__data__.has(key);
36618}
36619
36620module.exports = stackHas;
36621
36622},{}],409:[function(require,module,exports){
36623var ListCache = require('./_ListCache'),
36624 Map = require('./_Map'),
36625 MapCache = require('./_MapCache');
36626
36627/** Used as the size to enable large array optimizations. */
36628var LARGE_ARRAY_SIZE = 200;
36629
36630/**
36631 * Sets the stack `key` to `value`.
36632 *
36633 * @private
36634 * @name set
36635 * @memberOf Stack
36636 * @param {string} key The key of the value to set.
36637 * @param {*} value The value to set.
36638 * @returns {Object} Returns the stack cache instance.
36639 */
36640function stackSet(key, value) {
36641 var data = this.__data__;
36642 if (data instanceof ListCache) {
36643 var pairs = data.__data__;
36644 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
36645 pairs.push([key, value]);
36646 this.size = ++data.size;
36647 return this;
36648 }
36649 data = this.__data__ = new MapCache(pairs);
36650 }
36651 data.set(key, value);
36652 this.size = data.size;
36653 return this;
36654}
36655
36656module.exports = stackSet;
36657
36658},{"./_ListCache":253,"./_Map":254,"./_MapCache":255}],410:[function(require,module,exports){
36659/**
36660 * A specialized version of `_.indexOf` which performs strict equality
36661 * comparisons of values, i.e. `===`.
36662 *
36663 * @private
36664 * @param {Array} array The array to inspect.
36665 * @param {*} value The value to search for.
36666 * @param {number} fromIndex The index to search from.
36667 * @returns {number} Returns the index of the matched value, else `-1`.
36668 */
36669function strictIndexOf(array, value, fromIndex) {
36670 var index = fromIndex - 1,
36671 length = array.length;
36672
36673 while (++index < length) {
36674 if (array[index] === value) {
36675 return index;
36676 }
36677 }
36678 return -1;
36679}
36680
36681module.exports = strictIndexOf;
36682
36683},{}],411:[function(require,module,exports){
36684var memoizeCapped = require('./_memoizeCapped');
36685
36686/** Used to match property names within property paths. */
36687var reLeadingDot = /^\./,
36688 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
36689
36690/** Used to match backslashes in property paths. */
36691var reEscapeChar = /\\(\\)?/g;
36692
36693/**
36694 * Converts `string` to a property path array.
36695 *
36696 * @private
36697 * @param {string} string The string to convert.
36698 * @returns {Array} Returns the property path array.
36699 */
36700var stringToPath = memoizeCapped(function(string) {
36701 var result = [];
36702 if (reLeadingDot.test(string)) {
36703 result.push('');
36704 }
36705 string.replace(rePropName, function(match, number, quote, string) {
36706 result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
36707 });
36708 return result;
36709});
36710
36711module.exports = stringToPath;
36712
36713},{"./_memoizeCapped":391}],412:[function(require,module,exports){
36714var isSymbol = require('./isSymbol');
36715
36716/** Used as references for various `Number` constants. */
36717var INFINITY = 1 / 0;
36718
36719/**
36720 * Converts `value` to a string key if it's not a string or symbol.
36721 *
36722 * @private
36723 * @param {*} value The value to inspect.
36724 * @returns {string|symbol} Returns the key.
36725 */
36726function toKey(value) {
36727 if (typeof value == 'string' || isSymbol(value)) {
36728 return value;
36729 }
36730 var result = (value + '');
36731 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
36732}
36733
36734module.exports = toKey;
36735
36736},{"./isSymbol":445}],413:[function(require,module,exports){
36737/** Used for built-in method references. */
36738var funcProto = Function.prototype;
36739
36740/** Used to resolve the decompiled source of functions. */
36741var funcToString = funcProto.toString;
36742
36743/**
36744 * Converts `func` to its source code.
36745 *
36746 * @private
36747 * @param {Function} func The function to convert.
36748 * @returns {string} Returns the source code.
36749 */
36750function toSource(func) {
36751 if (func != null) {
36752 try {
36753 return funcToString.call(func);
36754 } catch (e) {}
36755 try {
36756 return (func + '');
36757 } catch (e) {}
36758 }
36759 return '';
36760}
36761
36762module.exports = toSource;
36763
36764},{}],414:[function(require,module,exports){
36765var assignValue = require('./_assignValue'),
36766 copyObject = require('./_copyObject'),
36767 createAssigner = require('./_createAssigner'),
36768 isArrayLike = require('./isArrayLike'),
36769 isPrototype = require('./_isPrototype'),
36770 keys = require('./keys');
36771
36772/** Used for built-in method references. */
36773var objectProto = Object.prototype;
36774
36775/** Used to check objects for own properties. */
36776var hasOwnProperty = objectProto.hasOwnProperty;
36777
36778/**
36779 * Assigns own enumerable string keyed properties of source objects to the
36780 * destination object. Source objects are applied from left to right.
36781 * Subsequent sources overwrite property assignments of previous sources.
36782 *
36783 * **Note:** This method mutates `object` and is loosely based on
36784 * [`Object.assign`](https://mdn.io/Object/assign).
36785 *
36786 * @static
36787 * @memberOf _
36788 * @since 0.10.0
36789 * @category Object
36790 * @param {Object} object The destination object.
36791 * @param {...Object} [sources] The source objects.
36792 * @returns {Object} Returns `object`.
36793 * @see _.assignIn
36794 * @example
36795 *
36796 * function Foo() {
36797 * this.a = 1;
36798 * }
36799 *
36800 * function Bar() {
36801 * this.c = 3;
36802 * }
36803 *
36804 * Foo.prototype.b = 2;
36805 * Bar.prototype.d = 4;
36806 *
36807 * _.assign({ 'a': 0 }, new Foo, new Bar);
36808 * // => { 'a': 1, 'c': 3 }
36809 */
36810var assign = createAssigner(function(object, source) {
36811 if (isPrototype(source) || isArrayLike(source)) {
36812 copyObject(source, keys(source), object);
36813 return;
36814 }
36815 for (var key in source) {
36816 if (hasOwnProperty.call(source, key)) {
36817 assignValue(object, key, source[key]);
36818 }
36819 }
36820});
36821
36822module.exports = assign;
36823
36824},{"./_assignValue":276,"./_copyObject":336,"./_createAssigner":340,"./_isPrototype":377,"./isArrayLike":434,"./keys":447}],415:[function(require,module,exports){
36825var copyObject = require('./_copyObject'),
36826 createAssigner = require('./_createAssigner'),
36827 keysIn = require('./keysIn');
36828
36829/**
36830 * This method is like `_.assignIn` except that it accepts `customizer`
36831 * which is invoked to produce the assigned values. If `customizer` returns
36832 * `undefined`, assignment is handled by the method instead. The `customizer`
36833 * is invoked with five arguments: (objValue, srcValue, key, object, source).
36834 *
36835 * **Note:** This method mutates `object`.
36836 *
36837 * @static
36838 * @memberOf _
36839 * @since 4.0.0
36840 * @alias extendWith
36841 * @category Object
36842 * @param {Object} object The destination object.
36843 * @param {...Object} sources The source objects.
36844 * @param {Function} [customizer] The function to customize assigned values.
36845 * @returns {Object} Returns `object`.
36846 * @see _.assignWith
36847 * @example
36848 *
36849 * function customizer(objValue, srcValue) {
36850 * return _.isUndefined(objValue) ? srcValue : objValue;
36851 * }
36852 *
36853 * var defaults = _.partialRight(_.assignInWith, customizer);
36854 *
36855 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
36856 * // => { 'a': 1, 'b': 2 }
36857 */
36858var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
36859 copyObject(source, keysIn(source), object, customizer);
36860});
36861
36862module.exports = assignInWith;
36863
36864},{"./_copyObject":336,"./_createAssigner":340,"./keysIn":448}],416:[function(require,module,exports){
36865var baseClone = require('./_baseClone');
36866
36867/** Used to compose bitmasks for cloning. */
36868var CLONE_SYMBOLS_FLAG = 4;
36869
36870/**
36871 * Creates a shallow clone of `value`.
36872 *
36873 * **Note:** This method is loosely based on the
36874 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
36875 * and supports cloning arrays, array buffers, booleans, date objects, maps,
36876 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
36877 * arrays. The own enumerable properties of `arguments` objects are cloned
36878 * as plain objects. An empty object is returned for uncloneable values such
36879 * as error objects, functions, DOM nodes, and WeakMaps.
36880 *
36881 * @static
36882 * @memberOf _
36883 * @since 0.1.0
36884 * @category Lang
36885 * @param {*} value The value to clone.
36886 * @returns {*} Returns the cloned value.
36887 * @see _.cloneDeep
36888 * @example
36889 *
36890 * var objects = [{ 'a': 1 }, { 'b': 2 }];
36891 *
36892 * var shallow = _.clone(objects);
36893 * console.log(shallow[0] === objects[0]);
36894 * // => true
36895 */
36896function clone(value) {
36897 return baseClone(value, CLONE_SYMBOLS_FLAG);
36898}
36899
36900module.exports = clone;
36901
36902},{"./_baseClone":282}],417:[function(require,module,exports){
36903var baseClone = require('./_baseClone');
36904
36905/** Used to compose bitmasks for cloning. */
36906var CLONE_DEEP_FLAG = 1,
36907 CLONE_SYMBOLS_FLAG = 4;
36908
36909/**
36910 * This method is like `_.clone` except that it recursively clones `value`.
36911 *
36912 * @static
36913 * @memberOf _
36914 * @since 1.0.0
36915 * @category Lang
36916 * @param {*} value The value to recursively clone.
36917 * @returns {*} Returns the deep cloned value.
36918 * @see _.clone
36919 * @example
36920 *
36921 * var objects = [{ 'a': 1 }, { 'b': 2 }];
36922 *
36923 * var deep = _.cloneDeep(objects);
36924 * console.log(deep[0] === objects[0]);
36925 * // => false
36926 */
36927function cloneDeep(value) {
36928 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
36929}
36930
36931module.exports = cloneDeep;
36932
36933},{"./_baseClone":282}],418:[function(require,module,exports){
36934var baseClone = require('./_baseClone');
36935
36936/** Used to compose bitmasks for cloning. */
36937var CLONE_DEEP_FLAG = 1,
36938 CLONE_SYMBOLS_FLAG = 4;
36939
36940/**
36941 * This method is like `_.cloneWith` except that it recursively clones `value`.
36942 *
36943 * @static
36944 * @memberOf _
36945 * @since 4.0.0
36946 * @category Lang
36947 * @param {*} value The value to recursively clone.
36948 * @param {Function} [customizer] The function to customize cloning.
36949 * @returns {*} Returns the deep cloned value.
36950 * @see _.cloneWith
36951 * @example
36952 *
36953 * function customizer(value) {
36954 * if (_.isElement(value)) {
36955 * return value.cloneNode(true);
36956 * }
36957 * }
36958 *
36959 * var el = _.cloneDeepWith(document.body, customizer);
36960 *
36961 * console.log(el === document.body);
36962 * // => false
36963 * console.log(el.nodeName);
36964 * // => 'BODY'
36965 * console.log(el.childNodes.length);
36966 * // => 20
36967 */
36968function cloneDeepWith(value, customizer) {
36969 customizer = typeof customizer == 'function' ? customizer : undefined;
36970 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
36971}
36972
36973module.exports = cloneDeepWith;
36974
36975},{"./_baseClone":282}],419:[function(require,module,exports){
36976/**
36977 * Creates a function that returns `value`.
36978 *
36979 * @static
36980 * @memberOf _
36981 * @since 2.4.0
36982 * @category Util
36983 * @param {*} value The value to return from the new function.
36984 * @returns {Function} Returns the new constant function.
36985 * @example
36986 *
36987 * var objects = _.times(2, _.constant({ 'a': 1 }));
36988 *
36989 * console.log(objects);
36990 * // => [{ 'a': 1 }, { 'a': 1 }]
36991 *
36992 * console.log(objects[0] === objects[1]);
36993 * // => true
36994 */
36995function constant(value) {
36996 return function() {
36997 return value;
36998 };
36999}
37000
37001module.exports = constant;
37002
37003},{}],420:[function(require,module,exports){
37004var apply = require('./_apply'),
37005 assignInWith = require('./assignInWith'),
37006 baseRest = require('./_baseRest'),
37007 customDefaultsAssignIn = require('./_customDefaultsAssignIn');
37008
37009/**
37010 * Assigns own and inherited enumerable string keyed properties of source
37011 * objects to the destination object for all destination properties that
37012 * resolve to `undefined`. Source objects are applied from left to right.
37013 * Once a property is set, additional values of the same property are ignored.
37014 *
37015 * **Note:** This method mutates `object`.
37016 *
37017 * @static
37018 * @since 0.1.0
37019 * @memberOf _
37020 * @category Object
37021 * @param {Object} object The destination object.
37022 * @param {...Object} [sources] The source objects.
37023 * @returns {Object} Returns `object`.
37024 * @see _.defaultsDeep
37025 * @example
37026 *
37027 * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
37028 * // => { 'a': 1, 'b': 2 }
37029 */
37030var defaults = baseRest(function(args) {
37031 args.push(undefined, customDefaultsAssignIn);
37032 return apply(assignInWith, undefined, args);
37033});
37034
37035module.exports = defaults;
37036
37037},{"./_apply":265,"./_baseRest":315,"./_customDefaultsAssignIn":345,"./assignInWith":415}],421:[function(require,module,exports){
37038/**
37039 * Performs a
37040 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
37041 * comparison between two values to determine if they are equivalent.
37042 *
37043 * @static
37044 * @memberOf _
37045 * @since 4.0.0
37046 * @category Lang
37047 * @param {*} value The value to compare.
37048 * @param {*} other The other value to compare.
37049 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
37050 * @example
37051 *
37052 * var object = { 'a': 1 };
37053 * var other = { 'a': 1 };
37054 *
37055 * _.eq(object, object);
37056 * // => true
37057 *
37058 * _.eq(object, other);
37059 * // => false
37060 *
37061 * _.eq('a', 'a');
37062 * // => true
37063 *
37064 * _.eq('a', Object('a'));
37065 * // => false
37066 *
37067 * _.eq(NaN, NaN);
37068 * // => true
37069 */
37070function eq(value, other) {
37071 return value === other || (value !== value && other !== other);
37072}
37073
37074module.exports = eq;
37075
37076},{}],422:[function(require,module,exports){
37077var toString = require('./toString');
37078
37079/**
37080 * Used to match `RegExp`
37081 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
37082 */
37083var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
37084 reHasRegExpChar = RegExp(reRegExpChar.source);
37085
37086/**
37087 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
37088 * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
37089 *
37090 * @static
37091 * @memberOf _
37092 * @since 3.0.0
37093 * @category String
37094 * @param {string} [string=''] The string to escape.
37095 * @returns {string} Returns the escaped string.
37096 * @example
37097 *
37098 * _.escapeRegExp('[lodash](https://lodash.com/)');
37099 * // => '\[lodash\]\(https://lodash\.com/\)'
37100 */
37101function escapeRegExp(string) {
37102 string = toString(string);
37103 return (string && reHasRegExpChar.test(string))
37104 ? string.replace(reRegExpChar, '\\$&')
37105 : string;
37106}
37107
37108module.exports = escapeRegExp;
37109
37110},{"./toString":463}],423:[function(require,module,exports){
37111var createFind = require('./_createFind'),
37112 findIndex = require('./findIndex');
37113
37114/**
37115 * Iterates over elements of `collection`, returning the first element
37116 * `predicate` returns truthy for. The predicate is invoked with three
37117 * arguments: (value, index|key, collection).
37118 *
37119 * @static
37120 * @memberOf _
37121 * @since 0.1.0
37122 * @category Collection
37123 * @param {Array|Object} collection The collection to inspect.
37124 * @param {Function} [predicate=_.identity] The function invoked per iteration.
37125 * @param {number} [fromIndex=0] The index to search from.
37126 * @returns {*} Returns the matched element, else `undefined`.
37127 * @example
37128 *
37129 * var users = [
37130 * { 'user': 'barney', 'age': 36, 'active': true },
37131 * { 'user': 'fred', 'age': 40, 'active': false },
37132 * { 'user': 'pebbles', 'age': 1, 'active': true }
37133 * ];
37134 *
37135 * _.find(users, function(o) { return o.age < 40; });
37136 * // => object for 'barney'
37137 *
37138 * // The `_.matches` iteratee shorthand.
37139 * _.find(users, { 'age': 1, 'active': true });
37140 * // => object for 'pebbles'
37141 *
37142 * // The `_.matchesProperty` iteratee shorthand.
37143 * _.find(users, ['active', false]);
37144 * // => object for 'fred'
37145 *
37146 * // The `_.property` iteratee shorthand.
37147 * _.find(users, 'active');
37148 * // => object for 'barney'
37149 */
37150var find = createFind(findIndex);
37151
37152module.exports = find;
37153
37154},{"./_createFind":343,"./findIndex":424}],424:[function(require,module,exports){
37155var baseFindIndex = require('./_baseFindIndex'),
37156 baseIteratee = require('./_baseIteratee'),
37157 toInteger = require('./toInteger');
37158
37159/* Built-in method references for those with the same name as other `lodash` methods. */
37160var nativeMax = Math.max;
37161
37162/**
37163 * This method is like `_.find` except that it returns the index of the first
37164 * element `predicate` returns truthy for instead of the element itself.
37165 *
37166 * @static
37167 * @memberOf _
37168 * @since 1.1.0
37169 * @category Array
37170 * @param {Array} array The array to inspect.
37171 * @param {Function} [predicate=_.identity] The function invoked per iteration.
37172 * @param {number} [fromIndex=0] The index to search from.
37173 * @returns {number} Returns the index of the found element, else `-1`.
37174 * @example
37175 *
37176 * var users = [
37177 * { 'user': 'barney', 'active': false },
37178 * { 'user': 'fred', 'active': false },
37179 * { 'user': 'pebbles', 'active': true }
37180 * ];
37181 *
37182 * _.findIndex(users, function(o) { return o.user == 'barney'; });
37183 * // => 0
37184 *
37185 * // The `_.matches` iteratee shorthand.
37186 * _.findIndex(users, { 'user': 'fred', 'active': false });
37187 * // => 1
37188 *
37189 * // The `_.matchesProperty` iteratee shorthand.
37190 * _.findIndex(users, ['active', false]);
37191 * // => 0
37192 *
37193 * // The `_.property` iteratee shorthand.
37194 * _.findIndex(users, 'active');
37195 * // => 2
37196 */
37197function findIndex(array, predicate, fromIndex) {
37198 var length = array == null ? 0 : array.length;
37199 if (!length) {
37200 return -1;
37201 }
37202 var index = fromIndex == null ? 0 : toInteger(fromIndex);
37203 if (index < 0) {
37204 index = nativeMax(length + index, 0);
37205 }
37206 return baseFindIndex(array, baseIteratee(predicate, 3), index);
37207}
37208
37209module.exports = findIndex;
37210
37211},{"./_baseFindIndex":285,"./_baseIteratee":303,"./toInteger":460}],425:[function(require,module,exports){
37212var createFind = require('./_createFind'),
37213 findLastIndex = require('./findLastIndex');
37214
37215/**
37216 * This method is like `_.find` except that it iterates over elements of
37217 * `collection` from right to left.
37218 *
37219 * @static
37220 * @memberOf _
37221 * @since 2.0.0
37222 * @category Collection
37223 * @param {Array|Object} collection The collection to inspect.
37224 * @param {Function} [predicate=_.identity] The function invoked per iteration.
37225 * @param {number} [fromIndex=collection.length-1] The index to search from.
37226 * @returns {*} Returns the matched element, else `undefined`.
37227 * @example
37228 *
37229 * _.findLast([1, 2, 3, 4], function(n) {
37230 * return n % 2 == 1;
37231 * });
37232 * // => 3
37233 */
37234var findLast = createFind(findLastIndex);
37235
37236module.exports = findLast;
37237
37238},{"./_createFind":343,"./findLastIndex":426}],426:[function(require,module,exports){
37239var baseFindIndex = require('./_baseFindIndex'),
37240 baseIteratee = require('./_baseIteratee'),
37241 toInteger = require('./toInteger');
37242
37243/* Built-in method references for those with the same name as other `lodash` methods. */
37244var nativeMax = Math.max,
37245 nativeMin = Math.min;
37246
37247/**
37248 * This method is like `_.findIndex` except that it iterates over elements
37249 * of `collection` from right to left.
37250 *
37251 * @static
37252 * @memberOf _
37253 * @since 2.0.0
37254 * @category Array
37255 * @param {Array} array The array to inspect.
37256 * @param {Function} [predicate=_.identity] The function invoked per iteration.
37257 * @param {number} [fromIndex=array.length-1] The index to search from.
37258 * @returns {number} Returns the index of the found element, else `-1`.
37259 * @example
37260 *
37261 * var users = [
37262 * { 'user': 'barney', 'active': true },
37263 * { 'user': 'fred', 'active': false },
37264 * { 'user': 'pebbles', 'active': false }
37265 * ];
37266 *
37267 * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
37268 * // => 2
37269 *
37270 * // The `_.matches` iteratee shorthand.
37271 * _.findLastIndex(users, { 'user': 'barney', 'active': true });
37272 * // => 0
37273 *
37274 * // The `_.matchesProperty` iteratee shorthand.
37275 * _.findLastIndex(users, ['active', false]);
37276 * // => 2
37277 *
37278 * // The `_.property` iteratee shorthand.
37279 * _.findLastIndex(users, 'active');
37280 * // => 0
37281 */
37282function findLastIndex(array, predicate, fromIndex) {
37283 var length = array == null ? 0 : array.length;
37284 if (!length) {
37285 return -1;
37286 }
37287 var index = length - 1;
37288 if (fromIndex !== undefined) {
37289 index = toInteger(fromIndex);
37290 index = fromIndex < 0
37291 ? nativeMax(length + index, 0)
37292 : nativeMin(index, length - 1);
37293 }
37294 return baseFindIndex(array, baseIteratee(predicate, 3), index, true);
37295}
37296
37297module.exports = findLastIndex;
37298
37299},{"./_baseFindIndex":285,"./_baseIteratee":303,"./toInteger":460}],427:[function(require,module,exports){
37300var baseGet = require('./_baseGet');
37301
37302/**
37303 * Gets the value at `path` of `object`. If the resolved value is
37304 * `undefined`, the `defaultValue` is returned in its place.
37305 *
37306 * @static
37307 * @memberOf _
37308 * @since 3.7.0
37309 * @category Object
37310 * @param {Object} object The object to query.
37311 * @param {Array|string} path The path of the property to get.
37312 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
37313 * @returns {*} Returns the resolved value.
37314 * @example
37315 *
37316 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
37317 *
37318 * _.get(object, 'a[0].b.c');
37319 * // => 3
37320 *
37321 * _.get(object, ['a', '0', 'b', 'c']);
37322 * // => 3
37323 *
37324 * _.get(object, 'a.b.c', 'default');
37325 * // => 'default'
37326 */
37327function get(object, path, defaultValue) {
37328 var result = object == null ? undefined : baseGet(object, path);
37329 return result === undefined ? defaultValue : result;
37330}
37331
37332module.exports = get;
37333
37334},{"./_baseGet":289}],428:[function(require,module,exports){
37335var baseHas = require('./_baseHas'),
37336 hasPath = require('./_hasPath');
37337
37338/**
37339 * Checks if `path` is a direct property of `object`.
37340 *
37341 * @static
37342 * @since 0.1.0
37343 * @memberOf _
37344 * @category Object
37345 * @param {Object} object The object to query.
37346 * @param {Array|string} path The path to check.
37347 * @returns {boolean} Returns `true` if `path` exists, else `false`.
37348 * @example
37349 *
37350 * var object = { 'a': { 'b': 2 } };
37351 * var other = _.create({ 'a': _.create({ 'b': 2 }) });
37352 *
37353 * _.has(object, 'a');
37354 * // => true
37355 *
37356 * _.has(object, 'a.b');
37357 * // => true
37358 *
37359 * _.has(object, ['a', 'b']);
37360 * // => true
37361 *
37362 * _.has(other, 'a');
37363 * // => false
37364 */
37365function has(object, path) {
37366 return object != null && hasPath(object, path, baseHas);
37367}
37368
37369module.exports = has;
37370
37371},{"./_baseHas":292,"./_hasPath":362}],429:[function(require,module,exports){
37372var baseHasIn = require('./_baseHasIn'),
37373 hasPath = require('./_hasPath');
37374
37375/**
37376 * Checks if `path` is a direct or inherited property of `object`.
37377 *
37378 * @static
37379 * @memberOf _
37380 * @since 4.0.0
37381 * @category Object
37382 * @param {Object} object The object to query.
37383 * @param {Array|string} path The path to check.
37384 * @returns {boolean} Returns `true` if `path` exists, else `false`.
37385 * @example
37386 *
37387 * var object = _.create({ 'a': _.create({ 'b': 2 }) });
37388 *
37389 * _.hasIn(object, 'a');
37390 * // => true
37391 *
37392 * _.hasIn(object, 'a.b');
37393 * // => true
37394 *
37395 * _.hasIn(object, ['a', 'b']);
37396 * // => true
37397 *
37398 * _.hasIn(object, 'b');
37399 * // => false
37400 */
37401function hasIn(object, path) {
37402 return object != null && hasPath(object, path, baseHasIn);
37403}
37404
37405module.exports = hasIn;
37406
37407},{"./_baseHasIn":293,"./_hasPath":362}],430:[function(require,module,exports){
37408/**
37409 * This method returns the first argument it receives.
37410 *
37411 * @static
37412 * @since 0.1.0
37413 * @memberOf _
37414 * @category Util
37415 * @param {*} value Any value.
37416 * @returns {*} Returns `value`.
37417 * @example
37418 *
37419 * var object = { 'a': 1 };
37420 *
37421 * console.log(_.identity(object) === object);
37422 * // => true
37423 */
37424function identity(value) {
37425 return value;
37426}
37427
37428module.exports = identity;
37429
37430},{}],431:[function(require,module,exports){
37431var baseIndexOf = require('./_baseIndexOf'),
37432 isArrayLike = require('./isArrayLike'),
37433 isString = require('./isString'),
37434 toInteger = require('./toInteger'),
37435 values = require('./values');
37436
37437/* Built-in method references for those with the same name as other `lodash` methods. */
37438var nativeMax = Math.max;
37439
37440/**
37441 * Checks if `value` is in `collection`. If `collection` is a string, it's
37442 * checked for a substring of `value`, otherwise
37443 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
37444 * is used for equality comparisons. If `fromIndex` is negative, it's used as
37445 * the offset from the end of `collection`.
37446 *
37447 * @static
37448 * @memberOf _
37449 * @since 0.1.0
37450 * @category Collection
37451 * @param {Array|Object|string} collection The collection to inspect.
37452 * @param {*} value The value to search for.
37453 * @param {number} [fromIndex=0] The index to search from.
37454 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
37455 * @returns {boolean} Returns `true` if `value` is found, else `false`.
37456 * @example
37457 *
37458 * _.includes([1, 2, 3], 1);
37459 * // => true
37460 *
37461 * _.includes([1, 2, 3], 1, 2);
37462 * // => false
37463 *
37464 * _.includes({ 'a': 1, 'b': 2 }, 1);
37465 * // => true
37466 *
37467 * _.includes('abcd', 'bc');
37468 * // => true
37469 */
37470function includes(collection, value, fromIndex, guard) {
37471 collection = isArrayLike(collection) ? collection : values(collection);
37472 fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
37473
37474 var length = collection.length;
37475 if (fromIndex < 0) {
37476 fromIndex = nativeMax(length + fromIndex, 0);
37477 }
37478 return isString(collection)
37479 ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
37480 : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
37481}
37482
37483module.exports = includes;
37484
37485},{"./_baseIndexOf":294,"./isArrayLike":434,"./isString":444,"./toInteger":460,"./values":465}],432:[function(require,module,exports){
37486var baseIsArguments = require('./_baseIsArguments'),
37487 isObjectLike = require('./isObjectLike');
37488
37489/** Used for built-in method references. */
37490var objectProto = Object.prototype;
37491
37492/** Used to check objects for own properties. */
37493var hasOwnProperty = objectProto.hasOwnProperty;
37494
37495/** Built-in value references. */
37496var propertyIsEnumerable = objectProto.propertyIsEnumerable;
37497
37498/**
37499 * Checks if `value` is likely an `arguments` object.
37500 *
37501 * @static
37502 * @memberOf _
37503 * @since 0.1.0
37504 * @category Lang
37505 * @param {*} value The value to check.
37506 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
37507 * else `false`.
37508 * @example
37509 *
37510 * _.isArguments(function() { return arguments; }());
37511 * // => true
37512 *
37513 * _.isArguments([1, 2, 3]);
37514 * // => false
37515 */
37516var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
37517 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
37518 !propertyIsEnumerable.call(value, 'callee');
37519};
37520
37521module.exports = isArguments;
37522
37523},{"./_baseIsArguments":295,"./isObjectLike":441}],433:[function(require,module,exports){
37524/**
37525 * Checks if `value` is classified as an `Array` object.
37526 *
37527 * @static
37528 * @memberOf _
37529 * @since 0.1.0
37530 * @category Lang
37531 * @param {*} value The value to check.
37532 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
37533 * @example
37534 *
37535 * _.isArray([1, 2, 3]);
37536 * // => true
37537 *
37538 * _.isArray(document.body.children);
37539 * // => false
37540 *
37541 * _.isArray('abc');
37542 * // => false
37543 *
37544 * _.isArray(_.noop);
37545 * // => false
37546 */
37547var isArray = Array.isArray;
37548
37549module.exports = isArray;
37550
37551},{}],434:[function(require,module,exports){
37552var isFunction = require('./isFunction'),
37553 isLength = require('./isLength');
37554
37555/**
37556 * Checks if `value` is array-like. A value is considered array-like if it's
37557 * not a function and has a `value.length` that's an integer greater than or
37558 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
37559 *
37560 * @static
37561 * @memberOf _
37562 * @since 4.0.0
37563 * @category Lang
37564 * @param {*} value The value to check.
37565 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
37566 * @example
37567 *
37568 * _.isArrayLike([1, 2, 3]);
37569 * // => true
37570 *
37571 * _.isArrayLike(document.body.children);
37572 * // => true
37573 *
37574 * _.isArrayLike('abc');
37575 * // => true
37576 *
37577 * _.isArrayLike(_.noop);
37578 * // => false
37579 */
37580function isArrayLike(value) {
37581 return value != null && isLength(value.length) && !isFunction(value);
37582}
37583
37584module.exports = isArrayLike;
37585
37586},{"./isFunction":437,"./isLength":439}],435:[function(require,module,exports){
37587var isArrayLike = require('./isArrayLike'),
37588 isObjectLike = require('./isObjectLike');
37589
37590/**
37591 * This method is like `_.isArrayLike` except that it also checks if `value`
37592 * is an object.
37593 *
37594 * @static
37595 * @memberOf _
37596 * @since 4.0.0
37597 * @category Lang
37598 * @param {*} value The value to check.
37599 * @returns {boolean} Returns `true` if `value` is an array-like object,
37600 * else `false`.
37601 * @example
37602 *
37603 * _.isArrayLikeObject([1, 2, 3]);
37604 * // => true
37605 *
37606 * _.isArrayLikeObject(document.body.children);
37607 * // => true
37608 *
37609 * _.isArrayLikeObject('abc');
37610 * // => false
37611 *
37612 * _.isArrayLikeObject(_.noop);
37613 * // => false
37614 */
37615function isArrayLikeObject(value) {
37616 return isObjectLike(value) && isArrayLike(value);
37617}
37618
37619module.exports = isArrayLikeObject;
37620
37621},{"./isArrayLike":434,"./isObjectLike":441}],436:[function(require,module,exports){
37622var root = require('./_root'),
37623 stubFalse = require('./stubFalse');
37624
37625/** Detect free variable `exports`. */
37626var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
37627
37628/** Detect free variable `module`. */
37629var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
37630
37631/** Detect the popular CommonJS extension `module.exports`. */
37632var moduleExports = freeModule && freeModule.exports === freeExports;
37633
37634/** Built-in value references. */
37635var Buffer = moduleExports ? root.Buffer : undefined;
37636
37637/* Built-in method references for those with the same name as other `lodash` methods. */
37638var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
37639
37640/**
37641 * Checks if `value` is a buffer.
37642 *
37643 * @static
37644 * @memberOf _
37645 * @since 4.3.0
37646 * @category Lang
37647 * @param {*} value The value to check.
37648 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
37649 * @example
37650 *
37651 * _.isBuffer(new Buffer(2));
37652 * // => true
37653 *
37654 * _.isBuffer(new Uint8Array(2));
37655 * // => false
37656 */
37657var isBuffer = nativeIsBuffer || stubFalse;
37658
37659module.exports = isBuffer;
37660
37661},{"./_root":399,"./stubFalse":458}],437:[function(require,module,exports){
37662var baseGetTag = require('./_baseGetTag'),
37663 isObject = require('./isObject');
37664
37665/** `Object#toString` result references. */
37666var asyncTag = '[object AsyncFunction]',
37667 funcTag = '[object Function]',
37668 genTag = '[object GeneratorFunction]',
37669 proxyTag = '[object Proxy]';
37670
37671/**
37672 * Checks if `value` is classified as a `Function` object.
37673 *
37674 * @static
37675 * @memberOf _
37676 * @since 0.1.0
37677 * @category Lang
37678 * @param {*} value The value to check.
37679 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
37680 * @example
37681 *
37682 * _.isFunction(_);
37683 * // => true
37684 *
37685 * _.isFunction(/abc/);
37686 * // => false
37687 */
37688function isFunction(value) {
37689 if (!isObject(value)) {
37690 return false;
37691 }
37692 // The use of `Object#toString` avoids issues with the `typeof` operator
37693 // in Safari 9 which returns 'object' for typed arrays and other constructors.
37694 var tag = baseGetTag(value);
37695 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
37696}
37697
37698module.exports = isFunction;
37699
37700},{"./_baseGetTag":291,"./isObject":440}],438:[function(require,module,exports){
37701var toInteger = require('./toInteger');
37702
37703/**
37704 * Checks if `value` is an integer.
37705 *
37706 * **Note:** This method is based on
37707 * [`Number.isInteger`](https://mdn.io/Number/isInteger).
37708 *
37709 * @static
37710 * @memberOf _
37711 * @since 4.0.0
37712 * @category Lang
37713 * @param {*} value The value to check.
37714 * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
37715 * @example
37716 *
37717 * _.isInteger(3);
37718 * // => true
37719 *
37720 * _.isInteger(Number.MIN_VALUE);
37721 * // => false
37722 *
37723 * _.isInteger(Infinity);
37724 * // => false
37725 *
37726 * _.isInteger('3');
37727 * // => false
37728 */
37729function isInteger(value) {
37730 return typeof value == 'number' && value == toInteger(value);
37731}
37732
37733module.exports = isInteger;
37734
37735},{"./toInteger":460}],439:[function(require,module,exports){
37736/** Used as references for various `Number` constants. */
37737var MAX_SAFE_INTEGER = 9007199254740991;
37738
37739/**
37740 * Checks if `value` is a valid array-like length.
37741 *
37742 * **Note:** This method is loosely based on
37743 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
37744 *
37745 * @static
37746 * @memberOf _
37747 * @since 4.0.0
37748 * @category Lang
37749 * @param {*} value The value to check.
37750 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
37751 * @example
37752 *
37753 * _.isLength(3);
37754 * // => true
37755 *
37756 * _.isLength(Number.MIN_VALUE);
37757 * // => false
37758 *
37759 * _.isLength(Infinity);
37760 * // => false
37761 *
37762 * _.isLength('3');
37763 * // => false
37764 */
37765function isLength(value) {
37766 return typeof value == 'number' &&
37767 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
37768}
37769
37770module.exports = isLength;
37771
37772},{}],440:[function(require,module,exports){
37773/**
37774 * Checks if `value` is the
37775 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
37776 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
37777 *
37778 * @static
37779 * @memberOf _
37780 * @since 0.1.0
37781 * @category Lang
37782 * @param {*} value The value to check.
37783 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
37784 * @example
37785 *
37786 * _.isObject({});
37787 * // => true
37788 *
37789 * _.isObject([1, 2, 3]);
37790 * // => true
37791 *
37792 * _.isObject(_.noop);
37793 * // => true
37794 *
37795 * _.isObject(null);
37796 * // => false
37797 */
37798function isObject(value) {
37799 var type = typeof value;
37800 return value != null && (type == 'object' || type == 'function');
37801}
37802
37803module.exports = isObject;
37804
37805},{}],441:[function(require,module,exports){
37806/**
37807 * Checks if `value` is object-like. A value is object-like if it's not `null`
37808 * and has a `typeof` result of "object".
37809 *
37810 * @static
37811 * @memberOf _
37812 * @since 4.0.0
37813 * @category Lang
37814 * @param {*} value The value to check.
37815 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
37816 * @example
37817 *
37818 * _.isObjectLike({});
37819 * // => true
37820 *
37821 * _.isObjectLike([1, 2, 3]);
37822 * // => true
37823 *
37824 * _.isObjectLike(_.noop);
37825 * // => false
37826 *
37827 * _.isObjectLike(null);
37828 * // => false
37829 */
37830function isObjectLike(value) {
37831 return value != null && typeof value == 'object';
37832}
37833
37834module.exports = isObjectLike;
37835
37836},{}],442:[function(require,module,exports){
37837var baseGetTag = require('./_baseGetTag'),
37838 getPrototype = require('./_getPrototype'),
37839 isObjectLike = require('./isObjectLike');
37840
37841/** `Object#toString` result references. */
37842var objectTag = '[object Object]';
37843
37844/** Used for built-in method references. */
37845var funcProto = Function.prototype,
37846 objectProto = Object.prototype;
37847
37848/** Used to resolve the decompiled source of functions. */
37849var funcToString = funcProto.toString;
37850
37851/** Used to check objects for own properties. */
37852var hasOwnProperty = objectProto.hasOwnProperty;
37853
37854/** Used to infer the `Object` constructor. */
37855var objectCtorString = funcToString.call(Object);
37856
37857/**
37858 * Checks if `value` is a plain object, that is, an object created by the
37859 * `Object` constructor or one with a `[[Prototype]]` of `null`.
37860 *
37861 * @static
37862 * @memberOf _
37863 * @since 0.8.0
37864 * @category Lang
37865 * @param {*} value The value to check.
37866 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
37867 * @example
37868 *
37869 * function Foo() {
37870 * this.a = 1;
37871 * }
37872 *
37873 * _.isPlainObject(new Foo);
37874 * // => false
37875 *
37876 * _.isPlainObject([1, 2, 3]);
37877 * // => false
37878 *
37879 * _.isPlainObject({ 'x': 0, 'y': 0 });
37880 * // => true
37881 *
37882 * _.isPlainObject(Object.create(null));
37883 * // => true
37884 */
37885function isPlainObject(value) {
37886 if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
37887 return false;
37888 }
37889 var proto = getPrototype(value);
37890 if (proto === null) {
37891 return true;
37892 }
37893 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
37894 return typeof Ctor == 'function' && Ctor instanceof Ctor &&
37895 funcToString.call(Ctor) == objectCtorString;
37896}
37897
37898module.exports = isPlainObject;
37899
37900},{"./_baseGetTag":291,"./_getPrototype":356,"./isObjectLike":441}],443:[function(require,module,exports){
37901var baseIsRegExp = require('./_baseIsRegExp'),
37902 baseUnary = require('./_baseUnary'),
37903 nodeUtil = require('./_nodeUtil');
37904
37905/* Node.js helper references. */
37906var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;
37907
37908/**
37909 * Checks if `value` is classified as a `RegExp` object.
37910 *
37911 * @static
37912 * @memberOf _
37913 * @since 0.1.0
37914 * @category Lang
37915 * @param {*} value The value to check.
37916 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
37917 * @example
37918 *
37919 * _.isRegExp(/abc/);
37920 * // => true
37921 *
37922 * _.isRegExp('/abc/');
37923 * // => false
37924 */
37925var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
37926
37927module.exports = isRegExp;
37928
37929},{"./_baseIsRegExp":301,"./_baseUnary":320,"./_nodeUtil":395}],444:[function(require,module,exports){
37930var baseGetTag = require('./_baseGetTag'),
37931 isArray = require('./isArray'),
37932 isObjectLike = require('./isObjectLike');
37933
37934/** `Object#toString` result references. */
37935var stringTag = '[object String]';
37936
37937/**
37938 * Checks if `value` is classified as a `String` primitive or object.
37939 *
37940 * @static
37941 * @since 0.1.0
37942 * @memberOf _
37943 * @category Lang
37944 * @param {*} value The value to check.
37945 * @returns {boolean} Returns `true` if `value` is a string, else `false`.
37946 * @example
37947 *
37948 * _.isString('abc');
37949 * // => true
37950 *
37951 * _.isString(1);
37952 * // => false
37953 */
37954function isString(value) {
37955 return typeof value == 'string' ||
37956 (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
37957}
37958
37959module.exports = isString;
37960
37961},{"./_baseGetTag":291,"./isArray":433,"./isObjectLike":441}],445:[function(require,module,exports){
37962var baseGetTag = require('./_baseGetTag'),
37963 isObjectLike = require('./isObjectLike');
37964
37965/** `Object#toString` result references. */
37966var symbolTag = '[object Symbol]';
37967
37968/**
37969 * Checks if `value` is classified as a `Symbol` primitive or object.
37970 *
37971 * @static
37972 * @memberOf _
37973 * @since 4.0.0
37974 * @category Lang
37975 * @param {*} value The value to check.
37976 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
37977 * @example
37978 *
37979 * _.isSymbol(Symbol.iterator);
37980 * // => true
37981 *
37982 * _.isSymbol('abc');
37983 * // => false
37984 */
37985function isSymbol(value) {
37986 return typeof value == 'symbol' ||
37987 (isObjectLike(value) && baseGetTag(value) == symbolTag);
37988}
37989
37990module.exports = isSymbol;
37991
37992},{"./_baseGetTag":291,"./isObjectLike":441}],446:[function(require,module,exports){
37993var baseIsTypedArray = require('./_baseIsTypedArray'),
37994 baseUnary = require('./_baseUnary'),
37995 nodeUtil = require('./_nodeUtil');
37996
37997/* Node.js helper references. */
37998var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
37999
38000/**
38001 * Checks if `value` is classified as a typed array.
38002 *
38003 * @static
38004 * @memberOf _
38005 * @since 3.0.0
38006 * @category Lang
38007 * @param {*} value The value to check.
38008 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
38009 * @example
38010 *
38011 * _.isTypedArray(new Uint8Array);
38012 * // => true
38013 *
38014 * _.isTypedArray([]);
38015 * // => false
38016 */
38017var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
38018
38019module.exports = isTypedArray;
38020
38021},{"./_baseIsTypedArray":302,"./_baseUnary":320,"./_nodeUtil":395}],447:[function(require,module,exports){
38022var arrayLikeKeys = require('./_arrayLikeKeys'),
38023 baseKeys = require('./_baseKeys'),
38024 isArrayLike = require('./isArrayLike');
38025
38026/**
38027 * Creates an array of the own enumerable property names of `object`.
38028 *
38029 * **Note:** Non-object values are coerced to objects. See the
38030 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
38031 * for more details.
38032 *
38033 * @static
38034 * @since 0.1.0
38035 * @memberOf _
38036 * @category Object
38037 * @param {Object} object The object to query.
38038 * @returns {Array} Returns the array of property names.
38039 * @example
38040 *
38041 * function Foo() {
38042 * this.a = 1;
38043 * this.b = 2;
38044 * }
38045 *
38046 * Foo.prototype.c = 3;
38047 *
38048 * _.keys(new Foo);
38049 * // => ['a', 'b'] (iteration order is not guaranteed)
38050 *
38051 * _.keys('hi');
38052 * // => ['0', '1']
38053 */
38054function keys(object) {
38055 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
38056}
38057
38058module.exports = keys;
38059
38060},{"./_arrayLikeKeys":270,"./_baseKeys":304,"./isArrayLike":434}],448:[function(require,module,exports){
38061var arrayLikeKeys = require('./_arrayLikeKeys'),
38062 baseKeysIn = require('./_baseKeysIn'),
38063 isArrayLike = require('./isArrayLike');
38064
38065/**
38066 * Creates an array of the own and inherited enumerable property names of `object`.
38067 *
38068 * **Note:** Non-object values are coerced to objects.
38069 *
38070 * @static
38071 * @memberOf _
38072 * @since 3.0.0
38073 * @category Object
38074 * @param {Object} object The object to query.
38075 * @returns {Array} Returns the array of property names.
38076 * @example
38077 *
38078 * function Foo() {
38079 * this.a = 1;
38080 * this.b = 2;
38081 * }
38082 *
38083 * Foo.prototype.c = 3;
38084 *
38085 * _.keysIn(new Foo);
38086 * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
38087 */
38088function keysIn(object) {
38089 return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
38090}
38091
38092module.exports = keysIn;
38093
38094},{"./_arrayLikeKeys":270,"./_baseKeysIn":305,"./isArrayLike":434}],449:[function(require,module,exports){
38095var arrayMap = require('./_arrayMap'),
38096 baseIteratee = require('./_baseIteratee'),
38097 baseMap = require('./_baseMap'),
38098 isArray = require('./isArray');
38099
38100/**
38101 * Creates an array of values by running each element in `collection` thru
38102 * `iteratee`. The iteratee is invoked with three arguments:
38103 * (value, index|key, collection).
38104 *
38105 * Many lodash methods are guarded to work as iteratees for methods like
38106 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
38107 *
38108 * The guarded methods are:
38109 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
38110 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
38111 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
38112 * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
38113 *
38114 * @static
38115 * @memberOf _
38116 * @since 0.1.0
38117 * @category Collection
38118 * @param {Array|Object} collection The collection to iterate over.
38119 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
38120 * @returns {Array} Returns the new mapped array.
38121 * @example
38122 *
38123 * function square(n) {
38124 * return n * n;
38125 * }
38126 *
38127 * _.map([4, 8], square);
38128 * // => [16, 64]
38129 *
38130 * _.map({ 'a': 4, 'b': 8 }, square);
38131 * // => [16, 64] (iteration order is not guaranteed)
38132 *
38133 * var users = [
38134 * { 'user': 'barney' },
38135 * { 'user': 'fred' }
38136 * ];
38137 *
38138 * // The `_.property` iteratee shorthand.
38139 * _.map(users, 'user');
38140 * // => ['barney', 'fred']
38141 */
38142function map(collection, iteratee) {
38143 var func = isArray(collection) ? arrayMap : baseMap;
38144 return func(collection, baseIteratee(iteratee, 3));
38145}
38146
38147module.exports = map;
38148
38149},{"./_arrayMap":271,"./_baseIteratee":303,"./_baseMap":306,"./isArray":433}],450:[function(require,module,exports){
38150var MapCache = require('./_MapCache');
38151
38152/** Error message constants. */
38153var FUNC_ERROR_TEXT = 'Expected a function';
38154
38155/**
38156 * Creates a function that memoizes the result of `func`. If `resolver` is
38157 * provided, it determines the cache key for storing the result based on the
38158 * arguments provided to the memoized function. By default, the first argument
38159 * provided to the memoized function is used as the map cache key. The `func`
38160 * is invoked with the `this` binding of the memoized function.
38161 *
38162 * **Note:** The cache is exposed as the `cache` property on the memoized
38163 * function. Its creation may be customized by replacing the `_.memoize.Cache`
38164 * constructor with one whose instances implement the
38165 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
38166 * method interface of `clear`, `delete`, `get`, `has`, and `set`.
38167 *
38168 * @static
38169 * @memberOf _
38170 * @since 0.1.0
38171 * @category Function
38172 * @param {Function} func The function to have its output memoized.
38173 * @param {Function} [resolver] The function to resolve the cache key.
38174 * @returns {Function} Returns the new memoized function.
38175 * @example
38176 *
38177 * var object = { 'a': 1, 'b': 2 };
38178 * var other = { 'c': 3, 'd': 4 };
38179 *
38180 * var values = _.memoize(_.values);
38181 * values(object);
38182 * // => [1, 2]
38183 *
38184 * values(other);
38185 * // => [3, 4]
38186 *
38187 * object.a = 2;
38188 * values(object);
38189 * // => [1, 2]
38190 *
38191 * // Modify the result cache.
38192 * values.cache.set(object, ['a', 'b']);
38193 * values(object);
38194 * // => ['a', 'b']
38195 *
38196 * // Replace `_.memoize.Cache`.
38197 * _.memoize.Cache = WeakMap;
38198 */
38199function memoize(func, resolver) {
38200 if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
38201 throw new TypeError(FUNC_ERROR_TEXT);
38202 }
38203 var memoized = function() {
38204 var args = arguments,
38205 key = resolver ? resolver.apply(this, args) : args[0],
38206 cache = memoized.cache;
38207
38208 if (cache.has(key)) {
38209 return cache.get(key);
38210 }
38211 var result = func.apply(this, args);
38212 memoized.cache = cache.set(key, result) || cache;
38213 return result;
38214 };
38215 memoized.cache = new (memoize.Cache || MapCache);
38216 return memoized;
38217}
38218
38219// Expose `MapCache`.
38220memoize.Cache = MapCache;
38221
38222module.exports = memoize;
38223
38224},{"./_MapCache":255}],451:[function(require,module,exports){
38225var baseMerge = require('./_baseMerge'),
38226 createAssigner = require('./_createAssigner');
38227
38228/**
38229 * This method is like `_.merge` except that it accepts `customizer` which
38230 * is invoked to produce the merged values of the destination and source
38231 * properties. If `customizer` returns `undefined`, merging is handled by the
38232 * method instead. The `customizer` is invoked with six arguments:
38233 * (objValue, srcValue, key, object, source, stack).
38234 *
38235 * **Note:** This method mutates `object`.
38236 *
38237 * @static
38238 * @memberOf _
38239 * @since 4.0.0
38240 * @category Object
38241 * @param {Object} object The destination object.
38242 * @param {...Object} sources The source objects.
38243 * @param {Function} customizer The function to customize assigned values.
38244 * @returns {Object} Returns `object`.
38245 * @example
38246 *
38247 * function customizer(objValue, srcValue) {
38248 * if (_.isArray(objValue)) {
38249 * return objValue.concat(srcValue);
38250 * }
38251 * }
38252 *
38253 * var object = { 'a': [1], 'b': [2] };
38254 * var other = { 'a': [3], 'b': [4] };
38255 *
38256 * _.mergeWith(object, other, customizer);
38257 * // => { 'a': [1, 3], 'b': [2, 4] }
38258 */
38259var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
38260 baseMerge(object, source, srcIndex, customizer);
38261});
38262
38263module.exports = mergeWith;
38264
38265},{"./_baseMerge":309,"./_createAssigner":340}],452:[function(require,module,exports){
38266/**
38267 * This method returns `undefined`.
38268 *
38269 * @static
38270 * @memberOf _
38271 * @since 2.3.0
38272 * @category Util
38273 * @example
38274 *
38275 * _.times(2, _.noop);
38276 * // => [undefined, undefined]
38277 */
38278function noop() {
38279 // No operation performed.
38280}
38281
38282module.exports = noop;
38283
38284},{}],453:[function(require,module,exports){
38285var baseProperty = require('./_baseProperty'),
38286 basePropertyDeep = require('./_basePropertyDeep'),
38287 isKey = require('./_isKey'),
38288 toKey = require('./_toKey');
38289
38290/**
38291 * Creates a function that returns the value at `path` of a given object.
38292 *
38293 * @static
38294 * @memberOf _
38295 * @since 2.4.0
38296 * @category Util
38297 * @param {Array|string} path The path of the property to get.
38298 * @returns {Function} Returns the new accessor function.
38299 * @example
38300 *
38301 * var objects = [
38302 * { 'a': { 'b': 2 } },
38303 * { 'a': { 'b': 1 } }
38304 * ];
38305 *
38306 * _.map(objects, _.property('a.b'));
38307 * // => [2, 1]
38308 *
38309 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
38310 * // => [1, 2]
38311 */
38312function property(path) {
38313 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
38314}
38315
38316module.exports = property;
38317
38318},{"./_baseProperty":312,"./_basePropertyDeep":313,"./_isKey":374,"./_toKey":412}],454:[function(require,module,exports){
38319var baseRepeat = require('./_baseRepeat'),
38320 isIterateeCall = require('./_isIterateeCall'),
38321 toInteger = require('./toInteger'),
38322 toString = require('./toString');
38323
38324/**
38325 * Repeats the given string `n` times.
38326 *
38327 * @static
38328 * @memberOf _
38329 * @since 3.0.0
38330 * @category String
38331 * @param {string} [string=''] The string to repeat.
38332 * @param {number} [n=1] The number of times to repeat the string.
38333 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
38334 * @returns {string} Returns the repeated string.
38335 * @example
38336 *
38337 * _.repeat('*', 3);
38338 * // => '***'
38339 *
38340 * _.repeat('abc', 2);
38341 * // => 'abcabc'
38342 *
38343 * _.repeat('abc', 0);
38344 * // => ''
38345 */
38346function repeat(string, n, guard) {
38347 if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
38348 n = 1;
38349 } else {
38350 n = toInteger(n);
38351 }
38352 return baseRepeat(toString(string), n);
38353}
38354
38355module.exports = repeat;
38356
38357},{"./_baseRepeat":314,"./_isIterateeCall":373,"./toInteger":460,"./toString":463}],455:[function(require,module,exports){
38358var baseFlatten = require('./_baseFlatten'),
38359 baseOrderBy = require('./_baseOrderBy'),
38360 baseRest = require('./_baseRest'),
38361 isIterateeCall = require('./_isIterateeCall');
38362
38363/**
38364 * Creates an array of elements, sorted in ascending order by the results of
38365 * running each element in a collection thru each iteratee. This method
38366 * performs a stable sort, that is, it preserves the original sort order of
38367 * equal elements. The iteratees are invoked with one argument: (value).
38368 *
38369 * @static
38370 * @memberOf _
38371 * @since 0.1.0
38372 * @category Collection
38373 * @param {Array|Object} collection The collection to iterate over.
38374 * @param {...(Function|Function[])} [iteratees=[_.identity]]
38375 * The iteratees to sort by.
38376 * @returns {Array} Returns the new sorted array.
38377 * @example
38378 *
38379 * var users = [
38380 * { 'user': 'fred', 'age': 48 },
38381 * { 'user': 'barney', 'age': 36 },
38382 * { 'user': 'fred', 'age': 40 },
38383 * { 'user': 'barney', 'age': 34 }
38384 * ];
38385 *
38386 * _.sortBy(users, [function(o) { return o.user; }]);
38387 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
38388 *
38389 * _.sortBy(users, ['user', 'age']);
38390 * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
38391 */
38392var sortBy = baseRest(function(collection, iteratees) {
38393 if (collection == null) {
38394 return [];
38395 }
38396 var length = iteratees.length;
38397 if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
38398 iteratees = [];
38399 } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
38400 iteratees = [iteratees[0]];
38401 }
38402 return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
38403});
38404
38405module.exports = sortBy;
38406
38407},{"./_baseFlatten":286,"./_baseOrderBy":311,"./_baseRest":315,"./_isIterateeCall":373}],456:[function(require,module,exports){
38408var baseClamp = require('./_baseClamp'),
38409 baseToString = require('./_baseToString'),
38410 toInteger = require('./toInteger'),
38411 toString = require('./toString');
38412
38413/**
38414 * Checks if `string` starts with the given target string.
38415 *
38416 * @static
38417 * @memberOf _
38418 * @since 3.0.0
38419 * @category String
38420 * @param {string} [string=''] The string to inspect.
38421 * @param {string} [target] The string to search for.
38422 * @param {number} [position=0] The position to search from.
38423 * @returns {boolean} Returns `true` if `string` starts with `target`,
38424 * else `false`.
38425 * @example
38426 *
38427 * _.startsWith('abc', 'a');
38428 * // => true
38429 *
38430 * _.startsWith('abc', 'b');
38431 * // => false
38432 *
38433 * _.startsWith('abc', 'b', 1);
38434 * // => true
38435 */
38436function startsWith(string, target, position) {
38437 string = toString(string);
38438 position = position == null
38439 ? 0
38440 : baseClamp(toInteger(position), 0, string.length);
38441
38442 target = baseToString(target);
38443 return string.slice(position, position + target.length) == target;
38444}
38445
38446module.exports = startsWith;
38447
38448},{"./_baseClamp":281,"./_baseToString":319,"./toInteger":460,"./toString":463}],457:[function(require,module,exports){
38449/**
38450 * This method returns a new empty array.
38451 *
38452 * @static
38453 * @memberOf _
38454 * @since 4.13.0
38455 * @category Util
38456 * @returns {Array} Returns the new empty array.
38457 * @example
38458 *
38459 * var arrays = _.times(2, _.stubArray);
38460 *
38461 * console.log(arrays);
38462 * // => [[], []]
38463 *
38464 * console.log(arrays[0] === arrays[1]);
38465 * // => false
38466 */
38467function stubArray() {
38468 return [];
38469}
38470
38471module.exports = stubArray;
38472
38473},{}],458:[function(require,module,exports){
38474/**
38475 * This method returns `false`.
38476 *
38477 * @static
38478 * @memberOf _
38479 * @since 4.13.0
38480 * @category Util
38481 * @returns {boolean} Returns `false`.
38482 * @example
38483 *
38484 * _.times(2, _.stubFalse);
38485 * // => [false, false]
38486 */
38487function stubFalse() {
38488 return false;
38489}
38490
38491module.exports = stubFalse;
38492
38493},{}],459:[function(require,module,exports){
38494var toNumber = require('./toNumber');
38495
38496/** Used as references for various `Number` constants. */
38497var INFINITY = 1 / 0,
38498 MAX_INTEGER = 1.7976931348623157e+308;
38499
38500/**
38501 * Converts `value` to a finite number.
38502 *
38503 * @static
38504 * @memberOf _
38505 * @since 4.12.0
38506 * @category Lang
38507 * @param {*} value The value to convert.
38508 * @returns {number} Returns the converted number.
38509 * @example
38510 *
38511 * _.toFinite(3.2);
38512 * // => 3.2
38513 *
38514 * _.toFinite(Number.MIN_VALUE);
38515 * // => 5e-324
38516 *
38517 * _.toFinite(Infinity);
38518 * // => 1.7976931348623157e+308
38519 *
38520 * _.toFinite('3.2');
38521 * // => 3.2
38522 */
38523function toFinite(value) {
38524 if (!value) {
38525 return value === 0 ? value : 0;
38526 }
38527 value = toNumber(value);
38528 if (value === INFINITY || value === -INFINITY) {
38529 var sign = (value < 0 ? -1 : 1);
38530 return sign * MAX_INTEGER;
38531 }
38532 return value === value ? value : 0;
38533}
38534
38535module.exports = toFinite;
38536
38537},{"./toNumber":461}],460:[function(require,module,exports){
38538var toFinite = require('./toFinite');
38539
38540/**
38541 * Converts `value` to an integer.
38542 *
38543 * **Note:** This method is loosely based on
38544 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
38545 *
38546 * @static
38547 * @memberOf _
38548 * @since 4.0.0
38549 * @category Lang
38550 * @param {*} value The value to convert.
38551 * @returns {number} Returns the converted integer.
38552 * @example
38553 *
38554 * _.toInteger(3.2);
38555 * // => 3
38556 *
38557 * _.toInteger(Number.MIN_VALUE);
38558 * // => 0
38559 *
38560 * _.toInteger(Infinity);
38561 * // => 1.7976931348623157e+308
38562 *
38563 * _.toInteger('3.2');
38564 * // => 3
38565 */
38566function toInteger(value) {
38567 var result = toFinite(value),
38568 remainder = result % 1;
38569
38570 return result === result ? (remainder ? result - remainder : result) : 0;
38571}
38572
38573module.exports = toInteger;
38574
38575},{"./toFinite":459}],461:[function(require,module,exports){
38576var isObject = require('./isObject'),
38577 isSymbol = require('./isSymbol');
38578
38579/** Used as references for various `Number` constants. */
38580var NAN = 0 / 0;
38581
38582/** Used to match leading and trailing whitespace. */
38583var reTrim = /^\s+|\s+$/g;
38584
38585/** Used to detect bad signed hexadecimal string values. */
38586var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
38587
38588/** Used to detect binary string values. */
38589var reIsBinary = /^0b[01]+$/i;
38590
38591/** Used to detect octal string values. */
38592var reIsOctal = /^0o[0-7]+$/i;
38593
38594/** Built-in method references without a dependency on `root`. */
38595var freeParseInt = parseInt;
38596
38597/**
38598 * Converts `value` to a number.
38599 *
38600 * @static
38601 * @memberOf _
38602 * @since 4.0.0
38603 * @category Lang
38604 * @param {*} value The value to process.
38605 * @returns {number} Returns the number.
38606 * @example
38607 *
38608 * _.toNumber(3.2);
38609 * // => 3.2
38610 *
38611 * _.toNumber(Number.MIN_VALUE);
38612 * // => 5e-324
38613 *
38614 * _.toNumber(Infinity);
38615 * // => Infinity
38616 *
38617 * _.toNumber('3.2');
38618 * // => 3.2
38619 */
38620function toNumber(value) {
38621 if (typeof value == 'number') {
38622 return value;
38623 }
38624 if (isSymbol(value)) {
38625 return NAN;
38626 }
38627 if (isObject(value)) {
38628 var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
38629 value = isObject(other) ? (other + '') : other;
38630 }
38631 if (typeof value != 'string') {
38632 return value === 0 ? value : +value;
38633 }
38634 value = value.replace(reTrim, '');
38635 var isBinary = reIsBinary.test(value);
38636 return (isBinary || reIsOctal.test(value))
38637 ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
38638 : (reIsBadHex.test(value) ? NAN : +value);
38639}
38640
38641module.exports = toNumber;
38642
38643},{"./isObject":440,"./isSymbol":445}],462:[function(require,module,exports){
38644var copyObject = require('./_copyObject'),
38645 keysIn = require('./keysIn');
38646
38647/**
38648 * Converts `value` to a plain object flattening inherited enumerable string
38649 * keyed properties of `value` to own properties of the plain object.
38650 *
38651 * @static
38652 * @memberOf _
38653 * @since 3.0.0
38654 * @category Lang
38655 * @param {*} value The value to convert.
38656 * @returns {Object} Returns the converted plain object.
38657 * @example
38658 *
38659 * function Foo() {
38660 * this.b = 2;
38661 * }
38662 *
38663 * Foo.prototype.c = 3;
38664 *
38665 * _.assign({ 'a': 1 }, new Foo);
38666 * // => { 'a': 1, 'b': 2 }
38667 *
38668 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
38669 * // => { 'a': 1, 'b': 2, 'c': 3 }
38670 */
38671function toPlainObject(value) {
38672 return copyObject(value, keysIn(value));
38673}
38674
38675module.exports = toPlainObject;
38676
38677},{"./_copyObject":336,"./keysIn":448}],463:[function(require,module,exports){
38678var baseToString = require('./_baseToString');
38679
38680/**
38681 * Converts `value` to a string. An empty string is returned for `null`
38682 * and `undefined` values. The sign of `-0` is preserved.
38683 *
38684 * @static
38685 * @memberOf _
38686 * @since 4.0.0
38687 * @category Lang
38688 * @param {*} value The value to convert.
38689 * @returns {string} Returns the converted string.
38690 * @example
38691 *
38692 * _.toString(null);
38693 * // => ''
38694 *
38695 * _.toString(-0);
38696 * // => '-0'
38697 *
38698 * _.toString([1, 2, 3]);
38699 * // => '1,2,3'
38700 */
38701function toString(value) {
38702 return value == null ? '' : baseToString(value);
38703}
38704
38705module.exports = toString;
38706
38707},{"./_baseToString":319}],464:[function(require,module,exports){
38708var baseUniq = require('./_baseUniq');
38709
38710/**
38711 * Creates a duplicate-free version of an array, using
38712 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
38713 * for equality comparisons, in which only the first occurrence of each element
38714 * is kept. The order of result values is determined by the order they occur
38715 * in the array.
38716 *
38717 * @static
38718 * @memberOf _
38719 * @since 0.1.0
38720 * @category Array
38721 * @param {Array} array The array to inspect.
38722 * @returns {Array} Returns the new duplicate free array.
38723 * @example
38724 *
38725 * _.uniq([2, 1, 2]);
38726 * // => [2, 1]
38727 */
38728function uniq(array) {
38729 return (array && array.length) ? baseUniq(array) : [];
38730}
38731
38732module.exports = uniq;
38733
38734},{"./_baseUniq":321}],465:[function(require,module,exports){
38735var baseValues = require('./_baseValues'),
38736 keys = require('./keys');
38737
38738/**
38739 * Creates an array of the own enumerable string keyed property values of `object`.
38740 *
38741 * **Note:** Non-object values are coerced to objects.
38742 *
38743 * @static
38744 * @since 0.1.0
38745 * @memberOf _
38746 * @category Object
38747 * @param {Object} object The object to query.
38748 * @returns {Array} Returns the array of property values.
38749 * @example
38750 *
38751 * function Foo() {
38752 * this.a = 1;
38753 * this.b = 2;
38754 * }
38755 *
38756 * Foo.prototype.c = 3;
38757 *
38758 * _.values(new Foo);
38759 * // => [1, 2] (iteration order is not guaranteed)
38760 *
38761 * _.values('hi');
38762 * // => ['h', 'i']
38763 */
38764function values(object) {
38765 return object == null ? [] : baseValues(object, keys(object));
38766}
38767
38768module.exports = values;
38769
38770},{"./_baseValues":322,"./keys":447}],466:[function(require,module,exports){
38771module.exports = minimatch
38772minimatch.Minimatch = Minimatch
38773
38774var path = { sep: '/' }
38775try {
38776 path = require('path')
38777} catch (er) {}
38778
38779var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
38780var expand = require('brace-expansion')
38781
38782var plTypes = {
38783 '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
38784 '?': { open: '(?:', close: ')?' },
38785 '+': { open: '(?:', close: ')+' },
38786 '*': { open: '(?:', close: ')*' },
38787 '@': { open: '(?:', close: ')' }
38788}
38789
38790// any single thing other than /
38791// don't need to escape / when using new RegExp()
38792var qmark = '[^/]'
38793
38794// * => any number of characters
38795var star = qmark + '*?'
38796
38797// ** when dots are allowed. Anything goes, except .. and .
38798// not (^ or / followed by one or two dots followed by $ or /),
38799// followed by anything, any number of times.
38800var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
38801
38802// not a ^ or / followed by a dot,
38803// followed by anything, any number of times.
38804var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
38805
38806// characters that need to be escaped in RegExp.
38807var reSpecials = charSet('().*{}+?[]^$\\!')
38808
38809// "abc" -> { a:true, b:true, c:true }
38810function charSet (s) {
38811 return s.split('').reduce(function (set, c) {
38812 set[c] = true
38813 return set
38814 }, {})
38815}
38816
38817// normalizes slashes.
38818var slashSplit = /\/+/
38819
38820minimatch.filter = filter
38821function filter (pattern, options) {
38822 options = options || {}
38823 return function (p, i, list) {
38824 return minimatch(p, pattern, options)
38825 }
38826}
38827
38828function ext (a, b) {
38829 a = a || {}
38830 b = b || {}
38831 var t = {}
38832 Object.keys(b).forEach(function (k) {
38833 t[k] = b[k]
38834 })
38835 Object.keys(a).forEach(function (k) {
38836 t[k] = a[k]
38837 })
38838 return t
38839}
38840
38841minimatch.defaults = function (def) {
38842 if (!def || !Object.keys(def).length) return minimatch
38843
38844 var orig = minimatch
38845
38846 var m = function minimatch (p, pattern, options) {
38847 return orig.minimatch(p, pattern, ext(def, options))
38848 }
38849
38850 m.Minimatch = function Minimatch (pattern, options) {
38851 return new orig.Minimatch(pattern, ext(def, options))
38852 }
38853
38854 return m
38855}
38856
38857Minimatch.defaults = function (def) {
38858 if (!def || !Object.keys(def).length) return Minimatch
38859 return minimatch.defaults(def).Minimatch
38860}
38861
38862function minimatch (p, pattern, options) {
38863 if (typeof pattern !== 'string') {
38864 throw new TypeError('glob pattern string required')
38865 }
38866
38867 if (!options) options = {}
38868
38869 // shortcut: comments match nothing.
38870 if (!options.nocomment && pattern.charAt(0) === '#') {
38871 return false
38872 }
38873
38874 // "" only matches ""
38875 if (pattern.trim() === '') return p === ''
38876
38877 return new Minimatch(pattern, options).match(p)
38878}
38879
38880function Minimatch (pattern, options) {
38881 if (!(this instanceof Minimatch)) {
38882 return new Minimatch(pattern, options)
38883 }
38884
38885 if (typeof pattern !== 'string') {
38886 throw new TypeError('glob pattern string required')
38887 }
38888
38889 if (!options) options = {}
38890 pattern = pattern.trim()
38891
38892 // windows support: need to use /, not \
38893 if (path.sep !== '/') {
38894 pattern = pattern.split(path.sep).join('/')
38895 }
38896
38897 this.options = options
38898 this.set = []
38899 this.pattern = pattern
38900 this.regexp = null
38901 this.negate = false
38902 this.comment = false
38903 this.empty = false
38904
38905 // make the set of regexps etc.
38906 this.make()
38907}
38908
38909Minimatch.prototype.debug = function () {}
38910
38911Minimatch.prototype.make = make
38912function make () {
38913 // don't do it more than once.
38914 if (this._made) return
38915
38916 var pattern = this.pattern
38917 var options = this.options
38918
38919 // empty patterns and comments match nothing.
38920 if (!options.nocomment && pattern.charAt(0) === '#') {
38921 this.comment = true
38922 return
38923 }
38924 if (!pattern) {
38925 this.empty = true
38926 return
38927 }
38928
38929 // step 1: figure out negation, etc.
38930 this.parseNegate()
38931
38932 // step 2: expand braces
38933 var set = this.globSet = this.braceExpand()
38934
38935 if (options.debug) this.debug = console.error
38936
38937 this.debug(this.pattern, set)
38938
38939 // step 3: now we have a set, so turn each one into a series of path-portion
38940 // matching patterns.
38941 // These will be regexps, except in the case of "**", which is
38942 // set to the GLOBSTAR object for globstar behavior,
38943 // and will not contain any / characters
38944 set = this.globParts = set.map(function (s) {
38945 return s.split(slashSplit)
38946 })
38947
38948 this.debug(this.pattern, set)
38949
38950 // glob --> regexps
38951 set = set.map(function (s, si, set) {
38952 return s.map(this.parse, this)
38953 }, this)
38954
38955 this.debug(this.pattern, set)
38956
38957 // filter out everything that didn't compile properly.
38958 set = set.filter(function (s) {
38959 return s.indexOf(false) === -1
38960 })
38961
38962 this.debug(this.pattern, set)
38963
38964 this.set = set
38965}
38966
38967Minimatch.prototype.parseNegate = parseNegate
38968function parseNegate () {
38969 var pattern = this.pattern
38970 var negate = false
38971 var options = this.options
38972 var negateOffset = 0
38973
38974 if (options.nonegate) return
38975
38976 for (var i = 0, l = pattern.length
38977 ; i < l && pattern.charAt(i) === '!'
38978 ; i++) {
38979 negate = !negate
38980 negateOffset++
38981 }
38982
38983 if (negateOffset) this.pattern = pattern.substr(negateOffset)
38984 this.negate = negate
38985}
38986
38987// Brace expansion:
38988// a{b,c}d -> abd acd
38989// a{b,}c -> abc ac
38990// a{0..3}d -> a0d a1d a2d a3d
38991// a{b,c{d,e}f}g -> abg acdfg acefg
38992// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
38993//
38994// Invalid sets are not expanded.
38995// a{2..}b -> a{2..}b
38996// a{b}c -> a{b}c
38997minimatch.braceExpand = function (pattern, options) {
38998 return braceExpand(pattern, options)
38999}
39000
39001Minimatch.prototype.braceExpand = braceExpand
39002
39003function braceExpand (pattern, options) {
39004 if (!options) {
39005 if (this instanceof Minimatch) {
39006 options = this.options
39007 } else {
39008 options = {}
39009 }
39010 }
39011
39012 pattern = typeof pattern === 'undefined'
39013 ? this.pattern : pattern
39014
39015 if (typeof pattern === 'undefined') {
39016 throw new TypeError('undefined pattern')
39017 }
39018
39019 if (options.nobrace ||
39020 !pattern.match(/\{.*\}/)) {
39021 // shortcut. no need to expand.
39022 return [pattern]
39023 }
39024
39025 return expand(pattern)
39026}
39027
39028// parse a component of the expanded set.
39029// At this point, no pattern may contain "/" in it
39030// so we're going to return a 2d array, where each entry is the full
39031// pattern, split on '/', and then turned into a regular expression.
39032// A regexp is made at the end which joins each array with an
39033// escaped /, and another full one which joins each regexp with |.
39034//
39035// Following the lead of Bash 4.1, note that "**" only has special meaning
39036// when it is the *only* thing in a path portion. Otherwise, any series
39037// of * is equivalent to a single *. Globstar behavior is enabled by
39038// default, and can be disabled by setting options.noglobstar.
39039Minimatch.prototype.parse = parse
39040var SUBPARSE = {}
39041function parse (pattern, isSub) {
39042 if (pattern.length > 1024 * 64) {
39043 throw new TypeError('pattern is too long')
39044 }
39045
39046 var options = this.options
39047
39048 // shortcuts
39049 if (!options.noglobstar && pattern === '**') return GLOBSTAR
39050 if (pattern === '') return ''
39051
39052 var re = ''
39053 var hasMagic = !!options.nocase
39054 var escaping = false
39055 // ? => one single character
39056 var patternListStack = []
39057 var negativeLists = []
39058 var stateChar
39059 var inClass = false
39060 var reClassStart = -1
39061 var classStart = -1
39062 // . and .. never match anything that doesn't start with .,
39063 // even when options.dot is set.
39064 var patternStart = pattern.charAt(0) === '.' ? '' // anything
39065 // not (start or / followed by . or .. followed by / or end)
39066 : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
39067 : '(?!\\.)'
39068 var self = this
39069
39070 function clearStateChar () {
39071 if (stateChar) {
39072 // we had some state-tracking character
39073 // that wasn't consumed by this pass.
39074 switch (stateChar) {
39075 case '*':
39076 re += star
39077 hasMagic = true
39078 break
39079 case '?':
39080 re += qmark
39081 hasMagic = true
39082 break
39083 default:
39084 re += '\\' + stateChar
39085 break
39086 }
39087 self.debug('clearStateChar %j %j', stateChar, re)
39088 stateChar = false
39089 }
39090 }
39091
39092 for (var i = 0, len = pattern.length, c
39093 ; (i < len) && (c = pattern.charAt(i))
39094 ; i++) {
39095 this.debug('%s\t%s %s %j', pattern, i, re, c)
39096
39097 // skip over any that are escaped.
39098 if (escaping && reSpecials[c]) {
39099 re += '\\' + c
39100 escaping = false
39101 continue
39102 }
39103
39104 switch (c) {
39105 case '/':
39106 // completely not allowed, even escaped.
39107 // Should already be path-split by now.
39108 return false
39109
39110 case '\\':
39111 clearStateChar()
39112 escaping = true
39113 continue
39114
39115 // the various stateChar values
39116 // for the "extglob" stuff.
39117 case '?':
39118 case '*':
39119 case '+':
39120 case '@':
39121 case '!':
39122 this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
39123
39124 // all of those are literals inside a class, except that
39125 // the glob [!a] means [^a] in regexp
39126 if (inClass) {
39127 this.debug(' in class')
39128 if (c === '!' && i === classStart + 1) c = '^'
39129 re += c
39130 continue
39131 }
39132
39133 // if we already have a stateChar, then it means
39134 // that there was something like ** or +? in there.
39135 // Handle the stateChar, then proceed with this one.
39136 self.debug('call clearStateChar %j', stateChar)
39137 clearStateChar()
39138 stateChar = c
39139 // if extglob is disabled, then +(asdf|foo) isn't a thing.
39140 // just clear the statechar *now*, rather than even diving into
39141 // the patternList stuff.
39142 if (options.noext) clearStateChar()
39143 continue
39144
39145 case '(':
39146 if (inClass) {
39147 re += '('
39148 continue
39149 }
39150
39151 if (!stateChar) {
39152 re += '\\('
39153 continue
39154 }
39155
39156 patternListStack.push({
39157 type: stateChar,
39158 start: i - 1,
39159 reStart: re.length,
39160 open: plTypes[stateChar].open,
39161 close: plTypes[stateChar].close
39162 })
39163 // negation is (?:(?!js)[^/]*)
39164 re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
39165 this.debug('plType %j %j', stateChar, re)
39166 stateChar = false
39167 continue
39168
39169 case ')':
39170 if (inClass || !patternListStack.length) {
39171 re += '\\)'
39172 continue
39173 }
39174
39175 clearStateChar()
39176 hasMagic = true
39177 var pl = patternListStack.pop()
39178 // negation is (?:(?!js)[^/]*)
39179 // The others are (?:<pattern>)<type>
39180 re += pl.close
39181 if (pl.type === '!') {
39182 negativeLists.push(pl)
39183 }
39184 pl.reEnd = re.length
39185 continue
39186
39187 case '|':
39188 if (inClass || !patternListStack.length || escaping) {
39189 re += '\\|'
39190 escaping = false
39191 continue
39192 }
39193
39194 clearStateChar()
39195 re += '|'
39196 continue
39197
39198 // these are mostly the same in regexp and glob
39199 case '[':
39200 // swallow any state-tracking char before the [
39201 clearStateChar()
39202
39203 if (inClass) {
39204 re += '\\' + c
39205 continue
39206 }
39207
39208 inClass = true
39209 classStart = i
39210 reClassStart = re.length
39211 re += c
39212 continue
39213
39214 case ']':
39215 // a right bracket shall lose its special
39216 // meaning and represent itself in
39217 // a bracket expression if it occurs
39218 // first in the list. -- POSIX.2 2.8.3.2
39219 if (i === classStart + 1 || !inClass) {
39220 re += '\\' + c
39221 escaping = false
39222 continue
39223 }
39224
39225 // handle the case where we left a class open.
39226 // "[z-a]" is valid, equivalent to "\[z-a\]"
39227 if (inClass) {
39228 // split where the last [ was, make sure we don't have
39229 // an invalid re. if so, re-walk the contents of the
39230 // would-be class to re-translate any characters that
39231 // were passed through as-is
39232 // TODO: It would probably be faster to determine this
39233 // without a try/catch and a new RegExp, but it's tricky
39234 // to do safely. For now, this is safe and works.
39235 var cs = pattern.substring(classStart + 1, i)
39236 try {
39237 RegExp('[' + cs + ']')
39238 } catch (er) {
39239 // not a valid class!
39240 var sp = this.parse(cs, SUBPARSE)
39241 re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
39242 hasMagic = hasMagic || sp[1]
39243 inClass = false
39244 continue
39245 }
39246 }
39247
39248 // finish up the class.
39249 hasMagic = true
39250 inClass = false
39251 re += c
39252 continue
39253
39254 default:
39255 // swallow any state char that wasn't consumed
39256 clearStateChar()
39257
39258 if (escaping) {
39259 // no need
39260 escaping = false
39261 } else if (reSpecials[c]
39262 && !(c === '^' && inClass)) {
39263 re += '\\'
39264 }
39265
39266 re += c
39267
39268 } // switch
39269 } // for
39270
39271 // handle the case where we left a class open.
39272 // "[abc" is valid, equivalent to "\[abc"
39273 if (inClass) {
39274 // split where the last [ was, and escape it
39275 // this is a huge pita. We now have to re-walk
39276 // the contents of the would-be class to re-translate
39277 // any characters that were passed through as-is
39278 cs = pattern.substr(classStart + 1)
39279 sp = this.parse(cs, SUBPARSE)
39280 re = re.substr(0, reClassStart) + '\\[' + sp[0]
39281 hasMagic = hasMagic || sp[1]
39282 }
39283
39284 // handle the case where we had a +( thing at the *end*
39285 // of the pattern.
39286 // each pattern list stack adds 3 chars, and we need to go through
39287 // and escape any | chars that were passed through as-is for the regexp.
39288 // Go through and escape them, taking care not to double-escape any
39289 // | chars that were already escaped.
39290 for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
39291 var tail = re.slice(pl.reStart + pl.open.length)
39292 this.debug('setting tail', re, pl)
39293 // maybe some even number of \, then maybe 1 \, followed by a |
39294 tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
39295 if (!$2) {
39296 // the | isn't already escaped, so escape it.
39297 $2 = '\\'
39298 }
39299
39300 // need to escape all those slashes *again*, without escaping the
39301 // one that we need for escaping the | character. As it works out,
39302 // escaping an even number of slashes can be done by simply repeating
39303 // it exactly after itself. That's why this trick works.
39304 //
39305 // I am sorry that you have to see this.
39306 return $1 + $1 + $2 + '|'
39307 })
39308
39309 this.debug('tail=%j\n %s', tail, tail, pl, re)
39310 var t = pl.type === '*' ? star
39311 : pl.type === '?' ? qmark
39312 : '\\' + pl.type
39313
39314 hasMagic = true
39315 re = re.slice(0, pl.reStart) + t + '\\(' + tail
39316 }
39317
39318 // handle trailing things that only matter at the very end.
39319 clearStateChar()
39320 if (escaping) {
39321 // trailing \\
39322 re += '\\\\'
39323 }
39324
39325 // only need to apply the nodot start if the re starts with
39326 // something that could conceivably capture a dot
39327 var addPatternStart = false
39328 switch (re.charAt(0)) {
39329 case '.':
39330 case '[':
39331 case '(': addPatternStart = true
39332 }
39333
39334 // Hack to work around lack of negative lookbehind in JS
39335 // A pattern like: *.!(x).!(y|z) needs to ensure that a name
39336 // like 'a.xyz.yz' doesn't match. So, the first negative
39337 // lookahead, has to look ALL the way ahead, to the end of
39338 // the pattern.
39339 for (var n = negativeLists.length - 1; n > -1; n--) {
39340 var nl = negativeLists[n]
39341
39342 var nlBefore = re.slice(0, nl.reStart)
39343 var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
39344 var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
39345 var nlAfter = re.slice(nl.reEnd)
39346
39347 nlLast += nlAfter
39348
39349 // Handle nested stuff like *(*.js|!(*.json)), where open parens
39350 // mean that we should *not* include the ) in the bit that is considered
39351 // "after" the negated section.
39352 var openParensBefore = nlBefore.split('(').length - 1
39353 var cleanAfter = nlAfter
39354 for (i = 0; i < openParensBefore; i++) {
39355 cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
39356 }
39357 nlAfter = cleanAfter
39358
39359 var dollar = ''
39360 if (nlAfter === '' && isSub !== SUBPARSE) {
39361 dollar = '$'
39362 }
39363 var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
39364 re = newRe
39365 }
39366
39367 // if the re is not "" at this point, then we need to make sure
39368 // it doesn't match against an empty path part.
39369 // Otherwise a/* will match a/, which it should not.
39370 if (re !== '' && hasMagic) {
39371 re = '(?=.)' + re
39372 }
39373
39374 if (addPatternStart) {
39375 re = patternStart + re
39376 }
39377
39378 // parsing just a piece of a larger pattern.
39379 if (isSub === SUBPARSE) {
39380 return [re, hasMagic]
39381 }
39382
39383 // skip the regexp for non-magical patterns
39384 // unescape anything in it, though, so that it'll be
39385 // an exact match against a file etc.
39386 if (!hasMagic) {
39387 return globUnescape(pattern)
39388 }
39389
39390 var flags = options.nocase ? 'i' : ''
39391 try {
39392 var regExp = new RegExp('^' + re + '$', flags)
39393 } catch (er) {
39394 // If it was an invalid regular expression, then it can't match
39395 // anything. This trick looks for a character after the end of
39396 // the string, which is of course impossible, except in multi-line
39397 // mode, but it's not a /m regex.
39398 return new RegExp('$.')
39399 }
39400
39401 regExp._glob = pattern
39402 regExp._src = re
39403
39404 return regExp
39405}
39406
39407minimatch.makeRe = function (pattern, options) {
39408 return new Minimatch(pattern, options || {}).makeRe()
39409}
39410
39411Minimatch.prototype.makeRe = makeRe
39412function makeRe () {
39413 if (this.regexp || this.regexp === false) return this.regexp
39414
39415 // at this point, this.set is a 2d array of partial
39416 // pattern strings, or "**".
39417 //
39418 // It's better to use .match(). This function shouldn't
39419 // be used, really, but it's pretty convenient sometimes,
39420 // when you just want to work with a regex.
39421 var set = this.set
39422
39423 if (!set.length) {
39424 this.regexp = false
39425 return this.regexp
39426 }
39427 var options = this.options
39428
39429 var twoStar = options.noglobstar ? star
39430 : options.dot ? twoStarDot
39431 : twoStarNoDot
39432 var flags = options.nocase ? 'i' : ''
39433
39434 var re = set.map(function (pattern) {
39435 return pattern.map(function (p) {
39436 return (p === GLOBSTAR) ? twoStar
39437 : (typeof p === 'string') ? regExpEscape(p)
39438 : p._src
39439 }).join('\\\/')
39440 }).join('|')
39441
39442 // must match entire pattern
39443 // ending in a * or ** will make it less strict.
39444 re = '^(?:' + re + ')$'
39445
39446 // can match anything, as long as it's not this.
39447 if (this.negate) re = '^(?!' + re + ').*$'
39448
39449 try {
39450 this.regexp = new RegExp(re, flags)
39451 } catch (ex) {
39452 this.regexp = false
39453 }
39454 return this.regexp
39455}
39456
39457minimatch.match = function (list, pattern, options) {
39458 options = options || {}
39459 var mm = new Minimatch(pattern, options)
39460 list = list.filter(function (f) {
39461 return mm.match(f)
39462 })
39463 if (mm.options.nonull && !list.length) {
39464 list.push(pattern)
39465 }
39466 return list
39467}
39468
39469Minimatch.prototype.match = match
39470function match (f, partial) {
39471 this.debug('match', f, this.pattern)
39472 // short-circuit in the case of busted things.
39473 // comments, etc.
39474 if (this.comment) return false
39475 if (this.empty) return f === ''
39476
39477 if (f === '/' && partial) return true
39478
39479 var options = this.options
39480
39481 // windows: need to use /, not \
39482 if (path.sep !== '/') {
39483 f = f.split(path.sep).join('/')
39484 }
39485
39486 // treat the test path as a set of pathparts.
39487 f = f.split(slashSplit)
39488 this.debug(this.pattern, 'split', f)
39489
39490 // just ONE of the pattern sets in this.set needs to match
39491 // in order for it to be valid. If negating, then just one
39492 // match means that we have failed.
39493 // Either way, return on the first hit.
39494
39495 var set = this.set
39496 this.debug(this.pattern, 'set', set)
39497
39498 // Find the basename of the path by looking for the last non-empty segment
39499 var filename
39500 var i
39501 for (i = f.length - 1; i >= 0; i--) {
39502 filename = f[i]
39503 if (filename) break
39504 }
39505
39506 for (i = 0; i < set.length; i++) {
39507 var pattern = set[i]
39508 var file = f
39509 if (options.matchBase && pattern.length === 1) {
39510 file = [filename]
39511 }
39512 var hit = this.matchOne(file, pattern, partial)
39513 if (hit) {
39514 if (options.flipNegate) return true
39515 return !this.negate
39516 }
39517 }
39518
39519 // didn't get any hits. this is success if it's a negative
39520 // pattern, failure otherwise.
39521 if (options.flipNegate) return false
39522 return this.negate
39523}
39524
39525// set partial to true to test if, for example,
39526// "/a/b" matches the start of "/*/b/*/d"
39527// Partial means, if you run out of file before you run
39528// out of pattern, then that's fine, as long as all
39529// the parts match.
39530Minimatch.prototype.matchOne = function (file, pattern, partial) {
39531 var options = this.options
39532
39533 this.debug('matchOne',
39534 { 'this': this, file: file, pattern: pattern })
39535
39536 this.debug('matchOne', file.length, pattern.length)
39537
39538 for (var fi = 0,
39539 pi = 0,
39540 fl = file.length,
39541 pl = pattern.length
39542 ; (fi < fl) && (pi < pl)
39543 ; fi++, pi++) {
39544 this.debug('matchOne loop')
39545 var p = pattern[pi]
39546 var f = file[fi]
39547
39548 this.debug(pattern, p, f)
39549
39550 // should be impossible.
39551 // some invalid regexp stuff in the set.
39552 if (p === false) return false
39553
39554 if (p === GLOBSTAR) {
39555 this.debug('GLOBSTAR', [pattern, p, f])
39556
39557 // "**"
39558 // a/**/b/**/c would match the following:
39559 // a/b/x/y/z/c
39560 // a/x/y/z/b/c
39561 // a/b/x/b/x/c
39562 // a/b/c
39563 // To do this, take the rest of the pattern after
39564 // the **, and see if it would match the file remainder.
39565 // If so, return success.
39566 // If not, the ** "swallows" a segment, and try again.
39567 // This is recursively awful.
39568 //
39569 // a/**/b/**/c matching a/b/x/y/z/c
39570 // - a matches a
39571 // - doublestar
39572 // - matchOne(b/x/y/z/c, b/**/c)
39573 // - b matches b
39574 // - doublestar
39575 // - matchOne(x/y/z/c, c) -> no
39576 // - matchOne(y/z/c, c) -> no
39577 // - matchOne(z/c, c) -> no
39578 // - matchOne(c, c) yes, hit
39579 var fr = fi
39580 var pr = pi + 1
39581 if (pr === pl) {
39582 this.debug('** at the end')
39583 // a ** at the end will just swallow the rest.
39584 // We have found a match.
39585 // however, it will not swallow /.x, unless
39586 // options.dot is set.
39587 // . and .. are *never* matched by **, for explosively
39588 // exponential reasons.
39589 for (; fi < fl; fi++) {
39590 if (file[fi] === '.' || file[fi] === '..' ||
39591 (!options.dot && file[fi].charAt(0) === '.')) return false
39592 }
39593 return true
39594 }
39595
39596 // ok, let's see if we can swallow whatever we can.
39597 while (fr < fl) {
39598 var swallowee = file[fr]
39599
39600 this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
39601
39602 // XXX remove this slice. Just pass the start index.
39603 if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
39604 this.debug('globstar found match!', fr, fl, swallowee)
39605 // found a match.
39606 return true
39607 } else {
39608 // can't swallow "." or ".." ever.
39609 // can only swallow ".foo" when explicitly asked.
39610 if (swallowee === '.' || swallowee === '..' ||
39611 (!options.dot && swallowee.charAt(0) === '.')) {
39612 this.debug('dot detected!', file, fr, pattern, pr)
39613 break
39614 }
39615
39616 // ** swallows a segment, and continue.
39617 this.debug('globstar swallow a segment, and continue')
39618 fr++
39619 }
39620 }
39621
39622 // no match was found.
39623 // However, in partial mode, we can't say this is necessarily over.
39624 // If there's more *pattern* left, then
39625 if (partial) {
39626 // ran out of file
39627 this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
39628 if (fr === fl) return true
39629 }
39630 return false
39631 }
39632
39633 // something other than **
39634 // non-magic patterns just have to match exactly
39635 // patterns with magic have been turned into regexps.
39636 var hit
39637 if (typeof p === 'string') {
39638 if (options.nocase) {
39639 hit = f.toLowerCase() === p.toLowerCase()
39640 } else {
39641 hit = f === p
39642 }
39643 this.debug('string match', p, f, hit)
39644 } else {
39645 hit = f.match(p)
39646 this.debug('pattern match', p, f, hit)
39647 }
39648
39649 if (!hit) return false
39650 }
39651
39652 // Note: ending in / means that we'll get a final ""
39653 // at the end of the pattern. This can only match a
39654 // corresponding "" at the end of the file.
39655 // If the file ends in /, then it can only match a
39656 // a pattern that ends in /, unless the pattern just
39657 // doesn't have any more for it. But, a/b/ should *not*
39658 // match "a/b/*", even though "" matches against the
39659 // [^/]*? pattern, except in partial mode, where it might
39660 // simply not be reached yet.
39661 // However, a/b/ should still satisfy a/*
39662
39663 // now either we fell off the end of the pattern, or we're done.
39664 if (fi === fl && pi === pl) {
39665 // ran out of pattern and filename at the same time.
39666 // an exact hit!
39667 return true
39668 } else if (fi === fl) {
39669 // ran out of file, but still had pattern left.
39670 // this is ok if we're doing the match as part of
39671 // a glob fs traversal.
39672 return partial
39673 } else if (pi === pl) {
39674 // ran out of pattern, still have file left.
39675 // this is only acceptable if we're on the very last
39676 // empty segment of a file with a trailing slash.
39677 // a/* should match a/b/
39678 var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
39679 return emptyFileEnd
39680 }
39681
39682 // should be unreachable.
39683 throw new Error('wtf?')
39684}
39685
39686// replace stuff like \* with *
39687function globUnescape (s) {
39688 return s.replace(/\\(.)/g, '$1')
39689}
39690
39691function regExpEscape (s) {
39692 return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
39693}
39694
39695},{"brace-expansion":119,"path":469}],467:[function(require,module,exports){
39696/**
39697 * Helpers.
39698 */
39699
39700var s = 1000
39701var m = s * 60
39702var h = m * 60
39703var d = h * 24
39704var y = d * 365.25
39705
39706/**
39707 * Parse or format the given `val`.
39708 *
39709 * Options:
39710 *
39711 * - `long` verbose formatting [false]
39712 *
39713 * @param {String|Number} val
39714 * @param {Object} options
39715 * @throws {Error} throw an error if val is not a non-empty string or a number
39716 * @return {String|Number}
39717 * @api public
39718 */
39719
39720module.exports = function (val, options) {
39721 options = options || {}
39722 var type = typeof val
39723 if (type === 'string' && val.length > 0) {
39724 return parse(val)
39725 } else if (type === 'number' && isNaN(val) === false) {
39726 return options.long ?
39727 fmtLong(val) :
39728 fmtShort(val)
39729 }
39730 throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val))
39731}
39732
39733/**
39734 * Parse the given `str` and return milliseconds.
39735 *
39736 * @param {String} str
39737 * @return {Number}
39738 * @api private
39739 */
39740
39741function parse(str) {
39742 str = String(str)
39743 if (str.length > 10000) {
39744 return
39745 }
39746 var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str)
39747 if (!match) {
39748 return
39749 }
39750 var n = parseFloat(match[1])
39751 var type = (match[2] || 'ms').toLowerCase()
39752 switch (type) {
39753 case 'years':
39754 case 'year':
39755 case 'yrs':
39756 case 'yr':
39757 case 'y':
39758 return n * y
39759 case 'days':
39760 case 'day':
39761 case 'd':
39762 return n * d
39763 case 'hours':
39764 case 'hour':
39765 case 'hrs':
39766 case 'hr':
39767 case 'h':
39768 return n * h
39769 case 'minutes':
39770 case 'minute':
39771 case 'mins':
39772 case 'min':
39773 case 'm':
39774 return n * m
39775 case 'seconds':
39776 case 'second':
39777 case 'secs':
39778 case 'sec':
39779 case 's':
39780 return n * s
39781 case 'milliseconds':
39782 case 'millisecond':
39783 case 'msecs':
39784 case 'msec':
39785 case 'ms':
39786 return n
39787 default:
39788 return undefined
39789 }
39790}
39791
39792/**
39793 * Short format for `ms`.
39794 *
39795 * @param {Number} ms
39796 * @return {String}
39797 * @api private
39798 */
39799
39800function fmtShort(ms) {
39801 if (ms >= d) {
39802 return Math.round(ms / d) + 'd'
39803 }
39804 if (ms >= h) {
39805 return Math.round(ms / h) + 'h'
39806 }
39807 if (ms >= m) {
39808 return Math.round(ms / m) + 'm'
39809 }
39810 if (ms >= s) {
39811 return Math.round(ms / s) + 's'
39812 }
39813 return ms + 'ms'
39814}
39815
39816/**
39817 * Long format for `ms`.
39818 *
39819 * @param {Number} ms
39820 * @return {String}
39821 * @api private
39822 */
39823
39824function fmtLong(ms) {
39825 return plural(ms, d, 'day') ||
39826 plural(ms, h, 'hour') ||
39827 plural(ms, m, 'minute') ||
39828 plural(ms, s, 'second') ||
39829 ms + ' ms'
39830}
39831
39832/**
39833 * Pluralization helper.
39834 */
39835
39836function plural(ms, n, name) {
39837 if (ms < n) {
39838 return
39839 }
39840 if (ms < n * 1.5) {
39841 return Math.floor(ms / n) + ' ' + name
39842 }
39843 return Math.ceil(ms / n) + ' ' + name + 's'
39844}
39845
39846},{}],468:[function(require,module,exports){
39847'use strict';
39848module.exports = Number.isNaN || function (x) {
39849 return x !== x;
39850};
39851
39852},{}],469:[function(require,module,exports){
39853(function (process){
39854// Copyright Joyent, Inc. and other Node contributors.
39855//
39856// Permission is hereby granted, free of charge, to any person obtaining a
39857// copy of this software and associated documentation files (the
39858// "Software"), to deal in the Software without restriction, including
39859// without limitation the rights to use, copy, modify, merge, publish,
39860// distribute, sublicense, and/or sell copies of the Software, and to permit
39861// persons to whom the Software is furnished to do so, subject to the
39862// following conditions:
39863//
39864// The above copyright notice and this permission notice shall be included
39865// in all copies or substantial portions of the Software.
39866//
39867// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
39868// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
39869// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
39870// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
39871// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
39872// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
39873// USE OR OTHER DEALINGS IN THE SOFTWARE.
39874
39875// resolves . and .. elements in a path array with directory names there
39876// must be no slashes, empty elements, or device names (c:\) in the array
39877// (so also no leading and trailing slashes - it does not distinguish
39878// relative and absolute paths)
39879function normalizeArray(parts, allowAboveRoot) {
39880 // if the path tries to go above the root, `up` ends up > 0
39881 var up = 0;
39882 for (var i = parts.length - 1; i >= 0; i--) {
39883 var last = parts[i];
39884 if (last === '.') {
39885 parts.splice(i, 1);
39886 } else if (last === '..') {
39887 parts.splice(i, 1);
39888 up++;
39889 } else if (up) {
39890 parts.splice(i, 1);
39891 up--;
39892 }
39893 }
39894
39895 // if the path is allowed to go above the root, restore leading ..s
39896 if (allowAboveRoot) {
39897 for (; up--; up) {
39898 parts.unshift('..');
39899 }
39900 }
39901
39902 return parts;
39903}
39904
39905// Split a filename into [root, dir, basename, ext], unix version
39906// 'root' is just a slash, or nothing.
39907var splitPathRe =
39908 /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
39909var splitPath = function(filename) {
39910 return splitPathRe.exec(filename).slice(1);
39911};
39912
39913// path.resolve([from ...], to)
39914// posix version
39915exports.resolve = function() {
39916 var resolvedPath = '',
39917 resolvedAbsolute = false;
39918
39919 for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
39920 var path = (i >= 0) ? arguments[i] : process.cwd();
39921
39922 // Skip empty and invalid entries
39923 if (typeof path !== 'string') {
39924 throw new TypeError('Arguments to path.resolve must be strings');
39925 } else if (!path) {
39926 continue;
39927 }
39928
39929 resolvedPath = path + '/' + resolvedPath;
39930 resolvedAbsolute = path.charAt(0) === '/';
39931 }
39932
39933 // At this point the path should be resolved to a full absolute path, but
39934 // handle relative paths to be safe (might happen when process.cwd() fails)
39935
39936 // Normalize the path
39937 resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
39938 return !!p;
39939 }), !resolvedAbsolute).join('/');
39940
39941 return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
39942};
39943
39944// path.normalize(path)
39945// posix version
39946exports.normalize = function(path) {
39947 var isAbsolute = exports.isAbsolute(path),
39948 trailingSlash = substr(path, -1) === '/';
39949
39950 // Normalize the path
39951 path = normalizeArray(filter(path.split('/'), function(p) {
39952 return !!p;
39953 }), !isAbsolute).join('/');
39954
39955 if (!path && !isAbsolute) {
39956 path = '.';
39957 }
39958 if (path && trailingSlash) {
39959 path += '/';
39960 }
39961
39962 return (isAbsolute ? '/' : '') + path;
39963};
39964
39965// posix version
39966exports.isAbsolute = function(path) {
39967 return path.charAt(0) === '/';
39968};
39969
39970// posix version
39971exports.join = function() {
39972 var paths = Array.prototype.slice.call(arguments, 0);
39973 return exports.normalize(filter(paths, function(p, index) {
39974 if (typeof p !== 'string') {
39975 throw new TypeError('Arguments to path.join must be strings');
39976 }
39977 return p;
39978 }).join('/'));
39979};
39980
39981
39982// path.relative(from, to)
39983// posix version
39984exports.relative = function(from, to) {
39985 from = exports.resolve(from).substr(1);
39986 to = exports.resolve(to).substr(1);
39987
39988 function trim(arr) {
39989 var start = 0;
39990 for (; start < arr.length; start++) {
39991 if (arr[start] !== '') break;
39992 }
39993
39994 var end = arr.length - 1;
39995 for (; end >= 0; end--) {
39996 if (arr[end] !== '') break;
39997 }
39998
39999 if (start > end) return [];
40000 return arr.slice(start, end - start + 1);
40001 }
40002
40003 var fromParts = trim(from.split('/'));
40004 var toParts = trim(to.split('/'));
40005
40006 var length = Math.min(fromParts.length, toParts.length);
40007 var samePartsLength = length;
40008 for (var i = 0; i < length; i++) {
40009 if (fromParts[i] !== toParts[i]) {
40010 samePartsLength = i;
40011 break;
40012 }
40013 }
40014
40015 var outputParts = [];
40016 for (var i = samePartsLength; i < fromParts.length; i++) {
40017 outputParts.push('..');
40018 }
40019
40020 outputParts = outputParts.concat(toParts.slice(samePartsLength));
40021
40022 return outputParts.join('/');
40023};
40024
40025exports.sep = '/';
40026exports.delimiter = ':';
40027
40028exports.dirname = function(path) {
40029 var result = splitPath(path),
40030 root = result[0],
40031 dir = result[1];
40032
40033 if (!root && !dir) {
40034 // No dirname whatsoever
40035 return '.';
40036 }
40037
40038 if (dir) {
40039 // It has a dirname, strip trailing slash
40040 dir = dir.substr(0, dir.length - 1);
40041 }
40042
40043 return root + dir;
40044};
40045
40046
40047exports.basename = function(path, ext) {
40048 var f = splitPath(path)[2];
40049 // TODO: make this comparison case-insensitive on windows?
40050 if (ext && f.substr(-1 * ext.length) === ext) {
40051 f = f.substr(0, f.length - ext.length);
40052 }
40053 return f;
40054};
40055
40056
40057exports.extname = function(path) {
40058 return splitPath(path)[3];
40059};
40060
40061function filter (xs, f) {
40062 if (xs.filter) return xs.filter(f);
40063 var res = [];
40064 for (var i = 0; i < xs.length; i++) {
40065 if (f(xs[i], i, xs)) res.push(xs[i]);
40066 }
40067 return res;
40068}
40069
40070// String.prototype.substr - negative index don't work in IE8
40071var substr = 'ab'.substr(-1) === 'b'
40072 ? function (str, start, len) { return str.substr(start, len) }
40073 : function (str, start, len) {
40074 if (start < 0) start = str.length + start;
40075 return str.substr(start, len);
40076 }
40077;
40078
40079}).call(this,require('_process'))
40080},{"_process":471}],470:[function(require,module,exports){
40081(function (process){
40082'use strict';
40083
40084function posix(path) {
40085 return path.charAt(0) === '/';
40086}
40087
40088function win32(path) {
40089 // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
40090 var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
40091 var result = splitDeviceRe.exec(path);
40092 var device = result[1] || '';
40093 var isUnc = Boolean(device && device.charAt(1) !== ':');
40094
40095 // UNC paths are always absolute
40096 return Boolean(result[2] || isUnc);
40097}
40098
40099module.exports = process.platform === 'win32' ? win32 : posix;
40100module.exports.posix = posix;
40101module.exports.win32 = win32;
40102
40103}).call(this,require('_process'))
40104},{"_process":471}],471:[function(require,module,exports){
40105// shim for using process in browser
40106var process = module.exports = {};
40107
40108// cached from whatever global is present so that test runners that stub it
40109// don't break things. But we need to wrap it in a try catch in case it is
40110// wrapped in strict mode code which doesn't define any globals. It's inside a
40111// function because try/catches deoptimize in certain engines.
40112
40113var cachedSetTimeout;
40114var cachedClearTimeout;
40115
40116function defaultSetTimout() {
40117 throw new Error('setTimeout has not been defined');
40118}
40119function defaultClearTimeout () {
40120 throw new Error('clearTimeout has not been defined');
40121}
40122(function () {
40123 try {
40124 if (typeof setTimeout === 'function') {
40125 cachedSetTimeout = setTimeout;
40126 } else {
40127 cachedSetTimeout = defaultSetTimout;
40128 }
40129 } catch (e) {
40130 cachedSetTimeout = defaultSetTimout;
40131 }
40132 try {
40133 if (typeof clearTimeout === 'function') {
40134 cachedClearTimeout = clearTimeout;
40135 } else {
40136 cachedClearTimeout = defaultClearTimeout;
40137 }
40138 } catch (e) {
40139 cachedClearTimeout = defaultClearTimeout;
40140 }
40141} ())
40142function runTimeout(fun) {
40143 if (cachedSetTimeout === setTimeout) {
40144 //normal enviroments in sane situations
40145 return setTimeout(fun, 0);
40146 }
40147 // if setTimeout wasn't available but was latter defined
40148 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
40149 cachedSetTimeout = setTimeout;
40150 return setTimeout(fun, 0);
40151 }
40152 try {
40153 // when when somebody has screwed with setTimeout but no I.E. maddness
40154 return cachedSetTimeout(fun, 0);
40155 } catch(e){
40156 try {
40157 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
40158 return cachedSetTimeout.call(null, fun, 0);
40159 } catch(e){
40160 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
40161 return cachedSetTimeout.call(this, fun, 0);
40162 }
40163 }
40164
40165
40166}
40167function runClearTimeout(marker) {
40168 if (cachedClearTimeout === clearTimeout) {
40169 //normal enviroments in sane situations
40170 return clearTimeout(marker);
40171 }
40172 // if clearTimeout wasn't available but was latter defined
40173 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
40174 cachedClearTimeout = clearTimeout;
40175 return clearTimeout(marker);
40176 }
40177 try {
40178 // when when somebody has screwed with setTimeout but no I.E. maddness
40179 return cachedClearTimeout(marker);
40180 } catch (e){
40181 try {
40182 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
40183 return cachedClearTimeout.call(null, marker);
40184 } catch (e){
40185 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
40186 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
40187 return cachedClearTimeout.call(this, marker);
40188 }
40189 }
40190
40191
40192
40193}
40194var queue = [];
40195var draining = false;
40196var currentQueue;
40197var queueIndex = -1;
40198
40199function cleanUpNextTick() {
40200 if (!draining || !currentQueue) {
40201 return;
40202 }
40203 draining = false;
40204 if (currentQueue.length) {
40205 queue = currentQueue.concat(queue);
40206 } else {
40207 queueIndex = -1;
40208 }
40209 if (queue.length) {
40210 drainQueue();
40211 }
40212}
40213
40214function drainQueue() {
40215 if (draining) {
40216 return;
40217 }
40218 var timeout = runTimeout(cleanUpNextTick);
40219 draining = true;
40220
40221 var len = queue.length;
40222 while(len) {
40223 currentQueue = queue;
40224 queue = [];
40225 while (++queueIndex < len) {
40226 if (currentQueue) {
40227 currentQueue[queueIndex].run();
40228 }
40229 }
40230 queueIndex = -1;
40231 len = queue.length;
40232 }
40233 currentQueue = null;
40234 draining = false;
40235 runClearTimeout(timeout);
40236}
40237
40238process.nextTick = function (fun) {
40239 var args = new Array(arguments.length - 1);
40240 if (arguments.length > 1) {
40241 for (var i = 1; i < arguments.length; i++) {
40242 args[i - 1] = arguments[i];
40243 }
40244 }
40245 queue.push(new Item(fun, args));
40246 if (queue.length === 1 && !draining) {
40247 runTimeout(drainQueue);
40248 }
40249};
40250
40251// v8 likes predictible objects
40252function Item(fun, array) {
40253 this.fun = fun;
40254 this.array = array;
40255}
40256Item.prototype.run = function () {
40257 this.fun.apply(null, this.array);
40258};
40259process.title = 'browser';
40260process.browser = true;
40261process.env = {};
40262process.argv = [];
40263process.version = ''; // empty string to avoid regexp issues
40264process.versions = {};
40265
40266function noop() {}
40267
40268process.on = noop;
40269process.addListener = noop;
40270process.once = noop;
40271process.off = noop;
40272process.removeListener = noop;
40273process.removeAllListeners = noop;
40274process.emit = noop;
40275
40276process.binding = function (name) {
40277 throw new Error('process.binding is not supported');
40278};
40279
40280process.cwd = function () { return '/' };
40281process.chdir = function (dir) {
40282 throw new Error('process.chdir is not supported');
40283};
40284process.umask = function() { return 0; };
40285
40286},{}],472:[function(require,module,exports){
40287'use strict';
40288var isFinite = require('is-finite');
40289
40290module.exports = function (str, n) {
40291 if (typeof str !== 'string') {
40292 throw new TypeError('Expected `input` to be a string');
40293 }
40294
40295 if (n < 0 || !isFinite(n)) {
40296 throw new TypeError('Expected `count` to be a positive finite number');
40297 }
40298
40299 var ret = '';
40300
40301 do {
40302 if (n & 1) {
40303 ret += str;
40304 }
40305
40306 str += str;
40307 } while ((n >>= 1));
40308
40309 return ret;
40310};
40311
40312},{"is-finite":246}],473:[function(require,module,exports){
40313'use strict';
40314module.exports = function (str) {
40315 var isExtendedLengthPath = /^\\\\\?\\/.test(str);
40316 var hasNonAscii = /[^\x00-\x80]+/.test(str);
40317
40318 if (isExtendedLengthPath || hasNonAscii) {
40319 return str;
40320 }
40321
40322 return str.replace(/\\/g, '/');
40323};
40324
40325},{}],474:[function(require,module,exports){
40326/* -*- Mode: js; js-indent-level: 2; -*- */
40327/*
40328 * Copyright 2011 Mozilla Foundation and contributors
40329 * Licensed under the New BSD license. See LICENSE or:
40330 * http://opensource.org/licenses/BSD-3-Clause
40331 */
40332
40333var util = require('./util');
40334var has = Object.prototype.hasOwnProperty;
40335
40336/**
40337 * A data structure which is a combination of an array and a set. Adding a new
40338 * member is O(1), testing for membership is O(1), and finding the index of an
40339 * element is O(1). Removing elements from the set is not supported. Only
40340 * strings are supported for membership.
40341 */
40342function ArraySet() {
40343 this._array = [];
40344 this._set = Object.create(null);
40345}
40346
40347/**
40348 * Static method for creating ArraySet instances from an existing array.
40349 */
40350ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
40351 var set = new ArraySet();
40352 for (var i = 0, len = aArray.length; i < len; i++) {
40353 set.add(aArray[i], aAllowDuplicates);
40354 }
40355 return set;
40356};
40357
40358/**
40359 * Return how many unique items are in this ArraySet. If duplicates have been
40360 * added, than those do not count towards the size.
40361 *
40362 * @returns Number
40363 */
40364ArraySet.prototype.size = function ArraySet_size() {
40365 return Object.getOwnPropertyNames(this._set).length;
40366};
40367
40368/**
40369 * Add the given string to this set.
40370 *
40371 * @param String aStr
40372 */
40373ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
40374 var sStr = util.toSetString(aStr);
40375 var isDuplicate = has.call(this._set, sStr);
40376 var idx = this._array.length;
40377 if (!isDuplicate || aAllowDuplicates) {
40378 this._array.push(aStr);
40379 }
40380 if (!isDuplicate) {
40381 this._set[sStr] = idx;
40382 }
40383};
40384
40385/**
40386 * Is the given string a member of this set?
40387 *
40388 * @param String aStr
40389 */
40390ArraySet.prototype.has = function ArraySet_has(aStr) {
40391 var sStr = util.toSetString(aStr);
40392 return has.call(this._set, sStr);
40393};
40394
40395/**
40396 * What is the index of the given string in the array?
40397 *
40398 * @param String aStr
40399 */
40400ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
40401 var sStr = util.toSetString(aStr);
40402 if (has.call(this._set, sStr)) {
40403 return this._set[sStr];
40404 }
40405 throw new Error('"' + aStr + '" is not in the set.');
40406};
40407
40408/**
40409 * What is the element at the given index?
40410 *
40411 * @param Number aIdx
40412 */
40413ArraySet.prototype.at = function ArraySet_at(aIdx) {
40414 if (aIdx >= 0 && aIdx < this._array.length) {
40415 return this._array[aIdx];
40416 }
40417 throw new Error('No element indexed by ' + aIdx);
40418};
40419
40420/**
40421 * Returns the array representation of this set (which has the proper indices
40422 * indicated by indexOf). Note that this is a copy of the internal array used
40423 * for storing the members so that no one can mess with internal state.
40424 */
40425ArraySet.prototype.toArray = function ArraySet_toArray() {
40426 return this._array.slice();
40427};
40428
40429exports.ArraySet = ArraySet;
40430
40431},{"./util":483}],475:[function(require,module,exports){
40432/* -*- Mode: js; js-indent-level: 2; -*- */
40433/*
40434 * Copyright 2011 Mozilla Foundation and contributors
40435 * Licensed under the New BSD license. See LICENSE or:
40436 * http://opensource.org/licenses/BSD-3-Clause
40437 *
40438 * Based on the Base 64 VLQ implementation in Closure Compiler:
40439 * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
40440 *
40441 * Copyright 2011 The Closure Compiler Authors. All rights reserved.
40442 * Redistribution and use in source and binary forms, with or without
40443 * modification, are permitted provided that the following conditions are
40444 * met:
40445 *
40446 * * Redistributions of source code must retain the above copyright
40447 * notice, this list of conditions and the following disclaimer.
40448 * * Redistributions in binary form must reproduce the above
40449 * copyright notice, this list of conditions and the following
40450 * disclaimer in the documentation and/or other materials provided
40451 * with the distribution.
40452 * * Neither the name of Google Inc. nor the names of its
40453 * contributors may be used to endorse or promote products derived
40454 * from this software without specific prior written permission.
40455 *
40456 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
40457 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40458 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
40459 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
40460 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40461 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
40462 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
40463 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
40464 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40465 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40466 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40467 */
40468
40469var base64 = require('./base64');
40470
40471// A single base 64 digit can contain 6 bits of data. For the base 64 variable
40472// length quantities we use in the source map spec, the first bit is the sign,
40473// the next four bits are the actual value, and the 6th bit is the
40474// continuation bit. The continuation bit tells us whether there are more
40475// digits in this value following this digit.
40476//
40477// Continuation
40478// | Sign
40479// | |
40480// V V
40481// 101011
40482
40483var VLQ_BASE_SHIFT = 5;
40484
40485// binary: 100000
40486var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
40487
40488// binary: 011111
40489var VLQ_BASE_MASK = VLQ_BASE - 1;
40490
40491// binary: 100000
40492var VLQ_CONTINUATION_BIT = VLQ_BASE;
40493
40494/**
40495 * Converts from a two-complement value to a value where the sign bit is
40496 * placed in the least significant bit. For example, as decimals:
40497 * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
40498 * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
40499 */
40500function toVLQSigned(aValue) {
40501 return aValue < 0
40502 ? ((-aValue) << 1) + 1
40503 : (aValue << 1) + 0;
40504}
40505
40506/**
40507 * Converts to a two-complement value from a value where the sign bit is
40508 * placed in the least significant bit. For example, as decimals:
40509 * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
40510 * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
40511 */
40512function fromVLQSigned(aValue) {
40513 var isNegative = (aValue & 1) === 1;
40514 var shifted = aValue >> 1;
40515 return isNegative
40516 ? -shifted
40517 : shifted;
40518}
40519
40520/**
40521 * Returns the base 64 VLQ encoded value.
40522 */
40523exports.encode = function base64VLQ_encode(aValue) {
40524 var encoded = "";
40525 var digit;
40526
40527 var vlq = toVLQSigned(aValue);
40528
40529 do {
40530 digit = vlq & VLQ_BASE_MASK;
40531 vlq >>>= VLQ_BASE_SHIFT;
40532 if (vlq > 0) {
40533 // There are still more digits in this value, so we must make sure the
40534 // continuation bit is marked.
40535 digit |= VLQ_CONTINUATION_BIT;
40536 }
40537 encoded += base64.encode(digit);
40538 } while (vlq > 0);
40539
40540 return encoded;
40541};
40542
40543/**
40544 * Decodes the next base 64 VLQ value from the given string and returns the
40545 * value and the rest of the string via the out parameter.
40546 */
40547exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
40548 var strLen = aStr.length;
40549 var result = 0;
40550 var shift = 0;
40551 var continuation, digit;
40552
40553 do {
40554 if (aIndex >= strLen) {
40555 throw new Error("Expected more digits in base 64 VLQ value.");
40556 }
40557
40558 digit = base64.decode(aStr.charCodeAt(aIndex++));
40559 if (digit === -1) {
40560 throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
40561 }
40562
40563 continuation = !!(digit & VLQ_CONTINUATION_BIT);
40564 digit &= VLQ_BASE_MASK;
40565 result = result + (digit << shift);
40566 shift += VLQ_BASE_SHIFT;
40567 } while (continuation);
40568
40569 aOutParam.value = fromVLQSigned(result);
40570 aOutParam.rest = aIndex;
40571};
40572
40573},{"./base64":476}],476:[function(require,module,exports){
40574/* -*- Mode: js; js-indent-level: 2; -*- */
40575/*
40576 * Copyright 2011 Mozilla Foundation and contributors
40577 * Licensed under the New BSD license. See LICENSE or:
40578 * http://opensource.org/licenses/BSD-3-Clause
40579 */
40580
40581var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
40582
40583/**
40584 * Encode an integer in the range of 0 to 63 to a single base 64 digit.
40585 */
40586exports.encode = function (number) {
40587 if (0 <= number && number < intToCharMap.length) {
40588 return intToCharMap[number];
40589 }
40590 throw new TypeError("Must be between 0 and 63: " + number);
40591};
40592
40593/**
40594 * Decode a single base 64 character code digit to an integer. Returns -1 on
40595 * failure.
40596 */
40597exports.decode = function (charCode) {
40598 var bigA = 65; // 'A'
40599 var bigZ = 90; // 'Z'
40600
40601 var littleA = 97; // 'a'
40602 var littleZ = 122; // 'z'
40603
40604 var zero = 48; // '0'
40605 var nine = 57; // '9'
40606
40607 var plus = 43; // '+'
40608 var slash = 47; // '/'
40609
40610 var littleOffset = 26;
40611 var numberOffset = 52;
40612
40613 // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
40614 if (bigA <= charCode && charCode <= bigZ) {
40615 return (charCode - bigA);
40616 }
40617
40618 // 26 - 51: abcdefghijklmnopqrstuvwxyz
40619 if (littleA <= charCode && charCode <= littleZ) {
40620 return (charCode - littleA + littleOffset);
40621 }
40622
40623 // 52 - 61: 0123456789
40624 if (zero <= charCode && charCode <= nine) {
40625 return (charCode - zero + numberOffset);
40626 }
40627
40628 // 62: +
40629 if (charCode == plus) {
40630 return 62;
40631 }
40632
40633 // 63: /
40634 if (charCode == slash) {
40635 return 63;
40636 }
40637
40638 // Invalid base64 digit.
40639 return -1;
40640};
40641
40642},{}],477:[function(require,module,exports){
40643/* -*- Mode: js; js-indent-level: 2; -*- */
40644/*
40645 * Copyright 2011 Mozilla Foundation and contributors
40646 * Licensed under the New BSD license. See LICENSE or:
40647 * http://opensource.org/licenses/BSD-3-Clause
40648 */
40649
40650exports.GREATEST_LOWER_BOUND = 1;
40651exports.LEAST_UPPER_BOUND = 2;
40652
40653/**
40654 * Recursive implementation of binary search.
40655 *
40656 * @param aLow Indices here and lower do not contain the needle.
40657 * @param aHigh Indices here and higher do not contain the needle.
40658 * @param aNeedle The element being searched for.
40659 * @param aHaystack The non-empty array being searched.
40660 * @param aCompare Function which takes two elements and returns -1, 0, or 1.
40661 * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
40662 * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
40663 * closest element that is smaller than or greater than the one we are
40664 * searching for, respectively, if the exact element cannot be found.
40665 */
40666function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
40667 // This function terminates when one of the following is true:
40668 //
40669 // 1. We find the exact element we are looking for.
40670 //
40671 // 2. We did not find the exact element, but we can return the index of
40672 // the next-closest element.
40673 //
40674 // 3. We did not find the exact element, and there is no next-closest
40675 // element than the one we are searching for, so we return -1.
40676 var mid = Math.floor((aHigh - aLow) / 2) + aLow;
40677 var cmp = aCompare(aNeedle, aHaystack[mid], true);
40678 if (cmp === 0) {
40679 // Found the element we are looking for.
40680 return mid;
40681 }
40682 else if (cmp > 0) {
40683 // Our needle is greater than aHaystack[mid].
40684 if (aHigh - mid > 1) {
40685 // The element is in the upper half.
40686 return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
40687 }
40688
40689 // The exact needle element was not found in this haystack. Determine if
40690 // we are in termination case (3) or (2) and return the appropriate thing.
40691 if (aBias == exports.LEAST_UPPER_BOUND) {
40692 return aHigh < aHaystack.length ? aHigh : -1;
40693 } else {
40694 return mid;
40695 }
40696 }
40697 else {
40698 // Our needle is less than aHaystack[mid].
40699 if (mid - aLow > 1) {
40700 // The element is in the lower half.
40701 return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
40702 }
40703
40704 // we are in termination case (3) or (2) and return the appropriate thing.
40705 if (aBias == exports.LEAST_UPPER_BOUND) {
40706 return mid;
40707 } else {
40708 return aLow < 0 ? -1 : aLow;
40709 }
40710 }
40711}
40712
40713/**
40714 * This is an implementation of binary search which will always try and return
40715 * the index of the closest element if there is no exact hit. This is because
40716 * mappings between original and generated line/col pairs are single points,
40717 * and there is an implicit region between each of them, so a miss just means
40718 * that you aren't on the very start of a region.
40719 *
40720 * @param aNeedle The element you are looking for.
40721 * @param aHaystack The array that is being searched.
40722 * @param aCompare A function which takes the needle and an element in the
40723 * array and returns -1, 0, or 1 depending on whether the needle is less
40724 * than, equal to, or greater than the element, respectively.
40725 * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
40726 * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
40727 * closest element that is smaller than or greater than the one we are
40728 * searching for, respectively, if the exact element cannot be found.
40729 * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
40730 */
40731exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
40732 if (aHaystack.length === 0) {
40733 return -1;
40734 }
40735
40736 var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
40737 aCompare, aBias || exports.GREATEST_LOWER_BOUND);
40738 if (index < 0) {
40739 return -1;
40740 }
40741
40742 // We have found either the exact element, or the next-closest element than
40743 // the one we are searching for. However, there may be more than one such
40744 // element. Make sure we always return the smallest of these.
40745 while (index - 1 >= 0) {
40746 if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
40747 break;
40748 }
40749 --index;
40750 }
40751
40752 return index;
40753};
40754
40755},{}],478:[function(require,module,exports){
40756/* -*- Mode: js; js-indent-level: 2; -*- */
40757/*
40758 * Copyright 2014 Mozilla Foundation and contributors
40759 * Licensed under the New BSD license. See LICENSE or:
40760 * http://opensource.org/licenses/BSD-3-Clause
40761 */
40762
40763var util = require('./util');
40764
40765/**
40766 * Determine whether mappingB is after mappingA with respect to generated
40767 * position.
40768 */
40769function generatedPositionAfter(mappingA, mappingB) {
40770 // Optimized for most common case
40771 var lineA = mappingA.generatedLine;
40772 var lineB = mappingB.generatedLine;
40773 var columnA = mappingA.generatedColumn;
40774 var columnB = mappingB.generatedColumn;
40775 return lineB > lineA || lineB == lineA && columnB >= columnA ||
40776 util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
40777}
40778
40779/**
40780 * A data structure to provide a sorted view of accumulated mappings in a
40781 * performance conscious manner. It trades a neglibable overhead in general
40782 * case for a large speedup in case of mappings being added in order.
40783 */
40784function MappingList() {
40785 this._array = [];
40786 this._sorted = true;
40787 // Serves as infimum
40788 this._last = {generatedLine: -1, generatedColumn: 0};
40789}
40790
40791/**
40792 * Iterate through internal items. This method takes the same arguments that
40793 * `Array.prototype.forEach` takes.
40794 *
40795 * NOTE: The order of the mappings is NOT guaranteed.
40796 */
40797MappingList.prototype.unsortedForEach =
40798 function MappingList_forEach(aCallback, aThisArg) {
40799 this._array.forEach(aCallback, aThisArg);
40800 };
40801
40802/**
40803 * Add the given source mapping.
40804 *
40805 * @param Object aMapping
40806 */
40807MappingList.prototype.add = function MappingList_add(aMapping) {
40808 if (generatedPositionAfter(this._last, aMapping)) {
40809 this._last = aMapping;
40810 this._array.push(aMapping);
40811 } else {
40812 this._sorted = false;
40813 this._array.push(aMapping);
40814 }
40815};
40816
40817/**
40818 * Returns the flat, sorted array of mappings. The mappings are sorted by
40819 * generated position.
40820 *
40821 * WARNING: This method returns internal data without copying, for
40822 * performance. The return value must NOT be mutated, and should be treated as
40823 * an immutable borrow. If you want to take ownership, you must make your own
40824 * copy.
40825 */
40826MappingList.prototype.toArray = function MappingList_toArray() {
40827 if (!this._sorted) {
40828 this._array.sort(util.compareByGeneratedPositionsInflated);
40829 this._sorted = true;
40830 }
40831 return this._array;
40832};
40833
40834exports.MappingList = MappingList;
40835
40836},{"./util":483}],479:[function(require,module,exports){
40837/* -*- Mode: js; js-indent-level: 2; -*- */
40838/*
40839 * Copyright 2011 Mozilla Foundation and contributors
40840 * Licensed under the New BSD license. See LICENSE or:
40841 * http://opensource.org/licenses/BSD-3-Clause
40842 */
40843
40844// It turns out that some (most?) JavaScript engines don't self-host
40845// `Array.prototype.sort`. This makes sense because C++ will likely remain
40846// faster than JS when doing raw CPU-intensive sorting. However, when using a
40847// custom comparator function, calling back and forth between the VM's C++ and
40848// JIT'd JS is rather slow *and* loses JIT type information, resulting in
40849// worse generated code for the comparator function than would be optimal. In
40850// fact, when sorting with a comparator, these costs outweigh the benefits of
40851// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
40852// a ~3500ms mean speed-up in `bench/bench.html`.
40853
40854/**
40855 * Swap the elements indexed by `x` and `y` in the array `ary`.
40856 *
40857 * @param {Array} ary
40858 * The array.
40859 * @param {Number} x
40860 * The index of the first item.
40861 * @param {Number} y
40862 * The index of the second item.
40863 */
40864function swap(ary, x, y) {
40865 var temp = ary[x];
40866 ary[x] = ary[y];
40867 ary[y] = temp;
40868}
40869
40870/**
40871 * Returns a random integer within the range `low .. high` inclusive.
40872 *
40873 * @param {Number} low
40874 * The lower bound on the range.
40875 * @param {Number} high
40876 * The upper bound on the range.
40877 */
40878function randomIntInRange(low, high) {
40879 return Math.round(low + (Math.random() * (high - low)));
40880}
40881
40882/**
40883 * The Quick Sort algorithm.
40884 *
40885 * @param {Array} ary
40886 * An array to sort.
40887 * @param {function} comparator
40888 * Function to use to compare two items.
40889 * @param {Number} p
40890 * Start index of the array
40891 * @param {Number} r
40892 * End index of the array
40893 */
40894function doQuickSort(ary, comparator, p, r) {
40895 // If our lower bound is less than our upper bound, we (1) partition the
40896 // array into two pieces and (2) recurse on each half. If it is not, this is
40897 // the empty array and our base case.
40898
40899 if (p < r) {
40900 // (1) Partitioning.
40901 //
40902 // The partitioning chooses a pivot between `p` and `r` and moves all
40903 // elements that are less than or equal to the pivot to the before it, and
40904 // all the elements that are greater than it after it. The effect is that
40905 // once partition is done, the pivot is in the exact place it will be when
40906 // the array is put in sorted order, and it will not need to be moved
40907 // again. This runs in O(n) time.
40908
40909 // Always choose a random pivot so that an input array which is reverse
40910 // sorted does not cause O(n^2) running time.
40911 var pivotIndex = randomIntInRange(p, r);
40912 var i = p - 1;
40913
40914 swap(ary, pivotIndex, r);
40915 var pivot = ary[r];
40916
40917 // Immediately after `j` is incremented in this loop, the following hold
40918 // true:
40919 //
40920 // * Every element in `ary[p .. i]` is less than or equal to the pivot.
40921 //
40922 // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
40923 for (var j = p; j < r; j++) {
40924 if (comparator(ary[j], pivot) <= 0) {
40925 i += 1;
40926 swap(ary, i, j);
40927 }
40928 }
40929
40930 swap(ary, i + 1, j);
40931 var q = i + 1;
40932
40933 // (2) Recurse on each half.
40934
40935 doQuickSort(ary, comparator, p, q - 1);
40936 doQuickSort(ary, comparator, q + 1, r);
40937 }
40938}
40939
40940/**
40941 * Sort the given array in-place with the given comparator function.
40942 *
40943 * @param {Array} ary
40944 * An array to sort.
40945 * @param {function} comparator
40946 * Function to use to compare two items.
40947 */
40948exports.quickSort = function (ary, comparator) {
40949 doQuickSort(ary, comparator, 0, ary.length - 1);
40950};
40951
40952},{}],480:[function(require,module,exports){
40953/* -*- Mode: js; js-indent-level: 2; -*- */
40954/*
40955 * Copyright 2011 Mozilla Foundation and contributors
40956 * Licensed under the New BSD license. See LICENSE or:
40957 * http://opensource.org/licenses/BSD-3-Clause
40958 */
40959
40960var util = require('./util');
40961var binarySearch = require('./binary-search');
40962var ArraySet = require('./array-set').ArraySet;
40963var base64VLQ = require('./base64-vlq');
40964var quickSort = require('./quick-sort').quickSort;
40965
40966function SourceMapConsumer(aSourceMap) {
40967 var sourceMap = aSourceMap;
40968 if (typeof aSourceMap === 'string') {
40969 sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
40970 }
40971
40972 return sourceMap.sections != null
40973 ? new IndexedSourceMapConsumer(sourceMap)
40974 : new BasicSourceMapConsumer(sourceMap);
40975}
40976
40977SourceMapConsumer.fromSourceMap = function(aSourceMap) {
40978 return BasicSourceMapConsumer.fromSourceMap(aSourceMap);
40979}
40980
40981/**
40982 * The version of the source mapping spec that we are consuming.
40983 */
40984SourceMapConsumer.prototype._version = 3;
40985
40986// `__generatedMappings` and `__originalMappings` are arrays that hold the
40987// parsed mapping coordinates from the source map's "mappings" attribute. They
40988// are lazily instantiated, accessed via the `_generatedMappings` and
40989// `_originalMappings` getters respectively, and we only parse the mappings
40990// and create these arrays once queried for a source location. We jump through
40991// these hoops because there can be many thousands of mappings, and parsing
40992// them is expensive, so we only want to do it if we must.
40993//
40994// Each object in the arrays is of the form:
40995//
40996// {
40997// generatedLine: The line number in the generated code,
40998// generatedColumn: The column number in the generated code,
40999// source: The path to the original source file that generated this
41000// chunk of code,
41001// originalLine: The line number in the original source that
41002// corresponds to this chunk of generated code,
41003// originalColumn: The column number in the original source that
41004// corresponds to this chunk of generated code,
41005// name: The name of the original symbol which generated this chunk of
41006// code.
41007// }
41008//
41009// All properties except for `generatedLine` and `generatedColumn` can be
41010// `null`.
41011//
41012// `_generatedMappings` is ordered by the generated positions.
41013//
41014// `_originalMappings` is ordered by the original positions.
41015
41016SourceMapConsumer.prototype.__generatedMappings = null;
41017Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
41018 get: function () {
41019 if (!this.__generatedMappings) {
41020 this._parseMappings(this._mappings, this.sourceRoot);
41021 }
41022
41023 return this.__generatedMappings;
41024 }
41025});
41026
41027SourceMapConsumer.prototype.__originalMappings = null;
41028Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
41029 get: function () {
41030 if (!this.__originalMappings) {
41031 this._parseMappings(this._mappings, this.sourceRoot);
41032 }
41033
41034 return this.__originalMappings;
41035 }
41036});
41037
41038SourceMapConsumer.prototype._charIsMappingSeparator =
41039 function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
41040 var c = aStr.charAt(index);
41041 return c === ";" || c === ",";
41042 };
41043
41044/**
41045 * Parse the mappings in a string in to a data structure which we can easily
41046 * query (the ordered arrays in the `this.__generatedMappings` and
41047 * `this.__originalMappings` properties).
41048 */
41049SourceMapConsumer.prototype._parseMappings =
41050 function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
41051 throw new Error("Subclasses must implement _parseMappings");
41052 };
41053
41054SourceMapConsumer.GENERATED_ORDER = 1;
41055SourceMapConsumer.ORIGINAL_ORDER = 2;
41056
41057SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
41058SourceMapConsumer.LEAST_UPPER_BOUND = 2;
41059
41060/**
41061 * Iterate over each mapping between an original source/line/column and a
41062 * generated line/column in this source map.
41063 *
41064 * @param Function aCallback
41065 * The function that is called with each mapping.
41066 * @param Object aContext
41067 * Optional. If specified, this object will be the value of `this` every
41068 * time that `aCallback` is called.
41069 * @param aOrder
41070 * Either `SourceMapConsumer.GENERATED_ORDER` or
41071 * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
41072 * iterate over the mappings sorted by the generated file's line/column
41073 * order or the original's source/line/column order, respectively. Defaults to
41074 * `SourceMapConsumer.GENERATED_ORDER`.
41075 */
41076SourceMapConsumer.prototype.eachMapping =
41077 function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
41078 var context = aContext || null;
41079 var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
41080
41081 var mappings;
41082 switch (order) {
41083 case SourceMapConsumer.GENERATED_ORDER:
41084 mappings = this._generatedMappings;
41085 break;
41086 case SourceMapConsumer.ORIGINAL_ORDER:
41087 mappings = this._originalMappings;
41088 break;
41089 default:
41090 throw new Error("Unknown order of iteration.");
41091 }
41092
41093 var sourceRoot = this.sourceRoot;
41094 mappings.map(function (mapping) {
41095 var source = mapping.source === null ? null : this._sources.at(mapping.source);
41096 if (source != null && sourceRoot != null) {
41097 source = util.join(sourceRoot, source);
41098 }
41099 return {
41100 source: source,
41101 generatedLine: mapping.generatedLine,
41102 generatedColumn: mapping.generatedColumn,
41103 originalLine: mapping.originalLine,
41104 originalColumn: mapping.originalColumn,
41105 name: mapping.name === null ? null : this._names.at(mapping.name)
41106 };
41107 }, this).forEach(aCallback, context);
41108 };
41109
41110/**
41111 * Returns all generated line and column information for the original source,
41112 * line, and column provided. If no column is provided, returns all mappings
41113 * corresponding to a either the line we are searching for or the next
41114 * closest line that has any mappings. Otherwise, returns all mappings
41115 * corresponding to the given line and either the column we are searching for
41116 * or the next closest column that has any offsets.
41117 *
41118 * The only argument is an object with the following properties:
41119 *
41120 * - source: The filename of the original source.
41121 * - line: The line number in the original source.
41122 * - column: Optional. the column number in the original source.
41123 *
41124 * and an array of objects is returned, each with the following properties:
41125 *
41126 * - line: The line number in the generated source, or null.
41127 * - column: The column number in the generated source, or null.
41128 */
41129SourceMapConsumer.prototype.allGeneratedPositionsFor =
41130 function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
41131 var line = util.getArg(aArgs, 'line');
41132
41133 // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
41134 // returns the index of the closest mapping less than the needle. By
41135 // setting needle.originalColumn to 0, we thus find the last mapping for
41136 // the given line, provided such a mapping exists.
41137 var needle = {
41138 source: util.getArg(aArgs, 'source'),
41139 originalLine: line,
41140 originalColumn: util.getArg(aArgs, 'column', 0)
41141 };
41142
41143 if (this.sourceRoot != null) {
41144 needle.source = util.relative(this.sourceRoot, needle.source);
41145 }
41146 if (!this._sources.has(needle.source)) {
41147 return [];
41148 }
41149 needle.source = this._sources.indexOf(needle.source);
41150
41151 var mappings = [];
41152
41153 var index = this._findMapping(needle,
41154 this._originalMappings,
41155 "originalLine",
41156 "originalColumn",
41157 util.compareByOriginalPositions,
41158 binarySearch.LEAST_UPPER_BOUND);
41159 if (index >= 0) {
41160 var mapping = this._originalMappings[index];
41161
41162 if (aArgs.column === undefined) {
41163 var originalLine = mapping.originalLine;
41164
41165 // Iterate until either we run out of mappings, or we run into
41166 // a mapping for a different line than the one we found. Since
41167 // mappings are sorted, this is guaranteed to find all mappings for
41168 // the line we found.
41169 while (mapping && mapping.originalLine === originalLine) {
41170 mappings.push({
41171 line: util.getArg(mapping, 'generatedLine', null),
41172 column: util.getArg(mapping, 'generatedColumn', null),
41173 lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
41174 });
41175
41176 mapping = this._originalMappings[++index];
41177 }
41178 } else {
41179 var originalColumn = mapping.originalColumn;
41180
41181 // Iterate until either we run out of mappings, or we run into
41182 // a mapping for a different line than the one we were searching for.
41183 // Since mappings are sorted, this is guaranteed to find all mappings for
41184 // the line we are searching for.
41185 while (mapping &&
41186 mapping.originalLine === line &&
41187 mapping.originalColumn == originalColumn) {
41188 mappings.push({
41189 line: util.getArg(mapping, 'generatedLine', null),
41190 column: util.getArg(mapping, 'generatedColumn', null),
41191 lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
41192 });
41193
41194 mapping = this._originalMappings[++index];
41195 }
41196 }
41197 }
41198
41199 return mappings;
41200 };
41201
41202exports.SourceMapConsumer = SourceMapConsumer;
41203
41204/**
41205 * A BasicSourceMapConsumer instance represents a parsed source map which we can
41206 * query for information about the original file positions by giving it a file
41207 * position in the generated source.
41208 *
41209 * The only parameter is the raw source map (either as a JSON string, or
41210 * already parsed to an object). According to the spec, source maps have the
41211 * following attributes:
41212 *
41213 * - version: Which version of the source map spec this map is following.
41214 * - sources: An array of URLs to the original source files.
41215 * - names: An array of identifiers which can be referrenced by individual mappings.
41216 * - sourceRoot: Optional. The URL root from which all sources are relative.
41217 * - sourcesContent: Optional. An array of contents of the original source files.
41218 * - mappings: A string of base64 VLQs which contain the actual mappings.
41219 * - file: Optional. The generated file this source map is associated with.
41220 *
41221 * Here is an example source map, taken from the source map spec[0]:
41222 *
41223 * {
41224 * version : 3,
41225 * file: "out.js",
41226 * sourceRoot : "",
41227 * sources: ["foo.js", "bar.js"],
41228 * names: ["src", "maps", "are", "fun"],
41229 * mappings: "AA,AB;;ABCDE;"
41230 * }
41231 *
41232 * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
41233 */
41234function BasicSourceMapConsumer(aSourceMap) {
41235 var sourceMap = aSourceMap;
41236 if (typeof aSourceMap === 'string') {
41237 sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
41238 }
41239
41240 var version = util.getArg(sourceMap, 'version');
41241 var sources = util.getArg(sourceMap, 'sources');
41242 // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
41243 // requires the array) to play nice here.
41244 var names = util.getArg(sourceMap, 'names', []);
41245 var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
41246 var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
41247 var mappings = util.getArg(sourceMap, 'mappings');
41248 var file = util.getArg(sourceMap, 'file', null);
41249
41250 // Once again, Sass deviates from the spec and supplies the version as a
41251 // string rather than a number, so we use loose equality checking here.
41252 if (version != this._version) {
41253 throw new Error('Unsupported version: ' + version);
41254 }
41255
41256 sources = sources
41257 .map(String)
41258 // Some source maps produce relative source paths like "./foo.js" instead of
41259 // "foo.js". Normalize these first so that future comparisons will succeed.
41260 // See bugzil.la/1090768.
41261 .map(util.normalize)
41262 // Always ensure that absolute sources are internally stored relative to
41263 // the source root, if the source root is absolute. Not doing this would
41264 // be particularly problematic when the source root is a prefix of the
41265 // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
41266 .map(function (source) {
41267 return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
41268 ? util.relative(sourceRoot, source)
41269 : source;
41270 });
41271
41272 // Pass `true` below to allow duplicate names and sources. While source maps
41273 // are intended to be compressed and deduplicated, the TypeScript compiler
41274 // sometimes generates source maps with duplicates in them. See Github issue
41275 // #72 and bugzil.la/889492.
41276 this._names = ArraySet.fromArray(names.map(String), true);
41277 this._sources = ArraySet.fromArray(sources, true);
41278
41279 this.sourceRoot = sourceRoot;
41280 this.sourcesContent = sourcesContent;
41281 this._mappings = mappings;
41282 this.file = file;
41283}
41284
41285BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
41286BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
41287
41288/**
41289 * Create a BasicSourceMapConsumer from a SourceMapGenerator.
41290 *
41291 * @param SourceMapGenerator aSourceMap
41292 * The source map that will be consumed.
41293 * @returns BasicSourceMapConsumer
41294 */
41295BasicSourceMapConsumer.fromSourceMap =
41296 function SourceMapConsumer_fromSourceMap(aSourceMap) {
41297 var smc = Object.create(BasicSourceMapConsumer.prototype);
41298
41299 var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
41300 var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
41301 smc.sourceRoot = aSourceMap._sourceRoot;
41302 smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
41303 smc.sourceRoot);
41304 smc.file = aSourceMap._file;
41305
41306 // Because we are modifying the entries (by converting string sources and
41307 // names to indices into the sources and names ArraySets), we have to make
41308 // a copy of the entry or else bad things happen. Shared mutable state
41309 // strikes again! See github issue #191.
41310
41311 var generatedMappings = aSourceMap._mappings.toArray().slice();
41312 var destGeneratedMappings = smc.__generatedMappings = [];
41313 var destOriginalMappings = smc.__originalMappings = [];
41314
41315 for (var i = 0, length = generatedMappings.length; i < length; i++) {
41316 var srcMapping = generatedMappings[i];
41317 var destMapping = new Mapping;
41318 destMapping.generatedLine = srcMapping.generatedLine;
41319 destMapping.generatedColumn = srcMapping.generatedColumn;
41320
41321 if (srcMapping.source) {
41322 destMapping.source = sources.indexOf(srcMapping.source);
41323 destMapping.originalLine = srcMapping.originalLine;
41324 destMapping.originalColumn = srcMapping.originalColumn;
41325
41326 if (srcMapping.name) {
41327 destMapping.name = names.indexOf(srcMapping.name);
41328 }
41329
41330 destOriginalMappings.push(destMapping);
41331 }
41332
41333 destGeneratedMappings.push(destMapping);
41334 }
41335
41336 quickSort(smc.__originalMappings, util.compareByOriginalPositions);
41337
41338 return smc;
41339 };
41340
41341/**
41342 * The version of the source mapping spec that we are consuming.
41343 */
41344BasicSourceMapConsumer.prototype._version = 3;
41345
41346/**
41347 * The list of original sources.
41348 */
41349Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
41350 get: function () {
41351 return this._sources.toArray().map(function (s) {
41352 return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;
41353 }, this);
41354 }
41355});
41356
41357/**
41358 * Provide the JIT with a nice shape / hidden class.
41359 */
41360function Mapping() {
41361 this.generatedLine = 0;
41362 this.generatedColumn = 0;
41363 this.source = null;
41364 this.originalLine = null;
41365 this.originalColumn = null;
41366 this.name = null;
41367}
41368
41369/**
41370 * Parse the mappings in a string in to a data structure which we can easily
41371 * query (the ordered arrays in the `this.__generatedMappings` and
41372 * `this.__originalMappings` properties).
41373 */
41374BasicSourceMapConsumer.prototype._parseMappings =
41375 function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
41376 var generatedLine = 1;
41377 var previousGeneratedColumn = 0;
41378 var previousOriginalLine = 0;
41379 var previousOriginalColumn = 0;
41380 var previousSource = 0;
41381 var previousName = 0;
41382 var length = aStr.length;
41383 var index = 0;
41384 var cachedSegments = {};
41385 var temp = {};
41386 var originalMappings = [];
41387 var generatedMappings = [];
41388 var mapping, str, segment, end, value;
41389
41390 while (index < length) {
41391 if (aStr.charAt(index) === ';') {
41392 generatedLine++;
41393 index++;
41394 previousGeneratedColumn = 0;
41395 }
41396 else if (aStr.charAt(index) === ',') {
41397 index++;
41398 }
41399 else {
41400 mapping = new Mapping();
41401 mapping.generatedLine = generatedLine;
41402
41403 // Because each offset is encoded relative to the previous one,
41404 // many segments often have the same encoding. We can exploit this
41405 // fact by caching the parsed variable length fields of each segment,
41406 // allowing us to avoid a second parse if we encounter the same
41407 // segment again.
41408 for (end = index; end < length; end++) {
41409 if (this._charIsMappingSeparator(aStr, end)) {
41410 break;
41411 }
41412 }
41413 str = aStr.slice(index, end);
41414
41415 segment = cachedSegments[str];
41416 if (segment) {
41417 index += str.length;
41418 } else {
41419 segment = [];
41420 while (index < end) {
41421 base64VLQ.decode(aStr, index, temp);
41422 value = temp.value;
41423 index = temp.rest;
41424 segment.push(value);
41425 }
41426
41427 if (segment.length === 2) {
41428 throw new Error('Found a source, but no line and column');
41429 }
41430
41431 if (segment.length === 3) {
41432 throw new Error('Found a source and line, but no column');
41433 }
41434
41435 cachedSegments[str] = segment;
41436 }
41437
41438 // Generated column.
41439 mapping.generatedColumn = previousGeneratedColumn + segment[0];
41440 previousGeneratedColumn = mapping.generatedColumn;
41441
41442 if (segment.length > 1) {
41443 // Original source.
41444 mapping.source = previousSource + segment[1];
41445 previousSource += segment[1];
41446
41447 // Original line.
41448 mapping.originalLine = previousOriginalLine + segment[2];
41449 previousOriginalLine = mapping.originalLine;
41450 // Lines are stored 0-based
41451 mapping.originalLine += 1;
41452
41453 // Original column.
41454 mapping.originalColumn = previousOriginalColumn + segment[3];
41455 previousOriginalColumn = mapping.originalColumn;
41456
41457 if (segment.length > 4) {
41458 // Original name.
41459 mapping.name = previousName + segment[4];
41460 previousName += segment[4];
41461 }
41462 }
41463
41464 generatedMappings.push(mapping);
41465 if (typeof mapping.originalLine === 'number') {
41466 originalMappings.push(mapping);
41467 }
41468 }
41469 }
41470
41471 quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
41472 this.__generatedMappings = generatedMappings;
41473
41474 quickSort(originalMappings, util.compareByOriginalPositions);
41475 this.__originalMappings = originalMappings;
41476 };
41477
41478/**
41479 * Find the mapping that best matches the hypothetical "needle" mapping that
41480 * we are searching for in the given "haystack" of mappings.
41481 */
41482BasicSourceMapConsumer.prototype._findMapping =
41483 function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
41484 aColumnName, aComparator, aBias) {
41485 // To return the position we are searching for, we must first find the
41486 // mapping for the given position and then return the opposite position it
41487 // points to. Because the mappings are sorted, we can use binary search to
41488 // find the best mapping.
41489
41490 if (aNeedle[aLineName] <= 0) {
41491 throw new TypeError('Line must be greater than or equal to 1, got '
41492 + aNeedle[aLineName]);
41493 }
41494 if (aNeedle[aColumnName] < 0) {
41495 throw new TypeError('Column must be greater than or equal to 0, got '
41496 + aNeedle[aColumnName]);
41497 }
41498
41499 return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
41500 };
41501
41502/**
41503 * Compute the last column for each generated mapping. The last column is
41504 * inclusive.
41505 */
41506BasicSourceMapConsumer.prototype.computeColumnSpans =
41507 function SourceMapConsumer_computeColumnSpans() {
41508 for (var index = 0; index < this._generatedMappings.length; ++index) {
41509 var mapping = this._generatedMappings[index];
41510
41511 // Mappings do not contain a field for the last generated columnt. We
41512 // can come up with an optimistic estimate, however, by assuming that
41513 // mappings are contiguous (i.e. given two consecutive mappings, the
41514 // first mapping ends where the second one starts).
41515 if (index + 1 < this._generatedMappings.length) {
41516 var nextMapping = this._generatedMappings[index + 1];
41517
41518 if (mapping.generatedLine === nextMapping.generatedLine) {
41519 mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
41520 continue;
41521 }
41522 }
41523
41524 // The last mapping for each line spans the entire line.
41525 mapping.lastGeneratedColumn = Infinity;
41526 }
41527 };
41528
41529/**
41530 * Returns the original source, line, and column information for the generated
41531 * source's line and column positions provided. The only argument is an object
41532 * with the following properties:
41533 *
41534 * - line: The line number in the generated source.
41535 * - column: The column number in the generated source.
41536 * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
41537 * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
41538 * closest element that is smaller than or greater than the one we are
41539 * searching for, respectively, if the exact element cannot be found.
41540 * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
41541 *
41542 * and an object is returned with the following properties:
41543 *
41544 * - source: The original source file, or null.
41545 * - line: The line number in the original source, or null.
41546 * - column: The column number in the original source, or null.
41547 * - name: The original identifier, or null.
41548 */
41549BasicSourceMapConsumer.prototype.originalPositionFor =
41550 function SourceMapConsumer_originalPositionFor(aArgs) {
41551 var needle = {
41552 generatedLine: util.getArg(aArgs, 'line'),
41553 generatedColumn: util.getArg(aArgs, 'column')
41554 };
41555
41556 var index = this._findMapping(
41557 needle,
41558 this._generatedMappings,
41559 "generatedLine",
41560 "generatedColumn",
41561 util.compareByGeneratedPositionsDeflated,
41562 util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
41563 );
41564
41565 if (index >= 0) {
41566 var mapping = this._generatedMappings[index];
41567
41568 if (mapping.generatedLine === needle.generatedLine) {
41569 var source = util.getArg(mapping, 'source', null);
41570 if (source !== null) {
41571 source = this._sources.at(source);
41572 if (this.sourceRoot != null) {
41573 source = util.join(this.sourceRoot, source);
41574 }
41575 }
41576 var name = util.getArg(mapping, 'name', null);
41577 if (name !== null) {
41578 name = this._names.at(name);
41579 }
41580 return {
41581 source: source,
41582 line: util.getArg(mapping, 'originalLine', null),
41583 column: util.getArg(mapping, 'originalColumn', null),
41584 name: name
41585 };
41586 }
41587 }
41588
41589 return {
41590 source: null,
41591 line: null,
41592 column: null,
41593 name: null
41594 };
41595 };
41596
41597/**
41598 * Return true if we have the source content for every source in the source
41599 * map, false otherwise.
41600 */
41601BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
41602 function BasicSourceMapConsumer_hasContentsOfAllSources() {
41603 if (!this.sourcesContent) {
41604 return false;
41605 }
41606 return this.sourcesContent.length >= this._sources.size() &&
41607 !this.sourcesContent.some(function (sc) { return sc == null; });
41608 };
41609
41610/**
41611 * Returns the original source content. The only argument is the url of the
41612 * original source file. Returns null if no original source content is
41613 * available.
41614 */
41615BasicSourceMapConsumer.prototype.sourceContentFor =
41616 function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
41617 if (!this.sourcesContent) {
41618 return null;
41619 }
41620
41621 if (this.sourceRoot != null) {
41622 aSource = util.relative(this.sourceRoot, aSource);
41623 }
41624
41625 if (this._sources.has(aSource)) {
41626 return this.sourcesContent[this._sources.indexOf(aSource)];
41627 }
41628
41629 var url;
41630 if (this.sourceRoot != null
41631 && (url = util.urlParse(this.sourceRoot))) {
41632 // XXX: file:// URIs and absolute paths lead to unexpected behavior for
41633 // many users. We can help them out when they expect file:// URIs to
41634 // behave like it would if they were running a local HTTP server. See
41635 // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
41636 var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
41637 if (url.scheme == "file"
41638 && this._sources.has(fileUriAbsPath)) {
41639 return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
41640 }
41641
41642 if ((!url.path || url.path == "/")
41643 && this._sources.has("/" + aSource)) {
41644 return this.sourcesContent[this._sources.indexOf("/" + aSource)];
41645 }
41646 }
41647
41648 // This function is used recursively from
41649 // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
41650 // don't want to throw if we can't find the source - we just want to
41651 // return null, so we provide a flag to exit gracefully.
41652 if (nullOnMissing) {
41653 return null;
41654 }
41655 else {
41656 throw new Error('"' + aSource + '" is not in the SourceMap.');
41657 }
41658 };
41659
41660/**
41661 * Returns the generated line and column information for the original source,
41662 * line, and column positions provided. The only argument is an object with
41663 * the following properties:
41664 *
41665 * - source: The filename of the original source.
41666 * - line: The line number in the original source.
41667 * - column: The column number in the original source.
41668 * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
41669 * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
41670 * closest element that is smaller than or greater than the one we are
41671 * searching for, respectively, if the exact element cannot be found.
41672 * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
41673 *
41674 * and an object is returned with the following properties:
41675 *
41676 * - line: The line number in the generated source, or null.
41677 * - column: The column number in the generated source, or null.
41678 */
41679BasicSourceMapConsumer.prototype.generatedPositionFor =
41680 function SourceMapConsumer_generatedPositionFor(aArgs) {
41681 var source = util.getArg(aArgs, 'source');
41682 if (this.sourceRoot != null) {
41683 source = util.relative(this.sourceRoot, source);
41684 }
41685 if (!this._sources.has(source)) {
41686 return {
41687 line: null,
41688 column: null,
41689 lastColumn: null
41690 };
41691 }
41692 source = this._sources.indexOf(source);
41693
41694 var needle = {
41695 source: source,
41696 originalLine: util.getArg(aArgs, 'line'),
41697 originalColumn: util.getArg(aArgs, 'column')
41698 };
41699
41700 var index = this._findMapping(
41701 needle,
41702 this._originalMappings,
41703 "originalLine",
41704 "originalColumn",
41705 util.compareByOriginalPositions,
41706 util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
41707 );
41708
41709 if (index >= 0) {
41710 var mapping = this._originalMappings[index];
41711
41712 if (mapping.source === needle.source) {
41713 return {
41714 line: util.getArg(mapping, 'generatedLine', null),
41715 column: util.getArg(mapping, 'generatedColumn', null),
41716 lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
41717 };
41718 }
41719 }
41720
41721 return {
41722 line: null,
41723 column: null,
41724 lastColumn: null
41725 };
41726 };
41727
41728exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
41729
41730/**
41731 * An IndexedSourceMapConsumer instance represents a parsed source map which
41732 * we can query for information. It differs from BasicSourceMapConsumer in
41733 * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
41734 * input.
41735 *
41736 * The only parameter is a raw source map (either as a JSON string, or already
41737 * parsed to an object). According to the spec for indexed source maps, they
41738 * have the following attributes:
41739 *
41740 * - version: Which version of the source map spec this map is following.
41741 * - file: Optional. The generated file this source map is associated with.
41742 * - sections: A list of section definitions.
41743 *
41744 * Each value under the "sections" field has two fields:
41745 * - offset: The offset into the original specified at which this section
41746 * begins to apply, defined as an object with a "line" and "column"
41747 * field.
41748 * - map: A source map definition. This source map could also be indexed,
41749 * but doesn't have to be.
41750 *
41751 * Instead of the "map" field, it's also possible to have a "url" field
41752 * specifying a URL to retrieve a source map from, but that's currently
41753 * unsupported.
41754 *
41755 * Here's an example source map, taken from the source map spec[0], but
41756 * modified to omit a section which uses the "url" field.
41757 *
41758 * {
41759 * version : 3,
41760 * file: "app.js",
41761 * sections: [{
41762 * offset: {line:100, column:10},
41763 * map: {
41764 * version : 3,
41765 * file: "section.js",
41766 * sources: ["foo.js", "bar.js"],
41767 * names: ["src", "maps", "are", "fun"],
41768 * mappings: "AAAA,E;;ABCDE;"
41769 * }
41770 * }],
41771 * }
41772 *
41773 * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
41774 */
41775function IndexedSourceMapConsumer(aSourceMap) {
41776 var sourceMap = aSourceMap;
41777 if (typeof aSourceMap === 'string') {
41778 sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
41779 }
41780
41781 var version = util.getArg(sourceMap, 'version');
41782 var sections = util.getArg(sourceMap, 'sections');
41783
41784 if (version != this._version) {
41785 throw new Error('Unsupported version: ' + version);
41786 }
41787
41788 this._sources = new ArraySet();
41789 this._names = new ArraySet();
41790
41791 var lastOffset = {
41792 line: -1,
41793 column: 0
41794 };
41795 this._sections = sections.map(function (s) {
41796 if (s.url) {
41797 // The url field will require support for asynchronicity.
41798 // See https://github.com/mozilla/source-map/issues/16
41799 throw new Error('Support for url field in sections not implemented.');
41800 }
41801 var offset = util.getArg(s, 'offset');
41802 var offsetLine = util.getArg(offset, 'line');
41803 var offsetColumn = util.getArg(offset, 'column');
41804
41805 if (offsetLine < lastOffset.line ||
41806 (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
41807 throw new Error('Section offsets must be ordered and non-overlapping.');
41808 }
41809 lastOffset = offset;
41810
41811 return {
41812 generatedOffset: {
41813 // The offset fields are 0-based, but we use 1-based indices when
41814 // encoding/decoding from VLQ.
41815 generatedLine: offsetLine + 1,
41816 generatedColumn: offsetColumn + 1
41817 },
41818 consumer: new SourceMapConsumer(util.getArg(s, 'map'))
41819 }
41820 });
41821}
41822
41823IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
41824IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
41825
41826/**
41827 * The version of the source mapping spec that we are consuming.
41828 */
41829IndexedSourceMapConsumer.prototype._version = 3;
41830
41831/**
41832 * The list of original sources.
41833 */
41834Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
41835 get: function () {
41836 var sources = [];
41837 for (var i = 0; i < this._sections.length; i++) {
41838 for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
41839 sources.push(this._sections[i].consumer.sources[j]);
41840 }
41841 }
41842 return sources;
41843 }
41844});
41845
41846/**
41847 * Returns the original source, line, and column information for the generated
41848 * source's line and column positions provided. The only argument is an object
41849 * with the following properties:
41850 *
41851 * - line: The line number in the generated source.
41852 * - column: The column number in the generated source.
41853 *
41854 * and an object is returned with the following properties:
41855 *
41856 * - source: The original source file, or null.
41857 * - line: The line number in the original source, or null.
41858 * - column: The column number in the original source, or null.
41859 * - name: The original identifier, or null.
41860 */
41861IndexedSourceMapConsumer.prototype.originalPositionFor =
41862 function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
41863 var needle = {
41864 generatedLine: util.getArg(aArgs, 'line'),
41865 generatedColumn: util.getArg(aArgs, 'column')
41866 };
41867
41868 // Find the section containing the generated position we're trying to map
41869 // to an original position.
41870 var sectionIndex = binarySearch.search(needle, this._sections,
41871 function(needle, section) {
41872 var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
41873 if (cmp) {
41874 return cmp;
41875 }
41876
41877 return (needle.generatedColumn -
41878 section.generatedOffset.generatedColumn);
41879 });
41880 var section = this._sections[sectionIndex];
41881
41882 if (!section) {
41883 return {
41884 source: null,
41885 line: null,
41886 column: null,
41887 name: null
41888 };
41889 }
41890
41891 return section.consumer.originalPositionFor({
41892 line: needle.generatedLine -
41893 (section.generatedOffset.generatedLine - 1),
41894 column: needle.generatedColumn -
41895 (section.generatedOffset.generatedLine === needle.generatedLine
41896 ? section.generatedOffset.generatedColumn - 1
41897 : 0),
41898 bias: aArgs.bias
41899 });
41900 };
41901
41902/**
41903 * Return true if we have the source content for every source in the source
41904 * map, false otherwise.
41905 */
41906IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
41907 function IndexedSourceMapConsumer_hasContentsOfAllSources() {
41908 return this._sections.every(function (s) {
41909 return s.consumer.hasContentsOfAllSources();
41910 });
41911 };
41912
41913/**
41914 * Returns the original source content. The only argument is the url of the
41915 * original source file. Returns null if no original source content is
41916 * available.
41917 */
41918IndexedSourceMapConsumer.prototype.sourceContentFor =
41919 function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
41920 for (var i = 0; i < this._sections.length; i++) {
41921 var section = this._sections[i];
41922
41923 var content = section.consumer.sourceContentFor(aSource, true);
41924 if (content) {
41925 return content;
41926 }
41927 }
41928 if (nullOnMissing) {
41929 return null;
41930 }
41931 else {
41932 throw new Error('"' + aSource + '" is not in the SourceMap.');
41933 }
41934 };
41935
41936/**
41937 * Returns the generated line and column information for the original source,
41938 * line, and column positions provided. The only argument is an object with
41939 * the following properties:
41940 *
41941 * - source: The filename of the original source.
41942 * - line: The line number in the original source.
41943 * - column: The column number in the original source.
41944 *
41945 * and an object is returned with the following properties:
41946 *
41947 * - line: The line number in the generated source, or null.
41948 * - column: The column number in the generated source, or null.
41949 */
41950IndexedSourceMapConsumer.prototype.generatedPositionFor =
41951 function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
41952 for (var i = 0; i < this._sections.length; i++) {
41953 var section = this._sections[i];
41954
41955 // Only consider this section if the requested source is in the list of
41956 // sources of the consumer.
41957 if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {
41958 continue;
41959 }
41960 var generatedPosition = section.consumer.generatedPositionFor(aArgs);
41961 if (generatedPosition) {
41962 var ret = {
41963 line: generatedPosition.line +
41964 (section.generatedOffset.generatedLine - 1),
41965 column: generatedPosition.column +
41966 (section.generatedOffset.generatedLine === generatedPosition.line
41967 ? section.generatedOffset.generatedColumn - 1
41968 : 0)
41969 };
41970 return ret;
41971 }
41972 }
41973
41974 return {
41975 line: null,
41976 column: null
41977 };
41978 };
41979
41980/**
41981 * Parse the mappings in a string in to a data structure which we can easily
41982 * query (the ordered arrays in the `this.__generatedMappings` and
41983 * `this.__originalMappings` properties).
41984 */
41985IndexedSourceMapConsumer.prototype._parseMappings =
41986 function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
41987 this.__generatedMappings = [];
41988 this.__originalMappings = [];
41989 for (var i = 0; i < this._sections.length; i++) {
41990 var section = this._sections[i];
41991 var sectionMappings = section.consumer._generatedMappings;
41992 for (var j = 0; j < sectionMappings.length; j++) {
41993 var mapping = sectionMappings[j];
41994
41995 var source = section.consumer._sources.at(mapping.source);
41996 if (section.consumer.sourceRoot !== null) {
41997 source = util.join(section.consumer.sourceRoot, source);
41998 }
41999 this._sources.add(source);
42000 source = this._sources.indexOf(source);
42001
42002 var name = section.consumer._names.at(mapping.name);
42003 this._names.add(name);
42004 name = this._names.indexOf(name);
42005
42006 // The mappings coming from the consumer for the section have
42007 // generated positions relative to the start of the section, so we
42008 // need to offset them to be relative to the start of the concatenated
42009 // generated file.
42010 var adjustedMapping = {
42011 source: source,
42012 generatedLine: mapping.generatedLine +
42013 (section.generatedOffset.generatedLine - 1),
42014 generatedColumn: mapping.generatedColumn +
42015 (section.generatedOffset.generatedLine === mapping.generatedLine
42016 ? section.generatedOffset.generatedColumn - 1
42017 : 0),
42018 originalLine: mapping.originalLine,
42019 originalColumn: mapping.originalColumn,
42020 name: name
42021 };
42022
42023 this.__generatedMappings.push(adjustedMapping);
42024 if (typeof adjustedMapping.originalLine === 'number') {
42025 this.__originalMappings.push(adjustedMapping);
42026 }
42027 }
42028 }
42029
42030 quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
42031 quickSort(this.__originalMappings, util.compareByOriginalPositions);
42032 };
42033
42034exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
42035
42036},{"./array-set":474,"./base64-vlq":475,"./binary-search":477,"./quick-sort":479,"./util":483}],481:[function(require,module,exports){
42037/* -*- Mode: js; js-indent-level: 2; -*- */
42038/*
42039 * Copyright 2011 Mozilla Foundation and contributors
42040 * Licensed under the New BSD license. See LICENSE or:
42041 * http://opensource.org/licenses/BSD-3-Clause
42042 */
42043
42044var base64VLQ = require('./base64-vlq');
42045var util = require('./util');
42046var ArraySet = require('./array-set').ArraySet;
42047var MappingList = require('./mapping-list').MappingList;
42048
42049/**
42050 * An instance of the SourceMapGenerator represents a source map which is
42051 * being built incrementally. You may pass an object with the following
42052 * properties:
42053 *
42054 * - file: The filename of the generated source.
42055 * - sourceRoot: A root for all relative URLs in this source map.
42056 */
42057function SourceMapGenerator(aArgs) {
42058 if (!aArgs) {
42059 aArgs = {};
42060 }
42061 this._file = util.getArg(aArgs, 'file', null);
42062 this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
42063 this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
42064 this._sources = new ArraySet();
42065 this._names = new ArraySet();
42066 this._mappings = new MappingList();
42067 this._sourcesContents = null;
42068}
42069
42070SourceMapGenerator.prototype._version = 3;
42071
42072/**
42073 * Creates a new SourceMapGenerator based on a SourceMapConsumer
42074 *
42075 * @param aSourceMapConsumer The SourceMap.
42076 */
42077SourceMapGenerator.fromSourceMap =
42078 function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
42079 var sourceRoot = aSourceMapConsumer.sourceRoot;
42080 var generator = new SourceMapGenerator({
42081 file: aSourceMapConsumer.file,
42082 sourceRoot: sourceRoot
42083 });
42084 aSourceMapConsumer.eachMapping(function (mapping) {
42085 var newMapping = {
42086 generated: {
42087 line: mapping.generatedLine,
42088 column: mapping.generatedColumn
42089 }
42090 };
42091
42092 if (mapping.source != null) {
42093 newMapping.source = mapping.source;
42094 if (sourceRoot != null) {
42095 newMapping.source = util.relative(sourceRoot, newMapping.source);
42096 }
42097
42098 newMapping.original = {
42099 line: mapping.originalLine,
42100 column: mapping.originalColumn
42101 };
42102
42103 if (mapping.name != null) {
42104 newMapping.name = mapping.name;
42105 }
42106 }
42107
42108 generator.addMapping(newMapping);
42109 });
42110 aSourceMapConsumer.sources.forEach(function (sourceFile) {
42111 var content = aSourceMapConsumer.sourceContentFor(sourceFile);
42112 if (content != null) {
42113 generator.setSourceContent(sourceFile, content);
42114 }
42115 });
42116 return generator;
42117 };
42118
42119/**
42120 * Add a single mapping from original source line and column to the generated
42121 * source's line and column for this source map being created. The mapping
42122 * object should have the following properties:
42123 *
42124 * - generated: An object with the generated line and column positions.
42125 * - original: An object with the original line and column positions.
42126 * - source: The original source file (relative to the sourceRoot).
42127 * - name: An optional original token name for this mapping.
42128 */
42129SourceMapGenerator.prototype.addMapping =
42130 function SourceMapGenerator_addMapping(aArgs) {
42131 var generated = util.getArg(aArgs, 'generated');
42132 var original = util.getArg(aArgs, 'original', null);
42133 var source = util.getArg(aArgs, 'source', null);
42134 var name = util.getArg(aArgs, 'name', null);
42135
42136 if (!this._skipValidation) {
42137 this._validateMapping(generated, original, source, name);
42138 }
42139
42140 if (source != null) {
42141 source = String(source);
42142 if (!this._sources.has(source)) {
42143 this._sources.add(source);
42144 }
42145 }
42146
42147 if (name != null) {
42148 name = String(name);
42149 if (!this._names.has(name)) {
42150 this._names.add(name);
42151 }
42152 }
42153
42154 this._mappings.add({
42155 generatedLine: generated.line,
42156 generatedColumn: generated.column,
42157 originalLine: original != null && original.line,
42158 originalColumn: original != null && original.column,
42159 source: source,
42160 name: name
42161 });
42162 };
42163
42164/**
42165 * Set the source content for a source file.
42166 */
42167SourceMapGenerator.prototype.setSourceContent =
42168 function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
42169 var source = aSourceFile;
42170 if (this._sourceRoot != null) {
42171 source = util.relative(this._sourceRoot, source);
42172 }
42173
42174 if (aSourceContent != null) {
42175 // Add the source content to the _sourcesContents map.
42176 // Create a new _sourcesContents map if the property is null.
42177 if (!this._sourcesContents) {
42178 this._sourcesContents = Object.create(null);
42179 }
42180 this._sourcesContents[util.toSetString(source)] = aSourceContent;
42181 } else if (this._sourcesContents) {
42182 // Remove the source file from the _sourcesContents map.
42183 // If the _sourcesContents map is empty, set the property to null.
42184 delete this._sourcesContents[util.toSetString(source)];
42185 if (Object.keys(this._sourcesContents).length === 0) {
42186 this._sourcesContents = null;
42187 }
42188 }
42189 };
42190
42191/**
42192 * Applies the mappings of a sub-source-map for a specific source file to the
42193 * source map being generated. Each mapping to the supplied source file is
42194 * rewritten using the supplied source map. Note: The resolution for the
42195 * resulting mappings is the minimium of this map and the supplied map.
42196 *
42197 * @param aSourceMapConsumer The source map to be applied.
42198 * @param aSourceFile Optional. The filename of the source file.
42199 * If omitted, SourceMapConsumer's file property will be used.
42200 * @param aSourceMapPath Optional. The dirname of the path to the source map
42201 * to be applied. If relative, it is relative to the SourceMapConsumer.
42202 * This parameter is needed when the two source maps aren't in the same
42203 * directory, and the source map to be applied contains relative source
42204 * paths. If so, those relative source paths need to be rewritten
42205 * relative to the SourceMapGenerator.
42206 */
42207SourceMapGenerator.prototype.applySourceMap =
42208 function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
42209 var sourceFile = aSourceFile;
42210 // If aSourceFile is omitted, we will use the file property of the SourceMap
42211 if (aSourceFile == null) {
42212 if (aSourceMapConsumer.file == null) {
42213 throw new Error(
42214 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
42215 'or the source map\'s "file" property. Both were omitted.'
42216 );
42217 }
42218 sourceFile = aSourceMapConsumer.file;
42219 }
42220 var sourceRoot = this._sourceRoot;
42221 // Make "sourceFile" relative if an absolute Url is passed.
42222 if (sourceRoot != null) {
42223 sourceFile = util.relative(sourceRoot, sourceFile);
42224 }
42225 // Applying the SourceMap can add and remove items from the sources and
42226 // the names array.
42227 var newSources = new ArraySet();
42228 var newNames = new ArraySet();
42229
42230 // Find mappings for the "sourceFile"
42231 this._mappings.unsortedForEach(function (mapping) {
42232 if (mapping.source === sourceFile && mapping.originalLine != null) {
42233 // Check if it can be mapped by the source map, then update the mapping.
42234 var original = aSourceMapConsumer.originalPositionFor({
42235 line: mapping.originalLine,
42236 column: mapping.originalColumn
42237 });
42238 if (original.source != null) {
42239 // Copy mapping
42240 mapping.source = original.source;
42241 if (aSourceMapPath != null) {
42242 mapping.source = util.join(aSourceMapPath, mapping.source)
42243 }
42244 if (sourceRoot != null) {
42245 mapping.source = util.relative(sourceRoot, mapping.source);
42246 }
42247 mapping.originalLine = original.line;
42248 mapping.originalColumn = original.column;
42249 if (original.name != null) {
42250 mapping.name = original.name;
42251 }
42252 }
42253 }
42254
42255 var source = mapping.source;
42256 if (source != null && !newSources.has(source)) {
42257 newSources.add(source);
42258 }
42259
42260 var name = mapping.name;
42261 if (name != null && !newNames.has(name)) {
42262 newNames.add(name);
42263 }
42264
42265 }, this);
42266 this._sources = newSources;
42267 this._names = newNames;
42268
42269 // Copy sourcesContents of applied map.
42270 aSourceMapConsumer.sources.forEach(function (sourceFile) {
42271 var content = aSourceMapConsumer.sourceContentFor(sourceFile);
42272 if (content != null) {
42273 if (aSourceMapPath != null) {
42274 sourceFile = util.join(aSourceMapPath, sourceFile);
42275 }
42276 if (sourceRoot != null) {
42277 sourceFile = util.relative(sourceRoot, sourceFile);
42278 }
42279 this.setSourceContent(sourceFile, content);
42280 }
42281 }, this);
42282 };
42283
42284/**
42285 * A mapping can have one of the three levels of data:
42286 *
42287 * 1. Just the generated position.
42288 * 2. The Generated position, original position, and original source.
42289 * 3. Generated and original position, original source, as well as a name
42290 * token.
42291 *
42292 * To maintain consistency, we validate that any new mapping being added falls
42293 * in to one of these categories.
42294 */
42295SourceMapGenerator.prototype._validateMapping =
42296 function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
42297 aName) {
42298 if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
42299 && aGenerated.line > 0 && aGenerated.column >= 0
42300 && !aOriginal && !aSource && !aName) {
42301 // Case 1.
42302 return;
42303 }
42304 else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
42305 && aOriginal && 'line' in aOriginal && 'column' in aOriginal
42306 && aGenerated.line > 0 && aGenerated.column >= 0
42307 && aOriginal.line > 0 && aOriginal.column >= 0
42308 && aSource) {
42309 // Cases 2 and 3.
42310 return;
42311 }
42312 else {
42313 throw new Error('Invalid mapping: ' + JSON.stringify({
42314 generated: aGenerated,
42315 source: aSource,
42316 original: aOriginal,
42317 name: aName
42318 }));
42319 }
42320 };
42321
42322/**
42323 * Serialize the accumulated mappings in to the stream of base 64 VLQs
42324 * specified by the source map format.
42325 */
42326SourceMapGenerator.prototype._serializeMappings =
42327 function SourceMapGenerator_serializeMappings() {
42328 var previousGeneratedColumn = 0;
42329 var previousGeneratedLine = 1;
42330 var previousOriginalColumn = 0;
42331 var previousOriginalLine = 0;
42332 var previousName = 0;
42333 var previousSource = 0;
42334 var result = '';
42335 var next;
42336 var mapping;
42337 var nameIdx;
42338 var sourceIdx;
42339
42340 var mappings = this._mappings.toArray();
42341 for (var i = 0, len = mappings.length; i < len; i++) {
42342 mapping = mappings[i];
42343 next = ''
42344
42345 if (mapping.generatedLine !== previousGeneratedLine) {
42346 previousGeneratedColumn = 0;
42347 while (mapping.generatedLine !== previousGeneratedLine) {
42348 next += ';';
42349 previousGeneratedLine++;
42350 }
42351 }
42352 else {
42353 if (i > 0) {
42354 if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
42355 continue;
42356 }
42357 next += ',';
42358 }
42359 }
42360
42361 next += base64VLQ.encode(mapping.generatedColumn
42362 - previousGeneratedColumn);
42363 previousGeneratedColumn = mapping.generatedColumn;
42364
42365 if (mapping.source != null) {
42366 sourceIdx = this._sources.indexOf(mapping.source);
42367 next += base64VLQ.encode(sourceIdx - previousSource);
42368 previousSource = sourceIdx;
42369
42370 // lines are stored 0-based in SourceMap spec version 3
42371 next += base64VLQ.encode(mapping.originalLine - 1
42372 - previousOriginalLine);
42373 previousOriginalLine = mapping.originalLine - 1;
42374
42375 next += base64VLQ.encode(mapping.originalColumn
42376 - previousOriginalColumn);
42377 previousOriginalColumn = mapping.originalColumn;
42378
42379 if (mapping.name != null) {
42380 nameIdx = this._names.indexOf(mapping.name);
42381 next += base64VLQ.encode(nameIdx - previousName);
42382 previousName = nameIdx;
42383 }
42384 }
42385
42386 result += next;
42387 }
42388
42389 return result;
42390 };
42391
42392SourceMapGenerator.prototype._generateSourcesContent =
42393 function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
42394 return aSources.map(function (source) {
42395 if (!this._sourcesContents) {
42396 return null;
42397 }
42398 if (aSourceRoot != null) {
42399 source = util.relative(aSourceRoot, source);
42400 }
42401 var key = util.toSetString(source);
42402 return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
42403 ? this._sourcesContents[key]
42404 : null;
42405 }, this);
42406 };
42407
42408/**
42409 * Externalize the source map.
42410 */
42411SourceMapGenerator.prototype.toJSON =
42412 function SourceMapGenerator_toJSON() {
42413 var map = {
42414 version: this._version,
42415 sources: this._sources.toArray(),
42416 names: this._names.toArray(),
42417 mappings: this._serializeMappings()
42418 };
42419 if (this._file != null) {
42420 map.file = this._file;
42421 }
42422 if (this._sourceRoot != null) {
42423 map.sourceRoot = this._sourceRoot;
42424 }
42425 if (this._sourcesContents) {
42426 map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
42427 }
42428
42429 return map;
42430 };
42431
42432/**
42433 * Render the source map being generated to a string.
42434 */
42435SourceMapGenerator.prototype.toString =
42436 function SourceMapGenerator_toString() {
42437 return JSON.stringify(this.toJSON());
42438 };
42439
42440exports.SourceMapGenerator = SourceMapGenerator;
42441
42442},{"./array-set":474,"./base64-vlq":475,"./mapping-list":478,"./util":483}],482:[function(require,module,exports){
42443/* -*- Mode: js; js-indent-level: 2; -*- */
42444/*
42445 * Copyright 2011 Mozilla Foundation and contributors
42446 * Licensed under the New BSD license. See LICENSE or:
42447 * http://opensource.org/licenses/BSD-3-Clause
42448 */
42449
42450var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;
42451var util = require('./util');
42452
42453// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
42454// operating systems these days (capturing the result).
42455var REGEX_NEWLINE = /(\r?\n)/;
42456
42457// Newline character code for charCodeAt() comparisons
42458var NEWLINE_CODE = 10;
42459
42460// Private symbol for identifying `SourceNode`s when multiple versions of
42461// the source-map library are loaded. This MUST NOT CHANGE across
42462// versions!
42463var isSourceNode = "$$$isSourceNode$$$";
42464
42465/**
42466 * SourceNodes provide a way to abstract over interpolating/concatenating
42467 * snippets of generated JavaScript source code while maintaining the line and
42468 * column information associated with the original source code.
42469 *
42470 * @param aLine The original line number.
42471 * @param aColumn The original column number.
42472 * @param aSource The original source's filename.
42473 * @param aChunks Optional. An array of strings which are snippets of
42474 * generated JS, or other SourceNodes.
42475 * @param aName The original identifier.
42476 */
42477function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
42478 this.children = [];
42479 this.sourceContents = {};
42480 this.line = aLine == null ? null : aLine;
42481 this.column = aColumn == null ? null : aColumn;
42482 this.source = aSource == null ? null : aSource;
42483 this.name = aName == null ? null : aName;
42484 this[isSourceNode] = true;
42485 if (aChunks != null) this.add(aChunks);
42486}
42487
42488/**
42489 * Creates a SourceNode from generated code and a SourceMapConsumer.
42490 *
42491 * @param aGeneratedCode The generated code
42492 * @param aSourceMapConsumer The SourceMap for the generated code
42493 * @param aRelativePath Optional. The path that relative sources in the
42494 * SourceMapConsumer should be relative to.
42495 */
42496SourceNode.fromStringWithSourceMap =
42497 function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
42498 // The SourceNode we want to fill with the generated code
42499 // and the SourceMap
42500 var node = new SourceNode();
42501
42502 // All even indices of this array are one line of the generated code,
42503 // while all odd indices are the newlines between two adjacent lines
42504 // (since `REGEX_NEWLINE` captures its match).
42505 // Processed fragments are removed from this array, by calling `shiftNextLine`.
42506 var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
42507 var shiftNextLine = function() {
42508 var lineContents = remainingLines.shift();
42509 // The last line of a file might not have a newline.
42510 var newLine = remainingLines.shift() || "";
42511 return lineContents + newLine;
42512 };
42513
42514 // We need to remember the position of "remainingLines"
42515 var lastGeneratedLine = 1, lastGeneratedColumn = 0;
42516
42517 // The generate SourceNodes we need a code range.
42518 // To extract it current and last mapping is used.
42519 // Here we store the last mapping.
42520 var lastMapping = null;
42521
42522 aSourceMapConsumer.eachMapping(function (mapping) {
42523 if (lastMapping !== null) {
42524 // We add the code from "lastMapping" to "mapping":
42525 // First check if there is a new line in between.
42526 if (lastGeneratedLine < mapping.generatedLine) {
42527 // Associate first line with "lastMapping"
42528 addMappingWithCode(lastMapping, shiftNextLine());
42529 lastGeneratedLine++;
42530 lastGeneratedColumn = 0;
42531 // The remaining code is added without mapping
42532 } else {
42533 // There is no new line in between.
42534 // Associate the code between "lastGeneratedColumn" and
42535 // "mapping.generatedColumn" with "lastMapping"
42536 var nextLine = remainingLines[0];
42537 var code = nextLine.substr(0, mapping.generatedColumn -
42538 lastGeneratedColumn);
42539 remainingLines[0] = nextLine.substr(mapping.generatedColumn -
42540 lastGeneratedColumn);
42541 lastGeneratedColumn = mapping.generatedColumn;
42542 addMappingWithCode(lastMapping, code);
42543 // No more remaining code, continue
42544 lastMapping = mapping;
42545 return;
42546 }
42547 }
42548 // We add the generated code until the first mapping
42549 // to the SourceNode without any mapping.
42550 // Each line is added as separate string.
42551 while (lastGeneratedLine < mapping.generatedLine) {
42552 node.add(shiftNextLine());
42553 lastGeneratedLine++;
42554 }
42555 if (lastGeneratedColumn < mapping.generatedColumn) {
42556 var nextLine = remainingLines[0];
42557 node.add(nextLine.substr(0, mapping.generatedColumn));
42558 remainingLines[0] = nextLine.substr(mapping.generatedColumn);
42559 lastGeneratedColumn = mapping.generatedColumn;
42560 }
42561 lastMapping = mapping;
42562 }, this);
42563 // We have processed all mappings.
42564 if (remainingLines.length > 0) {
42565 if (lastMapping) {
42566 // Associate the remaining code in the current line with "lastMapping"
42567 addMappingWithCode(lastMapping, shiftNextLine());
42568 }
42569 // and add the remaining lines without any mapping
42570 node.add(remainingLines.join(""));
42571 }
42572
42573 // Copy sourcesContent into SourceNode
42574 aSourceMapConsumer.sources.forEach(function (sourceFile) {
42575 var content = aSourceMapConsumer.sourceContentFor(sourceFile);
42576 if (content != null) {
42577 if (aRelativePath != null) {
42578 sourceFile = util.join(aRelativePath, sourceFile);
42579 }
42580 node.setSourceContent(sourceFile, content);
42581 }
42582 });
42583
42584 return node;
42585
42586 function addMappingWithCode(mapping, code) {
42587 if (mapping === null || mapping.source === undefined) {
42588 node.add(code);
42589 } else {
42590 var source = aRelativePath
42591 ? util.join(aRelativePath, mapping.source)
42592 : mapping.source;
42593 node.add(new SourceNode(mapping.originalLine,
42594 mapping.originalColumn,
42595 source,
42596 code,
42597 mapping.name));
42598 }
42599 }
42600 };
42601
42602/**
42603 * Add a chunk of generated JS to this source node.
42604 *
42605 * @param aChunk A string snippet of generated JS code, another instance of
42606 * SourceNode, or an array where each member is one of those things.
42607 */
42608SourceNode.prototype.add = function SourceNode_add(aChunk) {
42609 if (Array.isArray(aChunk)) {
42610 aChunk.forEach(function (chunk) {
42611 this.add(chunk);
42612 }, this);
42613 }
42614 else if (aChunk[isSourceNode] || typeof aChunk === "string") {
42615 if (aChunk) {
42616 this.children.push(aChunk);
42617 }
42618 }
42619 else {
42620 throw new TypeError(
42621 "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
42622 );
42623 }
42624 return this;
42625};
42626
42627/**
42628 * Add a chunk of generated JS to the beginning of this source node.
42629 *
42630 * @param aChunk A string snippet of generated JS code, another instance of
42631 * SourceNode, or an array where each member is one of those things.
42632 */
42633SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
42634 if (Array.isArray(aChunk)) {
42635 for (var i = aChunk.length-1; i >= 0; i--) {
42636 this.prepend(aChunk[i]);
42637 }
42638 }
42639 else if (aChunk[isSourceNode] || typeof aChunk === "string") {
42640 this.children.unshift(aChunk);
42641 }
42642 else {
42643 throw new TypeError(
42644 "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
42645 );
42646 }
42647 return this;
42648};
42649
42650/**
42651 * Walk over the tree of JS snippets in this node and its children. The
42652 * walking function is called once for each snippet of JS and is passed that
42653 * snippet and the its original associated source's line/column location.
42654 *
42655 * @param aFn The traversal function.
42656 */
42657SourceNode.prototype.walk = function SourceNode_walk(aFn) {
42658 var chunk;
42659 for (var i = 0, len = this.children.length; i < len; i++) {
42660 chunk = this.children[i];
42661 if (chunk[isSourceNode]) {
42662 chunk.walk(aFn);
42663 }
42664 else {
42665 if (chunk !== '') {
42666 aFn(chunk, { source: this.source,
42667 line: this.line,
42668 column: this.column,
42669 name: this.name });
42670 }
42671 }
42672 }
42673};
42674
42675/**
42676 * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
42677 * each of `this.children`.
42678 *
42679 * @param aSep The separator.
42680 */
42681SourceNode.prototype.join = function SourceNode_join(aSep) {
42682 var newChildren;
42683 var i;
42684 var len = this.children.length;
42685 if (len > 0) {
42686 newChildren = [];
42687 for (i = 0; i < len-1; i++) {
42688 newChildren.push(this.children[i]);
42689 newChildren.push(aSep);
42690 }
42691 newChildren.push(this.children[i]);
42692 this.children = newChildren;
42693 }
42694 return this;
42695};
42696
42697/**
42698 * Call String.prototype.replace on the very right-most source snippet. Useful
42699 * for trimming whitespace from the end of a source node, etc.
42700 *
42701 * @param aPattern The pattern to replace.
42702 * @param aReplacement The thing to replace the pattern with.
42703 */
42704SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
42705 var lastChild = this.children[this.children.length - 1];
42706 if (lastChild[isSourceNode]) {
42707 lastChild.replaceRight(aPattern, aReplacement);
42708 }
42709 else if (typeof lastChild === 'string') {
42710 this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
42711 }
42712 else {
42713 this.children.push(''.replace(aPattern, aReplacement));
42714 }
42715 return this;
42716};
42717
42718/**
42719 * Set the source content for a source file. This will be added to the SourceMapGenerator
42720 * in the sourcesContent field.
42721 *
42722 * @param aSourceFile The filename of the source file
42723 * @param aSourceContent The content of the source file
42724 */
42725SourceNode.prototype.setSourceContent =
42726 function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
42727 this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
42728 };
42729
42730/**
42731 * Walk over the tree of SourceNodes. The walking function is called for each
42732 * source file content and is passed the filename and source content.
42733 *
42734 * @param aFn The traversal function.
42735 */
42736SourceNode.prototype.walkSourceContents =
42737 function SourceNode_walkSourceContents(aFn) {
42738 for (var i = 0, len = this.children.length; i < len; i++) {
42739 if (this.children[i][isSourceNode]) {
42740 this.children[i].walkSourceContents(aFn);
42741 }
42742 }
42743
42744 var sources = Object.keys(this.sourceContents);
42745 for (var i = 0, len = sources.length; i < len; i++) {
42746 aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
42747 }
42748 };
42749
42750/**
42751 * Return the string representation of this source node. Walks over the tree
42752 * and concatenates all the various snippets together to one string.
42753 */
42754SourceNode.prototype.toString = function SourceNode_toString() {
42755 var str = "";
42756 this.walk(function (chunk) {
42757 str += chunk;
42758 });
42759 return str;
42760};
42761
42762/**
42763 * Returns the string representation of this source node along with a source
42764 * map.
42765 */
42766SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
42767 var generated = {
42768 code: "",
42769 line: 1,
42770 column: 0
42771 };
42772 var map = new SourceMapGenerator(aArgs);
42773 var sourceMappingActive = false;
42774 var lastOriginalSource = null;
42775 var lastOriginalLine = null;
42776 var lastOriginalColumn = null;
42777 var lastOriginalName = null;
42778 this.walk(function (chunk, original) {
42779 generated.code += chunk;
42780 if (original.source !== null
42781 && original.line !== null
42782 && original.column !== null) {
42783 if(lastOriginalSource !== original.source
42784 || lastOriginalLine !== original.line
42785 || lastOriginalColumn !== original.column
42786 || lastOriginalName !== original.name) {
42787 map.addMapping({
42788 source: original.source,
42789 original: {
42790 line: original.line,
42791 column: original.column
42792 },
42793 generated: {
42794 line: generated.line,
42795 column: generated.column
42796 },
42797 name: original.name
42798 });
42799 }
42800 lastOriginalSource = original.source;
42801 lastOriginalLine = original.line;
42802 lastOriginalColumn = original.column;
42803 lastOriginalName = original.name;
42804 sourceMappingActive = true;
42805 } else if (sourceMappingActive) {
42806 map.addMapping({
42807 generated: {
42808 line: generated.line,
42809 column: generated.column
42810 }
42811 });
42812 lastOriginalSource = null;
42813 sourceMappingActive = false;
42814 }
42815 for (var idx = 0, length = chunk.length; idx < length; idx++) {
42816 if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
42817 generated.line++;
42818 generated.column = 0;
42819 // Mappings end at eol
42820 if (idx + 1 === length) {
42821 lastOriginalSource = null;
42822 sourceMappingActive = false;
42823 } else if (sourceMappingActive) {
42824 map.addMapping({
42825 source: original.source,
42826 original: {
42827 line: original.line,
42828 column: original.column
42829 },
42830 generated: {
42831 line: generated.line,
42832 column: generated.column
42833 },
42834 name: original.name
42835 });
42836 }
42837 } else {
42838 generated.column++;
42839 }
42840 }
42841 });
42842 this.walkSourceContents(function (sourceFile, sourceContent) {
42843 map.setSourceContent(sourceFile, sourceContent);
42844 });
42845
42846 return { code: generated.code, map: map };
42847};
42848
42849exports.SourceNode = SourceNode;
42850
42851},{"./source-map-generator":481,"./util":483}],483:[function(require,module,exports){
42852/* -*- Mode: js; js-indent-level: 2; -*- */
42853/*
42854 * Copyright 2011 Mozilla Foundation and contributors
42855 * Licensed under the New BSD license. See LICENSE or:
42856 * http://opensource.org/licenses/BSD-3-Clause
42857 */
42858
42859/**
42860 * This is a helper function for getting values from parameter/options
42861 * objects.
42862 *
42863 * @param args The object we are extracting values from
42864 * @param name The name of the property we are getting.
42865 * @param defaultValue An optional value to return if the property is missing
42866 * from the object. If this is not specified and the property is missing, an
42867 * error will be thrown.
42868 */
42869function getArg(aArgs, aName, aDefaultValue) {
42870 if (aName in aArgs) {
42871 return aArgs[aName];
42872 } else if (arguments.length === 3) {
42873 return aDefaultValue;
42874 } else {
42875 throw new Error('"' + aName + '" is a required argument.');
42876 }
42877}
42878exports.getArg = getArg;
42879
42880var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
42881var dataUrlRegexp = /^data:.+\,.+$/;
42882
42883function urlParse(aUrl) {
42884 var match = aUrl.match(urlRegexp);
42885 if (!match) {
42886 return null;
42887 }
42888 return {
42889 scheme: match[1],
42890 auth: match[2],
42891 host: match[3],
42892 port: match[4],
42893 path: match[5]
42894 };
42895}
42896exports.urlParse = urlParse;
42897
42898function urlGenerate(aParsedUrl) {
42899 var url = '';
42900 if (aParsedUrl.scheme) {
42901 url += aParsedUrl.scheme + ':';
42902 }
42903 url += '//';
42904 if (aParsedUrl.auth) {
42905 url += aParsedUrl.auth + '@';
42906 }
42907 if (aParsedUrl.host) {
42908 url += aParsedUrl.host;
42909 }
42910 if (aParsedUrl.port) {
42911 url += ":" + aParsedUrl.port
42912 }
42913 if (aParsedUrl.path) {
42914 url += aParsedUrl.path;
42915 }
42916 return url;
42917}
42918exports.urlGenerate = urlGenerate;
42919
42920/**
42921 * Normalizes a path, or the path portion of a URL:
42922 *
42923 * - Replaces consecutive slashes with one slash.
42924 * - Removes unnecessary '.' parts.
42925 * - Removes unnecessary '<dir>/..' parts.
42926 *
42927 * Based on code in the Node.js 'path' core module.
42928 *
42929 * @param aPath The path or url to normalize.
42930 */
42931function normalize(aPath) {
42932 var path = aPath;
42933 var url = urlParse(aPath);
42934 if (url) {
42935 if (!url.path) {
42936 return aPath;
42937 }
42938 path = url.path;
42939 }
42940 var isAbsolute = exports.isAbsolute(path);
42941
42942 var parts = path.split(/\/+/);
42943 for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
42944 part = parts[i];
42945 if (part === '.') {
42946 parts.splice(i, 1);
42947 } else if (part === '..') {
42948 up++;
42949 } else if (up > 0) {
42950 if (part === '') {
42951 // The first part is blank if the path is absolute. Trying to go
42952 // above the root is a no-op. Therefore we can remove all '..' parts
42953 // directly after the root.
42954 parts.splice(i + 1, up);
42955 up = 0;
42956 } else {
42957 parts.splice(i, 2);
42958 up--;
42959 }
42960 }
42961 }
42962 path = parts.join('/');
42963
42964 if (path === '') {
42965 path = isAbsolute ? '/' : '.';
42966 }
42967
42968 if (url) {
42969 url.path = path;
42970 return urlGenerate(url);
42971 }
42972 return path;
42973}
42974exports.normalize = normalize;
42975
42976/**
42977 * Joins two paths/URLs.
42978 *
42979 * @param aRoot The root path or URL.
42980 * @param aPath The path or URL to be joined with the root.
42981 *
42982 * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
42983 * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
42984 * first.
42985 * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
42986 * is updated with the result and aRoot is returned. Otherwise the result
42987 * is returned.
42988 * - If aPath is absolute, the result is aPath.
42989 * - Otherwise the two paths are joined with a slash.
42990 * - Joining for example 'http://' and 'www.example.com' is also supported.
42991 */
42992function join(aRoot, aPath) {
42993 if (aRoot === "") {
42994 aRoot = ".";
42995 }
42996 if (aPath === "") {
42997 aPath = ".";
42998 }
42999 var aPathUrl = urlParse(aPath);
43000 var aRootUrl = urlParse(aRoot);
43001 if (aRootUrl) {
43002 aRoot = aRootUrl.path || '/';
43003 }
43004
43005 // `join(foo, '//www.example.org')`
43006 if (aPathUrl && !aPathUrl.scheme) {
43007 if (aRootUrl) {
43008 aPathUrl.scheme = aRootUrl.scheme;
43009 }
43010 return urlGenerate(aPathUrl);
43011 }
43012
43013 if (aPathUrl || aPath.match(dataUrlRegexp)) {
43014 return aPath;
43015 }
43016
43017 // `join('http://', 'www.example.com')`
43018 if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
43019 aRootUrl.host = aPath;
43020 return urlGenerate(aRootUrl);
43021 }
43022
43023 var joined = aPath.charAt(0) === '/'
43024 ? aPath
43025 : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
43026
43027 if (aRootUrl) {
43028 aRootUrl.path = joined;
43029 return urlGenerate(aRootUrl);
43030 }
43031 return joined;
43032}
43033exports.join = join;
43034
43035exports.isAbsolute = function (aPath) {
43036 return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
43037};
43038
43039/**
43040 * Make a path relative to a URL or another path.
43041 *
43042 * @param aRoot The root path or URL.
43043 * @param aPath The path or URL to be made relative to aRoot.
43044 */
43045function relative(aRoot, aPath) {
43046 if (aRoot === "") {
43047 aRoot = ".";
43048 }
43049
43050 aRoot = aRoot.replace(/\/$/, '');
43051
43052 // It is possible for the path to be above the root. In this case, simply
43053 // checking whether the root is a prefix of the path won't work. Instead, we
43054 // need to remove components from the root one by one, until either we find
43055 // a prefix that fits, or we run out of components to remove.
43056 var level = 0;
43057 while (aPath.indexOf(aRoot + '/') !== 0) {
43058 var index = aRoot.lastIndexOf("/");
43059 if (index < 0) {
43060 return aPath;
43061 }
43062
43063 // If the only part of the root that is left is the scheme (i.e. http://,
43064 // file:///, etc.), one or more slashes (/), or simply nothing at all, we
43065 // have exhausted all components, so the path is not relative to the root.
43066 aRoot = aRoot.slice(0, index);
43067 if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
43068 return aPath;
43069 }
43070
43071 ++level;
43072 }
43073
43074 // Make sure we add a "../" for each component we removed from the root.
43075 return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
43076}
43077exports.relative = relative;
43078
43079var supportsNullProto = (function () {
43080 var obj = Object.create(null);
43081 return !('__proto__' in obj);
43082}());
43083
43084function identity (s) {
43085 return s;
43086}
43087
43088/**
43089 * Because behavior goes wacky when you set `__proto__` on objects, we
43090 * have to prefix all the strings in our set with an arbitrary character.
43091 *
43092 * See https://github.com/mozilla/source-map/pull/31 and
43093 * https://github.com/mozilla/source-map/issues/30
43094 *
43095 * @param String aStr
43096 */
43097function toSetString(aStr) {
43098 if (isProtoString(aStr)) {
43099 return '$' + aStr;
43100 }
43101
43102 return aStr;
43103}
43104exports.toSetString = supportsNullProto ? identity : toSetString;
43105
43106function fromSetString(aStr) {
43107 if (isProtoString(aStr)) {
43108 return aStr.slice(1);
43109 }
43110
43111 return aStr;
43112}
43113exports.fromSetString = supportsNullProto ? identity : fromSetString;
43114
43115function isProtoString(s) {
43116 if (!s) {
43117 return false;
43118 }
43119
43120 var length = s.length;
43121
43122 if (length < 9 /* "__proto__".length */) {
43123 return false;
43124 }
43125
43126 if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
43127 s.charCodeAt(length - 2) !== 95 /* '_' */ ||
43128 s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
43129 s.charCodeAt(length - 4) !== 116 /* 't' */ ||
43130 s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
43131 s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
43132 s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
43133 s.charCodeAt(length - 8) !== 95 /* '_' */ ||
43134 s.charCodeAt(length - 9) !== 95 /* '_' */) {
43135 return false;
43136 }
43137
43138 for (var i = length - 10; i >= 0; i--) {
43139 if (s.charCodeAt(i) !== 36 /* '$' */) {
43140 return false;
43141 }
43142 }
43143
43144 return true;
43145}
43146
43147/**
43148 * Comparator between two mappings where the original positions are compared.
43149 *
43150 * Optionally pass in `true` as `onlyCompareGenerated` to consider two
43151 * mappings with the same original source/line/column, but different generated
43152 * line and column the same. Useful when searching for a mapping with a
43153 * stubbed out mapping.
43154 */
43155function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
43156 var cmp = mappingA.source - mappingB.source;
43157 if (cmp !== 0) {
43158 return cmp;
43159 }
43160
43161 cmp = mappingA.originalLine - mappingB.originalLine;
43162 if (cmp !== 0) {
43163 return cmp;
43164 }
43165
43166 cmp = mappingA.originalColumn - mappingB.originalColumn;
43167 if (cmp !== 0 || onlyCompareOriginal) {
43168 return cmp;
43169 }
43170
43171 cmp = mappingA.generatedColumn - mappingB.generatedColumn;
43172 if (cmp !== 0) {
43173 return cmp;
43174 }
43175
43176 cmp = mappingA.generatedLine - mappingB.generatedLine;
43177 if (cmp !== 0) {
43178 return cmp;
43179 }
43180
43181 return mappingA.name - mappingB.name;
43182}
43183exports.compareByOriginalPositions = compareByOriginalPositions;
43184
43185/**
43186 * Comparator between two mappings with deflated source and name indices where
43187 * the generated positions are compared.
43188 *
43189 * Optionally pass in `true` as `onlyCompareGenerated` to consider two
43190 * mappings with the same generated line and column, but different
43191 * source/name/original line and column the same. Useful when searching for a
43192 * mapping with a stubbed out mapping.
43193 */
43194function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
43195 var cmp = mappingA.generatedLine - mappingB.generatedLine;
43196 if (cmp !== 0) {
43197 return cmp;
43198 }
43199
43200 cmp = mappingA.generatedColumn - mappingB.generatedColumn;
43201 if (cmp !== 0 || onlyCompareGenerated) {
43202 return cmp;
43203 }
43204
43205 cmp = mappingA.source - mappingB.source;
43206 if (cmp !== 0) {
43207 return cmp;
43208 }
43209
43210 cmp = mappingA.originalLine - mappingB.originalLine;
43211 if (cmp !== 0) {
43212 return cmp;
43213 }
43214
43215 cmp = mappingA.originalColumn - mappingB.originalColumn;
43216 if (cmp !== 0) {
43217 return cmp;
43218 }
43219
43220 return mappingA.name - mappingB.name;
43221}
43222exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
43223
43224function strcmp(aStr1, aStr2) {
43225 if (aStr1 === aStr2) {
43226 return 0;
43227 }
43228
43229 if (aStr1 > aStr2) {
43230 return 1;
43231 }
43232
43233 return -1;
43234}
43235
43236/**
43237 * Comparator between two mappings with inflated source and name strings where
43238 * the generated positions are compared.
43239 */
43240function compareByGeneratedPositionsInflated(mappingA, mappingB) {
43241 var cmp = mappingA.generatedLine - mappingB.generatedLine;
43242 if (cmp !== 0) {
43243 return cmp;
43244 }
43245
43246 cmp = mappingA.generatedColumn - mappingB.generatedColumn;
43247 if (cmp !== 0) {
43248 return cmp;
43249 }
43250
43251 cmp = strcmp(mappingA.source, mappingB.source);
43252 if (cmp !== 0) {
43253 return cmp;
43254 }
43255
43256 cmp = mappingA.originalLine - mappingB.originalLine;
43257 if (cmp !== 0) {
43258 return cmp;
43259 }
43260
43261 cmp = mappingA.originalColumn - mappingB.originalColumn;
43262 if (cmp !== 0) {
43263 return cmp;
43264 }
43265
43266 return strcmp(mappingA.name, mappingB.name);
43267}
43268exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
43269
43270},{}],484:[function(require,module,exports){
43271/*
43272 * Copyright 2009-2011 Mozilla Foundation and contributors
43273 * Licensed under the New BSD license. See LICENSE.txt or:
43274 * http://opensource.org/licenses/BSD-3-Clause
43275 */
43276exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;
43277exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;
43278exports.SourceNode = require('./lib/source-node').SourceNode;
43279
43280},{"./lib/source-map-consumer":480,"./lib/source-map-generator":481,"./lib/source-node":482}],485:[function(require,module,exports){
43281'use strict';
43282var ansiRegex = require('ansi-regex')();
43283
43284module.exports = function (str) {
43285 return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
43286};
43287
43288},{"ansi-regex":1}],486:[function(require,module,exports){
43289(function (process){
43290'use strict';
43291var argv = process.argv;
43292
43293var terminator = argv.indexOf('--');
43294var hasFlag = function (flag) {
43295 flag = '--' + flag;
43296 var pos = argv.indexOf(flag);
43297 return pos !== -1 && (terminator !== -1 ? pos < terminator : true);
43298};
43299
43300module.exports = (function () {
43301 if ('FORCE_COLOR' in process.env) {
43302 return true;
43303 }
43304
43305 if (hasFlag('no-color') ||
43306 hasFlag('no-colors') ||
43307 hasFlag('color=false')) {
43308 return false;
43309 }
43310
43311 if (hasFlag('color') ||
43312 hasFlag('colors') ||
43313 hasFlag('color=true') ||
43314 hasFlag('color=always')) {
43315 return true;
43316 }
43317
43318 if (process.stdout && !process.stdout.isTTY) {
43319 return false;
43320 }
43321
43322 if (process.platform === 'win32') {
43323 return true;
43324 }
43325
43326 if ('COLORTERM' in process.env) {
43327 return true;
43328 }
43329
43330 if (process.env.TERM === 'dumb') {
43331 return false;
43332 }
43333
43334 if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
43335 return true;
43336 }
43337
43338 return false;
43339})();
43340
43341}).call(this,require('_process'))
43342},{"_process":471}],487:[function(require,module,exports){
43343'use strict';
43344module.exports = function toFastProperties(obj) {
43345 function f() {}
43346 f.prototype = obj;
43347 new f();
43348 return;
43349 eval(obj);
43350};
43351
43352},{}],488:[function(require,module,exports){
43353'use strict';
43354module.exports = function (str) {
43355 var tail = str.length;
43356
43357 while (/[\s\uFEFF\u00A0]/.test(str[tail - 1])) {
43358 tail--;
43359 }
43360
43361 return str.slice(0, tail);
43362};
43363
43364},{}],489:[function(require,module,exports){
43365exports.isatty = function () { return false; };
43366
43367function ReadStream() {
43368 throw new Error('tty.ReadStream is not implemented');
43369}
43370exports.ReadStream = ReadStream;
43371
43372function WriteStream() {
43373 throw new Error('tty.ReadStream is not implemented');
43374}
43375exports.WriteStream = WriteStream;
43376
43377},{}],490:[function(require,module,exports){
43378if (typeof Object.create === 'function') {
43379 // implementation from standard node.js 'util' module
43380 module.exports = function inherits(ctor, superCtor) {
43381 ctor.super_ = superCtor
43382 ctor.prototype = Object.create(superCtor.prototype, {
43383 constructor: {
43384 value: ctor,
43385 enumerable: false,
43386 writable: true,
43387 configurable: true
43388 }
43389 });
43390 };
43391} else {
43392 // old school shim for old browsers
43393 module.exports = function inherits(ctor, superCtor) {
43394 ctor.super_ = superCtor
43395 var TempCtor = function () {}
43396 TempCtor.prototype = superCtor.prototype
43397 ctor.prototype = new TempCtor()
43398 ctor.prototype.constructor = ctor
43399 }
43400}
43401
43402},{}],491:[function(require,module,exports){
43403module.exports = function isBuffer(arg) {
43404 return arg && typeof arg === 'object'
43405 && typeof arg.copy === 'function'
43406 && typeof arg.fill === 'function'
43407 && typeof arg.readUInt8 === 'function';
43408}
43409},{}],492:[function(require,module,exports){
43410(function (process,global){
43411// Copyright Joyent, Inc. and other Node contributors.
43412//
43413// Permission is hereby granted, free of charge, to any person obtaining a
43414// copy of this software and associated documentation files (the
43415// "Software"), to deal in the Software without restriction, including
43416// without limitation the rights to use, copy, modify, merge, publish,
43417// distribute, sublicense, and/or sell copies of the Software, and to permit
43418// persons to whom the Software is furnished to do so, subject to the
43419// following conditions:
43420//
43421// The above copyright notice and this permission notice shall be included
43422// in all copies or substantial portions of the Software.
43423//
43424// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
43425// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
43426// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
43427// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
43428// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
43429// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
43430// USE OR OTHER DEALINGS IN THE SOFTWARE.
43431
43432var formatRegExp = /%[sdj%]/g;
43433exports.format = function(f) {
43434 if (!isString(f)) {
43435 var objects = [];
43436 for (var i = 0; i < arguments.length; i++) {
43437 objects.push(inspect(arguments[i]));
43438 }
43439 return objects.join(' ');
43440 }
43441
43442 var i = 1;
43443 var args = arguments;
43444 var len = args.length;
43445 var str = String(f).replace(formatRegExp, function(x) {
43446 if (x === '%%') return '%';
43447 if (i >= len) return x;
43448 switch (x) {
43449 case '%s': return String(args[i++]);
43450 case '%d': return Number(args[i++]);
43451 case '%j':
43452 try {
43453 return JSON.stringify(args[i++]);
43454 } catch (_) {
43455 return '[Circular]';
43456 }
43457 default:
43458 return x;
43459 }
43460 });
43461 for (var x = args[i]; i < len; x = args[++i]) {
43462 if (isNull(x) || !isObject(x)) {
43463 str += ' ' + x;
43464 } else {
43465 str += ' ' + inspect(x);
43466 }
43467 }
43468 return str;
43469};
43470
43471
43472// Mark that a method should not be used.
43473// Returns a modified function which warns once by default.
43474// If --no-deprecation is set, then it is a no-op.
43475exports.deprecate = function(fn, msg) {
43476 // Allow for deprecating things in the process of starting up.
43477 if (isUndefined(global.process)) {
43478 return function() {
43479 return exports.deprecate(fn, msg).apply(this, arguments);
43480 };
43481 }
43482
43483 if (process.noDeprecation === true) {
43484 return fn;
43485 }
43486
43487 var warned = false;
43488 function deprecated() {
43489 if (!warned) {
43490 if (process.throwDeprecation) {
43491 throw new Error(msg);
43492 } else if (process.traceDeprecation) {
43493 console.trace(msg);
43494 } else {
43495 console.error(msg);
43496 }
43497 warned = true;
43498 }
43499 return fn.apply(this, arguments);
43500 }
43501
43502 return deprecated;
43503};
43504
43505
43506var debugs = {};
43507var debugEnviron;
43508exports.debuglog = function(set) {
43509 if (isUndefined(debugEnviron))
43510 debugEnviron = process.env.NODE_DEBUG || '';
43511 set = set.toUpperCase();
43512 if (!debugs[set]) {
43513 if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
43514 var pid = process.pid;
43515 debugs[set] = function() {
43516 var msg = exports.format.apply(exports, arguments);
43517 console.error('%s %d: %s', set, pid, msg);
43518 };
43519 } else {
43520 debugs[set] = function() {};
43521 }
43522 }
43523 return debugs[set];
43524};
43525
43526
43527/**
43528 * Echos the value of a value. Trys to print the value out
43529 * in the best way possible given the different types.
43530 *
43531 * @param {Object} obj The object to print out.
43532 * @param {Object} opts Optional options object that alters the output.
43533 */
43534/* legacy: obj, showHidden, depth, colors*/
43535function inspect(obj, opts) {
43536 // default options
43537 var ctx = {
43538 seen: [],
43539 stylize: stylizeNoColor
43540 };
43541 // legacy...
43542 if (arguments.length >= 3) ctx.depth = arguments[2];
43543 if (arguments.length >= 4) ctx.colors = arguments[3];
43544 if (isBoolean(opts)) {
43545 // legacy...
43546 ctx.showHidden = opts;
43547 } else if (opts) {
43548 // got an "options" object
43549 exports._extend(ctx, opts);
43550 }
43551 // set default options
43552 if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
43553 if (isUndefined(ctx.depth)) ctx.depth = 2;
43554 if (isUndefined(ctx.colors)) ctx.colors = false;
43555 if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
43556 if (ctx.colors) ctx.stylize = stylizeWithColor;
43557 return formatValue(ctx, obj, ctx.depth);
43558}
43559exports.inspect = inspect;
43560
43561
43562// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
43563inspect.colors = {
43564 'bold' : [1, 22],
43565 'italic' : [3, 23],
43566 'underline' : [4, 24],
43567 'inverse' : [7, 27],
43568 'white' : [37, 39],
43569 'grey' : [90, 39],
43570 'black' : [30, 39],
43571 'blue' : [34, 39],
43572 'cyan' : [36, 39],
43573 'green' : [32, 39],
43574 'magenta' : [35, 39],
43575 'red' : [31, 39],
43576 'yellow' : [33, 39]
43577};
43578
43579// Don't use 'blue' not visible on cmd.exe
43580inspect.styles = {
43581 'special': 'cyan',
43582 'number': 'yellow',
43583 'boolean': 'yellow',
43584 'undefined': 'grey',
43585 'null': 'bold',
43586 'string': 'green',
43587 'date': 'magenta',
43588 // "name": intentionally not styling
43589 'regexp': 'red'
43590};
43591
43592
43593function stylizeWithColor(str, styleType) {
43594 var style = inspect.styles[styleType];
43595
43596 if (style) {
43597 return '\u001b[' + inspect.colors[style][0] + 'm' + str +
43598 '\u001b[' + inspect.colors[style][1] + 'm';
43599 } else {
43600 return str;
43601 }
43602}
43603
43604
43605function stylizeNoColor(str, styleType) {
43606 return str;
43607}
43608
43609
43610function arrayToHash(array) {
43611 var hash = {};
43612
43613 array.forEach(function(val, idx) {
43614 hash[val] = true;
43615 });
43616
43617 return hash;
43618}
43619
43620
43621function formatValue(ctx, value, recurseTimes) {
43622 // Provide a hook for user-specified inspect functions.
43623 // Check that value is an object with an inspect function on it
43624 if (ctx.customInspect &&
43625 value &&
43626 isFunction(value.inspect) &&
43627 // Filter out the util module, it's inspect function is special
43628 value.inspect !== exports.inspect &&
43629 // Also filter out any prototype objects using the circular check.
43630 !(value.constructor && value.constructor.prototype === value)) {
43631 var ret = value.inspect(recurseTimes, ctx);
43632 if (!isString(ret)) {
43633 ret = formatValue(ctx, ret, recurseTimes);
43634 }
43635 return ret;
43636 }
43637
43638 // Primitive types cannot have properties
43639 var primitive = formatPrimitive(ctx, value);
43640 if (primitive) {
43641 return primitive;
43642 }
43643
43644 // Look up the keys of the object.
43645 var keys = Object.keys(value);
43646 var visibleKeys = arrayToHash(keys);
43647
43648 if (ctx.showHidden) {
43649 keys = Object.getOwnPropertyNames(value);
43650 }
43651
43652 // IE doesn't make error fields non-enumerable
43653 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
43654 if (isError(value)
43655 && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
43656 return formatError(value);
43657 }
43658
43659 // Some type of object without properties can be shortcutted.
43660 if (keys.length === 0) {
43661 if (isFunction(value)) {
43662 var name = value.name ? ': ' + value.name : '';
43663 return ctx.stylize('[Function' + name + ']', 'special');
43664 }
43665 if (isRegExp(value)) {
43666 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
43667 }
43668 if (isDate(value)) {
43669 return ctx.stylize(Date.prototype.toString.call(value), 'date');
43670 }
43671 if (isError(value)) {
43672 return formatError(value);
43673 }
43674 }
43675
43676 var base = '', array = false, braces = ['{', '}'];
43677
43678 // Make Array say that they are Array
43679 if (isArray(value)) {
43680 array = true;
43681 braces = ['[', ']'];
43682 }
43683
43684 // Make functions say that they are functions
43685 if (isFunction(value)) {
43686 var n = value.name ? ': ' + value.name : '';
43687 base = ' [Function' + n + ']';
43688 }
43689
43690 // Make RegExps say that they are RegExps
43691 if (isRegExp(value)) {
43692 base = ' ' + RegExp.prototype.toString.call(value);
43693 }
43694
43695 // Make dates with properties first say the date
43696 if (isDate(value)) {
43697 base = ' ' + Date.prototype.toUTCString.call(value);
43698 }
43699
43700 // Make error with message first say the error
43701 if (isError(value)) {
43702 base = ' ' + formatError(value);
43703 }
43704
43705 if (keys.length === 0 && (!array || value.length == 0)) {
43706 return braces[0] + base + braces[1];
43707 }
43708
43709 if (recurseTimes < 0) {
43710 if (isRegExp(value)) {
43711 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
43712 } else {
43713 return ctx.stylize('[Object]', 'special');
43714 }
43715 }
43716
43717 ctx.seen.push(value);
43718
43719 var output;
43720 if (array) {
43721 output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
43722 } else {
43723 output = keys.map(function(key) {
43724 return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
43725 });
43726 }
43727
43728 ctx.seen.pop();
43729
43730 return reduceToSingleString(output, base, braces);
43731}
43732
43733
43734function formatPrimitive(ctx, value) {
43735 if (isUndefined(value))
43736 return ctx.stylize('undefined', 'undefined');
43737 if (isString(value)) {
43738 var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
43739 .replace(/'/g, "\\'")
43740 .replace(/\\"/g, '"') + '\'';
43741 return ctx.stylize(simple, 'string');
43742 }
43743 if (isNumber(value))
43744 return ctx.stylize('' + value, 'number');
43745 if (isBoolean(value))
43746 return ctx.stylize('' + value, 'boolean');
43747 // For some reason typeof null is "object", so special case here.
43748 if (isNull(value))
43749 return ctx.stylize('null', 'null');
43750}
43751
43752
43753function formatError(value) {
43754 return '[' + Error.prototype.toString.call(value) + ']';
43755}
43756
43757
43758function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
43759 var output = [];
43760 for (var i = 0, l = value.length; i < l; ++i) {
43761 if (hasOwnProperty(value, String(i))) {
43762 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
43763 String(i), true));
43764 } else {
43765 output.push('');
43766 }
43767 }
43768 keys.forEach(function(key) {
43769 if (!key.match(/^\d+$/)) {
43770 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
43771 key, true));
43772 }
43773 });
43774 return output;
43775}
43776
43777
43778function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
43779 var name, str, desc;
43780 desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
43781 if (desc.get) {
43782 if (desc.set) {
43783 str = ctx.stylize('[Getter/Setter]', 'special');
43784 } else {
43785 str = ctx.stylize('[Getter]', 'special');
43786 }
43787 } else {
43788 if (desc.set) {
43789 str = ctx.stylize('[Setter]', 'special');
43790 }
43791 }
43792 if (!hasOwnProperty(visibleKeys, key)) {
43793 name = '[' + key + ']';
43794 }
43795 if (!str) {
43796 if (ctx.seen.indexOf(desc.value) < 0) {
43797 if (isNull(recurseTimes)) {
43798 str = formatValue(ctx, desc.value, null);
43799 } else {
43800 str = formatValue(ctx, desc.value, recurseTimes - 1);
43801 }
43802 if (str.indexOf('\n') > -1) {
43803 if (array) {
43804 str = str.split('\n').map(function(line) {
43805 return ' ' + line;
43806 }).join('\n').substr(2);
43807 } else {
43808 str = '\n' + str.split('\n').map(function(line) {
43809 return ' ' + line;
43810 }).join('\n');
43811 }
43812 }
43813 } else {
43814 str = ctx.stylize('[Circular]', 'special');
43815 }
43816 }
43817 if (isUndefined(name)) {
43818 if (array && key.match(/^\d+$/)) {
43819 return str;
43820 }
43821 name = JSON.stringify('' + key);
43822 if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
43823 name = name.substr(1, name.length - 2);
43824 name = ctx.stylize(name, 'name');
43825 } else {
43826 name = name.replace(/'/g, "\\'")
43827 .replace(/\\"/g, '"')
43828 .replace(/(^"|"$)/g, "'");
43829 name = ctx.stylize(name, 'string');
43830 }
43831 }
43832
43833 return name + ': ' + str;
43834}
43835
43836
43837function reduceToSingleString(output, base, braces) {
43838 var numLinesEst = 0;
43839 var length = output.reduce(function(prev, cur) {
43840 numLinesEst++;
43841 if (cur.indexOf('\n') >= 0) numLinesEst++;
43842 return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
43843 }, 0);
43844
43845 if (length > 60) {
43846 return braces[0] +
43847 (base === '' ? '' : base + '\n ') +
43848 ' ' +
43849 output.join(',\n ') +
43850 ' ' +
43851 braces[1];
43852 }
43853
43854 return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
43855}
43856
43857
43858// NOTE: These type checking functions intentionally don't use `instanceof`
43859// because it is fragile and can be easily faked with `Object.create()`.
43860function isArray(ar) {
43861 return Array.isArray(ar);
43862}
43863exports.isArray = isArray;
43864
43865function isBoolean(arg) {
43866 return typeof arg === 'boolean';
43867}
43868exports.isBoolean = isBoolean;
43869
43870function isNull(arg) {
43871 return arg === null;
43872}
43873exports.isNull = isNull;
43874
43875function isNullOrUndefined(arg) {
43876 return arg == null;
43877}
43878exports.isNullOrUndefined = isNullOrUndefined;
43879
43880function isNumber(arg) {
43881 return typeof arg === 'number';
43882}
43883exports.isNumber = isNumber;
43884
43885function isString(arg) {
43886 return typeof arg === 'string';
43887}
43888exports.isString = isString;
43889
43890function isSymbol(arg) {
43891 return typeof arg === 'symbol';
43892}
43893exports.isSymbol = isSymbol;
43894
43895function isUndefined(arg) {
43896 return arg === void 0;
43897}
43898exports.isUndefined = isUndefined;
43899
43900function isRegExp(re) {
43901 return isObject(re) && objectToString(re) === '[object RegExp]';
43902}
43903exports.isRegExp = isRegExp;
43904
43905function isObject(arg) {
43906 return typeof arg === 'object' && arg !== null;
43907}
43908exports.isObject = isObject;
43909
43910function isDate(d) {
43911 return isObject(d) && objectToString(d) === '[object Date]';
43912}
43913exports.isDate = isDate;
43914
43915function isError(e) {
43916 return isObject(e) &&
43917 (objectToString(e) === '[object Error]' || e instanceof Error);
43918}
43919exports.isError = isError;
43920
43921function isFunction(arg) {
43922 return typeof arg === 'function';
43923}
43924exports.isFunction = isFunction;
43925
43926function isPrimitive(arg) {
43927 return arg === null ||
43928 typeof arg === 'boolean' ||
43929 typeof arg === 'number' ||
43930 typeof arg === 'string' ||
43931 typeof arg === 'symbol' || // ES6 symbol
43932 typeof arg === 'undefined';
43933}
43934exports.isPrimitive = isPrimitive;
43935
43936exports.isBuffer = require('./support/isBuffer');
43937
43938function objectToString(o) {
43939 return Object.prototype.toString.call(o);
43940}
43941
43942
43943function pad(n) {
43944 return n < 10 ? '0' + n.toString(10) : n.toString(10);
43945}
43946
43947
43948var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
43949 'Oct', 'Nov', 'Dec'];
43950
43951// 26 Feb 16:19:34
43952function timestamp() {
43953 var d = new Date();
43954 var time = [pad(d.getHours()),
43955 pad(d.getMinutes()),
43956 pad(d.getSeconds())].join(':');
43957 return [d.getDate(), months[d.getMonth()], time].join(' ');
43958}
43959
43960
43961// log is just a thin wrapper to console.log that prepends a timestamp
43962exports.log = function() {
43963 console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
43964};
43965
43966
43967/**
43968 * Inherit the prototype methods from one constructor into another.
43969 *
43970 * The Function.prototype.inherits from lang.js rewritten as a standalone
43971 * function (not on Function.prototype). NOTE: If this file is to be loaded
43972 * during bootstrapping this function needs to be rewritten using some native
43973 * functions as prototype setup using normal JavaScript does not work as
43974 * expected during bootstrapping (see mirror.js in r114903).
43975 *
43976 * @param {function} ctor Constructor function which needs to inherit the
43977 * prototype.
43978 * @param {function} superCtor Constructor function to inherit prototype from.
43979 */
43980exports.inherits = require('inherits');
43981
43982exports._extend = function(origin, add) {
43983 // Don't do anything if add isn't an object
43984 if (!add || !isObject(add)) return origin;
43985
43986 var keys = Object.keys(add);
43987 var i = keys.length;
43988 while (i--) {
43989 origin[keys[i]] = add[keys[i]];
43990 }
43991 return origin;
43992};
43993
43994function hasOwnProperty(obj, prop) {
43995 return Object.prototype.hasOwnProperty.call(obj, prop);
43996}
43997
43998}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
43999},{"./support/isBuffer":491,"_process":471,"inherits":490}],493:[function(require,module,exports){
44000/*import { transform as babelTransform } from 'babel-core';
44001import babelTransformDynamicImport from 'babel-plugin-syntax-dynamic-import';
44002import babelTransformES2015ModulesSystemJS from 'babel-plugin-transform-es2015-modules-systemjs';*/
44003
44004// sadly, due to how rollup works, we can't use es6 imports here
44005var babelTransform = require('babel-core').transform;
44006var babelTransformDynamicImport = require('babel-plugin-syntax-dynamic-import');
44007var babelTransformES2015ModulesSystemJS = require('babel-plugin-transform-es2015-modules-systemjs');
44008
44009self.onmessage = function (evt) {
44010 // transform source with Babel
44011 var output = babelTransform(evt.data.source, {
44012 compact: false,
44013 filename: evt.data.key + '!transpiled',
44014 sourceFileName: evt.data.key,
44015 moduleIds: false,
44016 sourceMaps: 'inline',
44017 babelrc: false,
44018 plugins: [babelTransformDynamicImport, babelTransformES2015ModulesSystemJS],
44019 });
44020
44021 self.postMessage({key: evt.data.key, code: output.code, source: evt.data.source});
44022};
44023
44024},{"babel-core":4,"babel-plugin-syntax-dynamic-import":54,"babel-plugin-transform-es2015-modules-systemjs":55}]},{},[493]);