@vercel/node 1.13.0 → 1.13.1-canary.2

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