1 | module.exports =
|
2 | (function(modules, runtime) {
|
3 | "use strict";
|
4 |
|
5 | var installedModules = {};
|
6 |
|
7 |
|
8 | function __webpack_require__(moduleId) {
|
9 |
|
10 |
|
11 | if(installedModules[moduleId]) {
|
12 | return installedModules[moduleId].exports;
|
13 | }
|
14 |
|
15 | var module = installedModules[moduleId] = {
|
16 | i: moduleId,
|
17 | l: false,
|
18 | exports: {}
|
19 | };
|
20 |
|
21 |
|
22 | modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
23 |
|
24 |
|
25 | module.l = true;
|
26 |
|
27 |
|
28 | return module.exports;
|
29 | }
|
30 |
|
31 |
|
32 | __webpack_require__.ab = __dirname + "/";
|
33 |
|
34 |
|
35 | function startup() {
|
36 |
|
37 | return __webpack_require__(219);
|
38 | };
|
39 |
|
40 | runtime(__webpack_require__);
|
41 |
|
42 |
|
43 | return startup();
|
44 | })
|
45 |
|
46 | ({
|
47 |
|
48 | 46:
|
49 | (function(__unusedmodule, exports, __webpack_require__) {
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | var util = __webpack_require__(567);
|
59 | var has = Object.prototype.hasOwnProperty;
|
60 | var hasNativeMap = typeof Map !== "undefined";
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 | function ArraySet() {
|
69 | this._array = [];
|
70 | this._set = hasNativeMap ? new Map() : Object.create(null);
|
71 | }
|
72 |
|
73 |
|
74 |
|
75 |
|
76 | ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
|
77 | var set = new ArraySet();
|
78 | for (var i = 0, len = aArray.length; i < len; i++) {
|
79 | set.add(aArray[i], aAllowDuplicates);
|
80 | }
|
81 | return set;
|
82 | };
|
83 |
|
84 | /**
|
85 | * Return how many unique items are in this ArraySet. If duplicates have been
|
86 | * added, than those do not count towards the size.
|
87 | *
|
88 | * @returns Number
|
89 | */
|
90 | ArraySet.prototype.size = function ArraySet_size() {
|
91 | return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
|
92 | };
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 | ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
|
100 | var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
|
101 | var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
|
102 | var idx = this._array.length;
|
103 | if (!isDuplicate || aAllowDuplicates) {
|
104 | this._array.push(aStr);
|
105 | }
|
106 | if (!isDuplicate) {
|
107 | if (hasNativeMap) {
|
108 | this._set.set(aStr, idx);
|
109 | } else {
|
110 | this._set[sStr] = idx;
|
111 | }
|
112 | }
|
113 | };
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 | ArraySet.prototype.has = function ArraySet_has(aStr) {
|
121 | if (hasNativeMap) {
|
122 | return this._set.has(aStr);
|
123 | } else {
|
124 | var sStr = util.toSetString(aStr);
|
125 | return has.call(this._set, sStr);
|
126 | }
|
127 | };
|
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 | ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
|
135 | if (hasNativeMap) {
|
136 | var idx = this._set.get(aStr);
|
137 | if (idx >= 0) {
|
138 | return idx;
|
139 | }
|
140 | } else {
|
141 | var sStr = util.toSetString(aStr);
|
142 | if (has.call(this._set, sStr)) {
|
143 | return this._set[sStr];
|
144 | }
|
145 | }
|
146 |
|
147 | throw new Error('"' + aStr + '" is not in the set.');
|
148 | };
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 | ArraySet.prototype.at = function ArraySet_at(aIdx) {
|
156 | if (aIdx >= 0 && aIdx < this._array.length) {
|
157 | return this._array[aIdx];
|
158 | }
|
159 | throw new Error('No element indexed by ' + aIdx);
|
160 | };
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 | ArraySet.prototype.toArray = function ArraySet_toArray() {
|
168 | return this._array.slice();
|
169 | };
|
170 |
|
171 | exports.ArraySet = ArraySet;
|
172 |
|
173 |
|
174 | }),
|
175 |
|
176 | 116:
|
177 | (function(__unusedmodule, exports, __webpack_require__) {
|
178 |
|
179 |
|
180 |
|
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 | var base64VLQ = __webpack_require__(668);
|
187 | var util = __webpack_require__(567);
|
188 | var ArraySet = __webpack_require__(46).ArraySet;
|
189 | var MappingList = __webpack_require__(245).MappingList;
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 | function SourceMapGenerator(aArgs) {
|
200 | if (!aArgs) {
|
201 | aArgs = {};
|
202 | }
|
203 | this._file = util.getArg(aArgs, 'file', null);
|
204 | this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
|
205 | this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
|
206 | this._sources = new ArraySet();
|
207 | this._names = new ArraySet();
|
208 | this._mappings = new MappingList();
|
209 | this._sourcesContents = null;
|
210 | }
|
211 |
|
212 | SourceMapGenerator.prototype._version = 3;
|
213 |
|
214 |
|
215 |
|
216 |
|
217 |
|
218 |
|
219 | SourceMapGenerator.fromSourceMap =
|
220 | function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
|
221 | var sourceRoot = aSourceMapConsumer.sourceRoot;
|
222 | var generator = new SourceMapGenerator({
|
223 | file: aSourceMapConsumer.file,
|
224 | sourceRoot: sourceRoot
|
225 | });
|
226 | aSourceMapConsumer.eachMapping(function (mapping) {
|
227 | var newMapping = {
|
228 | generated: {
|
229 | line: mapping.generatedLine,
|
230 | column: mapping.generatedColumn
|
231 | }
|
232 | };
|
233 |
|
234 | if (mapping.source != null) {
|
235 | newMapping.source = mapping.source;
|
236 | if (sourceRoot != null) {
|
237 | newMapping.source = util.relative(sourceRoot, newMapping.source);
|
238 | }
|
239 |
|
240 | newMapping.original = {
|
241 | line: mapping.originalLine,
|
242 | column: mapping.originalColumn
|
243 | };
|
244 |
|
245 | if (mapping.name != null) {
|
246 | newMapping.name = mapping.name;
|
247 | }
|
248 | }
|
249 |
|
250 | generator.addMapping(newMapping);
|
251 | });
|
252 | aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
253 | var sourceRelative = sourceFile;
|
254 | if (sourceRoot !== null) {
|
255 | sourceRelative = util.relative(sourceRoot, sourceFile);
|
256 | }
|
257 |
|
258 | if (!generator._sources.has(sourceRelative)) {
|
259 | generator._sources.add(sourceRelative);
|
260 | }
|
261 |
|
262 | var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
263 | if (content != null) {
|
264 | generator.setSourceContent(sourceFile, content);
|
265 | }
|
266 | });
|
267 | return generator;
|
268 | };
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 | SourceMapGenerator.prototype.addMapping =
|
281 | function SourceMapGenerator_addMapping(aArgs) {
|
282 | var generated = util.getArg(aArgs, 'generated');
|
283 | var original = util.getArg(aArgs, 'original', null);
|
284 | var source = util.getArg(aArgs, 'source', null);
|
285 | var name = util.getArg(aArgs, 'name', null);
|
286 |
|
287 | if (!this._skipValidation) {
|
288 | this._validateMapping(generated, original, source, name);
|
289 | }
|
290 |
|
291 | if (source != null) {
|
292 | source = String(source);
|
293 | if (!this._sources.has(source)) {
|
294 | this._sources.add(source);
|
295 | }
|
296 | }
|
297 |
|
298 | if (name != null) {
|
299 | name = String(name);
|
300 | if (!this._names.has(name)) {
|
301 | this._names.add(name);
|
302 | }
|
303 | }
|
304 |
|
305 | this._mappings.add({
|
306 | generatedLine: generated.line,
|
307 | generatedColumn: generated.column,
|
308 | originalLine: original != null && original.line,
|
309 | originalColumn: original != null && original.column,
|
310 | source: source,
|
311 | name: name
|
312 | });
|
313 | };
|
314 |
|
315 |
|
316 |
|
317 |
|
318 | SourceMapGenerator.prototype.setSourceContent =
|
319 | function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
320 | var source = aSourceFile;
|
321 | if (this._sourceRoot != null) {
|
322 | source = util.relative(this._sourceRoot, source);
|
323 | }
|
324 |
|
325 | if (aSourceContent != null) {
|
326 |
|
327 |
|
328 | if (!this._sourcesContents) {
|
329 | this._sourcesContents = Object.create(null);
|
330 | }
|
331 | this._sourcesContents[util.toSetString(source)] = aSourceContent;
|
332 | } else if (this._sourcesContents) {
|
333 |
|
334 |
|
335 | delete this._sourcesContents[util.toSetString(source)];
|
336 | if (Object.keys(this._sourcesContents).length === 0) {
|
337 | this._sourcesContents = null;
|
338 | }
|
339 | }
|
340 | };
|
341 |
|
342 |
|
343 |
|
344 |
|
345 |
|
346 |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 | SourceMapGenerator.prototype.applySourceMap =
|
359 | function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
|
360 | var sourceFile = aSourceFile;
|
361 |
|
362 | if (aSourceFile == null) {
|
363 | if (aSourceMapConsumer.file == null) {
|
364 | throw new Error(
|
365 | 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
|
366 | 'or the source map\'s "file" property. Both were omitted.'
|
367 | );
|
368 | }
|
369 | sourceFile = aSourceMapConsumer.file;
|
370 | }
|
371 | var sourceRoot = this._sourceRoot;
|
372 |
|
373 | if (sourceRoot != null) {
|
374 | sourceFile = util.relative(sourceRoot, sourceFile);
|
375 | }
|
376 |
|
377 |
|
378 | var newSources = new ArraySet();
|
379 | var newNames = new ArraySet();
|
380 |
|
381 |
|
382 | this._mappings.unsortedForEach(function (mapping) {
|
383 | if (mapping.source === sourceFile && mapping.originalLine != null) {
|
384 |
|
385 | var original = aSourceMapConsumer.originalPositionFor({
|
386 | line: mapping.originalLine,
|
387 | column: mapping.originalColumn
|
388 | });
|
389 | if (original.source != null) {
|
390 |
|
391 | mapping.source = original.source;
|
392 | if (aSourceMapPath != null) {
|
393 | mapping.source = util.join(aSourceMapPath, mapping.source)
|
394 | }
|
395 | if (sourceRoot != null) {
|
396 | mapping.source = util.relative(sourceRoot, mapping.source);
|
397 | }
|
398 | mapping.originalLine = original.line;
|
399 | mapping.originalColumn = original.column;
|
400 | if (original.name != null) {
|
401 | mapping.name = original.name;
|
402 | }
|
403 | }
|
404 | }
|
405 |
|
406 | var source = mapping.source;
|
407 | if (source != null && !newSources.has(source)) {
|
408 | newSources.add(source);
|
409 | }
|
410 |
|
411 | var name = mapping.name;
|
412 | if (name != null && !newNames.has(name)) {
|
413 | newNames.add(name);
|
414 | }
|
415 |
|
416 | }, this);
|
417 | this._sources = newSources;
|
418 | this._names = newNames;
|
419 |
|
420 |
|
421 | aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
422 | var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
423 | if (content != null) {
|
424 | if (aSourceMapPath != null) {
|
425 | sourceFile = util.join(aSourceMapPath, sourceFile);
|
426 | }
|
427 | if (sourceRoot != null) {
|
428 | sourceFile = util.relative(sourceRoot, sourceFile);
|
429 | }
|
430 | this.setSourceContent(sourceFile, content);
|
431 | }
|
432 | }, this);
|
433 | };
|
434 |
|
435 |
|
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 | SourceMapGenerator.prototype._validateMapping =
|
447 | function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
|
448 | aName) {
|
449 |
|
450 |
|
451 |
|
452 |
|
453 | if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
|
454 | throw new Error(
|
455 | 'original.line and original.column are not numbers -- you probably meant to omit ' +
|
456 | 'the original mapping entirely and only map the generated position. If so, pass ' +
|
457 | 'null for the original mapping instead of an object with empty or null values.'
|
458 | );
|
459 | }
|
460 |
|
461 | if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
|
462 | && aGenerated.line > 0 && aGenerated.column >= 0
|
463 | && !aOriginal && !aSource && !aName) {
|
464 |
|
465 | return;
|
466 | }
|
467 | else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
|
468 | && aOriginal && 'line' in aOriginal && 'column' in aOriginal
|
469 | && aGenerated.line > 0 && aGenerated.column >= 0
|
470 | && aOriginal.line > 0 && aOriginal.column >= 0
|
471 | && aSource) {
|
472 |
|
473 | return;
|
474 | }
|
475 | else {
|
476 | throw new Error('Invalid mapping: ' + JSON.stringify({
|
477 | generated: aGenerated,
|
478 | source: aSource,
|
479 | original: aOriginal,
|
480 | name: aName
|
481 | }));
|
482 | }
|
483 | };
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 | SourceMapGenerator.prototype._serializeMappings =
|
490 | function SourceMapGenerator_serializeMappings() {
|
491 | var previousGeneratedColumn = 0;
|
492 | var previousGeneratedLine = 1;
|
493 | var previousOriginalColumn = 0;
|
494 | var previousOriginalLine = 0;
|
495 | var previousName = 0;
|
496 | var previousSource = 0;
|
497 | var result = '';
|
498 | var next;
|
499 | var mapping;
|
500 | var nameIdx;
|
501 | var sourceIdx;
|
502 |
|
503 | var mappings = this._mappings.toArray();
|
504 | for (var i = 0, len = mappings.length; i < len; i++) {
|
505 | mapping = mappings[i];
|
506 | next = ''
|
507 |
|
508 | if (mapping.generatedLine !== previousGeneratedLine) {
|
509 | previousGeneratedColumn = 0;
|
510 | while (mapping.generatedLine !== previousGeneratedLine) {
|
511 | next += ';';
|
512 | previousGeneratedLine++;
|
513 | }
|
514 | }
|
515 | else {
|
516 | if (i > 0) {
|
517 | if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
|
518 | continue;
|
519 | }
|
520 | next += ',';
|
521 | }
|
522 | }
|
523 |
|
524 | next += base64VLQ.encode(mapping.generatedColumn
|
525 | - previousGeneratedColumn);
|
526 | previousGeneratedColumn = mapping.generatedColumn;
|
527 |
|
528 | if (mapping.source != null) {
|
529 | sourceIdx = this._sources.indexOf(mapping.source);
|
530 | next += base64VLQ.encode(sourceIdx - previousSource);
|
531 | previousSource = sourceIdx;
|
532 |
|
533 |
|
534 | next += base64VLQ.encode(mapping.originalLine - 1
|
535 | - previousOriginalLine);
|
536 | previousOriginalLine = mapping.originalLine - 1;
|
537 |
|
538 | next += base64VLQ.encode(mapping.originalColumn
|
539 | - previousOriginalColumn);
|
540 | previousOriginalColumn = mapping.originalColumn;
|
541 |
|
542 | if (mapping.name != null) {
|
543 | nameIdx = this._names.indexOf(mapping.name);
|
544 | next += base64VLQ.encode(nameIdx - previousName);
|
545 | previousName = nameIdx;
|
546 | }
|
547 | }
|
548 |
|
549 | result += next;
|
550 | }
|
551 |
|
552 | return result;
|
553 | };
|
554 |
|
555 | SourceMapGenerator.prototype._generateSourcesContent =
|
556 | function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
|
557 | return aSources.map(function (source) {
|
558 | if (!this._sourcesContents) {
|
559 | return null;
|
560 | }
|
561 | if (aSourceRoot != null) {
|
562 | source = util.relative(aSourceRoot, source);
|
563 | }
|
564 | var key = util.toSetString(source);
|
565 | return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
|
566 | ? this._sourcesContents[key]
|
567 | : null;
|
568 | }, this);
|
569 | };
|
570 |
|
571 |
|
572 |
|
573 |
|
574 | SourceMapGenerator.prototype.toJSON =
|
575 | function SourceMapGenerator_toJSON() {
|
576 | var map = {
|
577 | version: this._version,
|
578 | sources: this._sources.toArray(),
|
579 | names: this._names.toArray(),
|
580 | mappings: this._serializeMappings()
|
581 | };
|
582 | if (this._file != null) {
|
583 | map.file = this._file;
|
584 | }
|
585 | if (this._sourceRoot != null) {
|
586 | map.sourceRoot = this._sourceRoot;
|
587 | }
|
588 | if (this._sourcesContents) {
|
589 | map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
|
590 | }
|
591 |
|
592 | return map;
|
593 | };
|
594 |
|
595 |
|
596 |
|
597 |
|
598 | SourceMapGenerator.prototype.toString =
|
599 | function SourceMapGenerator_toString() {
|
600 | return JSON.stringify(this.toJSON());
|
601 | };
|
602 |
|
603 | exports.SourceMapGenerator = SourceMapGenerator;
|
604 |
|
605 |
|
606 | }),
|
607 |
|
608 | 168:
|
609 | (function(__unusedmodule, exports, __webpack_require__) {
|
610 |
|
611 |
|
612 |
|
613 |
|
614 |
|
615 |
|
616 | exports.SourceMapGenerator = __webpack_require__(116).SourceMapGenerator;
|
617 | exports.SourceMapConsumer = __webpack_require__(302).SourceMapConsumer;
|
618 | exports.SourceNode = __webpack_require__(872).SourceNode;
|
619 |
|
620 |
|
621 | }),
|
622 |
|
623 | 219:
|
624 | (function(__unusedmodule, __unusedexports, __webpack_require__) {
|
625 |
|
626 | __webpack_require__(545).install();
|
627 |
|
628 |
|
629 | }),
|
630 |
|
631 | 245:
|
632 | (function(__unusedmodule, exports, __webpack_require__) {
|
633 |
|
634 |
|
635 |
|
636 |
|
637 |
|
638 |
|
639 |
|
640 |
|
641 | var util = __webpack_require__(567);
|
642 |
|
643 |
|
644 |
|
645 |
|
646 |
|
647 | function generatedPositionAfter(mappingA, mappingB) {
|
648 |
|
649 | var lineA = mappingA.generatedLine;
|
650 | var lineB = mappingB.generatedLine;
|
651 | var columnA = mappingA.generatedColumn;
|
652 | var columnB = mappingB.generatedColumn;
|
653 | return lineB > lineA || lineB == lineA && columnB >= columnA ||
|
654 | util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
|
655 | }
|
656 |
|
657 |
|
658 |
|
659 |
|
660 |
|
661 |
|
662 | function MappingList() {
|
663 | this._array = [];
|
664 | this._sorted = true;
|
665 |
|
666 | this._last = {generatedLine: -1, generatedColumn: 0};
|
667 | }
|
668 |
|
669 |
|
670 |
|
671 |
|
672 |
|
673 |
|
674 |
|
675 | MappingList.prototype.unsortedForEach =
|
676 | function MappingList_forEach(aCallback, aThisArg) {
|
677 | this._array.forEach(aCallback, aThisArg);
|
678 | };
|
679 |
|
680 |
|
681 |
|
682 |
|
683 |
|
684 |
|
685 | MappingList.prototype.add = function MappingList_add(aMapping) {
|
686 | if (generatedPositionAfter(this._last, aMapping)) {
|
687 | this._last = aMapping;
|
688 | this._array.push(aMapping);
|
689 | } else {
|
690 | this._sorted = false;
|
691 | this._array.push(aMapping);
|
692 | }
|
693 | };
|
694 |
|
695 |
|
696 |
|
697 |
|
698 |
|
699 |
|
700 |
|
701 |
|
702 |
|
703 |
|
704 | MappingList.prototype.toArray = function MappingList_toArray() {
|
705 | if (!this._sorted) {
|
706 | this._array.sort(util.compareByGeneratedPositionsInflated);
|
707 | this._sorted = true;
|
708 | }
|
709 | return this._array;
|
710 | };
|
711 |
|
712 | exports.MappingList = MappingList;
|
713 |
|
714 |
|
715 | }),
|
716 |
|
717 | 285:
|
718 | (function(__unusedmodule, exports) {
|
719 |
|
720 |
|
721 |
|
722 |
|
723 |
|
724 |
|
725 |
|
726 |
|
727 | exports.GREATEST_LOWER_BOUND = 1;
|
728 | exports.LEAST_UPPER_BOUND = 2;
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
|
736 |
|
737 |
|
738 |
|
739 |
|
740 |
|
741 |
|
742 |
|
743 | function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
744 |
|
745 |
|
746 |
|
747 |
|
748 |
|
749 |
|
750 |
|
751 |
|
752 |
|
753 | var mid = Math.floor((aHigh - aLow) / 2) + aLow;
|
754 | var cmp = aCompare(aNeedle, aHaystack[mid], true);
|
755 | if (cmp === 0) {
|
756 |
|
757 | return mid;
|
758 | }
|
759 | else if (cmp > 0) {
|
760 |
|
761 | if (aHigh - mid > 1) {
|
762 |
|
763 | return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
|
764 | }
|
765 |
|
766 |
|
767 |
|
768 | if (aBias == exports.LEAST_UPPER_BOUND) {
|
769 | return aHigh < aHaystack.length ? aHigh : -1;
|
770 | } else {
|
771 | return mid;
|
772 | }
|
773 | }
|
774 | else {
|
775 |
|
776 | if (mid - aLow > 1) {
|
777 |
|
778 | return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
|
779 | }
|
780 |
|
781 |
|
782 | if (aBias == exports.LEAST_UPPER_BOUND) {
|
783 | return mid;
|
784 | } else {
|
785 | return aLow < 0 ? -1 : aLow;
|
786 | }
|
787 | }
|
788 | }
|
789 |
|
790 |
|
791 |
|
792 |
|
793 |
|
794 |
|
795 |
|
796 |
|
797 |
|
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
|
805 |
|
806 |
|
807 |
|
808 | exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
|
809 | if (aHaystack.length === 0) {
|
810 | return -1;
|
811 | }
|
812 |
|
813 | var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
|
814 | aCompare, aBias || exports.GREATEST_LOWER_BOUND);
|
815 | if (index < 0) {
|
816 | return -1;
|
817 | }
|
818 |
|
819 |
|
820 |
|
821 |
|
822 | while (index - 1 >= 0) {
|
823 | if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
|
824 | break;
|
825 | }
|
826 | --index;
|
827 | }
|
828 |
|
829 | return index;
|
830 | };
|
831 |
|
832 |
|
833 | }),
|
834 |
|
835 | 302:
|
836 | (function(__unusedmodule, exports, __webpack_require__) {
|
837 |
|
838 |
|
839 |
|
840 |
|
841 |
|
842 |
|
843 |
|
844 |
|
845 | var util = __webpack_require__(567);
|
846 | var binarySearch = __webpack_require__(285);
|
847 | var ArraySet = __webpack_require__(46).ArraySet;
|
848 | var base64VLQ = __webpack_require__(668);
|
849 | var quickSort = __webpack_require__(882).quickSort;
|
850 |
|
851 | function SourceMapConsumer(aSourceMap, aSourceMapURL) {
|
852 | var sourceMap = aSourceMap;
|
853 | if (typeof aSourceMap === 'string') {
|
854 | sourceMap = util.parseSourceMapInput(aSourceMap);
|
855 | }
|
856 |
|
857 | return sourceMap.sections != null
|
858 | ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)
|
859 | : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
|
860 | }
|
861 |
|
862 | SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
|
863 | return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
|
864 | }
|
865 |
|
866 |
|
867 |
|
868 |
|
869 | SourceMapConsumer.prototype._version = 3;
|
870 |
|
871 |
|
872 |
|
873 |
|
874 |
|
875 |
|
876 |
|
877 |
|
878 |
|
879 |
|
880 |
|
881 |
|
882 |
|
883 |
|
884 |
|
885 |
|
886 |
|
887 |
|
888 |
|
889 |
|
890 |
|
891 |
|
892 |
|
893 |
|
894 |
|
895 |
|
896 |
|
897 |
|
898 |
|
899 |
|
900 |
|
901 | SourceMapConsumer.prototype.__generatedMappings = null;
|
902 | Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
|
903 | configurable: true,
|
904 | enumerable: true,
|
905 | get: function () {
|
906 | if (!this.__generatedMappings) {
|
907 | this._parseMappings(this._mappings, this.sourceRoot);
|
908 | }
|
909 |
|
910 | return this.__generatedMappings;
|
911 | }
|
912 | });
|
913 |
|
914 | SourceMapConsumer.prototype.__originalMappings = null;
|
915 | Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
|
916 | configurable: true,
|
917 | enumerable: true,
|
918 | get: function () {
|
919 | if (!this.__originalMappings) {
|
920 | this._parseMappings(this._mappings, this.sourceRoot);
|
921 | }
|
922 |
|
923 | return this.__originalMappings;
|
924 | }
|
925 | });
|
926 |
|
927 | SourceMapConsumer.prototype._charIsMappingSeparator =
|
928 | function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
|
929 | var c = aStr.charAt(index);
|
930 | return c === ";" || c === ",";
|
931 | };
|
932 |
|
933 |
|
934 |
|
935 |
|
936 |
|
937 |
|
938 | SourceMapConsumer.prototype._parseMappings =
|
939 | function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
|
940 | throw new Error("Subclasses must implement _parseMappings");
|
941 | };
|
942 |
|
943 | SourceMapConsumer.GENERATED_ORDER = 1;
|
944 | SourceMapConsumer.ORIGINAL_ORDER = 2;
|
945 |
|
946 | SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
|
947 | SourceMapConsumer.LEAST_UPPER_BOUND = 2;
|
948 |
|
949 |
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 |
|
956 |
|
957 |
|
958 |
|
959 |
|
960 |
|
961 |
|
962 |
|
963 |
|
964 |
|
965 | SourceMapConsumer.prototype.eachMapping =
|
966 | function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
|
967 | var context = aContext || null;
|
968 | var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
|
969 |
|
970 | var mappings;
|
971 | switch (order) {
|
972 | case SourceMapConsumer.GENERATED_ORDER:
|
973 | mappings = this._generatedMappings;
|
974 | break;
|
975 | case SourceMapConsumer.ORIGINAL_ORDER:
|
976 | mappings = this._originalMappings;
|
977 | break;
|
978 | default:
|
979 | throw new Error("Unknown order of iteration.");
|
980 | }
|
981 |
|
982 | var sourceRoot = this.sourceRoot;
|
983 | mappings.map(function (mapping) {
|
984 | var source = mapping.source === null ? null : this._sources.at(mapping.source);
|
985 | source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
|
986 | return {
|
987 | source: source,
|
988 | generatedLine: mapping.generatedLine,
|
989 | generatedColumn: mapping.generatedColumn,
|
990 | originalLine: mapping.originalLine,
|
991 | originalColumn: mapping.originalColumn,
|
992 | name: mapping.name === null ? null : this._names.at(mapping.name)
|
993 | };
|
994 | }, this).forEach(aCallback, context);
|
995 | };
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 |
|
1001 |
|
1002 |
|
1003 |
|
1004 |
|
1005 |
|
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 |
|
1017 |
|
1018 |
|
1019 | SourceMapConsumer.prototype.allGeneratedPositionsFor =
|
1020 | function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
|
1021 | var line = util.getArg(aArgs, 'line');
|
1022 |
|
1023 |
|
1024 |
|
1025 |
|
1026 |
|
1027 | var needle = {
|
1028 | source: util.getArg(aArgs, 'source'),
|
1029 | originalLine: line,
|
1030 | originalColumn: util.getArg(aArgs, 'column', 0)
|
1031 | };
|
1032 |
|
1033 | needle.source = this._findSourceIndex(needle.source);
|
1034 | if (needle.source < 0) {
|
1035 | return [];
|
1036 | }
|
1037 |
|
1038 | var mappings = [];
|
1039 |
|
1040 | var index = this._findMapping(needle,
|
1041 | this._originalMappings,
|
1042 | "originalLine",
|
1043 | "originalColumn",
|
1044 | util.compareByOriginalPositions,
|
1045 | binarySearch.LEAST_UPPER_BOUND);
|
1046 | if (index >= 0) {
|
1047 | var mapping = this._originalMappings[index];
|
1048 |
|
1049 | if (aArgs.column === undefined) {
|
1050 | var originalLine = mapping.originalLine;
|
1051 |
|
1052 |
|
1053 |
|
1054 |
|
1055 |
|
1056 | while (mapping && mapping.originalLine === originalLine) {
|
1057 | mappings.push({
|
1058 | line: util.getArg(mapping, 'generatedLine', null),
|
1059 | column: util.getArg(mapping, 'generatedColumn', null),
|
1060 | lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
|
1061 | });
|
1062 |
|
1063 | mapping = this._originalMappings[++index];
|
1064 | }
|
1065 | } else {
|
1066 | var originalColumn = mapping.originalColumn;
|
1067 |
|
1068 |
|
1069 |
|
1070 |
|
1071 |
|
1072 | while (mapping &&
|
1073 | mapping.originalLine === line &&
|
1074 | mapping.originalColumn == originalColumn) {
|
1075 | mappings.push({
|
1076 | line: util.getArg(mapping, 'generatedLine', null),
|
1077 | column: util.getArg(mapping, 'generatedColumn', null),
|
1078 | lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
|
1079 | });
|
1080 |
|
1081 | mapping = this._originalMappings[++index];
|
1082 | }
|
1083 | }
|
1084 | }
|
1085 |
|
1086 | return mappings;
|
1087 | };
|
1088 |
|
1089 | exports.SourceMapConsumer = SourceMapConsumer;
|
1090 |
|
1091 |
|
1092 |
|
1093 |
|
1094 |
|
1095 |
|
1096 |
|
1097 |
|
1098 |
|
1099 |
|
1100 |
|
1101 |
|
1102 |
|
1103 |
|
1104 |
|
1105 |
|
1106 |
|
1107 |
|
1108 |
|
1109 |
|
1110 |
|
1111 |
|
1112 |
|
1113 |
|
1114 |
|
1115 |
|
1116 |
|
1117 |
|
1118 |
|
1119 |
|
1120 |
|
1121 |
|
1122 |
|
1123 |
|
1124 |
|
1125 | function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
1126 | var sourceMap = aSourceMap;
|
1127 | if (typeof aSourceMap === 'string') {
|
1128 | sourceMap = util.parseSourceMapInput(aSourceMap);
|
1129 | }
|
1130 |
|
1131 | var version = util.getArg(sourceMap, 'version');
|
1132 | var sources = util.getArg(sourceMap, 'sources');
|
1133 |
|
1134 |
|
1135 | var names = util.getArg(sourceMap, 'names', []);
|
1136 | var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
|
1137 | var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
|
1138 | var mappings = util.getArg(sourceMap, 'mappings');
|
1139 | var file = util.getArg(sourceMap, 'file', null);
|
1140 |
|
1141 |
|
1142 |
|
1143 | if (version != this._version) {
|
1144 | throw new Error('Unsupported version: ' + version);
|
1145 | }
|
1146 |
|
1147 | if (sourceRoot) {
|
1148 | sourceRoot = util.normalize(sourceRoot);
|
1149 | }
|
1150 |
|
1151 | sources = sources
|
1152 | .map(String)
|
1153 |
|
1154 |
|
1155 |
|
1156 | .map(util.normalize)
|
1157 |
|
1158 |
|
1159 |
|
1160 |
|
1161 | .map(function (source) {
|
1162 | return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
|
1163 | ? util.relative(sourceRoot, source)
|
1164 | : source;
|
1165 | });
|
1166 |
|
1167 |
|
1168 |
|
1169 |
|
1170 |
|
1171 | this._names = ArraySet.fromArray(names.map(String), true);
|
1172 | this._sources = ArraySet.fromArray(sources, true);
|
1173 |
|
1174 | this._absoluteSources = this._sources.toArray().map(function (s) {
|
1175 | return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
|
1176 | });
|
1177 |
|
1178 | this.sourceRoot = sourceRoot;
|
1179 | this.sourcesContent = sourcesContent;
|
1180 | this._mappings = mappings;
|
1181 | this._sourceMapURL = aSourceMapURL;
|
1182 | this.file = file;
|
1183 | }
|
1184 |
|
1185 | BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
|
1186 | BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
|
1187 |
|
1188 |
|
1189 |
|
1190 |
|
1191 |
|
1192 | BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
|
1193 | var relativeSource = aSource;
|
1194 | if (this.sourceRoot != null) {
|
1195 | relativeSource = util.relative(this.sourceRoot, relativeSource);
|
1196 | }
|
1197 |
|
1198 | if (this._sources.has(relativeSource)) {
|
1199 | return this._sources.indexOf(relativeSource);
|
1200 | }
|
1201 |
|
1202 |
|
1203 |
|
1204 | var i;
|
1205 | for (i = 0; i < this._absoluteSources.length; ++i) {
|
1206 | if (this._absoluteSources[i] == aSource) {
|
1207 | return i;
|
1208 | }
|
1209 | }
|
1210 |
|
1211 | return -1;
|
1212 | };
|
1213 |
|
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 |
|
1220 |
|
1221 |
|
1222 |
|
1223 | BasicSourceMapConsumer.fromSourceMap =
|
1224 | function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
|
1225 | var smc = Object.create(BasicSourceMapConsumer.prototype);
|
1226 |
|
1227 | var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
|
1228 | var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
|
1229 | smc.sourceRoot = aSourceMap._sourceRoot;
|
1230 | smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
|
1231 | smc.sourceRoot);
|
1232 | smc.file = aSourceMap._file;
|
1233 | smc._sourceMapURL = aSourceMapURL;
|
1234 | smc._absoluteSources = smc._sources.toArray().map(function (s) {
|
1235 | return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
|
1236 | });
|
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 | var generatedMappings = aSourceMap._mappings.toArray().slice();
|
1244 | var destGeneratedMappings = smc.__generatedMappings = [];
|
1245 | var destOriginalMappings = smc.__originalMappings = [];
|
1246 |
|
1247 | for (var i = 0, length = generatedMappings.length; i < length; i++) {
|
1248 | var srcMapping = generatedMappings[i];
|
1249 | var destMapping = new Mapping;
|
1250 | destMapping.generatedLine = srcMapping.generatedLine;
|
1251 | destMapping.generatedColumn = srcMapping.generatedColumn;
|
1252 |
|
1253 | if (srcMapping.source) {
|
1254 | destMapping.source = sources.indexOf(srcMapping.source);
|
1255 | destMapping.originalLine = srcMapping.originalLine;
|
1256 | destMapping.originalColumn = srcMapping.originalColumn;
|
1257 |
|
1258 | if (srcMapping.name) {
|
1259 | destMapping.name = names.indexOf(srcMapping.name);
|
1260 | }
|
1261 |
|
1262 | destOriginalMappings.push(destMapping);
|
1263 | }
|
1264 |
|
1265 | destGeneratedMappings.push(destMapping);
|
1266 | }
|
1267 |
|
1268 | quickSort(smc.__originalMappings, util.compareByOriginalPositions);
|
1269 |
|
1270 | return smc;
|
1271 | };
|
1272 |
|
1273 |
|
1274 |
|
1275 |
|
1276 | BasicSourceMapConsumer.prototype._version = 3;
|
1277 |
|
1278 |
|
1279 |
|
1280 |
|
1281 | Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
|
1282 | get: function () {
|
1283 | return this._absoluteSources.slice();
|
1284 | }
|
1285 | });
|
1286 |
|
1287 |
|
1288 |
|
1289 |
|
1290 | function Mapping() {
|
1291 | this.generatedLine = 0;
|
1292 | this.generatedColumn = 0;
|
1293 | this.source = null;
|
1294 | this.originalLine = null;
|
1295 | this.originalColumn = null;
|
1296 | this.name = null;
|
1297 | }
|
1298 |
|
1299 |
|
1300 |
|
1301 |
|
1302 |
|
1303 |
|
1304 | BasicSourceMapConsumer.prototype._parseMappings =
|
1305 | function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
|
1306 | var generatedLine = 1;
|
1307 | var previousGeneratedColumn = 0;
|
1308 | var previousOriginalLine = 0;
|
1309 | var previousOriginalColumn = 0;
|
1310 | var previousSource = 0;
|
1311 | var previousName = 0;
|
1312 | var length = aStr.length;
|
1313 | var index = 0;
|
1314 | var cachedSegments = {};
|
1315 | var temp = {};
|
1316 | var originalMappings = [];
|
1317 | var generatedMappings = [];
|
1318 | var mapping, str, segment, end, value;
|
1319 |
|
1320 | while (index < length) {
|
1321 | if (aStr.charAt(index) === ';') {
|
1322 | generatedLine++;
|
1323 | index++;
|
1324 | previousGeneratedColumn = 0;
|
1325 | }
|
1326 | else if (aStr.charAt(index) === ',') {
|
1327 | index++;
|
1328 | }
|
1329 | else {
|
1330 | mapping = new Mapping();
|
1331 | mapping.generatedLine = generatedLine;
|
1332 |
|
1333 |
|
1334 |
|
1335 |
|
1336 |
|
1337 |
|
1338 | for (end = index; end < length; end++) {
|
1339 | if (this._charIsMappingSeparator(aStr, end)) {
|
1340 | break;
|
1341 | }
|
1342 | }
|
1343 | str = aStr.slice(index, end);
|
1344 |
|
1345 | segment = cachedSegments[str];
|
1346 | if (segment) {
|
1347 | index += str.length;
|
1348 | } else {
|
1349 | segment = [];
|
1350 | while (index < end) {
|
1351 | base64VLQ.decode(aStr, index, temp);
|
1352 | value = temp.value;
|
1353 | index = temp.rest;
|
1354 | segment.push(value);
|
1355 | }
|
1356 |
|
1357 | if (segment.length === 2) {
|
1358 | throw new Error('Found a source, but no line and column');
|
1359 | }
|
1360 |
|
1361 | if (segment.length === 3) {
|
1362 | throw new Error('Found a source and line, but no column');
|
1363 | }
|
1364 |
|
1365 | cachedSegments[str] = segment;
|
1366 | }
|
1367 |
|
1368 |
|
1369 | mapping.generatedColumn = previousGeneratedColumn + segment[0];
|
1370 | previousGeneratedColumn = mapping.generatedColumn;
|
1371 |
|
1372 | if (segment.length > 1) {
|
1373 |
|
1374 | mapping.source = previousSource + segment[1];
|
1375 | previousSource += segment[1];
|
1376 |
|
1377 |
|
1378 | mapping.originalLine = previousOriginalLine + segment[2];
|
1379 | previousOriginalLine = mapping.originalLine;
|
1380 |
|
1381 | mapping.originalLine += 1;
|
1382 |
|
1383 |
|
1384 | mapping.originalColumn = previousOriginalColumn + segment[3];
|
1385 | previousOriginalColumn = mapping.originalColumn;
|
1386 |
|
1387 | if (segment.length > 4) {
|
1388 |
|
1389 | mapping.name = previousName + segment[4];
|
1390 | previousName += segment[4];
|
1391 | }
|
1392 | }
|
1393 |
|
1394 | generatedMappings.push(mapping);
|
1395 | if (typeof mapping.originalLine === 'number') {
|
1396 | originalMappings.push(mapping);
|
1397 | }
|
1398 | }
|
1399 | }
|
1400 |
|
1401 | quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
|
1402 | this.__generatedMappings = generatedMappings;
|
1403 |
|
1404 | quickSort(originalMappings, util.compareByOriginalPositions);
|
1405 | this.__originalMappings = originalMappings;
|
1406 | };
|
1407 |
|
1408 |
|
1409 |
|
1410 |
|
1411 |
|
1412 | BasicSourceMapConsumer.prototype._findMapping =
|
1413 | function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
|
1414 | aColumnName, aComparator, aBias) {
|
1415 |
|
1416 |
|
1417 |
|
1418 |
|
1419 |
|
1420 | if (aNeedle[aLineName] <= 0) {
|
1421 | throw new TypeError('Line must be greater than or equal to 1, got '
|
1422 | + aNeedle[aLineName]);
|
1423 | }
|
1424 | if (aNeedle[aColumnName] < 0) {
|
1425 | throw new TypeError('Column must be greater than or equal to 0, got '
|
1426 | + aNeedle[aColumnName]);
|
1427 | }
|
1428 |
|
1429 | return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
|
1430 | };
|
1431 |
|
1432 |
|
1433 |
|
1434 |
|
1435 |
|
1436 | BasicSourceMapConsumer.prototype.computeColumnSpans =
|
1437 | function SourceMapConsumer_computeColumnSpans() {
|
1438 | for (var index = 0; index < this._generatedMappings.length; ++index) {
|
1439 | var mapping = this._generatedMappings[index];
|
1440 |
|
1441 |
|
1442 |
|
1443 |
|
1444 |
|
1445 | if (index + 1 < this._generatedMappings.length) {
|
1446 | var nextMapping = this._generatedMappings[index + 1];
|
1447 |
|
1448 | if (mapping.generatedLine === nextMapping.generatedLine) {
|
1449 | mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
|
1450 | continue;
|
1451 | }
|
1452 | }
|
1453 |
|
1454 |
|
1455 | mapping.lastGeneratedColumn = Infinity;
|
1456 | }
|
1457 | };
|
1458 |
|
1459 |
|
1460 |
|
1461 |
|
1462 |
|
1463 |
|
1464 |
|
1465 |
|
1466 |
|
1467 |
|
1468 |
|
1469 |
|
1470 |
|
1471 |
|
1472 |
|
1473 |
|
1474 |
|
1475 |
|
1476 |
|
1477 |
|
1478 |
|
1479 |
|
1480 |
|
1481 |
|
1482 |
|
1483 | BasicSourceMapConsumer.prototype.originalPositionFor =
|
1484 | function SourceMapConsumer_originalPositionFor(aArgs) {
|
1485 | var needle = {
|
1486 | generatedLine: util.getArg(aArgs, 'line'),
|
1487 | generatedColumn: util.getArg(aArgs, 'column')
|
1488 | };
|
1489 |
|
1490 | var index = this._findMapping(
|
1491 | needle,
|
1492 | this._generatedMappings,
|
1493 | "generatedLine",
|
1494 | "generatedColumn",
|
1495 | util.compareByGeneratedPositionsDeflated,
|
1496 | util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
|
1497 | );
|
1498 |
|
1499 | if (index >= 0) {
|
1500 | var mapping = this._generatedMappings[index];
|
1501 |
|
1502 | if (mapping.generatedLine === needle.generatedLine) {
|
1503 | var source = util.getArg(mapping, 'source', null);
|
1504 | if (source !== null) {
|
1505 | source = this._sources.at(source);
|
1506 | source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
|
1507 | }
|
1508 | var name = util.getArg(mapping, 'name', null);
|
1509 | if (name !== null) {
|
1510 | name = this._names.at(name);
|
1511 | }
|
1512 | return {
|
1513 | source: source,
|
1514 | line: util.getArg(mapping, 'originalLine', null),
|
1515 | column: util.getArg(mapping, 'originalColumn', null),
|
1516 | name: name
|
1517 | };
|
1518 | }
|
1519 | }
|
1520 |
|
1521 | return {
|
1522 | source: null,
|
1523 | line: null,
|
1524 | column: null,
|
1525 | name: null
|
1526 | };
|
1527 | };
|
1528 |
|
1529 |
|
1530 |
|
1531 |
|
1532 |
|
1533 | BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
|
1534 | function BasicSourceMapConsumer_hasContentsOfAllSources() {
|
1535 | if (!this.sourcesContent) {
|
1536 | return false;
|
1537 | }
|
1538 | return this.sourcesContent.length >= this._sources.size() &&
|
1539 | !this.sourcesContent.some(function (sc) { return sc == null; });
|
1540 | };
|
1541 |
|
1542 |
|
1543 |
|
1544 |
|
1545 |
|
1546 |
|
1547 | BasicSourceMapConsumer.prototype.sourceContentFor =
|
1548 | function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
|
1549 | if (!this.sourcesContent) {
|
1550 | return null;
|
1551 | }
|
1552 |
|
1553 | var index = this._findSourceIndex(aSource);
|
1554 | if (index >= 0) {
|
1555 | return this.sourcesContent[index];
|
1556 | }
|
1557 |
|
1558 | var relativeSource = aSource;
|
1559 | if (this.sourceRoot != null) {
|
1560 | relativeSource = util.relative(this.sourceRoot, relativeSource);
|
1561 | }
|
1562 |
|
1563 | var url;
|
1564 | if (this.sourceRoot != null
|
1565 | && (url = util.urlParse(this.sourceRoot))) {
|
1566 |
|
1567 |
|
1568 |
|
1569 |
|
1570 | var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
|
1571 | if (url.scheme == "file"
|
1572 | && this._sources.has(fileUriAbsPath)) {
|
1573 | return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
|
1574 | }
|
1575 |
|
1576 | if ((!url.path || url.path == "/")
|
1577 | && this._sources.has("/" + relativeSource)) {
|
1578 | return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
|
1579 | }
|
1580 | }
|
1581 |
|
1582 |
|
1583 |
|
1584 |
|
1585 |
|
1586 | if (nullOnMissing) {
|
1587 | return null;
|
1588 | }
|
1589 | else {
|
1590 | throw new Error('"' + relativeSource + '" is not in the SourceMap.');
|
1591 | }
|
1592 | };
|
1593 |
|
1594 |
|
1595 |
|
1596 |
|
1597 |
|
1598 |
|
1599 |
|
1600 |
|
1601 |
|
1602 |
|
1603 |
|
1604 |
|
1605 |
|
1606 |
|
1607 |
|
1608 |
|
1609 |
|
1610 |
|
1611 |
|
1612 |
|
1613 |
|
1614 |
|
1615 |
|
1616 |
|
1617 | BasicSourceMapConsumer.prototype.generatedPositionFor =
|
1618 | function SourceMapConsumer_generatedPositionFor(aArgs) {
|
1619 | var source = util.getArg(aArgs, 'source');
|
1620 | source = this._findSourceIndex(source);
|
1621 | if (source < 0) {
|
1622 | return {
|
1623 | line: null,
|
1624 | column: null,
|
1625 | lastColumn: null
|
1626 | };
|
1627 | }
|
1628 |
|
1629 | var needle = {
|
1630 | source: source,
|
1631 | originalLine: util.getArg(aArgs, 'line'),
|
1632 | originalColumn: util.getArg(aArgs, 'column')
|
1633 | };
|
1634 |
|
1635 | var index = this._findMapping(
|
1636 | needle,
|
1637 | this._originalMappings,
|
1638 | "originalLine",
|
1639 | "originalColumn",
|
1640 | util.compareByOriginalPositions,
|
1641 | util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
|
1642 | );
|
1643 |
|
1644 | if (index >= 0) {
|
1645 | var mapping = this._originalMappings[index];
|
1646 |
|
1647 | if (mapping.source === needle.source) {
|
1648 | return {
|
1649 | line: util.getArg(mapping, 'generatedLine', null),
|
1650 | column: util.getArg(mapping, 'generatedColumn', null),
|
1651 | lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
|
1652 | };
|
1653 | }
|
1654 | }
|
1655 |
|
1656 | return {
|
1657 | line: null,
|
1658 | column: null,
|
1659 | lastColumn: null
|
1660 | };
|
1661 | };
|
1662 |
|
1663 | exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
|
1664 |
|
1665 |
|
1666 |
|
1667 |
|
1668 |
|
1669 |
|
1670 |
|
1671 |
|
1672 |
|
1673 |
|
1674 |
|
1675 |
|
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 |
|
1684 |
|
1685 |
|
1686 |
|
1687 |
|
1688 |
|
1689 |
|
1690 |
|
1691 |
|
1692 |
|
1693 |
|
1694 |
|
1695 |
|
1696 |
|
1697 |
|
1698 |
|
1699 |
|
1700 |
|
1701 |
|
1702 |
|
1703 |
|
1704 |
|
1705 |
|
1706 |
|
1707 |
|
1708 |
|
1709 |
|
1710 |
|
1711 |
|
1712 |
|
1713 |
|
1714 | function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
1715 | var sourceMap = aSourceMap;
|
1716 | if (typeof aSourceMap === 'string') {
|
1717 | sourceMap = util.parseSourceMapInput(aSourceMap);
|
1718 | }
|
1719 |
|
1720 | var version = util.getArg(sourceMap, 'version');
|
1721 | var sections = util.getArg(sourceMap, 'sections');
|
1722 |
|
1723 | if (version != this._version) {
|
1724 | throw new Error('Unsupported version: ' + version);
|
1725 | }
|
1726 |
|
1727 | this._sources = new ArraySet();
|
1728 | this._names = new ArraySet();
|
1729 |
|
1730 | var lastOffset = {
|
1731 | line: -1,
|
1732 | column: 0
|
1733 | };
|
1734 | this._sections = sections.map(function (s) {
|
1735 | if (s.url) {
|
1736 |
|
1737 |
|
1738 | throw new Error('Support for url field in sections not implemented.');
|
1739 | }
|
1740 | var offset = util.getArg(s, 'offset');
|
1741 | var offsetLine = util.getArg(offset, 'line');
|
1742 | var offsetColumn = util.getArg(offset, 'column');
|
1743 |
|
1744 | if (offsetLine < lastOffset.line ||
|
1745 | (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
|
1746 | throw new Error('Section offsets must be ordered and non-overlapping.');
|
1747 | }
|
1748 | lastOffset = offset;
|
1749 |
|
1750 | return {
|
1751 | generatedOffset: {
|
1752 |
|
1753 |
|
1754 | generatedLine: offsetLine + 1,
|
1755 | generatedColumn: offsetColumn + 1
|
1756 | },
|
1757 | consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)
|
1758 | }
|
1759 | });
|
1760 | }
|
1761 |
|
1762 | IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
|
1763 | IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
|
1764 |
|
1765 |
|
1766 |
|
1767 |
|
1768 | IndexedSourceMapConsumer.prototype._version = 3;
|
1769 |
|
1770 |
|
1771 |
|
1772 |
|
1773 | Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
|
1774 | get: function () {
|
1775 | var sources = [];
|
1776 | for (var i = 0; i < this._sections.length; i++) {
|
1777 | for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
|
1778 | sources.push(this._sections[i].consumer.sources[j]);
|
1779 | }
|
1780 | }
|
1781 | return sources;
|
1782 | }
|
1783 | });
|
1784 |
|
1785 |
|
1786 |
|
1787 |
|
1788 |
|
1789 |
|
1790 |
|
1791 |
|
1792 |
|
1793 |
|
1794 |
|
1795 |
|
1796 |
|
1797 |
|
1798 |
|
1799 |
|
1800 |
|
1801 |
|
1802 |
|
1803 |
|
1804 | IndexedSourceMapConsumer.prototype.originalPositionFor =
|
1805 | function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
|
1806 | var needle = {
|
1807 | generatedLine: util.getArg(aArgs, 'line'),
|
1808 | generatedColumn: util.getArg(aArgs, 'column')
|
1809 | };
|
1810 |
|
1811 |
|
1812 |
|
1813 | var sectionIndex = binarySearch.search(needle, this._sections,
|
1814 | function(needle, section) {
|
1815 | var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
|
1816 | if (cmp) {
|
1817 | return cmp;
|
1818 | }
|
1819 |
|
1820 | return (needle.generatedColumn -
|
1821 | section.generatedOffset.generatedColumn);
|
1822 | });
|
1823 | var section = this._sections[sectionIndex];
|
1824 |
|
1825 | if (!section) {
|
1826 | return {
|
1827 | source: null,
|
1828 | line: null,
|
1829 | column: null,
|
1830 | name: null
|
1831 | };
|
1832 | }
|
1833 |
|
1834 | return section.consumer.originalPositionFor({
|
1835 | line: needle.generatedLine -
|
1836 | (section.generatedOffset.generatedLine - 1),
|
1837 | column: needle.generatedColumn -
|
1838 | (section.generatedOffset.generatedLine === needle.generatedLine
|
1839 | ? section.generatedOffset.generatedColumn - 1
|
1840 | : 0),
|
1841 | bias: aArgs.bias
|
1842 | });
|
1843 | };
|
1844 |
|
1845 |
|
1846 |
|
1847 |
|
1848 |
|
1849 | IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
|
1850 | function IndexedSourceMapConsumer_hasContentsOfAllSources() {
|
1851 | return this._sections.every(function (s) {
|
1852 | return s.consumer.hasContentsOfAllSources();
|
1853 | });
|
1854 | };
|
1855 |
|
1856 |
|
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 | IndexedSourceMapConsumer.prototype.sourceContentFor =
|
1862 | function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
|
1863 | for (var i = 0; i < this._sections.length; i++) {
|
1864 | var section = this._sections[i];
|
1865 |
|
1866 | var content = section.consumer.sourceContentFor(aSource, true);
|
1867 | if (content) {
|
1868 | return content;
|
1869 | }
|
1870 | }
|
1871 | if (nullOnMissing) {
|
1872 | return null;
|
1873 | }
|
1874 | else {
|
1875 | throw new Error('"' + aSource + '" is not in the SourceMap.');
|
1876 | }
|
1877 | };
|
1878 |
|
1879 |
|
1880 |
|
1881 |
|
1882 |
|
1883 |
|
1884 |
|
1885 |
|
1886 |
|
1887 |
|
1888 |
|
1889 |
|
1890 |
|
1891 |
|
1892 |
|
1893 |
|
1894 |
|
1895 |
|
1896 |
|
1897 | IndexedSourceMapConsumer.prototype.generatedPositionFor =
|
1898 | function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
|
1899 | for (var i = 0; i < this._sections.length; i++) {
|
1900 | var section = this._sections[i];
|
1901 |
|
1902 |
|
1903 |
|
1904 | if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {
|
1905 | continue;
|
1906 | }
|
1907 | var generatedPosition = section.consumer.generatedPositionFor(aArgs);
|
1908 | if (generatedPosition) {
|
1909 | var ret = {
|
1910 | line: generatedPosition.line +
|
1911 | (section.generatedOffset.generatedLine - 1),
|
1912 | column: generatedPosition.column +
|
1913 | (section.generatedOffset.generatedLine === generatedPosition.line
|
1914 | ? section.generatedOffset.generatedColumn - 1
|
1915 | : 0)
|
1916 | };
|
1917 | return ret;
|
1918 | }
|
1919 | }
|
1920 |
|
1921 | return {
|
1922 | line: null,
|
1923 | column: null
|
1924 | };
|
1925 | };
|
1926 |
|
1927 |
|
1928 |
|
1929 |
|
1930 |
|
1931 |
|
1932 | IndexedSourceMapConsumer.prototype._parseMappings =
|
1933 | function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
|
1934 | this.__generatedMappings = [];
|
1935 | this.__originalMappings = [];
|
1936 | for (var i = 0; i < this._sections.length; i++) {
|
1937 | var section = this._sections[i];
|
1938 | var sectionMappings = section.consumer._generatedMappings;
|
1939 | for (var j = 0; j < sectionMappings.length; j++) {
|
1940 | var mapping = sectionMappings[j];
|
1941 |
|
1942 | var source = section.consumer._sources.at(mapping.source);
|
1943 | source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
|
1944 | this._sources.add(source);
|
1945 | source = this._sources.indexOf(source);
|
1946 |
|
1947 | var name = null;
|
1948 | if (mapping.name) {
|
1949 | name = section.consumer._names.at(mapping.name);
|
1950 | this._names.add(name);
|
1951 | name = this._names.indexOf(name);
|
1952 | }
|
1953 |
|
1954 |
|
1955 |
|
1956 |
|
1957 |
|
1958 | var adjustedMapping = {
|
1959 | source: source,
|
1960 | generatedLine: mapping.generatedLine +
|
1961 | (section.generatedOffset.generatedLine - 1),
|
1962 | generatedColumn: mapping.generatedColumn +
|
1963 | (section.generatedOffset.generatedLine === mapping.generatedLine
|
1964 | ? section.generatedOffset.generatedColumn - 1
|
1965 | : 0),
|
1966 | originalLine: mapping.originalLine,
|
1967 | originalColumn: mapping.originalColumn,
|
1968 | name: name
|
1969 | };
|
1970 |
|
1971 | this.__generatedMappings.push(adjustedMapping);
|
1972 | if (typeof adjustedMapping.originalLine === 'number') {
|
1973 | this.__originalMappings.push(adjustedMapping);
|
1974 | }
|
1975 | }
|
1976 | }
|
1977 |
|
1978 | quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
|
1979 | quickSort(this.__originalMappings, util.compareByOriginalPositions);
|
1980 | };
|
1981 |
|
1982 | exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
|
1983 |
|
1984 |
|
1985 | }),
|
1986 |
|
1987 | 470:
|
1988 | (function(module) {
|
1989 |
|
1990 | var toString = Object.prototype.toString
|
1991 |
|
1992 | var isModern = (
|
1993 | typeof Buffer.alloc === 'function' &&
|
1994 | typeof Buffer.allocUnsafe === 'function' &&
|
1995 | typeof Buffer.from === 'function'
|
1996 | )
|
1997 |
|
1998 | function isArrayBuffer (input) {
|
1999 | return toString.call(input).slice(8, -1) === 'ArrayBuffer'
|
2000 | }
|
2001 |
|
2002 | function fromArrayBuffer (obj, byteOffset, length) {
|
2003 | byteOffset >>>= 0
|
2004 |
|
2005 | var maxLength = obj.byteLength - byteOffset
|
2006 |
|
2007 | if (maxLength < 0) {
|
2008 | throw new RangeError("'offset' is out of bounds")
|
2009 | }
|
2010 |
|
2011 | if (length === undefined) {
|
2012 | length = maxLength
|
2013 | } else {
|
2014 | length >>>= 0
|
2015 |
|
2016 | if (length > maxLength) {
|
2017 | throw new RangeError("'length' is out of bounds")
|
2018 | }
|
2019 | }
|
2020 |
|
2021 | return isModern
|
2022 | ? Buffer.from(obj.slice(byteOffset, byteOffset + length))
|
2023 | : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)))
|
2024 | }
|
2025 |
|
2026 | function fromString (string, encoding) {
|
2027 | if (typeof encoding !== 'string' || encoding === '') {
|
2028 | encoding = 'utf8'
|
2029 | }
|
2030 |
|
2031 | if (!Buffer.isEncoding(encoding)) {
|
2032 | throw new TypeError('"encoding" must be a valid string encoding')
|
2033 | }
|
2034 |
|
2035 | return isModern
|
2036 | ? Buffer.from(string, encoding)
|
2037 | : new Buffer(string, encoding)
|
2038 | }
|
2039 |
|
2040 | function bufferFrom (value, encodingOrOffset, length) {
|
2041 | if (typeof value === 'number') {
|
2042 | throw new TypeError('"value" argument must not be a number')
|
2043 | }
|
2044 |
|
2045 | if (isArrayBuffer(value)) {
|
2046 | return fromArrayBuffer(value, encodingOrOffset, length)
|
2047 | }
|
2048 |
|
2049 | if (typeof value === 'string') {
|
2050 | return fromString(value, encodingOrOffset)
|
2051 | }
|
2052 |
|
2053 | return isModern
|
2054 | ? Buffer.from(value)
|
2055 | : new Buffer(value)
|
2056 | }
|
2057 |
|
2058 | module.exports = bufferFrom
|
2059 |
|
2060 |
|
2061 | }),
|
2062 |
|
2063 | 545:
|
2064 | (function(module, exports, __webpack_require__) {
|
2065 |
|
2066 | module = __webpack_require__.nmd(module);
|
2067 | var SourceMapConsumer = __webpack_require__(168).SourceMapConsumer;
|
2068 | var path = __webpack_require__(622);
|
2069 |
|
2070 | var fs;
|
2071 | try {
|
2072 | fs = __webpack_require__(747);
|
2073 | if (!fs.existsSync || !fs.readFileSync) {
|
2074 |
|
2075 | fs = null;
|
2076 | }
|
2077 | } catch (err) {
|
2078 |
|
2079 | }
|
2080 |
|
2081 | var bufferFrom = __webpack_require__(470);
|
2082 |
|
2083 |
|
2084 |
|
2085 |
|
2086 |
|
2087 |
|
2088 |
|
2089 | function dynamicRequire(mod, request) {
|
2090 | return mod.require(request);
|
2091 | }
|
2092 |
|
2093 |
|
2094 | var errorFormatterInstalled = false;
|
2095 | var uncaughtShimInstalled = false;
|
2096 |
|
2097 |
|
2098 | var emptyCacheBetweenOperations = false;
|
2099 |
|
2100 |
|
2101 | var environment = "auto";
|
2102 |
|
2103 |
|
2104 | var fileContentsCache = {};
|
2105 |
|
2106 |
|
2107 | var sourceMapCache = {};
|
2108 |
|
2109 |
|
2110 | var reSourceMap = /^data:application\/json[^,]+base64,/;
|
2111 |
|
2112 |
|
2113 | var retrieveFileHandlers = [];
|
2114 | var retrieveMapHandlers = [];
|
2115 |
|
2116 | function isInBrowser() {
|
2117 | if (environment === "browser")
|
2118 | return true;
|
2119 | if (environment === "node")
|
2120 | return false;
|
2121 | return ((typeof window !== 'undefined') && (typeof XMLHttpRequest === 'function') && !(window.require && window.module && window.process && window.process.type === "renderer"));
|
2122 | }
|
2123 |
|
2124 | function hasGlobalProcessEventEmitter() {
|
2125 | return ((typeof process === 'object') && (process !== null) && (typeof process.on === 'function'));
|
2126 | }
|
2127 |
|
2128 | function handlerExec(list) {
|
2129 | return function(arg) {
|
2130 | for (var i = 0; i < list.length; i++) {
|
2131 | var ret = list[i](arg);
|
2132 | if (ret) {
|
2133 | return ret;
|
2134 | }
|
2135 | }
|
2136 | return null;
|
2137 | };
|
2138 | }
|
2139 |
|
2140 | var retrieveFile = handlerExec(retrieveFileHandlers);
|
2141 |
|
2142 | retrieveFileHandlers.push(function(path) {
|
2143 |
|
2144 | path = path.trim();
|
2145 | if (/^file:/.test(path)) {
|
2146 |
|
2147 | path = path.replace(/file:\/\/\/(\w:)?/, function(protocol, drive) {
|
2148 | return drive ?
|
2149 | '' :
|
2150 | '/';
|
2151 | });
|
2152 | }
|
2153 | if (path in fileContentsCache) {
|
2154 | return fileContentsCache[path];
|
2155 | }
|
2156 |
|
2157 | var contents = '';
|
2158 | try {
|
2159 | if (!fs) {
|
2160 |
|
2161 | var xhr = new XMLHttpRequest();
|
2162 | xhr.open('GET', path, false);
|
2163 | xhr.send(null);
|
2164 | if (xhr.readyState === 4 && xhr.status === 200) {
|
2165 | contents = xhr.responseText;
|
2166 | }
|
2167 | } else if (fs.existsSync(path)) {
|
2168 |
|
2169 | contents = fs.readFileSync(path, 'utf8');
|
2170 | }
|
2171 | } catch (er) {
|
2172 |
|
2173 | }
|
2174 |
|
2175 | return fileContentsCache[path] = contents;
|
2176 | });
|
2177 |
|
2178 |
|
2179 |
|
2180 | function supportRelativeURL(file, url) {
|
2181 | if (!file) return url;
|
2182 | var dir = path.dirname(file);
|
2183 | var match = /^\w+:\/\/[^\/]*/.exec(dir);
|
2184 | var protocol = match ? match[0] : '';
|
2185 | var startPath = dir.slice(protocol.length);
|
2186 | if (protocol && /^\/\w\:/.test(startPath)) {
|
2187 |
|
2188 | protocol += '/';
|
2189 | return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\/g, '/');
|
2190 | }
|
2191 | return protocol + path.resolve(dir.slice(protocol.length), url);
|
2192 | }
|
2193 |
|
2194 | function retrieveSourceMapURL(source) {
|
2195 | var fileData;
|
2196 |
|
2197 | if (isInBrowser()) {
|
2198 | try {
|
2199 | var xhr = new XMLHttpRequest();
|
2200 | xhr.open('GET', source, false);
|
2201 | xhr.send(null);
|
2202 | fileData = xhr.readyState === 4 ? xhr.responseText : null;
|
2203 |
|
2204 |
|
2205 | var sourceMapHeader = xhr.getResponseHeader("SourceMap") ||
|
2206 | xhr.getResponseHeader("X-SourceMap");
|
2207 | if (sourceMapHeader) {
|
2208 | return sourceMapHeader;
|
2209 | }
|
2210 | } catch (e) {
|
2211 | }
|
2212 | }
|
2213 |
|
2214 |
|
2215 | fileData = retrieveFile(source);
|
2216 | var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg;
|
2217 |
|
2218 |
|
2219 | var lastMatch, match;
|
2220 | while (match = re.exec(fileData)) lastMatch = match;
|
2221 | if (!lastMatch) return null;
|
2222 | return lastMatch[1];
|
2223 | };
|
2224 |
|
2225 |
|
2226 |
|
2227 |
|
2228 |
|
2229 |
|
2230 | var retrieveSourceMap = handlerExec(retrieveMapHandlers);
|
2231 | retrieveMapHandlers.push(function(source) {
|
2232 | var sourceMappingURL = retrieveSourceMapURL(source);
|
2233 | if (!sourceMappingURL) return null;
|
2234 |
|
2235 |
|
2236 | var sourceMapData;
|
2237 | if (reSourceMap.test(sourceMappingURL)) {
|
2238 |
|
2239 | var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(',') + 1);
|
2240 | sourceMapData = bufferFrom(rawData, "base64").toString();
|
2241 | sourceMappingURL = source;
|
2242 | } else {
|
2243 |
|
2244 | sourceMappingURL = supportRelativeURL(source, sourceMappingURL);
|
2245 | sourceMapData = retrieveFile(sourceMappingURL);
|
2246 | }
|
2247 |
|
2248 | if (!sourceMapData) {
|
2249 | return null;
|
2250 | }
|
2251 |
|
2252 | return {
|
2253 | url: sourceMappingURL,
|
2254 | map: sourceMapData
|
2255 | };
|
2256 | });
|
2257 |
|
2258 | function mapSourcePosition(position) {
|
2259 | var sourceMap = sourceMapCache[position.source];
|
2260 | if (!sourceMap) {
|
2261 |
|
2262 | var urlAndMap = retrieveSourceMap(position.source);
|
2263 | if (urlAndMap) {
|
2264 | sourceMap = sourceMapCache[position.source] = {
|
2265 | url: urlAndMap.url,
|
2266 | map: new SourceMapConsumer(urlAndMap.map)
|
2267 | };
|
2268 |
|
2269 |
|
2270 |
|
2271 | if (sourceMap.map.sourcesContent) {
|
2272 | sourceMap.map.sources.forEach(function(source, i) {
|
2273 | var contents = sourceMap.map.sourcesContent[i];
|
2274 | if (contents) {
|
2275 | var url = supportRelativeURL(sourceMap.url, source);
|
2276 | fileContentsCache[url] = contents;
|
2277 | }
|
2278 | });
|
2279 | }
|
2280 | } else {
|
2281 | sourceMap = sourceMapCache[position.source] = {
|
2282 | url: null,
|
2283 | map: null
|
2284 | };
|
2285 | }
|
2286 | }
|
2287 |
|
2288 |
|
2289 | if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === 'function') {
|
2290 | var originalPosition = sourceMap.map.originalPositionFor(position);
|
2291 |
|
2292 |
|
2293 |
|
2294 |
|
2295 |
|
2296 |
|
2297 | if (originalPosition.source !== null) {
|
2298 | originalPosition.source = supportRelativeURL(
|
2299 | sourceMap.url, originalPosition.source);
|
2300 | return originalPosition;
|
2301 | }
|
2302 | }
|
2303 |
|
2304 | return position;
|
2305 | }
|
2306 |
|
2307 |
|
2308 |
|
2309 | function mapEvalOrigin(origin) {
|
2310 |
|
2311 | var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin);
|
2312 | if (match) {
|
2313 | var position = mapSourcePosition({
|
2314 | source: match[2],
|
2315 | line: +match[3],
|
2316 | column: match[4] - 1
|
2317 | });
|
2318 | return 'eval at ' + match[1] + ' (' + position.source + ':' +
|
2319 | position.line + ':' + (position.column + 1) + ')';
|
2320 | }
|
2321 |
|
2322 |
|
2323 | match = /^eval at ([^(]+) \((.+)\)$/.exec(origin);
|
2324 | if (match) {
|
2325 | return 'eval at ' + match[1] + ' (' + mapEvalOrigin(match[2]) + ')';
|
2326 | }
|
2327 |
|
2328 |
|
2329 | return origin;
|
2330 | }
|
2331 |
|
2332 |
|
2333 |
|
2334 |
|
2335 |
|
2336 |
|
2337 |
|
2338 | function CallSiteToString() {
|
2339 | var fileName;
|
2340 | var fileLocation = "";
|
2341 | if (this.isNative()) {
|
2342 | fileLocation = "native";
|
2343 | } else {
|
2344 | fileName = this.getScriptNameOrSourceURL();
|
2345 | if (!fileName && this.isEval()) {
|
2346 | fileLocation = this.getEvalOrigin();
|
2347 | fileLocation += ", ";
|
2348 | }
|
2349 |
|
2350 | if (fileName) {
|
2351 | fileLocation += fileName;
|
2352 | } else {
|
2353 |
|
2354 |
|
2355 |
|
2356 | fileLocation += "<anonymous>";
|
2357 | }
|
2358 | var lineNumber = this.getLineNumber();
|
2359 | if (lineNumber != null) {
|
2360 | fileLocation += ":" + lineNumber;
|
2361 | var columnNumber = this.getColumnNumber();
|
2362 | if (columnNumber) {
|
2363 | fileLocation += ":" + columnNumber;
|
2364 | }
|
2365 | }
|
2366 | }
|
2367 |
|
2368 | var line = "";
|
2369 | var functionName = this.getFunctionName();
|
2370 | var addSuffix = true;
|
2371 | var isConstructor = this.isConstructor();
|
2372 | var isMethodCall = !(this.isToplevel() || isConstructor);
|
2373 | if (isMethodCall) {
|
2374 | var typeName = this.getTypeName();
|
2375 |
|
2376 | if (typeName === "[object Object]") {
|
2377 | typeName = "null";
|
2378 | }
|
2379 | var methodName = this.getMethodName();
|
2380 | if (functionName) {
|
2381 | if (typeName && functionName.indexOf(typeName) != 0) {
|
2382 | line += typeName + ".";
|
2383 | }
|
2384 | line += functionName;
|
2385 | if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) {
|
2386 | line += " [as " + methodName + "]";
|
2387 | }
|
2388 | } else {
|
2389 | line += typeName + "." + (methodName || "<anonymous>");
|
2390 | }
|
2391 | } else if (isConstructor) {
|
2392 | line += "new " + (functionName || "<anonymous>");
|
2393 | } else if (functionName) {
|
2394 | line += functionName;
|
2395 | } else {
|
2396 | line += fileLocation;
|
2397 | addSuffix = false;
|
2398 | }
|
2399 | if (addSuffix) {
|
2400 | line += " (" + fileLocation + ")";
|
2401 | }
|
2402 | return line;
|
2403 | }
|
2404 |
|
2405 | function cloneCallSite(frame) {
|
2406 | var object = {};
|
2407 | Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) {
|
2408 | object[name] = /^(?:is|get)/.test(name) ? function() { return frame[name].call(frame); } : frame[name];
|
2409 | });
|
2410 | object.toString = CallSiteToString;
|
2411 | return object;
|
2412 | }
|
2413 |
|
2414 | function wrapCallSite(frame, state) {
|
2415 |
|
2416 | if (state === undefined) {
|
2417 | state = { nextPosition: null, curPosition: null }
|
2418 | }
|
2419 | if(frame.isNative()) {
|
2420 | state.curPosition = null;
|
2421 | return frame;
|
2422 | }
|
2423 |
|
2424 |
|
2425 |
|
2426 |
|
2427 | var source = frame.getFileName() || frame.getScriptNameOrSourceURL();
|
2428 | if (source) {
|
2429 | var line = frame.getLineNumber();
|
2430 | var column = frame.getColumnNumber() - 1;
|
2431 |
|
2432 |
|
2433 |
|
2434 |
|
2435 |
|
2436 |
|
2437 | var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;
|
2438 | var headerLength = noHeader.test(process.version) ? 0 : 62;
|
2439 | if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) {
|
2440 | column -= headerLength;
|
2441 | }
|
2442 |
|
2443 | var position = mapSourcePosition({
|
2444 | source: source,
|
2445 | line: line,
|
2446 | column: column
|
2447 | });
|
2448 | state.curPosition = position;
|
2449 | frame = cloneCallSite(frame);
|
2450 | var originalFunctionName = frame.getFunctionName;
|
2451 | frame.getFunctionName = function() {
|
2452 | if (state.nextPosition == null) {
|
2453 | return originalFunctionName();
|
2454 | }
|
2455 | return state.nextPosition.name || originalFunctionName();
|
2456 | };
|
2457 | frame.getFileName = function() { return position.source; };
|
2458 | frame.getLineNumber = function() { return position.line; };
|
2459 | frame.getColumnNumber = function() { return position.column + 1; };
|
2460 | frame.getScriptNameOrSourceURL = function() { return position.source; };
|
2461 | return frame;
|
2462 | }
|
2463 |
|
2464 |
|
2465 | var origin = frame.isEval() && frame.getEvalOrigin();
|
2466 | if (origin) {
|
2467 | origin = mapEvalOrigin(origin);
|
2468 | frame = cloneCallSite(frame);
|
2469 | frame.getEvalOrigin = function() { return origin; };
|
2470 | return frame;
|
2471 | }
|
2472 |
|
2473 |
|
2474 | return frame;
|
2475 | }
|
2476 |
|
2477 |
|
2478 |
|
2479 | function prepareStackTrace(error, stack) {
|
2480 | if (emptyCacheBetweenOperations) {
|
2481 | fileContentsCache = {};
|
2482 | sourceMapCache = {};
|
2483 | }
|
2484 |
|
2485 | var name = error.name || 'Error';
|
2486 | var message = error.message || '';
|
2487 | var errorString = name + ": " + message;
|
2488 |
|
2489 | var state = { nextPosition: null, curPosition: null };
|
2490 | var processedStack = [];
|
2491 | for (var i = stack.length - 1; i >= 0; i--) {
|
2492 | processedStack.push('\n at ' + wrapCallSite(stack[i], state));
|
2493 | state.nextPosition = state.curPosition;
|
2494 | }
|
2495 | state.curPosition = state.nextPosition = null;
|
2496 | return errorString + processedStack.reverse().join('');
|
2497 | }
|
2498 |
|
2499 |
|
2500 | function getErrorSource(error) {
|
2501 | var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack);
|
2502 | if (match) {
|
2503 | var source = match[1];
|
2504 | var line = +match[2];
|
2505 | var column = +match[3];
|
2506 |
|
2507 |
|
2508 | var contents = fileContentsCache[source];
|
2509 |
|
2510 |
|
2511 | if (!contents && fs && fs.existsSync(source)) {
|
2512 | try {
|
2513 | contents = fs.readFileSync(source, 'utf8');
|
2514 | } catch (er) {
|
2515 | contents = '';
|
2516 | }
|
2517 | }
|
2518 |
|
2519 |
|
2520 | if (contents) {
|
2521 | var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1];
|
2522 | if (code) {
|
2523 | return source + ':' + line + '\n' + code + '\n' +
|
2524 | new Array(column).join(' ') + '^';
|
2525 | }
|
2526 | }
|
2527 | }
|
2528 | return null;
|
2529 | }
|
2530 |
|
2531 | function printErrorAndExit (error) {
|
2532 | var source = getErrorSource(error);
|
2533 |
|
2534 |
|
2535 | if (process.stderr._handle && process.stderr._handle.setBlocking) {
|
2536 | process.stderr._handle.setBlocking(true);
|
2537 | }
|
2538 |
|
2539 | if (source) {
|
2540 | console.error();
|
2541 | console.error(source);
|
2542 | }
|
2543 |
|
2544 | console.error(error.stack);
|
2545 | process.exit(1);
|
2546 | }
|
2547 |
|
2548 | function shimEmitUncaughtException () {
|
2549 | var origEmit = process.emit;
|
2550 |
|
2551 | process.emit = function (type) {
|
2552 | if (type === 'uncaughtException') {
|
2553 | var hasStack = (arguments[1] && arguments[1].stack);
|
2554 | var hasListeners = (this.listeners(type).length > 0);
|
2555 |
|
2556 | if (hasStack && !hasListeners) {
|
2557 | return printErrorAndExit(arguments[1]);
|
2558 | }
|
2559 | }
|
2560 |
|
2561 | return origEmit.apply(this, arguments);
|
2562 | };
|
2563 | }
|
2564 |
|
2565 | var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0);
|
2566 | var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0);
|
2567 |
|
2568 | exports.wrapCallSite = wrapCallSite;
|
2569 | exports.getErrorSource = getErrorSource;
|
2570 | exports.mapSourcePosition = mapSourcePosition;
|
2571 | exports.retrieveSourceMap = retrieveSourceMap;
|
2572 |
|
2573 | exports.install = function(options) {
|
2574 | options = options || {};
|
2575 |
|
2576 | if (options.environment) {
|
2577 | environment = options.environment;
|
2578 | if (["node", "browser", "auto"].indexOf(environment) === -1) {
|
2579 | throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}")
|
2580 | }
|
2581 | }
|
2582 |
|
2583 |
|
2584 |
|
2585 | if (options.retrieveFile) {
|
2586 | if (options.overrideRetrieveFile) {
|
2587 | retrieveFileHandlers.length = 0;
|
2588 | }
|
2589 |
|
2590 | retrieveFileHandlers.unshift(options.retrieveFile);
|
2591 | }
|
2592 |
|
2593 |
|
2594 |
|
2595 | if (options.retrieveSourceMap) {
|
2596 | if (options.overrideRetrieveSourceMap) {
|
2597 | retrieveMapHandlers.length = 0;
|
2598 | }
|
2599 |
|
2600 | retrieveMapHandlers.unshift(options.retrieveSourceMap);
|
2601 | }
|
2602 |
|
2603 |
|
2604 | if (options.hookRequire && !isInBrowser()) {
|
2605 |
|
2606 | var Module = dynamicRequire(module, 'module');
|
2607 | var $compile = Module.prototype._compile;
|
2608 |
|
2609 | if (!$compile.__sourceMapSupport) {
|
2610 | Module.prototype._compile = function(content, filename) {
|
2611 | fileContentsCache[filename] = content;
|
2612 | sourceMapCache[filename] = undefined;
|
2613 | return $compile.call(this, content, filename);
|
2614 | };
|
2615 |
|
2616 | Module.prototype._compile.__sourceMapSupport = true;
|
2617 | }
|
2618 | }
|
2619 |
|
2620 |
|
2621 | if (!emptyCacheBetweenOperations) {
|
2622 | emptyCacheBetweenOperations = 'emptyCacheBetweenOperations' in options ?
|
2623 | options.emptyCacheBetweenOperations : false;
|
2624 | }
|
2625 |
|
2626 |
|
2627 | if (!errorFormatterInstalled) {
|
2628 | errorFormatterInstalled = true;
|
2629 | Error.prepareStackTrace = prepareStackTrace;
|
2630 | }
|
2631 |
|
2632 | if (!uncaughtShimInstalled) {
|
2633 | var installHandler = 'handleUncaughtExceptions' in options ?
|
2634 | options.handleUncaughtExceptions : true;
|
2635 |
|
2636 |
|
2637 |
|
2638 |
|
2639 | try {
|
2640 |
|
2641 | var worker_threads = dynamicRequire(module, 'worker_threads');
|
2642 | if (worker_threads.isMainThread === false) {
|
2643 | installHandler = false;
|
2644 | }
|
2645 | } catch(e) {}
|
2646 |
|
2647 |
|
2648 |
|
2649 |
|
2650 |
|
2651 |
|
2652 |
|
2653 |
|
2654 | if (installHandler && hasGlobalProcessEventEmitter()) {
|
2655 | uncaughtShimInstalled = true;
|
2656 | shimEmitUncaughtException();
|
2657 | }
|
2658 | }
|
2659 | };
|
2660 |
|
2661 | exports.resetRetrieveHandlers = function() {
|
2662 | retrieveFileHandlers.length = 0;
|
2663 | retrieveMapHandlers.length = 0;
|
2664 |
|
2665 | retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
|
2666 | retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);
|
2667 |
|
2668 | retrieveSourceMap = handlerExec(retrieveMapHandlers);
|
2669 | retrieveFile = handlerExec(retrieveFileHandlers);
|
2670 | }
|
2671 |
|
2672 |
|
2673 | }),
|
2674 |
|
2675 | 567:
|
2676 | (function(__unusedmodule, exports) {
|
2677 |
|
2678 |
|
2679 |
|
2680 |
|
2681 |
|
2682 |
|
2683 |
|
2684 |
|
2685 |
|
2686 |
|
2687 |
|
2688 |
|
2689 |
|
2690 |
|
2691 |
|
2692 |
|
2693 |
|
2694 |
|
2695 | function getArg(aArgs, aName, aDefaultValue) {
|
2696 | if (aName in aArgs) {
|
2697 | return aArgs[aName];
|
2698 | } else if (arguments.length === 3) {
|
2699 | return aDefaultValue;
|
2700 | } else {
|
2701 | throw new Error('"' + aName + '" is a required argument.');
|
2702 | }
|
2703 | }
|
2704 | exports.getArg = getArg;
|
2705 |
|
2706 | var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
|
2707 | var dataUrlRegexp = /^data:.+\,.+$/;
|
2708 |
|
2709 | function urlParse(aUrl) {
|
2710 | var match = aUrl.match(urlRegexp);
|
2711 | if (!match) {
|
2712 | return null;
|
2713 | }
|
2714 | return {
|
2715 | scheme: match[1],
|
2716 | auth: match[2],
|
2717 | host: match[3],
|
2718 | port: match[4],
|
2719 | path: match[5]
|
2720 | };
|
2721 | }
|
2722 | exports.urlParse = urlParse;
|
2723 |
|
2724 | function urlGenerate(aParsedUrl) {
|
2725 | var url = '';
|
2726 | if (aParsedUrl.scheme) {
|
2727 | url += aParsedUrl.scheme + ':';
|
2728 | }
|
2729 | url += '//';
|
2730 | if (aParsedUrl.auth) {
|
2731 | url += aParsedUrl.auth + '@';
|
2732 | }
|
2733 | if (aParsedUrl.host) {
|
2734 | url += aParsedUrl.host;
|
2735 | }
|
2736 | if (aParsedUrl.port) {
|
2737 | url += ":" + aParsedUrl.port
|
2738 | }
|
2739 | if (aParsedUrl.path) {
|
2740 | url += aParsedUrl.path;
|
2741 | }
|
2742 | return url;
|
2743 | }
|
2744 | exports.urlGenerate = urlGenerate;
|
2745 |
|
2746 |
|
2747 |
|
2748 |
|
2749 |
|
2750 |
|
2751 |
|
2752 |
|
2753 |
|
2754 |
|
2755 |
|
2756 |
|
2757 | function normalize(aPath) {
|
2758 | var path = aPath;
|
2759 | var url = urlParse(aPath);
|
2760 | if (url) {
|
2761 | if (!url.path) {
|
2762 | return aPath;
|
2763 | }
|
2764 | path = url.path;
|
2765 | }
|
2766 | var isAbsolute = exports.isAbsolute(path);
|
2767 |
|
2768 | var parts = path.split(/\/+/);
|
2769 | for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
2770 | part = parts[i];
|
2771 | if (part === '.') {
|
2772 | parts.splice(i, 1);
|
2773 | } else if (part === '..') {
|
2774 | up++;
|
2775 | } else if (up > 0) {
|
2776 | if (part === '') {
|
2777 |
|
2778 |
|
2779 |
|
2780 | parts.splice(i + 1, up);
|
2781 | up = 0;
|
2782 | } else {
|
2783 | parts.splice(i, 2);
|
2784 | up--;
|
2785 | }
|
2786 | }
|
2787 | }
|
2788 | path = parts.join('/');
|
2789 |
|
2790 | if (path === '') {
|
2791 | path = isAbsolute ? '/' : '.';
|
2792 | }
|
2793 |
|
2794 | if (url) {
|
2795 | url.path = path;
|
2796 | return urlGenerate(url);
|
2797 | }
|
2798 | return path;
|
2799 | }
|
2800 | exports.normalize = normalize;
|
2801 |
|
2802 |
|
2803 |
|
2804 |
|
2805 |
|
2806 |
|
2807 |
|
2808 |
|
2809 |
|
2810 |
|
2811 |
|
2812 |
|
2813 |
|
2814 |
|
2815 |
|
2816 |
|
2817 |
|
2818 | function join(aRoot, aPath) {
|
2819 | if (aRoot === "") {
|
2820 | aRoot = ".";
|
2821 | }
|
2822 | if (aPath === "") {
|
2823 | aPath = ".";
|
2824 | }
|
2825 | var aPathUrl = urlParse(aPath);
|
2826 | var aRootUrl = urlParse(aRoot);
|
2827 | if (aRootUrl) {
|
2828 | aRoot = aRootUrl.path || '/';
|
2829 | }
|
2830 |
|
2831 |
|
2832 | if (aPathUrl && !aPathUrl.scheme) {
|
2833 | if (aRootUrl) {
|
2834 | aPathUrl.scheme = aRootUrl.scheme;
|
2835 | }
|
2836 | return urlGenerate(aPathUrl);
|
2837 | }
|
2838 |
|
2839 | if (aPathUrl || aPath.match(dataUrlRegexp)) {
|
2840 | return aPath;
|
2841 | }
|
2842 |
|
2843 |
|
2844 | if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
|
2845 | aRootUrl.host = aPath;
|
2846 | return urlGenerate(aRootUrl);
|
2847 | }
|
2848 |
|
2849 | var joined = aPath.charAt(0) === '/'
|
2850 | ? aPath
|
2851 | : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
|
2852 |
|
2853 | if (aRootUrl) {
|
2854 | aRootUrl.path = joined;
|
2855 | return urlGenerate(aRootUrl);
|
2856 | }
|
2857 | return joined;
|
2858 | }
|
2859 | exports.join = join;
|
2860 |
|
2861 | exports.isAbsolute = function (aPath) {
|
2862 | return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
|
2863 | };
|
2864 |
|
2865 |
|
2866 |
|
2867 |
|
2868 |
|
2869 |
|
2870 |
|
2871 | function relative(aRoot, aPath) {
|
2872 | if (aRoot === "") {
|
2873 | aRoot = ".";
|
2874 | }
|
2875 |
|
2876 | aRoot = aRoot.replace(/\/$/, '');
|
2877 |
|
2878 |
|
2879 |
|
2880 |
|
2881 |
|
2882 | var level = 0;
|
2883 | while (aPath.indexOf(aRoot + '/') !== 0) {
|
2884 | var index = aRoot.lastIndexOf("/");
|
2885 | if (index < 0) {
|
2886 | return aPath;
|
2887 | }
|
2888 |
|
2889 |
|
2890 |
|
2891 |
|
2892 | aRoot = aRoot.slice(0, index);
|
2893 | if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
|
2894 | return aPath;
|
2895 | }
|
2896 |
|
2897 | ++level;
|
2898 | }
|
2899 |
|
2900 |
|
2901 | return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
2902 | }
|
2903 | exports.relative = relative;
|
2904 |
|
2905 | var supportsNullProto = (function () {
|
2906 | var obj = Object.create(null);
|
2907 | return !('__proto__' in obj);
|
2908 | }());
|
2909 |
|
2910 | function identity (s) {
|
2911 | return s;
|
2912 | }
|
2913 |
|
2914 |
|
2915 |
|
2916 |
|
2917 |
|
2918 |
|
2919 |
|
2920 |
|
2921 |
|
2922 |
|
2923 | function toSetString(aStr) {
|
2924 | if (isProtoString(aStr)) {
|
2925 | return '$' + aStr;
|
2926 | }
|
2927 |
|
2928 | return aStr;
|
2929 | }
|
2930 | exports.toSetString = supportsNullProto ? identity : toSetString;
|
2931 |
|
2932 | function fromSetString(aStr) {
|
2933 | if (isProtoString(aStr)) {
|
2934 | return aStr.slice(1);
|
2935 | }
|
2936 |
|
2937 | return aStr;
|
2938 | }
|
2939 | exports.fromSetString = supportsNullProto ? identity : fromSetString;
|
2940 |
|
2941 | function isProtoString(s) {
|
2942 | if (!s) {
|
2943 | return false;
|
2944 | }
|
2945 |
|
2946 | var length = s.length;
|
2947 |
|
2948 | if (length < 9 ) {
|
2949 | return false;
|
2950 | }
|
2951 |
|
2952 | if (s.charCodeAt(length - 1) !== 95 ||
|
2953 | s.charCodeAt(length - 2) !== 95 ||
|
2954 | s.charCodeAt(length - 3) !== 111 ||
|
2955 | s.charCodeAt(length - 4) !== 116 ||
|
2956 | s.charCodeAt(length - 5) !== 111 ||
|
2957 | s.charCodeAt(length - 6) !== 114 ||
|
2958 | s.charCodeAt(length - 7) !== 112 ||
|
2959 | s.charCodeAt(length - 8) !== 95 ||
|
2960 | s.charCodeAt(length - 9) !== 95 ) {
|
2961 | return false;
|
2962 | }
|
2963 |
|
2964 | for (var i = length - 10; i >= 0; i--) {
|
2965 | if (s.charCodeAt(i) !== 36 ) {
|
2966 | return false;
|
2967 | }
|
2968 | }
|
2969 |
|
2970 | return true;
|
2971 | }
|
2972 |
|
2973 |
|
2974 |
|
2975 |
|
2976 |
|
2977 |
|
2978 |
|
2979 |
|
2980 |
|
2981 | function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
|
2982 | var cmp = strcmp(mappingA.source, mappingB.source);
|
2983 | if (cmp !== 0) {
|
2984 | return cmp;
|
2985 | }
|
2986 |
|
2987 | cmp = mappingA.originalLine - mappingB.originalLine;
|
2988 | if (cmp !== 0) {
|
2989 | return cmp;
|
2990 | }
|
2991 |
|
2992 | cmp = mappingA.originalColumn - mappingB.originalColumn;
|
2993 | if (cmp !== 0 || onlyCompareOriginal) {
|
2994 | return cmp;
|
2995 | }
|
2996 |
|
2997 | cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
2998 | if (cmp !== 0) {
|
2999 | return cmp;
|
3000 | }
|
3001 |
|
3002 | cmp = mappingA.generatedLine - mappingB.generatedLine;
|
3003 | if (cmp !== 0) {
|
3004 | return cmp;
|
3005 | }
|
3006 |
|
3007 | return strcmp(mappingA.name, mappingB.name);
|
3008 | }
|
3009 | exports.compareByOriginalPositions = compareByOriginalPositions;
|
3010 |
|
3011 |
|
3012 |
|
3013 |
|
3014 |
|
3015 |
|
3016 |
|
3017 |
|
3018 |
|
3019 |
|
3020 | function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
|
3021 | var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
3022 | if (cmp !== 0) {
|
3023 | return cmp;
|
3024 | }
|
3025 |
|
3026 | cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
3027 | if (cmp !== 0 || onlyCompareGenerated) {
|
3028 | return cmp;
|
3029 | }
|
3030 |
|
3031 | cmp = strcmp(mappingA.source, mappingB.source);
|
3032 | if (cmp !== 0) {
|
3033 | return cmp;
|
3034 | }
|
3035 |
|
3036 | cmp = mappingA.originalLine - mappingB.originalLine;
|
3037 | if (cmp !== 0) {
|
3038 | return cmp;
|
3039 | }
|
3040 |
|
3041 | cmp = mappingA.originalColumn - mappingB.originalColumn;
|
3042 | if (cmp !== 0) {
|
3043 | return cmp;
|
3044 | }
|
3045 |
|
3046 | return strcmp(mappingA.name, mappingB.name);
|
3047 | }
|
3048 | exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
|
3049 |
|
3050 | function strcmp(aStr1, aStr2) {
|
3051 | if (aStr1 === aStr2) {
|
3052 | return 0;
|
3053 | }
|
3054 |
|
3055 | if (aStr1 === null) {
|
3056 | return 1;
|
3057 | }
|
3058 |
|
3059 | if (aStr2 === null) {
|
3060 | return -1;
|
3061 | }
|
3062 |
|
3063 | if (aStr1 > aStr2) {
|
3064 | return 1;
|
3065 | }
|
3066 |
|
3067 | return -1;
|
3068 | }
|
3069 |
|
3070 |
|
3071 |
|
3072 |
|
3073 |
|
3074 | function compareByGeneratedPositionsInflated(mappingA, mappingB) {
|
3075 | var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
3076 | if (cmp !== 0) {
|
3077 | return cmp;
|
3078 | }
|
3079 |
|
3080 | cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
3081 | if (cmp !== 0) {
|
3082 | return cmp;
|
3083 | }
|
3084 |
|
3085 | cmp = strcmp(mappingA.source, mappingB.source);
|
3086 | if (cmp !== 0) {
|
3087 | return cmp;
|
3088 | }
|
3089 |
|
3090 | cmp = mappingA.originalLine - mappingB.originalLine;
|
3091 | if (cmp !== 0) {
|
3092 | return cmp;
|
3093 | }
|
3094 |
|
3095 | cmp = mappingA.originalColumn - mappingB.originalColumn;
|
3096 | if (cmp !== 0) {
|
3097 | return cmp;
|
3098 | }
|
3099 |
|
3100 | return strcmp(mappingA.name, mappingB.name);
|
3101 | }
|
3102 | exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
|
3103 |
|
3104 |
|
3105 |
|
3106 |
|
3107 |
|
3108 |
|
3109 | function parseSourceMapInput(str) {
|
3110 | return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
|
3111 | }
|
3112 | exports.parseSourceMapInput = parseSourceMapInput;
|
3113 |
|
3114 |
|
3115 |
|
3116 |
|
3117 |
|
3118 | function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
|
3119 | sourceURL = sourceURL || '';
|
3120 |
|
3121 | if (sourceRoot) {
|
3122 |
|
3123 | if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
|
3124 | sourceRoot += '/';
|
3125 | }
|
3126 |
|
3127 |
|
3128 |
|
3129 |
|
3130 |
|
3131 | sourceURL = sourceRoot + sourceURL;
|
3132 | }
|
3133 |
|
3134 |
|
3135 |
|
3136 |
|
3137 |
|
3138 |
|
3139 |
|
3140 |
|
3141 |
|
3142 |
|
3143 |
|
3144 |
|
3145 |
|
3146 |
|
3147 |
|
3148 | if (sourceMapURL) {
|
3149 | var parsed = urlParse(sourceMapURL);
|
3150 | if (!parsed) {
|
3151 | throw new Error("sourceMapURL could not be parsed");
|
3152 | }
|
3153 | if (parsed.path) {
|
3154 |
|
3155 | var index = parsed.path.lastIndexOf('/');
|
3156 | if (index >= 0) {
|
3157 | parsed.path = parsed.path.substring(0, index + 1);
|
3158 | }
|
3159 | }
|
3160 | sourceURL = join(urlGenerate(parsed), sourceURL);
|
3161 | }
|
3162 |
|
3163 | return normalize(sourceURL);
|
3164 | }
|
3165 | exports.computeSourceURL = computeSourceURL;
|
3166 |
|
3167 |
|
3168 | }),
|
3169 |
|
3170 | 622:
|
3171 | (function(module) {
|
3172 |
|
3173 | module.exports = require("path");
|
3174 |
|
3175 | }),
|
3176 |
|
3177 | 668:
|
3178 | (function(__unusedmodule, exports, __webpack_require__) {
|
3179 |
|
3180 |
|
3181 |
|
3182 |
|
3183 |
|
3184 |
|
3185 |
|
3186 |
|
3187 |
|
3188 |
|
3189 |
|
3190 |
|
3191 |
|
3192 |
|
3193 |
|
3194 |
|
3195 |
|
3196 |
|
3197 |
|
3198 |
|
3199 |
|
3200 |
|
3201 |
|
3202 |
|
3203 |
|
3204 |
|
3205 |
|
3206 |
|
3207 |
|
3208 |
|
3209 |
|
3210 |
|
3211 |
|
3212 |
|
3213 |
|
3214 |
|
3215 |
|
3216 |
|
3217 | var base64 = __webpack_require__(781);
|
3218 |
|
3219 |
|
3220 |
|
3221 |
|
3222 |
|
3223 |
|
3224 |
|
3225 |
|
3226 |
|
3227 |
|
3228 |
|
3229 |
|
3230 |
|
3231 | var VLQ_BASE_SHIFT = 5;
|
3232 |
|
3233 |
|
3234 | var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
3235 |
|
3236 |
|
3237 | var VLQ_BASE_MASK = VLQ_BASE - 1;
|
3238 |
|
3239 |
|
3240 | var VLQ_CONTINUATION_BIT = VLQ_BASE;
|
3241 |
|
3242 |
|
3243 |
|
3244 |
|
3245 |
|
3246 |
|
3247 |
|
3248 | function toVLQSigned(aValue) {
|
3249 | return aValue < 0
|
3250 | ? ((-aValue) << 1) + 1
|
3251 | : (aValue << 1) + 0;
|
3252 | }
|
3253 |
|
3254 |
|
3255 |
|
3256 |
|
3257 |
|
3258 |
|
3259 |
|
3260 | function fromVLQSigned(aValue) {
|
3261 | var isNegative = (aValue & 1) === 1;
|
3262 | var shifted = aValue >> 1;
|
3263 | return isNegative
|
3264 | ? -shifted
|
3265 | : shifted;
|
3266 | }
|
3267 |
|
3268 |
|
3269 |
|
3270 |
|
3271 | exports.encode = function base64VLQ_encode(aValue) {
|
3272 | var encoded = "";
|
3273 | var digit;
|
3274 |
|
3275 | var vlq = toVLQSigned(aValue);
|
3276 |
|
3277 | do {
|
3278 | digit = vlq & VLQ_BASE_MASK;
|
3279 | vlq >>>= VLQ_BASE_SHIFT;
|
3280 | if (vlq > 0) {
|
3281 |
|
3282 |
|
3283 | digit |= VLQ_CONTINUATION_BIT;
|
3284 | }
|
3285 | encoded += base64.encode(digit);
|
3286 | } while (vlq > 0);
|
3287 |
|
3288 | return encoded;
|
3289 | };
|
3290 |
|
3291 |
|
3292 |
|
3293 |
|
3294 |
|
3295 | exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
|
3296 | var strLen = aStr.length;
|
3297 | var result = 0;
|
3298 | var shift = 0;
|
3299 | var continuation, digit;
|
3300 |
|
3301 | do {
|
3302 | if (aIndex >= strLen) {
|
3303 | throw new Error("Expected more digits in base 64 VLQ value.");
|
3304 | }
|
3305 |
|
3306 | digit = base64.decode(aStr.charCodeAt(aIndex++));
|
3307 | if (digit === -1) {
|
3308 | throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
|
3309 | }
|
3310 |
|
3311 | continuation = !!(digit & VLQ_CONTINUATION_BIT);
|
3312 | digit &= VLQ_BASE_MASK;
|
3313 | result = result + (digit << shift);
|
3314 | shift += VLQ_BASE_SHIFT;
|
3315 | } while (continuation);
|
3316 |
|
3317 | aOutParam.value = fromVLQSigned(result);
|
3318 | aOutParam.rest = aIndex;
|
3319 | };
|
3320 |
|
3321 |
|
3322 | }),
|
3323 |
|
3324 | 747:
|
3325 | (function(module) {
|
3326 |
|
3327 | module.exports = require("fs");
|
3328 |
|
3329 | }),
|
3330 |
|
3331 | 781:
|
3332 | (function(__unusedmodule, exports) {
|
3333 |
|
3334 |
|
3335 |
|
3336 |
|
3337 |
|
3338 |
|
3339 |
|
3340 |
|
3341 | var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
|
3342 |
|
3343 |
|
3344 |
|
3345 |
|
3346 | exports.encode = function (number) {
|
3347 | if (0 <= number && number < intToCharMap.length) {
|
3348 | return intToCharMap[number];
|
3349 | }
|
3350 | throw new TypeError("Must be between 0 and 63: " + number);
|
3351 | };
|
3352 |
|
3353 |
|
3354 |
|
3355 |
|
3356 |
|
3357 | exports.decode = function (charCode) {
|
3358 | var bigA = 65;
|
3359 | var bigZ = 90;
|
3360 |
|
3361 | var littleA = 97;
|
3362 | var littleZ = 122;
|
3363 |
|
3364 | var zero = 48;
|
3365 | var nine = 57;
|
3366 |
|
3367 | var plus = 43;
|
3368 | var slash = 47;
|
3369 |
|
3370 | var littleOffset = 26;
|
3371 | var numberOffset = 52;
|
3372 |
|
3373 |
|
3374 | if (bigA <= charCode && charCode <= bigZ) {
|
3375 | return (charCode - bigA);
|
3376 | }
|
3377 |
|
3378 |
|
3379 | if (littleA <= charCode && charCode <= littleZ) {
|
3380 | return (charCode - littleA + littleOffset);
|
3381 | }
|
3382 |
|
3383 |
|
3384 | if (zero <= charCode && charCode <= nine) {
|
3385 | return (charCode - zero + numberOffset);
|
3386 | }
|
3387 |
|
3388 |
|
3389 | if (charCode == plus) {
|
3390 | return 62;
|
3391 | }
|
3392 |
|
3393 |
|
3394 | if (charCode == slash) {
|
3395 | return 63;
|
3396 | }
|
3397 |
|
3398 |
|
3399 | return -1;
|
3400 | };
|
3401 |
|
3402 |
|
3403 | }),
|
3404 |
|
3405 | 872:
|
3406 | (function(__unusedmodule, exports, __webpack_require__) {
|
3407 |
|
3408 |
|
3409 |
|
3410 |
|
3411 |
|
3412 |
|
3413 |
|
3414 |
|
3415 | var SourceMapGenerator = __webpack_require__(116).SourceMapGenerator;
|
3416 | var util = __webpack_require__(567);
|
3417 |
|
3418 |
|
3419 |
|
3420 | var REGEX_NEWLINE = /(\r?\n)/;
|
3421 |
|
3422 |
|
3423 | var NEWLINE_CODE = 10;
|
3424 |
|
3425 |
|
3426 |
|
3427 |
|
3428 | var isSourceNode = "$$$isSourceNode$$$";
|
3429 |
|
3430 |
|
3431 |
|
3432 |
|
3433 |
|
3434 |
|
3435 |
|
3436 |
|
3437 |
|
3438 |
|
3439 |
|
3440 |
|
3441 |
|
3442 | function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
|
3443 | this.children = [];
|
3444 | this.sourceContents = {};
|
3445 | this.line = aLine == null ? null : aLine;
|
3446 | this.column = aColumn == null ? null : aColumn;
|
3447 | this.source = aSource == null ? null : aSource;
|
3448 | this.name = aName == null ? null : aName;
|
3449 | this[isSourceNode] = true;
|
3450 | if (aChunks != null) this.add(aChunks);
|
3451 | }
|
3452 |
|
3453 |
|
3454 |
|
3455 |
|
3456 |
|
3457 |
|
3458 |
|
3459 |
|
3460 |
|
3461 | SourceNode.fromStringWithSourceMap =
|
3462 | function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
|
3463 |
|
3464 |
|
3465 | var node = new SourceNode();
|
3466 |
|
3467 |
|
3468 |
|
3469 |
|
3470 |
|
3471 | var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
|
3472 | var remainingLinesIndex = 0;
|
3473 | var shiftNextLine = function() {
|
3474 | var lineContents = getNextLine();
|
3475 |
|
3476 | var newLine = getNextLine() || "";
|
3477 | return lineContents + newLine;
|
3478 |
|
3479 | function getNextLine() {
|
3480 | return remainingLinesIndex < remainingLines.length ?
|
3481 | remainingLines[remainingLinesIndex++] : undefined;
|
3482 | }
|
3483 | };
|
3484 |
|
3485 |
|
3486 | var lastGeneratedLine = 1, lastGeneratedColumn = 0;
|
3487 |
|
3488 |
|
3489 |
|
3490 |
|
3491 | var lastMapping = null;
|
3492 |
|
3493 | aSourceMapConsumer.eachMapping(function (mapping) {
|
3494 | if (lastMapping !== null) {
|
3495 |
|
3496 |
|
3497 | if (lastGeneratedLine < mapping.generatedLine) {
|
3498 |
|
3499 | addMappingWithCode(lastMapping, shiftNextLine());
|
3500 | lastGeneratedLine++;
|
3501 | lastGeneratedColumn = 0;
|
3502 |
|
3503 | } else {
|
3504 |
|
3505 |
|
3506 |
|
3507 | var nextLine = remainingLines[remainingLinesIndex] || '';
|
3508 | var code = nextLine.substr(0, mapping.generatedColumn -
|
3509 | lastGeneratedColumn);
|
3510 | remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
|
3511 | lastGeneratedColumn);
|
3512 | lastGeneratedColumn = mapping.generatedColumn;
|
3513 | addMappingWithCode(lastMapping, code);
|
3514 |
|
3515 | lastMapping = mapping;
|
3516 | return;
|
3517 | }
|
3518 | }
|
3519 |
|
3520 |
|
3521 |
|
3522 | while (lastGeneratedLine < mapping.generatedLine) {
|
3523 | node.add(shiftNextLine());
|
3524 | lastGeneratedLine++;
|
3525 | }
|
3526 | if (lastGeneratedColumn < mapping.generatedColumn) {
|
3527 | var nextLine = remainingLines[remainingLinesIndex] || '';
|
3528 | node.add(nextLine.substr(0, mapping.generatedColumn));
|
3529 | remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
|
3530 | lastGeneratedColumn = mapping.generatedColumn;
|
3531 | }
|
3532 | lastMapping = mapping;
|
3533 | }, this);
|
3534 |
|
3535 | if (remainingLinesIndex < remainingLines.length) {
|
3536 | if (lastMapping) {
|
3537 |
|
3538 | addMappingWithCode(lastMapping, shiftNextLine());
|
3539 | }
|
3540 |
|
3541 | node.add(remainingLines.splice(remainingLinesIndex).join(""));
|
3542 | }
|
3543 |
|
3544 |
|
3545 | aSourceMapConsumer.sources.forEach(function (sourceFile) {
|
3546 | var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
3547 | if (content != null) {
|
3548 | if (aRelativePath != null) {
|
3549 | sourceFile = util.join(aRelativePath, sourceFile);
|
3550 | }
|
3551 | node.setSourceContent(sourceFile, content);
|
3552 | }
|
3553 | });
|
3554 |
|
3555 | return node;
|
3556 |
|
3557 | function addMappingWithCode(mapping, code) {
|
3558 | if (mapping === null || mapping.source === undefined) {
|
3559 | node.add(code);
|
3560 | } else {
|
3561 | var source = aRelativePath
|
3562 | ? util.join(aRelativePath, mapping.source)
|
3563 | : mapping.source;
|
3564 | node.add(new SourceNode(mapping.originalLine,
|
3565 | mapping.originalColumn,
|
3566 | source,
|
3567 | code,
|
3568 | mapping.name));
|
3569 | }
|
3570 | }
|
3571 | };
|
3572 |
|
3573 |
|
3574 |
|
3575 |
|
3576 |
|
3577 |
|
3578 |
|
3579 | SourceNode.prototype.add = function SourceNode_add(aChunk) {
|
3580 | if (Array.isArray(aChunk)) {
|
3581 | aChunk.forEach(function (chunk) {
|
3582 | this.add(chunk);
|
3583 | }, this);
|
3584 | }
|
3585 | else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
3586 | if (aChunk) {
|
3587 | this.children.push(aChunk);
|
3588 | }
|
3589 | }
|
3590 | else {
|
3591 | throw new TypeError(
|
3592 | "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
3593 | );
|
3594 | }
|
3595 | return this;
|
3596 | };
|
3597 |
|
3598 |
|
3599 |
|
3600 |
|
3601 |
|
3602 |
|
3603 |
|
3604 | SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
|
3605 | if (Array.isArray(aChunk)) {
|
3606 | for (var i = aChunk.length-1; i >= 0; i--) {
|
3607 | this.prepend(aChunk[i]);
|
3608 | }
|
3609 | }
|
3610 | else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
3611 | this.children.unshift(aChunk);
|
3612 | }
|
3613 | else {
|
3614 | throw new TypeError(
|
3615 | "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
3616 | );
|
3617 | }
|
3618 | return this;
|
3619 | };
|
3620 |
|
3621 |
|
3622 |
|
3623 |
|
3624 |
|
3625 |
|
3626 |
|
3627 |
|
3628 | SourceNode.prototype.walk = function SourceNode_walk(aFn) {
|
3629 | var chunk;
|
3630 | for (var i = 0, len = this.children.length; i < len; i++) {
|
3631 | chunk = this.children[i];
|
3632 | if (chunk[isSourceNode]) {
|
3633 | chunk.walk(aFn);
|
3634 | }
|
3635 | else {
|
3636 | if (chunk !== '') {
|
3637 | aFn(chunk, { source: this.source,
|
3638 | line: this.line,
|
3639 | column: this.column,
|
3640 | name: this.name });
|
3641 | }
|
3642 | }
|
3643 | }
|
3644 | };
|
3645 |
|
3646 |
|
3647 |
|
3648 |
|
3649 |
|
3650 |
|
3651 |
|
3652 | SourceNode.prototype.join = function SourceNode_join(aSep) {
|
3653 | var newChildren;
|
3654 | var i;
|
3655 | var len = this.children.length;
|
3656 | if (len > 0) {
|
3657 | newChildren = [];
|
3658 | for (i = 0; i < len-1; i++) {
|
3659 | newChildren.push(this.children[i]);
|
3660 | newChildren.push(aSep);
|
3661 | }
|
3662 | newChildren.push(this.children[i]);
|
3663 | this.children = newChildren;
|
3664 | }
|
3665 | return this;
|
3666 | };
|
3667 |
|
3668 |
|
3669 |
|
3670 |
|
3671 |
|
3672 |
|
3673 |
|
3674 |
|
3675 | SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
|
3676 | var lastChild = this.children[this.children.length - 1];
|
3677 | if (lastChild[isSourceNode]) {
|
3678 | lastChild.replaceRight(aPattern, aReplacement);
|
3679 | }
|
3680 | else if (typeof lastChild === 'string') {
|
3681 | this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
|
3682 | }
|
3683 | else {
|
3684 | this.children.push(''.replace(aPattern, aReplacement));
|
3685 | }
|
3686 | return this;
|
3687 | };
|
3688 |
|
3689 |
|
3690 |
|
3691 |
|
3692 |
|
3693 |
|
3694 |
|
3695 |
|
3696 | SourceNode.prototype.setSourceContent =
|
3697 | function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
|
3698 | this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
|
3699 | };
|
3700 |
|
3701 |
|
3702 |
|
3703 |
|
3704 |
|
3705 |
|
3706 |
|
3707 | SourceNode.prototype.walkSourceContents =
|
3708 | function SourceNode_walkSourceContents(aFn) {
|
3709 | for (var i = 0, len = this.children.length; i < len; i++) {
|
3710 | if (this.children[i][isSourceNode]) {
|
3711 | this.children[i].walkSourceContents(aFn);
|
3712 | }
|
3713 | }
|
3714 |
|
3715 | var sources = Object.keys(this.sourceContents);
|
3716 | for (var i = 0, len = sources.length; i < len; i++) {
|
3717 | aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
|
3718 | }
|
3719 | };
|
3720 |
|
3721 |
|
3722 |
|
3723 |
|
3724 |
|
3725 | SourceNode.prototype.toString = function SourceNode_toString() {
|
3726 | var str = "";
|
3727 | this.walk(function (chunk) {
|
3728 | str += chunk;
|
3729 | });
|
3730 | return str;
|
3731 | };
|
3732 |
|
3733 |
|
3734 |
|
3735 |
|
3736 |
|
3737 | SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
|
3738 | var generated = {
|
3739 | code: "",
|
3740 | line: 1,
|
3741 | column: 0
|
3742 | };
|
3743 | var map = new SourceMapGenerator(aArgs);
|
3744 | var sourceMappingActive = false;
|
3745 | var lastOriginalSource = null;
|
3746 | var lastOriginalLine = null;
|
3747 | var lastOriginalColumn = null;
|
3748 | var lastOriginalName = null;
|
3749 | this.walk(function (chunk, original) {
|
3750 | generated.code += chunk;
|
3751 | if (original.source !== null
|
3752 | && original.line !== null
|
3753 | && original.column !== null) {
|
3754 | if(lastOriginalSource !== original.source
|
3755 | || lastOriginalLine !== original.line
|
3756 | || lastOriginalColumn !== original.column
|
3757 | || lastOriginalName !== original.name) {
|
3758 | map.addMapping({
|
3759 | source: original.source,
|
3760 | original: {
|
3761 | line: original.line,
|
3762 | column: original.column
|
3763 | },
|
3764 | generated: {
|
3765 | line: generated.line,
|
3766 | column: generated.column
|
3767 | },
|
3768 | name: original.name
|
3769 | });
|
3770 | }
|
3771 | lastOriginalSource = original.source;
|
3772 | lastOriginalLine = original.line;
|
3773 | lastOriginalColumn = original.column;
|
3774 | lastOriginalName = original.name;
|
3775 | sourceMappingActive = true;
|
3776 | } else if (sourceMappingActive) {
|
3777 | map.addMapping({
|
3778 | generated: {
|
3779 | line: generated.line,
|
3780 | column: generated.column
|
3781 | }
|
3782 | });
|
3783 | lastOriginalSource = null;
|
3784 | sourceMappingActive = false;
|
3785 | }
|
3786 | for (var idx = 0, length = chunk.length; idx < length; idx++) {
|
3787 | if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
|
3788 | generated.line++;
|
3789 | generated.column = 0;
|
3790 |
|
3791 | if (idx + 1 === length) {
|
3792 | lastOriginalSource = null;
|
3793 | sourceMappingActive = false;
|
3794 | } else if (sourceMappingActive) {
|
3795 | map.addMapping({
|
3796 | source: original.source,
|
3797 | original: {
|
3798 | line: original.line,
|
3799 | column: original.column
|
3800 | },
|
3801 | generated: {
|
3802 | line: generated.line,
|
3803 | column: generated.column
|
3804 | },
|
3805 | name: original.name
|
3806 | });
|
3807 | }
|
3808 | } else {
|
3809 | generated.column++;
|
3810 | }
|
3811 | }
|
3812 | });
|
3813 | this.walkSourceContents(function (sourceFile, sourceContent) {
|
3814 | map.setSourceContent(sourceFile, sourceContent);
|
3815 | });
|
3816 |
|
3817 | return { code: generated.code, map: map };
|
3818 | };
|
3819 |
|
3820 | exports.SourceNode = SourceNode;
|
3821 |
|
3822 |
|
3823 | }),
|
3824 |
|
3825 | 882:
|
3826 | (function(__unusedmodule, exports) {
|
3827 |
|
3828 |
|
3829 |
|
3830 |
|
3831 |
|
3832 |
|
3833 |
|
3834 |
|
3835 |
|
3836 |
|
3837 |
|
3838 |
|
3839 |
|
3840 |
|
3841 |
|
3842 |
|
3843 |
|
3844 |
|
3845 |
|
3846 |
|
3847 |
|
3848 |
|
3849 |
|
3850 |
|
3851 |
|
3852 |
|
3853 |
|
3854 |
|
3855 | function swap(ary, x, y) {
|
3856 | var temp = ary[x];
|
3857 | ary[x] = ary[y];
|
3858 | ary[y] = temp;
|
3859 | }
|
3860 |
|
3861 |
|
3862 |
|
3863 |
|
3864 |
|
3865 |
|
3866 |
|
3867 |
|
3868 |
|
3869 | function randomIntInRange(low, high) {
|
3870 | return Math.round(low + (Math.random() * (high - low)));
|
3871 | }
|
3872 |
|
3873 |
|
3874 |
|
3875 |
|
3876 |
|
3877 |
|
3878 |
|
3879 |
|
3880 |
|
3881 |
|
3882 |
|
3883 |
|
3884 |
|
3885 | function doQuickSort(ary, comparator, p, r) {
|
3886 |
|
3887 |
|
3888 |
|
3889 |
|
3890 | if (p < r) {
|
3891 |
|
3892 |
|
3893 |
|
3894 |
|
3895 |
|
3896 |
|
3897 |
|
3898 |
|
3899 |
|
3900 |
|
3901 |
|
3902 | var pivotIndex = randomIntInRange(p, r);
|
3903 | var i = p - 1;
|
3904 |
|
3905 | swap(ary, pivotIndex, r);
|
3906 | var pivot = ary[r];
|
3907 |
|
3908 |
|
3909 |
|
3910 |
|
3911 |
|
3912 |
|
3913 |
|
3914 | for (var j = p; j < r; j++) {
|
3915 | if (comparator(ary[j], pivot) <= 0) {
|
3916 | i += 1;
|
3917 | swap(ary, i, j);
|
3918 | }
|
3919 | }
|
3920 |
|
3921 | swap(ary, i + 1, j);
|
3922 | var q = i + 1;
|
3923 |
|
3924 |
|
3925 |
|
3926 | doQuickSort(ary, comparator, p, q - 1);
|
3927 | doQuickSort(ary, comparator, q + 1, r);
|
3928 | }
|
3929 | }
|
3930 |
|
3931 |
|
3932 |
|
3933 |
|
3934 |
|
3935 |
|
3936 |
|
3937 |
|
3938 |
|
3939 | exports.quickSort = function (ary, comparator) {
|
3940 | doQuickSort(ary, comparator, 0, ary.length - 1);
|
3941 | };
|
3942 |
|
3943 |
|
3944 | })
|
3945 |
|
3946 | },
|
3947 | function(__webpack_require__) {
|
3948 | "use strict";
|
3949 |
|
3950 |
|
3951 | !function() {
|
3952 | __webpack_require__.nmd = function(module) {
|
3953 | module.paths = [];
|
3954 | if (!module.children) module.children = [];
|
3955 | Object.defineProperty(module, 'loaded', {
|
3956 | enumerable: true,
|
3957 | get: function() { return module.l; }
|
3958 | });
|
3959 | Object.defineProperty(module, 'id', {
|
3960 | enumerable: true,
|
3961 | get: function() { return module.i; }
|
3962 | });
|
3963 | return module;
|
3964 | };
|
3965 | }();
|
3966 |
|
3967 | }
|
3968 | ); |
\ | No newline at end of file |