@rspack/core 0.7.6-canary-1a0d77d-20240627143904 → 1.0.0-alpha.1

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.
Files changed (87) hide show
  1. package/README.md +2 -2
  2. package/compiled/enhanced-resolve/index.js +11 -11
  3. package/compiled/webpack-sources/index.d.ts +130 -0
  4. package/compiled/webpack-sources/index.js +3520 -0
  5. package/compiled/webpack-sources/license +21 -0
  6. package/compiled/webpack-sources/package.json +1 -0
  7. package/dist/Chunk.d.ts +19 -14
  8. package/dist/Chunk.js +22 -17
  9. package/dist/ChunkGraph.d.ts +1 -1
  10. package/dist/ChunkGraph.js +5 -5
  11. package/dist/ChunkGroup.d.ts +17 -7
  12. package/dist/ChunkGroup.js +12 -2
  13. package/dist/Compilation.d.ts +31 -33
  14. package/dist/Compilation.js +33 -53
  15. package/dist/Compiler.d.ts +26 -28
  16. package/dist/Compiler.js +74 -26
  17. package/dist/ContextModuleFactory.d.ts +1 -1
  18. package/dist/ContextModuleFactory.js +1 -1
  19. package/dist/Entrypoint.d.ts +1 -1
  20. package/dist/Entrypoint.js +2 -2
  21. package/dist/Module.d.ts +12 -7
  22. package/dist/Module.js +1 -0
  23. package/dist/MultiCompiler.d.ts +11 -11
  24. package/dist/MultiCompiler.js +30 -13
  25. package/dist/NormalModule.d.ts +7 -4
  26. package/dist/NormalModule.js +27 -11
  27. package/dist/NormalModuleFactory.d.ts +3 -1
  28. package/dist/NormalModuleFactory.js +3 -23
  29. package/dist/ResolverFactory.d.ts +3 -3
  30. package/dist/ResolverFactory.js +1 -1
  31. package/dist/RspackError.d.ts +8 -0
  32. package/dist/RspackError.js +21 -0
  33. package/dist/Stats.d.ts +4 -2
  34. package/dist/Stats.js +6 -0
  35. package/dist/Template.d.ts +1 -1
  36. package/dist/Template.js +2 -2
  37. package/dist/Watching.d.ts +1 -1
  38. package/dist/builtin-loader/swc/index.d.ts +0 -4
  39. package/dist/builtin-loader/swc/index.js +1 -5
  40. package/dist/builtin-loader/swc/preact.d.ts +3 -4
  41. package/dist/builtin-loader/swc/types.d.ts +2 -17
  42. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -0
  43. package/dist/builtin-plugin/BundlerInfoRspackPlugin.js +1 -0
  44. package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +1 -1
  45. package/dist/builtin-plugin/JavascriptModulesPlugin.js +1 -1
  46. package/dist/builtin-plugin/LightningCssMiminizerRspackPlugin.js +1 -1
  47. package/dist/builtin-plugin/SplitChunksPlugin.js +11 -2
  48. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +0 -28
  49. package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +20 -69
  50. package/dist/builtin-plugin/css-extract/index.d.ts +2 -2
  51. package/dist/config/adapter.js +30 -16
  52. package/dist/config/adapterRuleUse.js +0 -11
  53. package/dist/config/defaults.js +22 -30
  54. package/dist/config/normalization.js +13 -5
  55. package/dist/config/zod.d.ts +753 -205
  56. package/dist/config/zod.js +27 -13
  57. package/dist/container/ModuleFederationPlugin.js +1 -1
  58. package/dist/container/default.runtime.js +1 -170
  59. package/dist/exports.d.ts +9 -2
  60. package/dist/exports.js +11 -6
  61. package/dist/lib/Cache.d.ts +3 -3
  62. package/dist/lib/Cache.js +1 -1
  63. package/dist/loader-runner/index.js +37 -12
  64. package/dist/rspack.d.ts +1 -1
  65. package/dist/rspackOptionsApply.js +3 -0
  66. package/dist/stats/DefaultStatsFactoryPlugin.js +35 -11
  67. package/dist/stats/DefaultStatsPrinterPlugin.js +2 -2
  68. package/dist/stats/StatsFactory.d.ts +2 -2
  69. package/dist/stats/StatsFactory.js +12 -12
  70. package/dist/stats/StatsPrinter.d.ts +1 -1
  71. package/dist/stats/StatsPrinter.js +8 -8
  72. package/dist/stats/statsFactoryUtils.d.ts +13 -4
  73. package/dist/util/SplitChunkSize.d.ts +5 -0
  74. package/dist/util/SplitChunkSize.js +18 -0
  75. package/dist/util/index.d.ts +2 -2
  76. package/dist/util/index.js +4 -3
  77. package/dist/util/memoize.js +5 -1
  78. package/dist/util/source.d.ts +1 -1
  79. package/dist/util/source.js +1 -1
  80. package/package.json +14 -9
  81. package/dist/builtin-loader/swc/emotion.d.ts +0 -17
  82. package/dist/builtin-loader/swc/emotion.js +0 -22
  83. package/dist/builtin-loader/swc/relay.d.ts +0 -5
  84. package/dist/builtin-loader/swc/relay.js +0 -48
  85. package/dist/container/default.runtime.d.ts +0 -2
  86. package/dist/lite-tapable/index.d.ts +0 -146
  87. package/dist/lite-tapable/index.js +0 -752
@@ -0,0 +1,3520 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ var __webpack_modules__ = ({
3
+
4
+ /***/ 337:
5
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
6
+
7
+ "use strict";
8
+ /*
9
+ MIT License http://www.opensource.org/licenses/mit-license.php
10
+ Author Tobias Koppers @sokra
11
+ */
12
+
13
+
14
+ const Source = __nccwpck_require__(313);
15
+ const streamChunksOfSourceMap = __nccwpck_require__(280);
16
+ const streamChunksOfRawSource = __nccwpck_require__(264);
17
+ const streamAndGetSourceAndMap = __nccwpck_require__(248);
18
+
19
+ const mapToBufferedMap = map => {
20
+ if (typeof map !== "object" || !map) return map;
21
+ const bufferedMap = Object.assign({}, map);
22
+ if (map.mappings) {
23
+ bufferedMap.mappings = Buffer.from(map.mappings, "utf-8");
24
+ }
25
+ if (map.sourcesContent) {
26
+ bufferedMap.sourcesContent = map.sourcesContent.map(
27
+ str => str && Buffer.from(str, "utf-8")
28
+ );
29
+ }
30
+ return bufferedMap;
31
+ };
32
+
33
+ const bufferedMapToMap = bufferedMap => {
34
+ if (typeof bufferedMap !== "object" || !bufferedMap) return bufferedMap;
35
+ const map = Object.assign({}, bufferedMap);
36
+ if (bufferedMap.mappings) {
37
+ map.mappings = bufferedMap.mappings.toString("utf-8");
38
+ }
39
+ if (bufferedMap.sourcesContent) {
40
+ map.sourcesContent = bufferedMap.sourcesContent.map(
41
+ buffer => buffer && buffer.toString("utf-8")
42
+ );
43
+ }
44
+ return map;
45
+ };
46
+
47
+ class CachedSource extends Source {
48
+ constructor(source, cachedData) {
49
+ super();
50
+ this._source = source;
51
+ this._cachedSourceType = cachedData ? cachedData.source : undefined;
52
+ this._cachedSource = undefined;
53
+ this._cachedBuffer = cachedData ? cachedData.buffer : undefined;
54
+ this._cachedSize = cachedData ? cachedData.size : undefined;
55
+ this._cachedMaps = cachedData ? cachedData.maps : new Map();
56
+ this._cachedHashUpdate = cachedData ? cachedData.hash : undefined;
57
+ }
58
+
59
+ getCachedData() {
60
+ const bufferedMaps = new Map();
61
+ for (const pair of this._cachedMaps) {
62
+ let cacheEntry = pair[1];
63
+ if (cacheEntry.bufferedMap === undefined) {
64
+ cacheEntry.bufferedMap = mapToBufferedMap(
65
+ this._getMapFromCacheEntry(cacheEntry)
66
+ );
67
+ }
68
+ bufferedMaps.set(pair[0], {
69
+ map: undefined,
70
+ bufferedMap: cacheEntry.bufferedMap
71
+ });
72
+ }
73
+ // We don't want to cache strings
74
+ // So if we have a caches sources
75
+ // create a buffer from it and only store
76
+ // if it was a Buffer or string
77
+ if (this._cachedSource) {
78
+ this.buffer();
79
+ }
80
+ return {
81
+ buffer: this._cachedBuffer,
82
+ source:
83
+ this._cachedSourceType !== undefined
84
+ ? this._cachedSourceType
85
+ : typeof this._cachedSource === "string"
86
+ ? true
87
+ : Buffer.isBuffer(this._cachedSource)
88
+ ? false
89
+ : undefined,
90
+ size: this._cachedSize,
91
+ maps: bufferedMaps,
92
+ hash: this._cachedHashUpdate
93
+ };
94
+ }
95
+
96
+ originalLazy() {
97
+ return this._source;
98
+ }
99
+
100
+ original() {
101
+ if (typeof this._source === "function") this._source = this._source();
102
+ return this._source;
103
+ }
104
+
105
+ source() {
106
+ const source = this._getCachedSource();
107
+ if (source !== undefined) return source;
108
+ return (this._cachedSource = this.original().source());
109
+ }
110
+
111
+ _getMapFromCacheEntry(cacheEntry) {
112
+ if (cacheEntry.map !== undefined) {
113
+ return cacheEntry.map;
114
+ } else if (cacheEntry.bufferedMap !== undefined) {
115
+ return (cacheEntry.map = bufferedMapToMap(cacheEntry.bufferedMap));
116
+ }
117
+ }
118
+
119
+ _getCachedSource() {
120
+ if (this._cachedSource !== undefined) return this._cachedSource;
121
+ if (this._cachedBuffer && this._cachedSourceType !== undefined) {
122
+ return (this._cachedSource = this._cachedSourceType
123
+ ? this._cachedBuffer.toString("utf-8")
124
+ : this._cachedBuffer);
125
+ }
126
+ }
127
+
128
+ buffer() {
129
+ if (this._cachedBuffer !== undefined) return this._cachedBuffer;
130
+ if (this._cachedSource !== undefined) {
131
+ if (Buffer.isBuffer(this._cachedSource)) {
132
+ return (this._cachedBuffer = this._cachedSource);
133
+ }
134
+ return (this._cachedBuffer = Buffer.from(this._cachedSource, "utf-8"));
135
+ }
136
+ if (typeof this.original().buffer === "function") {
137
+ return (this._cachedBuffer = this.original().buffer());
138
+ }
139
+ const bufferOrString = this.source();
140
+ if (Buffer.isBuffer(bufferOrString)) {
141
+ return (this._cachedBuffer = bufferOrString);
142
+ }
143
+ return (this._cachedBuffer = Buffer.from(bufferOrString, "utf-8"));
144
+ }
145
+
146
+ size() {
147
+ if (this._cachedSize !== undefined) return this._cachedSize;
148
+ if (this._cachedBuffer !== undefined) {
149
+ return (this._cachedSize = this._cachedBuffer.length);
150
+ }
151
+ const source = this._getCachedSource();
152
+ if (source !== undefined) {
153
+ return (this._cachedSize = Buffer.byteLength(source));
154
+ }
155
+ return (this._cachedSize = this.original().size());
156
+ }
157
+
158
+ sourceAndMap(options) {
159
+ const key = options ? JSON.stringify(options) : "{}";
160
+ const cacheEntry = this._cachedMaps.get(key);
161
+ // Look for a cached map
162
+ if (cacheEntry !== undefined) {
163
+ // We have a cached map in some representation
164
+ const map = this._getMapFromCacheEntry(cacheEntry);
165
+ // Either get the cached source or compute it
166
+ return { source: this.source(), map };
167
+ }
168
+ // Look for a cached source
169
+ let source = this._getCachedSource();
170
+ // Compute the map
171
+ let map;
172
+ if (source !== undefined) {
173
+ map = this.original().map(options);
174
+ } else {
175
+ // Compute the source and map together.
176
+ const sourceAndMap = this.original().sourceAndMap(options);
177
+ source = sourceAndMap.source;
178
+ map = sourceAndMap.map;
179
+ this._cachedSource = source;
180
+ }
181
+ this._cachedMaps.set(key, {
182
+ map,
183
+ bufferedMap: undefined
184
+ });
185
+ return { source, map };
186
+ }
187
+
188
+ streamChunks(options, onChunk, onSource, onName) {
189
+ const key = options ? JSON.stringify(options) : "{}";
190
+ if (
191
+ this._cachedMaps.has(key) &&
192
+ (this._cachedBuffer !== undefined || this._cachedSource !== undefined)
193
+ ) {
194
+ const { source, map } = this.sourceAndMap(options);
195
+ if (map) {
196
+ return streamChunksOfSourceMap(
197
+ source,
198
+ map,
199
+ onChunk,
200
+ onSource,
201
+ onName,
202
+ !!(options && options.finalSource),
203
+ true
204
+ );
205
+ } else {
206
+ return streamChunksOfRawSource(
207
+ source,
208
+ onChunk,
209
+ onSource,
210
+ onName,
211
+ !!(options && options.finalSource)
212
+ );
213
+ }
214
+ }
215
+ const { result, source, map } = streamAndGetSourceAndMap(
216
+ this.original(),
217
+ options,
218
+ onChunk,
219
+ onSource,
220
+ onName
221
+ );
222
+ this._cachedSource = source;
223
+ this._cachedMaps.set(key, {
224
+ map,
225
+ bufferedMap: undefined
226
+ });
227
+ return result;
228
+ }
229
+
230
+ map(options) {
231
+ const key = options ? JSON.stringify(options) : "{}";
232
+ const cacheEntry = this._cachedMaps.get(key);
233
+ if (cacheEntry !== undefined) {
234
+ return this._getMapFromCacheEntry(cacheEntry);
235
+ }
236
+ const map = this.original().map(options);
237
+ this._cachedMaps.set(key, {
238
+ map,
239
+ bufferedMap: undefined
240
+ });
241
+ return map;
242
+ }
243
+
244
+ updateHash(hash) {
245
+ if (this._cachedHashUpdate !== undefined) {
246
+ for (const item of this._cachedHashUpdate) hash.update(item);
247
+ return;
248
+ }
249
+ const update = [];
250
+ let currentString = undefined;
251
+ const tracker = {
252
+ update: item => {
253
+ if (typeof item === "string" && item.length < 10240) {
254
+ if (currentString === undefined) {
255
+ currentString = item;
256
+ } else {
257
+ currentString += item;
258
+ if (currentString.length > 102400) {
259
+ update.push(Buffer.from(currentString));
260
+ currentString = undefined;
261
+ }
262
+ }
263
+ } else {
264
+ if (currentString !== undefined) {
265
+ update.push(Buffer.from(currentString));
266
+ currentString = undefined;
267
+ }
268
+ update.push(item);
269
+ }
270
+ }
271
+ };
272
+ this.original().updateHash(tracker);
273
+ if (currentString !== undefined) {
274
+ update.push(Buffer.from(currentString));
275
+ }
276
+ for (const item of update) hash.update(item);
277
+ this._cachedHashUpdate = update;
278
+ }
279
+ }
280
+
281
+ module.exports = CachedSource;
282
+
283
+
284
+ /***/ }),
285
+
286
+ /***/ 615:
287
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
288
+
289
+ "use strict";
290
+ /*
291
+ MIT License http://www.opensource.org/licenses/mit-license.php
292
+ Author Tobias Koppers @sokra
293
+ */
294
+
295
+
296
+ const Source = __nccwpck_require__(313);
297
+
298
+ class CompatSource extends Source {
299
+ static from(sourceLike) {
300
+ return sourceLike instanceof Source
301
+ ? sourceLike
302
+ : new CompatSource(sourceLike);
303
+ }
304
+
305
+ constructor(sourceLike) {
306
+ super();
307
+ this._sourceLike = sourceLike;
308
+ }
309
+
310
+ source() {
311
+ return this._sourceLike.source();
312
+ }
313
+
314
+ buffer() {
315
+ if (typeof this._sourceLike.buffer === "function") {
316
+ return this._sourceLike.buffer();
317
+ }
318
+ return super.buffer();
319
+ }
320
+
321
+ size() {
322
+ if (typeof this._sourceLike.size === "function") {
323
+ return this._sourceLike.size();
324
+ }
325
+ return super.size();
326
+ }
327
+
328
+ map(options) {
329
+ if (typeof this._sourceLike.map === "function") {
330
+ return this._sourceLike.map(options);
331
+ }
332
+ return super.map(options);
333
+ }
334
+
335
+ sourceAndMap(options) {
336
+ if (typeof this._sourceLike.sourceAndMap === "function") {
337
+ return this._sourceLike.sourceAndMap(options);
338
+ }
339
+ return super.sourceAndMap(options);
340
+ }
341
+
342
+ updateHash(hash) {
343
+ if (typeof this._sourceLike.updateHash === "function") {
344
+ return this._sourceLike.updateHash(hash);
345
+ }
346
+ if (typeof this._sourceLike.map === "function") {
347
+ throw new Error(
348
+ "A Source-like object with a 'map' method must also provide an 'updateHash' method"
349
+ );
350
+ }
351
+ hash.update(this.buffer());
352
+ }
353
+ }
354
+
355
+ module.exports = CompatSource;
356
+
357
+
358
+ /***/ }),
359
+
360
+ /***/ 634:
361
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
362
+
363
+ "use strict";
364
+ /*
365
+ MIT License http://www.opensource.org/licenses/mit-license.php
366
+ Author Tobias Koppers @sokra
367
+ */
368
+
369
+
370
+ const Source = __nccwpck_require__(313);
371
+ const RawSource = __nccwpck_require__(798);
372
+ const streamChunks = __nccwpck_require__(65);
373
+ const { getMap, getSourceAndMap } = __nccwpck_require__(180);
374
+
375
+ const stringsAsRawSources = new WeakSet();
376
+
377
+ class ConcatSource extends Source {
378
+ constructor() {
379
+ super();
380
+ this._children = [];
381
+ for (let i = 0; i < arguments.length; i++) {
382
+ const item = arguments[i];
383
+ if (item instanceof ConcatSource) {
384
+ for (const child of item._children) {
385
+ this._children.push(child);
386
+ }
387
+ } else {
388
+ this._children.push(item);
389
+ }
390
+ }
391
+ this._isOptimized = arguments.length === 0;
392
+ }
393
+
394
+ getChildren() {
395
+ if (!this._isOptimized) this._optimize();
396
+ return this._children;
397
+ }
398
+
399
+ add(item) {
400
+ if (item instanceof ConcatSource) {
401
+ for (const child of item._children) {
402
+ this._children.push(child);
403
+ }
404
+ } else {
405
+ this._children.push(item);
406
+ }
407
+ this._isOptimized = false;
408
+ }
409
+
410
+ addAllSkipOptimizing(items) {
411
+ for (const item of items) {
412
+ this._children.push(item);
413
+ }
414
+ }
415
+
416
+ buffer() {
417
+ if (!this._isOptimized) this._optimize();
418
+ const buffers = [];
419
+ for (const child of this._children) {
420
+ if (typeof child.buffer === "function") {
421
+ buffers.push(child.buffer());
422
+ } else {
423
+ const bufferOrString = child.source();
424
+ if (Buffer.isBuffer(bufferOrString)) {
425
+ buffers.push(bufferOrString);
426
+ } else {
427
+ // This will not happen
428
+ buffers.push(Buffer.from(bufferOrString, "utf-8"));
429
+ }
430
+ }
431
+ }
432
+ return Buffer.concat(buffers);
433
+ }
434
+
435
+ source() {
436
+ if (!this._isOptimized) this._optimize();
437
+ let source = "";
438
+ for (const child of this._children) {
439
+ source += child.source();
440
+ }
441
+ return source;
442
+ }
443
+
444
+ size() {
445
+ if (!this._isOptimized) this._optimize();
446
+ let size = 0;
447
+ for (const child of this._children) {
448
+ size += child.size();
449
+ }
450
+ return size;
451
+ }
452
+
453
+ map(options) {
454
+ return getMap(this, options);
455
+ }
456
+
457
+ sourceAndMap(options) {
458
+ return getSourceAndMap(this, options);
459
+ }
460
+
461
+ streamChunks(options, onChunk, onSource, onName) {
462
+ if (!this._isOptimized) this._optimize();
463
+ if (this._children.length === 1)
464
+ return this._children[0].streamChunks(options, onChunk, onSource, onName);
465
+ let currentLineOffset = 0;
466
+ let currentColumnOffset = 0;
467
+ let sourceMapping = new Map();
468
+ let nameMapping = new Map();
469
+ const finalSource = !!(options && options.finalSource);
470
+ let code = "";
471
+ let needToCloseMapping = false;
472
+ for (const item of this._children) {
473
+ const sourceIndexMapping = [];
474
+ const nameIndexMapping = [];
475
+ let lastMappingLine = 0;
476
+ const { generatedLine, generatedColumn, source } = streamChunks(
477
+ item,
478
+ options,
479
+ // eslint-disable-next-line no-loop-func
480
+ (
481
+ chunk,
482
+ generatedLine,
483
+ generatedColumn,
484
+ sourceIndex,
485
+ originalLine,
486
+ originalColumn,
487
+ nameIndex
488
+ ) => {
489
+ const line = generatedLine + currentLineOffset;
490
+ const column =
491
+ generatedLine === 1
492
+ ? generatedColumn + currentColumnOffset
493
+ : generatedColumn;
494
+ if (needToCloseMapping) {
495
+ if (generatedLine !== 1 || generatedColumn !== 0) {
496
+ onChunk(
497
+ undefined,
498
+ currentLineOffset + 1,
499
+ currentColumnOffset,
500
+ -1,
501
+ -1,
502
+ -1,
503
+ -1
504
+ );
505
+ }
506
+ needToCloseMapping = false;
507
+ }
508
+ const resultSourceIndex =
509
+ sourceIndex < 0 || sourceIndex >= sourceIndexMapping.length
510
+ ? -1
511
+ : sourceIndexMapping[sourceIndex];
512
+ const resultNameIndex =
513
+ nameIndex < 0 || nameIndex >= nameIndexMapping.length
514
+ ? -1
515
+ : nameIndexMapping[nameIndex];
516
+ lastMappingLine = resultSourceIndex < 0 ? 0 : generatedLine;
517
+ if (finalSource) {
518
+ if (chunk !== undefined) code += chunk;
519
+ if (resultSourceIndex >= 0) {
520
+ onChunk(
521
+ undefined,
522
+ line,
523
+ column,
524
+ resultSourceIndex,
525
+ originalLine,
526
+ originalColumn,
527
+ resultNameIndex
528
+ );
529
+ }
530
+ } else {
531
+ if (resultSourceIndex < 0) {
532
+ onChunk(chunk, line, column, -1, -1, -1, -1);
533
+ } else {
534
+ onChunk(
535
+ chunk,
536
+ line,
537
+ column,
538
+ resultSourceIndex,
539
+ originalLine,
540
+ originalColumn,
541
+ resultNameIndex
542
+ );
543
+ }
544
+ }
545
+ },
546
+ (i, source, sourceContent) => {
547
+ let globalIndex = sourceMapping.get(source);
548
+ if (globalIndex === undefined) {
549
+ sourceMapping.set(source, (globalIndex = sourceMapping.size));
550
+ onSource(globalIndex, source, sourceContent);
551
+ }
552
+ sourceIndexMapping[i] = globalIndex;
553
+ },
554
+ (i, name) => {
555
+ let globalIndex = nameMapping.get(name);
556
+ if (globalIndex === undefined) {
557
+ nameMapping.set(name, (globalIndex = nameMapping.size));
558
+ onName(globalIndex, name);
559
+ }
560
+ nameIndexMapping[i] = globalIndex;
561
+ }
562
+ );
563
+ if (source !== undefined) code += source;
564
+ if (needToCloseMapping) {
565
+ if (generatedLine !== 1 || generatedColumn !== 0) {
566
+ onChunk(
567
+ undefined,
568
+ currentLineOffset + 1,
569
+ currentColumnOffset,
570
+ -1,
571
+ -1,
572
+ -1,
573
+ -1
574
+ );
575
+ needToCloseMapping = false;
576
+ }
577
+ }
578
+ if (generatedLine > 1) {
579
+ currentColumnOffset = generatedColumn;
580
+ } else {
581
+ currentColumnOffset += generatedColumn;
582
+ }
583
+ needToCloseMapping =
584
+ needToCloseMapping ||
585
+ (finalSource && lastMappingLine === generatedLine);
586
+ currentLineOffset += generatedLine - 1;
587
+ }
588
+ return {
589
+ generatedLine: currentLineOffset + 1,
590
+ generatedColumn: currentColumnOffset,
591
+ source: finalSource ? code : undefined
592
+ };
593
+ }
594
+
595
+ updateHash(hash) {
596
+ if (!this._isOptimized) this._optimize();
597
+ hash.update("ConcatSource");
598
+ for (const item of this._children) {
599
+ item.updateHash(hash);
600
+ }
601
+ }
602
+
603
+ _optimize() {
604
+ const newChildren = [];
605
+ let currentString = undefined;
606
+ let currentRawSources = undefined;
607
+ const addStringToRawSources = string => {
608
+ if (currentRawSources === undefined) {
609
+ currentRawSources = string;
610
+ } else if (Array.isArray(currentRawSources)) {
611
+ currentRawSources.push(string);
612
+ } else {
613
+ currentRawSources = [
614
+ typeof currentRawSources === "string"
615
+ ? currentRawSources
616
+ : currentRawSources.source(),
617
+ string
618
+ ];
619
+ }
620
+ };
621
+ const addSourceToRawSources = source => {
622
+ if (currentRawSources === undefined) {
623
+ currentRawSources = source;
624
+ } else if (Array.isArray(currentRawSources)) {
625
+ currentRawSources.push(source.source());
626
+ } else {
627
+ currentRawSources = [
628
+ typeof currentRawSources === "string"
629
+ ? currentRawSources
630
+ : currentRawSources.source(),
631
+ source.source()
632
+ ];
633
+ }
634
+ };
635
+ const mergeRawSources = () => {
636
+ if (Array.isArray(currentRawSources)) {
637
+ const rawSource = new RawSource(currentRawSources.join(""));
638
+ stringsAsRawSources.add(rawSource);
639
+ newChildren.push(rawSource);
640
+ } else if (typeof currentRawSources === "string") {
641
+ const rawSource = new RawSource(currentRawSources);
642
+ stringsAsRawSources.add(rawSource);
643
+ newChildren.push(rawSource);
644
+ } else {
645
+ newChildren.push(currentRawSources);
646
+ }
647
+ };
648
+ for (const child of this._children) {
649
+ if (typeof child === "string") {
650
+ if (currentString === undefined) {
651
+ currentString = child;
652
+ } else {
653
+ currentString += child;
654
+ }
655
+ } else {
656
+ if (currentString !== undefined) {
657
+ addStringToRawSources(currentString);
658
+ currentString = undefined;
659
+ }
660
+ if (stringsAsRawSources.has(child)) {
661
+ addSourceToRawSources(child);
662
+ } else {
663
+ if (currentRawSources !== undefined) {
664
+ mergeRawSources();
665
+ currentRawSources = undefined;
666
+ }
667
+ newChildren.push(child);
668
+ }
669
+ }
670
+ }
671
+ if (currentString !== undefined) {
672
+ addStringToRawSources(currentString);
673
+ }
674
+ if (currentRawSources !== undefined) {
675
+ mergeRawSources();
676
+ }
677
+ this._children = newChildren;
678
+ this._isOptimized = true;
679
+ }
680
+ }
681
+
682
+ module.exports = ConcatSource;
683
+
684
+
685
+ /***/ }),
686
+
687
+ /***/ 118:
688
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
689
+
690
+ "use strict";
691
+ /*
692
+ MIT License http://www.opensource.org/licenses/mit-license.php
693
+ Author Tobias Koppers @sokra
694
+ */
695
+
696
+
697
+ const { getMap, getSourceAndMap } = __nccwpck_require__(180);
698
+ const splitIntoLines = __nccwpck_require__(79);
699
+ const getGeneratedSourceInfo = __nccwpck_require__(849);
700
+ const Source = __nccwpck_require__(313);
701
+ const splitIntoPotentialTokens = __nccwpck_require__(884);
702
+
703
+ class OriginalSource extends Source {
704
+ constructor(value, name) {
705
+ super();
706
+ const isBuffer = Buffer.isBuffer(value);
707
+ this._value = isBuffer ? undefined : value;
708
+ this._valueAsBuffer = isBuffer ? value : undefined;
709
+ this._name = name;
710
+ }
711
+
712
+ getName() {
713
+ return this._name;
714
+ }
715
+
716
+ source() {
717
+ if (this._value === undefined) {
718
+ this._value = this._valueAsBuffer.toString("utf-8");
719
+ }
720
+ return this._value;
721
+ }
722
+
723
+ buffer() {
724
+ if (this._valueAsBuffer === undefined) {
725
+ this._valueAsBuffer = Buffer.from(this._value, "utf-8");
726
+ }
727
+ return this._valueAsBuffer;
728
+ }
729
+
730
+ map(options) {
731
+ return getMap(this, options);
732
+ }
733
+
734
+ sourceAndMap(options) {
735
+ return getSourceAndMap(this, options);
736
+ }
737
+
738
+ /**
739
+ * @param {object} options options
740
+ * @param {function(string, number, number, number, number, number, number): void} onChunk called for each chunk of code
741
+ * @param {function(number, string, string)} onSource called for each source
742
+ * @param {function(number, string)} onName called for each name
743
+ * @returns {void}
744
+ */
745
+ streamChunks(options, onChunk, onSource, onName) {
746
+ if (this._value === undefined) {
747
+ this._value = this._valueAsBuffer.toString("utf-8");
748
+ }
749
+ onSource(0, this._name, this._value);
750
+ const finalSource = !!(options && options.finalSource);
751
+ if (!options || options.columns !== false) {
752
+ // With column info we need to read all lines and split them
753
+ const matches = splitIntoPotentialTokens(this._value);
754
+ let line = 1;
755
+ let column = 0;
756
+ if (matches !== null) {
757
+ for (const match of matches) {
758
+ const isEndOfLine = match.endsWith("\n");
759
+ if (isEndOfLine && match.length === 1) {
760
+ if (!finalSource) onChunk(match, line, column, -1, -1, -1, -1);
761
+ } else {
762
+ const chunk = finalSource ? undefined : match;
763
+ onChunk(chunk, line, column, 0, line, column, -1);
764
+ }
765
+ if (isEndOfLine) {
766
+ line++;
767
+ column = 0;
768
+ } else {
769
+ column += match.length;
770
+ }
771
+ }
772
+ }
773
+ return {
774
+ generatedLine: line,
775
+ generatedColumn: column,
776
+ source: finalSource ? this._value : undefined
777
+ };
778
+ } else if (finalSource) {
779
+ // Without column info and with final source we only
780
+ // need meta info to generate mapping
781
+ const result = getGeneratedSourceInfo(this._value);
782
+ const { generatedLine, generatedColumn } = result;
783
+ if (generatedColumn === 0) {
784
+ for (let line = 1; line < generatedLine; line++)
785
+ onChunk(undefined, line, 0, 0, line, 0, -1);
786
+ } else {
787
+ for (let line = 1; line <= generatedLine; line++)
788
+ onChunk(undefined, line, 0, 0, line, 0, -1);
789
+ }
790
+ return result;
791
+ } else {
792
+ // Without column info, but also without final source
793
+ // we need to split source by lines
794
+ let line = 1;
795
+ const matches = splitIntoLines(this._value);
796
+ let match;
797
+ for (match of matches) {
798
+ onChunk(finalSource ? undefined : match, line, 0, 0, line, 0, -1);
799
+ line++;
800
+ }
801
+ return matches.length === 0 || match.endsWith("\n")
802
+ ? {
803
+ generatedLine: matches.length + 1,
804
+ generatedColumn: 0,
805
+ source: finalSource ? this._value : undefined
806
+ }
807
+ : {
808
+ generatedLine: matches.length,
809
+ generatedColumn: match.length,
810
+ source: finalSource ? this._value : undefined
811
+ };
812
+ }
813
+ }
814
+
815
+ updateHash(hash) {
816
+ if (this._valueAsBuffer === undefined) {
817
+ this._valueAsBuffer = Buffer.from(this._value, "utf-8");
818
+ }
819
+ hash.update("OriginalSource");
820
+ hash.update(this._valueAsBuffer);
821
+ hash.update(this._name || "");
822
+ }
823
+ }
824
+
825
+ module.exports = OriginalSource;
826
+
827
+
828
+ /***/ }),
829
+
830
+ /***/ 234:
831
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
832
+
833
+ "use strict";
834
+ /*
835
+ MIT License http://www.opensource.org/licenses/mit-license.php
836
+ Author Tobias Koppers @sokra
837
+ */
838
+
839
+
840
+ const Source = __nccwpck_require__(313);
841
+ const RawSource = __nccwpck_require__(798);
842
+ const streamChunks = __nccwpck_require__(65);
843
+ const { getMap, getSourceAndMap } = __nccwpck_require__(180);
844
+
845
+ const REPLACE_REGEX = /\n(?=.|\s)/g;
846
+
847
+ class PrefixSource extends Source {
848
+ constructor(prefix, source) {
849
+ super();
850
+ this._source =
851
+ typeof source === "string" || Buffer.isBuffer(source)
852
+ ? new RawSource(source, true)
853
+ : source;
854
+ this._prefix = prefix;
855
+ }
856
+
857
+ getPrefix() {
858
+ return this._prefix;
859
+ }
860
+
861
+ original() {
862
+ return this._source;
863
+ }
864
+
865
+ source() {
866
+ const node = this._source.source();
867
+ const prefix = this._prefix;
868
+ return prefix + node.replace(REPLACE_REGEX, "\n" + prefix);
869
+ }
870
+
871
+ // TODO efficient buffer() implementation
872
+
873
+ map(options) {
874
+ return getMap(this, options);
875
+ }
876
+
877
+ sourceAndMap(options) {
878
+ return getSourceAndMap(this, options);
879
+ }
880
+
881
+ streamChunks(options, onChunk, onSource, onName) {
882
+ const prefix = this._prefix;
883
+ const prefixOffset = prefix.length;
884
+ const linesOnly = !!(options && options.columns === false);
885
+ const { generatedLine, generatedColumn, source } = streamChunks(
886
+ this._source,
887
+ options,
888
+ (
889
+ chunk,
890
+ generatedLine,
891
+ generatedColumn,
892
+ sourceIndex,
893
+ originalLine,
894
+ originalColumn,
895
+ nameIndex
896
+ ) => {
897
+ if (generatedColumn !== 0) {
898
+ // In the middle of the line, we just adject the column
899
+ generatedColumn += prefixOffset;
900
+ } else if (chunk !== undefined) {
901
+ // At the start of the line, when we have source content
902
+ // add the prefix as generated mapping
903
+ // (in lines only mode we just add it to the original mapping
904
+ // for performance reasons)
905
+ if (linesOnly || sourceIndex < 0) {
906
+ chunk = prefix + chunk;
907
+ } else if (prefixOffset > 0) {
908
+ onChunk(prefix, generatedLine, generatedColumn, -1, -1, -1, -1);
909
+ generatedColumn += prefixOffset;
910
+ }
911
+ } else if (!linesOnly) {
912
+ // Without source content, we only need to adject the column info
913
+ // expect in lines only mode where prefix is added to original mapping
914
+ generatedColumn += prefixOffset;
915
+ }
916
+ onChunk(
917
+ chunk,
918
+ generatedLine,
919
+ generatedColumn,
920
+ sourceIndex,
921
+ originalLine,
922
+ originalColumn,
923
+ nameIndex
924
+ );
925
+ },
926
+ onSource,
927
+ onName
928
+ );
929
+ return {
930
+ generatedLine,
931
+ generatedColumn:
932
+ generatedColumn === 0 ? 0 : prefixOffset + generatedColumn,
933
+ source:
934
+ source !== undefined
935
+ ? prefix + source.replace(REPLACE_REGEX, "\n" + prefix)
936
+ : undefined
937
+ };
938
+ }
939
+
940
+ updateHash(hash) {
941
+ hash.update("PrefixSource");
942
+ this._source.updateHash(hash);
943
+ hash.update(this._prefix);
944
+ }
945
+ }
946
+
947
+ module.exports = PrefixSource;
948
+
949
+
950
+ /***/ }),
951
+
952
+ /***/ 798:
953
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
954
+
955
+ "use strict";
956
+ /*
957
+ MIT License http://www.opensource.org/licenses/mit-license.php
958
+ Author Tobias Koppers @sokra
959
+ */
960
+
961
+
962
+
963
+ const streamChunksOfRawSource = __nccwpck_require__(264);
964
+ const Source = __nccwpck_require__(313);
965
+
966
+ class RawSource extends Source {
967
+ constructor(value, convertToString = false) {
968
+ super();
969
+ const isBuffer = Buffer.isBuffer(value);
970
+ if (!isBuffer && typeof value !== "string") {
971
+ throw new TypeError("argument 'value' must be either string of Buffer");
972
+ }
973
+ this._valueIsBuffer = !convertToString && isBuffer;
974
+ this._value = convertToString && isBuffer ? undefined : value;
975
+ this._valueAsBuffer = isBuffer ? value : undefined;
976
+ this._valueAsString = isBuffer ? undefined : value;
977
+ }
978
+
979
+ isBuffer() {
980
+ return this._valueIsBuffer;
981
+ }
982
+
983
+ source() {
984
+ if (this._value === undefined) {
985
+ this._value = this._valueAsBuffer.toString("utf-8");
986
+ }
987
+ return this._value;
988
+ }
989
+
990
+ buffer() {
991
+ if (this._valueAsBuffer === undefined) {
992
+ this._valueAsBuffer = Buffer.from(this._value, "utf-8");
993
+ }
994
+ return this._valueAsBuffer;
995
+ }
996
+
997
+ map(options) {
998
+ return null;
999
+ }
1000
+
1001
+ /**
1002
+ * @param {object} options options
1003
+ * @param {function(string, number, number, number, number, number, number): void} onChunk called for each chunk of code
1004
+ * @param {function(number, string, string)} onSource called for each source
1005
+ * @param {function(number, string)} onName called for each name
1006
+ * @returns {void}
1007
+ */
1008
+ streamChunks(options, onChunk, onSource, onName) {
1009
+ if (this._value === undefined) {
1010
+ this._value = Buffer.from(this._valueAsBuffer, "utf-8");
1011
+ }
1012
+ if (this._valueAsString === undefined) {
1013
+ this._valueAsString =
1014
+ typeof this._value === "string"
1015
+ ? this._value
1016
+ : this._value.toString("utf-8");
1017
+ }
1018
+ return streamChunksOfRawSource(
1019
+ this._valueAsString,
1020
+ onChunk,
1021
+ onSource,
1022
+ onName,
1023
+ !!(options && options.finalSource)
1024
+ );
1025
+ }
1026
+
1027
+ updateHash(hash) {
1028
+ if (this._valueAsBuffer === undefined) {
1029
+ this._valueAsBuffer = Buffer.from(this._value, "utf-8");
1030
+ }
1031
+ hash.update("RawSource");
1032
+ hash.update(this._valueAsBuffer);
1033
+ }
1034
+ }
1035
+
1036
+ module.exports = RawSource;
1037
+
1038
+
1039
+ /***/ }),
1040
+
1041
+ /***/ 395:
1042
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1043
+
1044
+ "use strict";
1045
+ /*
1046
+ MIT License http://www.opensource.org/licenses/mit-license.php
1047
+ Author Tobias Koppers @sokra
1048
+ */
1049
+
1050
+
1051
+ const { getMap, getSourceAndMap } = __nccwpck_require__(180);
1052
+ const streamChunks = __nccwpck_require__(65);
1053
+ const Source = __nccwpck_require__(313);
1054
+ const splitIntoLines = __nccwpck_require__(79);
1055
+
1056
+ // since v8 7.0, Array.prototype.sort is stable
1057
+ const hasStableSort =
1058
+ typeof process === "object" &&
1059
+ process.versions &&
1060
+ typeof process.versions.v8 === "string" &&
1061
+ !/^[0-6]\./.test(process.versions.v8);
1062
+
1063
+ // This is larger than max string length
1064
+ const MAX_SOURCE_POSITION = 0x20000000;
1065
+
1066
+ class Replacement {
1067
+ constructor(start, end, content, name) {
1068
+ this.start = start;
1069
+ this.end = end;
1070
+ this.content = content;
1071
+ this.name = name;
1072
+ if (!hasStableSort) {
1073
+ this.index = -1;
1074
+ }
1075
+ }
1076
+ }
1077
+
1078
+ class ReplaceSource extends Source {
1079
+ constructor(source, name) {
1080
+ super();
1081
+ this._source = source;
1082
+ this._name = name;
1083
+ /** @type {Replacement[]} */
1084
+ this._replacements = [];
1085
+ this._isSorted = true;
1086
+ }
1087
+
1088
+ getName() {
1089
+ return this._name;
1090
+ }
1091
+
1092
+ getReplacements() {
1093
+ this._sortReplacements();
1094
+ return this._replacements;
1095
+ }
1096
+
1097
+ replace(start, end, newValue, name) {
1098
+ if (typeof newValue !== "string")
1099
+ throw new Error(
1100
+ "insertion must be a string, but is a " + typeof newValue
1101
+ );
1102
+ this._replacements.push(new Replacement(start, end, newValue, name));
1103
+ this._isSorted = false;
1104
+ }
1105
+
1106
+ insert(pos, newValue, name) {
1107
+ if (typeof newValue !== "string")
1108
+ throw new Error(
1109
+ "insertion must be a string, but is a " +
1110
+ typeof newValue +
1111
+ ": " +
1112
+ newValue
1113
+ );
1114
+ this._replacements.push(new Replacement(pos, pos - 1, newValue, name));
1115
+ this._isSorted = false;
1116
+ }
1117
+
1118
+ source() {
1119
+ if (this._replacements.length === 0) {
1120
+ return this._source.source();
1121
+ }
1122
+ let current = this._source.source();
1123
+ let pos = 0;
1124
+ const result = [];
1125
+
1126
+ this._sortReplacements();
1127
+ for (const replacement of this._replacements) {
1128
+ const start = Math.floor(replacement.start);
1129
+ const end = Math.floor(replacement.end + 1);
1130
+ if (pos < start) {
1131
+ const offset = start - pos;
1132
+ result.push(current.slice(0, offset));
1133
+ current = current.slice(offset);
1134
+ pos = start;
1135
+ }
1136
+ result.push(replacement.content);
1137
+ if (pos < end) {
1138
+ const offset = end - pos;
1139
+ current = current.slice(offset);
1140
+ pos = end;
1141
+ }
1142
+ }
1143
+ result.push(current);
1144
+ return result.join("");
1145
+ }
1146
+
1147
+ map(options) {
1148
+ if (this._replacements.length === 0) {
1149
+ return this._source.map(options);
1150
+ }
1151
+ return getMap(this, options);
1152
+ }
1153
+
1154
+ sourceAndMap(options) {
1155
+ if (this._replacements.length === 0) {
1156
+ return this._source.sourceAndMap(options);
1157
+ }
1158
+ return getSourceAndMap(this, options);
1159
+ }
1160
+
1161
+ original() {
1162
+ return this._source;
1163
+ }
1164
+
1165
+ _sortReplacements() {
1166
+ if (this._isSorted) return;
1167
+ if (hasStableSort) {
1168
+ this._replacements.sort(function (a, b) {
1169
+ const diff1 = a.start - b.start;
1170
+ if (diff1 !== 0) return diff1;
1171
+ const diff2 = a.end - b.end;
1172
+ if (diff2 !== 0) return diff2;
1173
+ return 0;
1174
+ });
1175
+ } else {
1176
+ this._replacements.forEach((repl, i) => (repl.index = i));
1177
+ this._replacements.sort(function (a, b) {
1178
+ const diff1 = a.start - b.start;
1179
+ if (diff1 !== 0) return diff1;
1180
+ const diff2 = a.end - b.end;
1181
+ if (diff2 !== 0) return diff2;
1182
+ return a.index - b.index;
1183
+ });
1184
+ }
1185
+ this._isSorted = true;
1186
+ }
1187
+
1188
+ streamChunks(options, onChunk, onSource, onName) {
1189
+ this._sortReplacements();
1190
+ const repls = this._replacements;
1191
+ let pos = 0;
1192
+ let i = 0;
1193
+ let replacmentEnd = -1;
1194
+ let nextReplacement =
1195
+ i < repls.length ? Math.floor(repls[i].start) : MAX_SOURCE_POSITION;
1196
+ let generatedLineOffset = 0;
1197
+ let generatedColumnOffset = 0;
1198
+ let generatedColumnOffsetLine = 0;
1199
+ const sourceContents = [];
1200
+ const nameMapping = new Map();
1201
+ const nameIndexMapping = [];
1202
+ const checkOriginalContent = (sourceIndex, line, column, expectedChunk) => {
1203
+ let content =
1204
+ sourceIndex < sourceContents.length
1205
+ ? sourceContents[sourceIndex]
1206
+ : undefined;
1207
+ if (content === undefined) return false;
1208
+ if (typeof content === "string") {
1209
+ content = splitIntoLines(content);
1210
+ sourceContents[sourceIndex] = content;
1211
+ }
1212
+ const contentLine = line <= content.length ? content[line - 1] : null;
1213
+ if (contentLine === null) return false;
1214
+ return (
1215
+ contentLine.slice(column, column + expectedChunk.length) ===
1216
+ expectedChunk
1217
+ );
1218
+ };
1219
+ let { generatedLine, generatedColumn } = streamChunks(
1220
+ this._source,
1221
+ Object.assign({}, options, { finalSource: false }),
1222
+ (
1223
+ chunk,
1224
+ generatedLine,
1225
+ generatedColumn,
1226
+ sourceIndex,
1227
+ originalLine,
1228
+ originalColumn,
1229
+ nameIndex
1230
+ ) => {
1231
+ let chunkPos = 0;
1232
+ let endPos = pos + chunk.length;
1233
+
1234
+ // Skip over when it has been replaced
1235
+ if (replacmentEnd > pos) {
1236
+ // Skip over the whole chunk
1237
+ if (replacmentEnd >= endPos) {
1238
+ const line = generatedLine + generatedLineOffset;
1239
+ if (chunk.endsWith("\n")) {
1240
+ generatedLineOffset--;
1241
+ if (generatedColumnOffsetLine === line) {
1242
+ // undo exiting corrections form the current line
1243
+ generatedColumnOffset += generatedColumn;
1244
+ }
1245
+ } else if (generatedColumnOffsetLine === line) {
1246
+ generatedColumnOffset -= chunk.length;
1247
+ } else {
1248
+ generatedColumnOffset = -chunk.length;
1249
+ generatedColumnOffsetLine = line;
1250
+ }
1251
+ pos = endPos;
1252
+ return;
1253
+ }
1254
+
1255
+ // Partially skip over chunk
1256
+ chunkPos = replacmentEnd - pos;
1257
+ if (
1258
+ checkOriginalContent(
1259
+ sourceIndex,
1260
+ originalLine,
1261
+ originalColumn,
1262
+ chunk.slice(0, chunkPos)
1263
+ )
1264
+ ) {
1265
+ originalColumn += chunkPos;
1266
+ }
1267
+ pos += chunkPos;
1268
+ const line = generatedLine + generatedLineOffset;
1269
+ if (generatedColumnOffsetLine === line) {
1270
+ generatedColumnOffset -= chunkPos;
1271
+ } else {
1272
+ generatedColumnOffset = -chunkPos;
1273
+ generatedColumnOffsetLine = line;
1274
+ }
1275
+ generatedColumn += chunkPos;
1276
+ }
1277
+
1278
+ // Is a replacement in the chunk?
1279
+ if (nextReplacement < endPos) {
1280
+ do {
1281
+ let line = generatedLine + generatedLineOffset;
1282
+ if (nextReplacement > pos) {
1283
+ // Emit chunk until replacement
1284
+ const offset = nextReplacement - pos;
1285
+ const chunkSlice = chunk.slice(chunkPos, chunkPos + offset);
1286
+ onChunk(
1287
+ chunkSlice,
1288
+ line,
1289
+ generatedColumn +
1290
+ (line === generatedColumnOffsetLine
1291
+ ? generatedColumnOffset
1292
+ : 0),
1293
+ sourceIndex,
1294
+ originalLine,
1295
+ originalColumn,
1296
+ nameIndex < 0 || nameIndex >= nameIndexMapping.length
1297
+ ? -1
1298
+ : nameIndexMapping[nameIndex]
1299
+ );
1300
+ generatedColumn += offset;
1301
+ chunkPos += offset;
1302
+ pos = nextReplacement;
1303
+ if (
1304
+ checkOriginalContent(
1305
+ sourceIndex,
1306
+ originalLine,
1307
+ originalColumn,
1308
+ chunkSlice
1309
+ )
1310
+ ) {
1311
+ originalColumn += chunkSlice.length;
1312
+ }
1313
+ }
1314
+
1315
+ // Insert replacement content splitted into chunks by lines
1316
+ const { content, name } = repls[i];
1317
+ let matches = splitIntoLines(content);
1318
+ let replacementNameIndex = nameIndex;
1319
+ if (sourceIndex >= 0 && name) {
1320
+ let globalIndex = nameMapping.get(name);
1321
+ if (globalIndex === undefined) {
1322
+ globalIndex = nameMapping.size;
1323
+ nameMapping.set(name, globalIndex);
1324
+ onName(globalIndex, name);
1325
+ }
1326
+ replacementNameIndex = globalIndex;
1327
+ }
1328
+ for (let m = 0; m < matches.length; m++) {
1329
+ const contentLine = matches[m];
1330
+ onChunk(
1331
+ contentLine,
1332
+ line,
1333
+ generatedColumn +
1334
+ (line === generatedColumnOffsetLine
1335
+ ? generatedColumnOffset
1336
+ : 0),
1337
+ sourceIndex,
1338
+ originalLine,
1339
+ originalColumn,
1340
+ replacementNameIndex
1341
+ );
1342
+
1343
+ // Only the first chunk has name assigned
1344
+ replacementNameIndex = -1;
1345
+
1346
+ if (m === matches.length - 1 && !contentLine.endsWith("\n")) {
1347
+ if (generatedColumnOffsetLine === line) {
1348
+ generatedColumnOffset += contentLine.length;
1349
+ } else {
1350
+ generatedColumnOffset = contentLine.length;
1351
+ generatedColumnOffsetLine = line;
1352
+ }
1353
+ } else {
1354
+ generatedLineOffset++;
1355
+ line++;
1356
+ generatedColumnOffset = -generatedColumn;
1357
+ generatedColumnOffsetLine = line;
1358
+ }
1359
+ }
1360
+
1361
+ // Remove replaced content by settings this variable
1362
+ replacmentEnd = Math.max(
1363
+ replacmentEnd,
1364
+ Math.floor(repls[i].end + 1)
1365
+ );
1366
+
1367
+ // Move to next replacment
1368
+ i++;
1369
+ nextReplacement =
1370
+ i < repls.length
1371
+ ? Math.floor(repls[i].start)
1372
+ : MAX_SOURCE_POSITION;
1373
+
1374
+ // Skip over when it has been replaced
1375
+ const offset = chunk.length - endPos + replacmentEnd - chunkPos;
1376
+ if (offset > 0) {
1377
+ // Skip over whole chunk
1378
+ if (replacmentEnd >= endPos) {
1379
+ let line = generatedLine + generatedLineOffset;
1380
+ if (chunk.endsWith("\n")) {
1381
+ generatedLineOffset--;
1382
+ if (generatedColumnOffsetLine === line) {
1383
+ // undo exiting corrections form the current line
1384
+ generatedColumnOffset += generatedColumn;
1385
+ }
1386
+ } else if (generatedColumnOffsetLine === line) {
1387
+ generatedColumnOffset -= chunk.length - chunkPos;
1388
+ } else {
1389
+ generatedColumnOffset = chunkPos - chunk.length;
1390
+ generatedColumnOffsetLine = line;
1391
+ }
1392
+ pos = endPos;
1393
+ return;
1394
+ }
1395
+
1396
+ // Partially skip over chunk
1397
+ const line = generatedLine + generatedLineOffset;
1398
+ if (
1399
+ checkOriginalContent(
1400
+ sourceIndex,
1401
+ originalLine,
1402
+ originalColumn,
1403
+ chunk.slice(chunkPos, chunkPos + offset)
1404
+ )
1405
+ ) {
1406
+ originalColumn += offset;
1407
+ }
1408
+ chunkPos += offset;
1409
+ pos += offset;
1410
+ if (generatedColumnOffsetLine === line) {
1411
+ generatedColumnOffset -= offset;
1412
+ } else {
1413
+ generatedColumnOffset = -offset;
1414
+ generatedColumnOffsetLine = line;
1415
+ }
1416
+ generatedColumn += offset;
1417
+ }
1418
+ } while (nextReplacement < endPos);
1419
+ }
1420
+
1421
+ // Emit remaining chunk
1422
+ if (chunkPos < chunk.length) {
1423
+ const chunkSlice = chunkPos === 0 ? chunk : chunk.slice(chunkPos);
1424
+ const line = generatedLine + generatedLineOffset;
1425
+ onChunk(
1426
+ chunkSlice,
1427
+ line,
1428
+ generatedColumn +
1429
+ (line === generatedColumnOffsetLine ? generatedColumnOffset : 0),
1430
+ sourceIndex,
1431
+ originalLine,
1432
+ originalColumn,
1433
+ nameIndex < 0 ? -1 : nameIndexMapping[nameIndex]
1434
+ );
1435
+ }
1436
+ pos = endPos;
1437
+ },
1438
+ (sourceIndex, source, sourceContent) => {
1439
+ while (sourceContents.length < sourceIndex)
1440
+ sourceContents.push(undefined);
1441
+ sourceContents[sourceIndex] = sourceContent;
1442
+ onSource(sourceIndex, source, sourceContent);
1443
+ },
1444
+ (nameIndex, name) => {
1445
+ let globalIndex = nameMapping.get(name);
1446
+ if (globalIndex === undefined) {
1447
+ globalIndex = nameMapping.size;
1448
+ nameMapping.set(name, globalIndex);
1449
+ onName(globalIndex, name);
1450
+ }
1451
+ nameIndexMapping[nameIndex] = globalIndex;
1452
+ }
1453
+ );
1454
+
1455
+ // Handle remaining replacements
1456
+ let remainer = "";
1457
+ for (; i < repls.length; i++) {
1458
+ remainer += repls[i].content;
1459
+ }
1460
+
1461
+ // Insert remaining replacements content splitted into chunks by lines
1462
+ let line = generatedLine + generatedLineOffset;
1463
+ let matches = splitIntoLines(remainer);
1464
+ for (let m = 0; m < matches.length; m++) {
1465
+ const contentLine = matches[m];
1466
+ onChunk(
1467
+ contentLine,
1468
+ line,
1469
+ generatedColumn +
1470
+ (line === generatedColumnOffsetLine ? generatedColumnOffset : 0),
1471
+ -1,
1472
+ -1,
1473
+ -1,
1474
+ -1
1475
+ );
1476
+
1477
+ if (m === matches.length - 1 && !contentLine.endsWith("\n")) {
1478
+ if (generatedColumnOffsetLine === line) {
1479
+ generatedColumnOffset += contentLine.length;
1480
+ } else {
1481
+ generatedColumnOffset = contentLine.length;
1482
+ generatedColumnOffsetLine = line;
1483
+ }
1484
+ } else {
1485
+ generatedLineOffset++;
1486
+ line++;
1487
+ generatedColumnOffset = -generatedColumn;
1488
+ generatedColumnOffsetLine = line;
1489
+ }
1490
+ }
1491
+
1492
+ return {
1493
+ generatedLine: line,
1494
+ generatedColumn:
1495
+ generatedColumn +
1496
+ (line === generatedColumnOffsetLine ? generatedColumnOffset : 0)
1497
+ };
1498
+ }
1499
+
1500
+ updateHash(hash) {
1501
+ this._sortReplacements();
1502
+ hash.update("ReplaceSource");
1503
+ this._source.updateHash(hash);
1504
+ hash.update(this._name || "");
1505
+ for (const repl of this._replacements) {
1506
+ hash.update(`${repl.start}${repl.end}${repl.content}${repl.name}`);
1507
+ }
1508
+ }
1509
+ }
1510
+
1511
+ module.exports = ReplaceSource;
1512
+
1513
+
1514
+ /***/ }),
1515
+
1516
+ /***/ 928:
1517
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1518
+
1519
+ "use strict";
1520
+ /*
1521
+ MIT License http://www.opensource.org/licenses/mit-license.php
1522
+ Author Tobias Koppers @sokra
1523
+ */
1524
+
1525
+
1526
+ const Source = __nccwpck_require__(313);
1527
+
1528
+ class SizeOnlySource extends Source {
1529
+ constructor(size) {
1530
+ super();
1531
+ this._size = size;
1532
+ }
1533
+
1534
+ _error() {
1535
+ return new Error(
1536
+ "Content and Map of this Source is not available (only size() is supported)"
1537
+ );
1538
+ }
1539
+
1540
+ size() {
1541
+ return this._size;
1542
+ }
1543
+
1544
+ source() {
1545
+ throw this._error();
1546
+ }
1547
+
1548
+ buffer() {
1549
+ throw this._error();
1550
+ }
1551
+
1552
+ map(options) {
1553
+ throw this._error();
1554
+ }
1555
+
1556
+ updateHash() {
1557
+ throw this._error();
1558
+ }
1559
+ }
1560
+
1561
+ module.exports = SizeOnlySource;
1562
+
1563
+
1564
+ /***/ }),
1565
+
1566
+ /***/ 313:
1567
+ /***/ ((module) => {
1568
+
1569
+ "use strict";
1570
+ /*
1571
+ MIT License http://www.opensource.org/licenses/mit-license.php
1572
+ Author Tobias Koppers @sokra
1573
+ */
1574
+
1575
+
1576
+ class Source {
1577
+ source() {
1578
+ throw new Error("Abstract");
1579
+ }
1580
+
1581
+ buffer() {
1582
+ const source = this.source();
1583
+ if (Buffer.isBuffer(source)) return source;
1584
+ return Buffer.from(source, "utf-8");
1585
+ }
1586
+
1587
+ size() {
1588
+ return this.buffer().length;
1589
+ }
1590
+
1591
+ map(options) {
1592
+ return null;
1593
+ }
1594
+
1595
+ sourceAndMap(options) {
1596
+ return {
1597
+ source: this.source(),
1598
+ map: this.map(options)
1599
+ };
1600
+ }
1601
+
1602
+ updateHash(hash) {
1603
+ throw new Error("Abstract");
1604
+ }
1605
+ }
1606
+
1607
+ module.exports = Source;
1608
+
1609
+
1610
+ /***/ }),
1611
+
1612
+ /***/ 221:
1613
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1614
+
1615
+ "use strict";
1616
+ /*
1617
+ MIT License http://www.opensource.org/licenses/mit-license.php
1618
+ Author Tobias Koppers @sokra
1619
+ */
1620
+
1621
+
1622
+ const Source = __nccwpck_require__(313);
1623
+ const streamChunksOfSourceMap = __nccwpck_require__(280);
1624
+ const streamChunksOfCombinedSourceMap = __nccwpck_require__(47);
1625
+ const { getMap, getSourceAndMap } = __nccwpck_require__(180);
1626
+
1627
+ class SourceMapSource extends Source {
1628
+ constructor(
1629
+ value,
1630
+ name,
1631
+ sourceMap,
1632
+ originalSource,
1633
+ innerSourceMap,
1634
+ removeOriginalSource
1635
+ ) {
1636
+ super();
1637
+ const valueIsBuffer = Buffer.isBuffer(value);
1638
+ this._valueAsString = valueIsBuffer ? undefined : value;
1639
+ this._valueAsBuffer = valueIsBuffer ? value : undefined;
1640
+
1641
+ this._name = name;
1642
+
1643
+ this._hasSourceMap = !!sourceMap;
1644
+ const sourceMapIsBuffer = Buffer.isBuffer(sourceMap);
1645
+ const sourceMapIsString = typeof sourceMap === "string";
1646
+ this._sourceMapAsObject =
1647
+ sourceMapIsBuffer || sourceMapIsString ? undefined : sourceMap;
1648
+ this._sourceMapAsString = sourceMapIsString ? sourceMap : undefined;
1649
+ this._sourceMapAsBuffer = sourceMapIsBuffer ? sourceMap : undefined;
1650
+
1651
+ this._hasOriginalSource = !!originalSource;
1652
+ const originalSourceIsBuffer = Buffer.isBuffer(originalSource);
1653
+ this._originalSourceAsString = originalSourceIsBuffer
1654
+ ? undefined
1655
+ : originalSource;
1656
+ this._originalSourceAsBuffer = originalSourceIsBuffer
1657
+ ? originalSource
1658
+ : undefined;
1659
+
1660
+ this._hasInnerSourceMap = !!innerSourceMap;
1661
+ const innerSourceMapIsBuffer = Buffer.isBuffer(innerSourceMap);
1662
+ const innerSourceMapIsString = typeof innerSourceMap === "string";
1663
+ this._innerSourceMapAsObject =
1664
+ innerSourceMapIsBuffer || innerSourceMapIsString
1665
+ ? undefined
1666
+ : innerSourceMap;
1667
+ this._innerSourceMapAsString = innerSourceMapIsString
1668
+ ? innerSourceMap
1669
+ : undefined;
1670
+ this._innerSourceMapAsBuffer = innerSourceMapIsBuffer
1671
+ ? innerSourceMap
1672
+ : undefined;
1673
+
1674
+ this._removeOriginalSource = removeOriginalSource;
1675
+ }
1676
+
1677
+ _ensureValueBuffer() {
1678
+ if (this._valueAsBuffer === undefined) {
1679
+ this._valueAsBuffer = Buffer.from(this._valueAsString, "utf-8");
1680
+ }
1681
+ }
1682
+
1683
+ _ensureValueString() {
1684
+ if (this._valueAsString === undefined) {
1685
+ this._valueAsString = this._valueAsBuffer.toString("utf-8");
1686
+ }
1687
+ }
1688
+
1689
+ _ensureOriginalSourceBuffer() {
1690
+ if (this._originalSourceAsBuffer === undefined && this._hasOriginalSource) {
1691
+ this._originalSourceAsBuffer = Buffer.from(
1692
+ this._originalSourceAsString,
1693
+ "utf-8"
1694
+ );
1695
+ }
1696
+ }
1697
+
1698
+ _ensureOriginalSourceString() {
1699
+ if (this._originalSourceAsString === undefined && this._hasOriginalSource) {
1700
+ this._originalSourceAsString = this._originalSourceAsBuffer.toString(
1701
+ "utf-8"
1702
+ );
1703
+ }
1704
+ }
1705
+
1706
+ _ensureInnerSourceMapObject() {
1707
+ if (this._innerSourceMapAsObject === undefined && this._hasInnerSourceMap) {
1708
+ this._ensureInnerSourceMapString();
1709
+ this._innerSourceMapAsObject = JSON.parse(this._innerSourceMapAsString);
1710
+ }
1711
+ }
1712
+
1713
+ _ensureInnerSourceMapBuffer() {
1714
+ if (this._innerSourceMapAsBuffer === undefined && this._hasInnerSourceMap) {
1715
+ this._ensureInnerSourceMapString();
1716
+ this._innerSourceMapAsBuffer = Buffer.from(
1717
+ this._innerSourceMapAsString,
1718
+ "utf-8"
1719
+ );
1720
+ }
1721
+ }
1722
+
1723
+ _ensureInnerSourceMapString() {
1724
+ if (this._innerSourceMapAsString === undefined && this._hasInnerSourceMap) {
1725
+ if (this._innerSourceMapAsBuffer !== undefined) {
1726
+ this._innerSourceMapAsString = this._innerSourceMapAsBuffer.toString(
1727
+ "utf-8"
1728
+ );
1729
+ } else {
1730
+ this._innerSourceMapAsString = JSON.stringify(
1731
+ this._innerSourceMapAsObject
1732
+ );
1733
+ }
1734
+ }
1735
+ }
1736
+
1737
+ _ensureSourceMapObject() {
1738
+ if (this._sourceMapAsObject === undefined) {
1739
+ this._ensureSourceMapString();
1740
+ this._sourceMapAsObject = JSON.parse(this._sourceMapAsString);
1741
+ }
1742
+ }
1743
+
1744
+ _ensureSourceMapBuffer() {
1745
+ if (this._sourceMapAsBuffer === undefined) {
1746
+ this._ensureSourceMapString();
1747
+ this._sourceMapAsBuffer = Buffer.from(this._sourceMapAsString, "utf-8");
1748
+ }
1749
+ }
1750
+
1751
+ _ensureSourceMapString() {
1752
+ if (this._sourceMapAsString === undefined) {
1753
+ if (this._sourceMapAsBuffer !== undefined) {
1754
+ this._sourceMapAsString = this._sourceMapAsBuffer.toString("utf-8");
1755
+ } else {
1756
+ this._sourceMapAsString = JSON.stringify(this._sourceMapAsObject);
1757
+ }
1758
+ }
1759
+ }
1760
+
1761
+ getArgsAsBuffers() {
1762
+ this._ensureValueBuffer();
1763
+ this._ensureSourceMapBuffer();
1764
+ this._ensureOriginalSourceBuffer();
1765
+ this._ensureInnerSourceMapBuffer();
1766
+ return [
1767
+ this._valueAsBuffer,
1768
+ this._name,
1769
+ this._sourceMapAsBuffer,
1770
+ this._originalSourceAsBuffer,
1771
+ this._innerSourceMapAsBuffer,
1772
+ this._removeOriginalSource
1773
+ ];
1774
+ }
1775
+
1776
+ buffer() {
1777
+ this._ensureValueBuffer();
1778
+ return this._valueAsBuffer;
1779
+ }
1780
+
1781
+ source() {
1782
+ this._ensureValueString();
1783
+ return this._valueAsString;
1784
+ }
1785
+
1786
+ map(options) {
1787
+ if (!this._hasInnerSourceMap) {
1788
+ this._ensureSourceMapObject();
1789
+ return this._sourceMapAsObject;
1790
+ }
1791
+ return getMap(this, options);
1792
+ }
1793
+
1794
+ sourceAndMap(options) {
1795
+ if (!this._hasInnerSourceMap) {
1796
+ this._ensureValueString();
1797
+ this._ensureSourceMapObject();
1798
+ return {
1799
+ source: this._valueAsString,
1800
+ map: this._sourceMapAsObject
1801
+ };
1802
+ }
1803
+ return getSourceAndMap(this, options);
1804
+ }
1805
+
1806
+ streamChunks(options, onChunk, onSource, onName) {
1807
+ this._ensureValueString();
1808
+ this._ensureSourceMapObject();
1809
+ this._ensureOriginalSourceString();
1810
+ if (this._hasInnerSourceMap) {
1811
+ this._ensureInnerSourceMapObject();
1812
+ return streamChunksOfCombinedSourceMap(
1813
+ this._valueAsString,
1814
+ this._sourceMapAsObject,
1815
+ this._name,
1816
+ this._originalSourceAsString,
1817
+ this._innerSourceMapAsObject,
1818
+ this._removeOriginalSource,
1819
+ onChunk,
1820
+ onSource,
1821
+ onName,
1822
+ !!(options && options.finalSource),
1823
+ !!(options && options.columns !== false)
1824
+ );
1825
+ } else {
1826
+ return streamChunksOfSourceMap(
1827
+ this._valueAsString,
1828
+ this._sourceMapAsObject,
1829
+ onChunk,
1830
+ onSource,
1831
+ onName,
1832
+ !!(options && options.finalSource),
1833
+ !!(options && options.columns !== false)
1834
+ );
1835
+ }
1836
+ }
1837
+
1838
+ updateHash(hash) {
1839
+ this._ensureValueBuffer();
1840
+ this._ensureSourceMapBuffer();
1841
+ this._ensureOriginalSourceBuffer();
1842
+ this._ensureInnerSourceMapBuffer();
1843
+
1844
+ hash.update("SourceMapSource");
1845
+
1846
+ hash.update(this._valueAsBuffer);
1847
+
1848
+ hash.update(this._sourceMapAsBuffer);
1849
+
1850
+ if (this._hasOriginalSource) {
1851
+ hash.update(this._originalSourceAsBuffer);
1852
+ }
1853
+
1854
+ if (this._hasInnerSourceMap) {
1855
+ hash.update(this._innerSourceMapAsBuffer);
1856
+ }
1857
+
1858
+ hash.update(this._removeOriginalSource ? "true" : "false");
1859
+ }
1860
+ }
1861
+
1862
+ module.exports = SourceMapSource;
1863
+
1864
+
1865
+ /***/ }),
1866
+
1867
+ /***/ 894:
1868
+ /***/ ((module) => {
1869
+
1870
+ "use strict";
1871
+ /*
1872
+ MIT License http://www.opensource.org/licenses/mit-license.php
1873
+ Author Tobias Koppers @sokra
1874
+ */
1875
+
1876
+
1877
+
1878
+ const ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(
1879
+ ""
1880
+ );
1881
+
1882
+ const CONTINUATION_BIT = 0x20;
1883
+
1884
+ const createMappingsSerializer = options => {
1885
+ const linesOnly = options && options.columns === false;
1886
+ return linesOnly
1887
+ ? createLinesOnlyMappingsSerializer()
1888
+ : createFullMappingsSerializer();
1889
+ };
1890
+
1891
+ const createFullMappingsSerializer = () => {
1892
+ let currentLine = 1;
1893
+ let currentColumn = 0;
1894
+ let currentSourceIndex = 0;
1895
+ let currentOriginalLine = 1;
1896
+ let currentOriginalColumn = 0;
1897
+ let currentNameIndex = 0;
1898
+ let activeMapping = false;
1899
+ let activeName = false;
1900
+ let initial = true;
1901
+ return (
1902
+ generatedLine,
1903
+ generatedColumn,
1904
+ sourceIndex,
1905
+ originalLine,
1906
+ originalColumn,
1907
+ nameIndex
1908
+ ) => {
1909
+ if (activeMapping && currentLine === generatedLine) {
1910
+ // A mapping is still active
1911
+ if (
1912
+ sourceIndex === currentSourceIndex &&
1913
+ originalLine === currentOriginalLine &&
1914
+ originalColumn === currentOriginalColumn &&
1915
+ !activeName &&
1916
+ nameIndex < 0
1917
+ ) {
1918
+ // avoid repeating the same original mapping
1919
+ return "";
1920
+ }
1921
+ } else {
1922
+ // No mapping is active
1923
+ if (sourceIndex < 0) {
1924
+ // avoid writing unneccessary generated mappings
1925
+ return "";
1926
+ }
1927
+ }
1928
+
1929
+ let str;
1930
+ if (currentLine < generatedLine) {
1931
+ str = ";".repeat(generatedLine - currentLine);
1932
+ currentLine = generatedLine;
1933
+ currentColumn = 0;
1934
+ initial = false;
1935
+ } else if (initial) {
1936
+ str = "";
1937
+ initial = false;
1938
+ } else {
1939
+ str = ",";
1940
+ }
1941
+
1942
+ const writeValue = value => {
1943
+ const sign = (value >>> 31) & 1;
1944
+ const mask = value >> 31;
1945
+ const absValue = (value + mask) ^ mask;
1946
+ let data = (absValue << 1) | sign;
1947
+ for (;;) {
1948
+ const sextet = data & 0x1f;
1949
+ data >>= 5;
1950
+ if (data === 0) {
1951
+ str += ALPHABET[sextet];
1952
+ break;
1953
+ } else {
1954
+ str += ALPHABET[sextet | CONTINUATION_BIT];
1955
+ }
1956
+ }
1957
+ };
1958
+ writeValue(generatedColumn - currentColumn);
1959
+ currentColumn = generatedColumn;
1960
+ if (sourceIndex >= 0) {
1961
+ activeMapping = true;
1962
+ if (sourceIndex === currentSourceIndex) {
1963
+ str += "A";
1964
+ } else {
1965
+ writeValue(sourceIndex - currentSourceIndex);
1966
+ currentSourceIndex = sourceIndex;
1967
+ }
1968
+ writeValue(originalLine - currentOriginalLine);
1969
+ currentOriginalLine = originalLine;
1970
+ if (originalColumn === currentOriginalColumn) {
1971
+ str += "A";
1972
+ } else {
1973
+ writeValue(originalColumn - currentOriginalColumn);
1974
+ currentOriginalColumn = originalColumn;
1975
+ }
1976
+ if (nameIndex >= 0) {
1977
+ writeValue(nameIndex - currentNameIndex);
1978
+ currentNameIndex = nameIndex;
1979
+ activeName = true;
1980
+ } else {
1981
+ activeName = false;
1982
+ }
1983
+ } else {
1984
+ activeMapping = false;
1985
+ }
1986
+ return str;
1987
+ };
1988
+ };
1989
+
1990
+ const createLinesOnlyMappingsSerializer = () => {
1991
+ let lastWrittenLine = 0;
1992
+ let currentLine = 1;
1993
+ let currentSourceIndex = 0;
1994
+ let currentOriginalLine = 1;
1995
+ return (
1996
+ generatedLine,
1997
+ _generatedColumn,
1998
+ sourceIndex,
1999
+ originalLine,
2000
+ _originalColumn,
2001
+ _nameIndex
2002
+ ) => {
2003
+ if (sourceIndex < 0) {
2004
+ // avoid writing generated mappings at all
2005
+ return "";
2006
+ }
2007
+ if (lastWrittenLine === generatedLine) {
2008
+ // avoid writing multiple original mappings per line
2009
+ return "";
2010
+ }
2011
+ let str;
2012
+ const writeValue = value => {
2013
+ const sign = (value >>> 31) & 1;
2014
+ const mask = value >> 31;
2015
+ const absValue = (value + mask) ^ mask;
2016
+ let data = (absValue << 1) | sign;
2017
+ for (;;) {
2018
+ const sextet = data & 0x1f;
2019
+ data >>= 5;
2020
+ if (data === 0) {
2021
+ str += ALPHABET[sextet];
2022
+ break;
2023
+ } else {
2024
+ str += ALPHABET[sextet | CONTINUATION_BIT];
2025
+ }
2026
+ }
2027
+ };
2028
+ lastWrittenLine = generatedLine;
2029
+ if (generatedLine === currentLine + 1) {
2030
+ currentLine = generatedLine;
2031
+ if (sourceIndex === currentSourceIndex) {
2032
+ currentSourceIndex = sourceIndex;
2033
+ if (originalLine === currentOriginalLine + 1) {
2034
+ currentOriginalLine = originalLine;
2035
+ return ";AACA";
2036
+ } else {
2037
+ str = ";AA";
2038
+ writeValue(originalLine - currentOriginalLine);
2039
+ currentOriginalLine = originalLine;
2040
+ return str + "A";
2041
+ }
2042
+ } else {
2043
+ str = ";A";
2044
+ writeValue(sourceIndex - currentSourceIndex);
2045
+ currentSourceIndex = sourceIndex;
2046
+ writeValue(originalLine - currentOriginalLine);
2047
+ currentOriginalLine = originalLine;
2048
+ return str + "A";
2049
+ }
2050
+ } else {
2051
+ str = ";".repeat(generatedLine - currentLine);
2052
+ currentLine = generatedLine;
2053
+ if (sourceIndex === currentSourceIndex) {
2054
+ currentSourceIndex = sourceIndex;
2055
+ if (originalLine === currentOriginalLine + 1) {
2056
+ currentOriginalLine = originalLine;
2057
+ return str + "AACA";
2058
+ } else {
2059
+ str += "AA";
2060
+ writeValue(originalLine - currentOriginalLine);
2061
+ currentOriginalLine = originalLine;
2062
+ return str + "A";
2063
+ }
2064
+ } else {
2065
+ str += "A";
2066
+ writeValue(sourceIndex - currentSourceIndex);
2067
+ currentSourceIndex = sourceIndex;
2068
+ writeValue(originalLine - currentOriginalLine);
2069
+ currentOriginalLine = originalLine;
2070
+ return str + "A";
2071
+ }
2072
+ }
2073
+ };
2074
+ };
2075
+
2076
+ module.exports = createMappingsSerializer;
2077
+
2078
+
2079
+ /***/ }),
2080
+
2081
+ /***/ 180:
2082
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
2083
+
2084
+ "use strict";
2085
+ /*
2086
+ MIT License http://www.opensource.org/licenses/mit-license.php
2087
+ Author Tobias Koppers @sokra
2088
+ */
2089
+
2090
+
2091
+
2092
+ const createMappingsSerializer = __nccwpck_require__(894);
2093
+
2094
+ exports.getSourceAndMap = (inputSource, options) => {
2095
+ let code = "";
2096
+ let mappings = "";
2097
+ let sources = [];
2098
+ let sourcesContent = [];
2099
+ let names = [];
2100
+ const addMapping = createMappingsSerializer(options);
2101
+ const { source } = inputSource.streamChunks(
2102
+ Object.assign({}, options, { finalSource: true }),
2103
+ (
2104
+ chunk,
2105
+ generatedLine,
2106
+ generatedColumn,
2107
+ sourceIndex,
2108
+ originalLine,
2109
+ originalColumn,
2110
+ nameIndex
2111
+ ) => {
2112
+ if (chunk !== undefined) code += chunk;
2113
+ mappings += addMapping(
2114
+ generatedLine,
2115
+ generatedColumn,
2116
+ sourceIndex,
2117
+ originalLine,
2118
+ originalColumn,
2119
+ nameIndex
2120
+ );
2121
+ },
2122
+ (sourceIndex, source, sourceContent) => {
2123
+ while (sources.length < sourceIndex) {
2124
+ sources.push(null);
2125
+ }
2126
+ sources[sourceIndex] = source;
2127
+ if (sourceContent !== undefined) {
2128
+ while (sourcesContent.length < sourceIndex) {
2129
+ sourcesContent.push(null);
2130
+ }
2131
+ sourcesContent[sourceIndex] = sourceContent;
2132
+ }
2133
+ },
2134
+ (nameIndex, name) => {
2135
+ while (names.length < nameIndex) {
2136
+ names.push(null);
2137
+ }
2138
+ names[nameIndex] = name;
2139
+ }
2140
+ );
2141
+ return {
2142
+ source: source !== undefined ? source : code,
2143
+ map:
2144
+ mappings.length > 0
2145
+ ? {
2146
+ version: 3,
2147
+ file: "x",
2148
+ mappings,
2149
+ sources,
2150
+ sourcesContent:
2151
+ sourcesContent.length > 0 ? sourcesContent : undefined,
2152
+ names
2153
+ }
2154
+ : null
2155
+ };
2156
+ };
2157
+
2158
+ exports.getMap = (source, options) => {
2159
+ let mappings = "";
2160
+ let sources = [];
2161
+ let sourcesContent = [];
2162
+ let names = [];
2163
+ const addMapping = createMappingsSerializer(options);
2164
+ source.streamChunks(
2165
+ Object.assign({}, options, { source: false, finalSource: true }),
2166
+ (
2167
+ chunk,
2168
+ generatedLine,
2169
+ generatedColumn,
2170
+ sourceIndex,
2171
+ originalLine,
2172
+ originalColumn,
2173
+ nameIndex
2174
+ ) => {
2175
+ mappings += addMapping(
2176
+ generatedLine,
2177
+ generatedColumn,
2178
+ sourceIndex,
2179
+ originalLine,
2180
+ originalColumn,
2181
+ nameIndex
2182
+ );
2183
+ },
2184
+ (sourceIndex, source, sourceContent) => {
2185
+ while (sources.length < sourceIndex) {
2186
+ sources.push(null);
2187
+ }
2188
+ sources[sourceIndex] = source;
2189
+ if (sourceContent !== undefined) {
2190
+ while (sourcesContent.length < sourceIndex) {
2191
+ sourcesContent.push(null);
2192
+ }
2193
+ sourcesContent[sourceIndex] = sourceContent;
2194
+ }
2195
+ },
2196
+ (nameIndex, name) => {
2197
+ while (names.length < nameIndex) {
2198
+ names.push(null);
2199
+ }
2200
+ names[nameIndex] = name;
2201
+ }
2202
+ );
2203
+ return mappings.length > 0
2204
+ ? {
2205
+ version: 3,
2206
+ file: "x",
2207
+ mappings,
2208
+ sources,
2209
+ sourcesContent: sourcesContent.length > 0 ? sourcesContent : undefined,
2210
+ names
2211
+ }
2212
+ : null;
2213
+ };
2214
+
2215
+
2216
+ /***/ }),
2217
+
2218
+ /***/ 849:
2219
+ /***/ ((module) => {
2220
+
2221
+ "use strict";
2222
+ /*
2223
+ MIT License http://www.opensource.org/licenses/mit-license.php
2224
+ Author Tobias Koppers @sokra
2225
+ */
2226
+
2227
+
2228
+
2229
+ const CHAR_CODE_NEW_LINE = "\n".charCodeAt(0);
2230
+
2231
+ const getGeneratedSourceInfo = source => {
2232
+ if (source === undefined) {
2233
+ return {};
2234
+ }
2235
+ const lastLineStart = source.lastIndexOf("\n");
2236
+ if (lastLineStart === -1) {
2237
+ return {
2238
+ generatedLine: 1,
2239
+ generatedColumn: source.length,
2240
+ source
2241
+ };
2242
+ }
2243
+ let generatedLine = 2;
2244
+ for (let i = 0; i < lastLineStart; i++) {
2245
+ if (source.charCodeAt(i) === CHAR_CODE_NEW_LINE) generatedLine++;
2246
+ }
2247
+ return {
2248
+ generatedLine,
2249
+ generatedColumn: source.length - lastLineStart - 1,
2250
+ source
2251
+ };
2252
+ };
2253
+
2254
+ module.exports = getGeneratedSourceInfo;
2255
+
2256
+
2257
+ /***/ }),
2258
+
2259
+ /***/ 177:
2260
+ /***/ ((module) => {
2261
+
2262
+ "use strict";
2263
+ /*
2264
+ MIT License http://www.opensource.org/licenses/mit-license.php
2265
+ Author Tobias Koppers @sokra
2266
+ */
2267
+
2268
+
2269
+
2270
+ const getSource = (sourceMap, index) => {
2271
+ if (index < 0) return null;
2272
+ const { sourceRoot, sources } = sourceMap;
2273
+ const source = sources[index];
2274
+ if (!sourceRoot) return source;
2275
+ if (sourceRoot.endsWith("/")) return sourceRoot + source;
2276
+ return sourceRoot + "/" + source;
2277
+ };
2278
+
2279
+ module.exports = getSource;
2280
+
2281
+
2282
+ /***/ }),
2283
+
2284
+ /***/ 213:
2285
+ /***/ ((module) => {
2286
+
2287
+ "use strict";
2288
+ /*
2289
+ MIT License http://www.opensource.org/licenses/mit-license.php
2290
+ Author Tobias Koppers @sokra
2291
+ */
2292
+
2293
+
2294
+
2295
+ const ALPHABET =
2296
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
2297
+
2298
+ const CONTINUATION_BIT = 0x20;
2299
+ const END_SEGMENT_BIT = 0x40;
2300
+ const NEXT_LINE = END_SEGMENT_BIT | 0x01;
2301
+ const INVALID = END_SEGMENT_BIT | 0x02;
2302
+ const DATA_MASK = 0x1f;
2303
+
2304
+ const ccToValue = new Uint8Array("z".charCodeAt(0) + 1);
2305
+ {
2306
+ ccToValue.fill(INVALID);
2307
+ for (let i = 0; i < ALPHABET.length; i++) {
2308
+ ccToValue[ALPHABET.charCodeAt(i)] = i;
2309
+ }
2310
+ ccToValue[",".charCodeAt(0)] = END_SEGMENT_BIT;
2311
+ ccToValue[";".charCodeAt(0)] = NEXT_LINE;
2312
+ }
2313
+ const ccMax = ccToValue.length - 1;
2314
+
2315
+ /**
2316
+ * @param {string} mappings the mappings string
2317
+ * @param {function(number, number, number, number, number, number): void} onMapping called for each mapping
2318
+ * @returns {void}
2319
+ */
2320
+ const readMappings = (mappings, onMapping) => {
2321
+ // generatedColumn, [sourceIndex, originalLine, orignalColumn, [nameIndex]]
2322
+ const currentData = new Uint32Array([0, 0, 1, 0, 0]);
2323
+ let currentDataPos = 0;
2324
+ // currentValue will include a sign bit at bit 0
2325
+ let currentValue = 0;
2326
+ let currentValuePos = 0;
2327
+ let generatedLine = 1;
2328
+ let generatedColumn = -1;
2329
+ for (let i = 0; i < mappings.length; i++) {
2330
+ const cc = mappings.charCodeAt(i);
2331
+ if (cc > ccMax) continue;
2332
+ const value = ccToValue[cc];
2333
+ if ((value & END_SEGMENT_BIT) !== 0) {
2334
+ // End current segment
2335
+ if (currentData[0] > generatedColumn) {
2336
+ if (currentDataPos === 1) {
2337
+ onMapping(generatedLine, currentData[0], -1, -1, -1, -1);
2338
+ } else if (currentDataPos === 4) {
2339
+ onMapping(
2340
+ generatedLine,
2341
+ currentData[0],
2342
+ currentData[1],
2343
+ currentData[2],
2344
+ currentData[3],
2345
+ -1
2346
+ );
2347
+ } else if (currentDataPos === 5) {
2348
+ onMapping(
2349
+ generatedLine,
2350
+ currentData[0],
2351
+ currentData[1],
2352
+ currentData[2],
2353
+ currentData[3],
2354
+ currentData[4]
2355
+ );
2356
+ }
2357
+ generatedColumn = currentData[0];
2358
+ }
2359
+ currentDataPos = 0;
2360
+ if (value === NEXT_LINE) {
2361
+ // Start new line
2362
+ generatedLine++;
2363
+ currentData[0] = 0;
2364
+ generatedColumn = -1;
2365
+ }
2366
+ } else if ((value & CONTINUATION_BIT) === 0) {
2367
+ // last sextet
2368
+ currentValue |= value << currentValuePos;
2369
+ const finalValue =
2370
+ currentValue & 1 ? -(currentValue >> 1) : currentValue >> 1;
2371
+ currentData[currentDataPos++] += finalValue;
2372
+ currentValuePos = 0;
2373
+ currentValue = 0;
2374
+ } else {
2375
+ currentValue |= (value & DATA_MASK) << currentValuePos;
2376
+ currentValuePos += 5;
2377
+ }
2378
+ }
2379
+ // End current segment
2380
+ if (currentDataPos === 1) {
2381
+ onMapping(generatedLine, currentData[0], -1, -1, -1, -1);
2382
+ } else if (currentDataPos === 4) {
2383
+ onMapping(
2384
+ generatedLine,
2385
+ currentData[0],
2386
+ currentData[1],
2387
+ currentData[2],
2388
+ currentData[3],
2389
+ -1
2390
+ );
2391
+ } else if (currentDataPos === 5) {
2392
+ onMapping(
2393
+ generatedLine,
2394
+ currentData[0],
2395
+ currentData[1],
2396
+ currentData[2],
2397
+ currentData[3],
2398
+ currentData[4]
2399
+ );
2400
+ }
2401
+ };
2402
+
2403
+ module.exports = readMappings;
2404
+
2405
+
2406
+ /***/ }),
2407
+
2408
+ /***/ 79:
2409
+ /***/ ((module) => {
2410
+
2411
+ const splitIntoLines = str => {
2412
+ const results = [];
2413
+ const len = str.length;
2414
+ let i = 0;
2415
+ for (; i < len; ) {
2416
+ const cc = str.charCodeAt(i);
2417
+ // 10 is "\n".charCodeAt(0)
2418
+ if (cc === 10) {
2419
+ results.push("\n");
2420
+ i++;
2421
+ } else {
2422
+ let j = i + 1;
2423
+ // 10 is "\n".charCodeAt(0)
2424
+ while (j < len && str.charCodeAt(j) !== 10) j++;
2425
+ results.push(str.slice(i, j + 1));
2426
+ i = j + 1;
2427
+ }
2428
+ }
2429
+ return results;
2430
+ };
2431
+ module.exports = splitIntoLines;
2432
+
2433
+
2434
+ /***/ }),
2435
+
2436
+ /***/ 884:
2437
+ /***/ ((module) => {
2438
+
2439
+ // \n = 10
2440
+ // ; = 59
2441
+ // { = 123
2442
+ // } = 125
2443
+ // <space> = 32
2444
+ // \r = 13
2445
+ // \t = 9
2446
+
2447
+ const splitIntoPotentialTokens = str => {
2448
+ const len = str.length;
2449
+ if (len === 0) return null;
2450
+ const results = [];
2451
+ let i = 0;
2452
+ for (; i < len; ) {
2453
+ const s = i;
2454
+ block: {
2455
+ let cc = str.charCodeAt(i);
2456
+ while (cc !== 10 && cc !== 59 && cc !== 123 && cc !== 125) {
2457
+ if (++i >= len) break block;
2458
+ cc = str.charCodeAt(i);
2459
+ }
2460
+ while (
2461
+ cc === 59 ||
2462
+ cc === 32 ||
2463
+ cc === 123 ||
2464
+ cc === 125 ||
2465
+ cc === 13 ||
2466
+ cc === 9
2467
+ ) {
2468
+ if (++i >= len) break block;
2469
+ cc = str.charCodeAt(i);
2470
+ }
2471
+ if (cc === 10) {
2472
+ i++;
2473
+ }
2474
+ }
2475
+ results.push(str.slice(s, i));
2476
+ }
2477
+ return results;
2478
+ };
2479
+ module.exports = splitIntoPotentialTokens;
2480
+
2481
+
2482
+ /***/ }),
2483
+
2484
+ /***/ 248:
2485
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
2486
+
2487
+ "use strict";
2488
+ /*
2489
+ MIT License http://www.opensource.org/licenses/mit-license.php
2490
+ Author Tobias Koppers @sokra
2491
+ */
2492
+
2493
+
2494
+
2495
+ const createMappingsSerializer = __nccwpck_require__(894);
2496
+ const streamChunks = __nccwpck_require__(65);
2497
+
2498
+ const streamAndGetSourceAndMap = (
2499
+ inputSource,
2500
+ options,
2501
+ onChunk,
2502
+ onSource,
2503
+ onName
2504
+ ) => {
2505
+ let code = "";
2506
+ let mappings = "";
2507
+ let sources = [];
2508
+ let sourcesContent = [];
2509
+ let names = [];
2510
+ const addMapping = createMappingsSerializer(
2511
+ Object.assign({}, options, { columns: true })
2512
+ );
2513
+ const finalSource = !!(options && options.finalSource);
2514
+ const { generatedLine, generatedColumn, source } = streamChunks(
2515
+ inputSource,
2516
+ options,
2517
+ (
2518
+ chunk,
2519
+ generatedLine,
2520
+ generatedColumn,
2521
+ sourceIndex,
2522
+ originalLine,
2523
+ originalColumn,
2524
+ nameIndex
2525
+ ) => {
2526
+ if (chunk !== undefined) code += chunk;
2527
+ mappings += addMapping(
2528
+ generatedLine,
2529
+ generatedColumn,
2530
+ sourceIndex,
2531
+ originalLine,
2532
+ originalColumn,
2533
+ nameIndex
2534
+ );
2535
+ return onChunk(
2536
+ finalSource ? undefined : chunk,
2537
+ generatedLine,
2538
+ generatedColumn,
2539
+ sourceIndex,
2540
+ originalLine,
2541
+ originalColumn,
2542
+ nameIndex
2543
+ );
2544
+ },
2545
+ (sourceIndex, source, sourceContent) => {
2546
+ while (sources.length < sourceIndex) {
2547
+ sources.push(null);
2548
+ }
2549
+ sources[sourceIndex] = source;
2550
+ if (sourceContent !== undefined) {
2551
+ while (sourcesContent.length < sourceIndex) {
2552
+ sourcesContent.push(null);
2553
+ }
2554
+ sourcesContent[sourceIndex] = sourceContent;
2555
+ }
2556
+ return onSource(sourceIndex, source, sourceContent);
2557
+ },
2558
+ (nameIndex, name) => {
2559
+ while (names.length < nameIndex) {
2560
+ names.push(null);
2561
+ }
2562
+ names[nameIndex] = name;
2563
+ return onName(nameIndex, name);
2564
+ }
2565
+ );
2566
+ const resultSource = source !== undefined ? source : code;
2567
+ return {
2568
+ result: {
2569
+ generatedLine,
2570
+ generatedColumn,
2571
+ source: finalSource ? resultSource : undefined
2572
+ },
2573
+ source: resultSource,
2574
+ map:
2575
+ mappings.length > 0
2576
+ ? {
2577
+ version: 3,
2578
+ file: "x",
2579
+ mappings,
2580
+ sources,
2581
+ sourcesContent:
2582
+ sourcesContent.length > 0 ? sourcesContent : undefined,
2583
+ names
2584
+ }
2585
+ : null
2586
+ };
2587
+ };
2588
+
2589
+ module.exports = streamAndGetSourceAndMap;
2590
+
2591
+
2592
+ /***/ }),
2593
+
2594
+ /***/ 65:
2595
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
2596
+
2597
+ "use strict";
2598
+ /*
2599
+ MIT License http://www.opensource.org/licenses/mit-license.php
2600
+ Author Tobias Koppers @sokra
2601
+ */
2602
+
2603
+
2604
+
2605
+ const streamChunksOfRawSource = __nccwpck_require__(264);
2606
+ const streamChunksOfSourceMap = __nccwpck_require__(280);
2607
+
2608
+ module.exports = (source, options, onChunk, onSource, onName) => {
2609
+ if (typeof source.streamChunks === "function") {
2610
+ return source.streamChunks(options, onChunk, onSource, onName);
2611
+ } else {
2612
+ const sourceAndMap = source.sourceAndMap(options);
2613
+ if (sourceAndMap.map) {
2614
+ return streamChunksOfSourceMap(
2615
+ sourceAndMap.source,
2616
+ sourceAndMap.map,
2617
+ onChunk,
2618
+ onSource,
2619
+ onName,
2620
+ !!(options && options.finalSource),
2621
+ !!(options && options.columns !== false)
2622
+ );
2623
+ } else {
2624
+ return streamChunksOfRawSource(
2625
+ sourceAndMap.source,
2626
+ onChunk,
2627
+ onSource,
2628
+ onName,
2629
+ !!(options && options.finalSource)
2630
+ );
2631
+ }
2632
+ }
2633
+ };
2634
+
2635
+
2636
+ /***/ }),
2637
+
2638
+ /***/ 47:
2639
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
2640
+
2641
+ "use strict";
2642
+ /*
2643
+ MIT License http://www.opensource.org/licenses/mit-license.php
2644
+ Author Tobias Koppers @sokra
2645
+ */
2646
+
2647
+
2648
+
2649
+ const streamChunksOfSourceMap = __nccwpck_require__(280);
2650
+ const splitIntoLines = __nccwpck_require__(79);
2651
+
2652
+ const streamChunksOfCombinedSourceMap = (
2653
+ source,
2654
+ sourceMap,
2655
+ innerSourceName,
2656
+ innerSource,
2657
+ innerSourceMap,
2658
+ removeInnerSource,
2659
+ onChunk,
2660
+ onSource,
2661
+ onName,
2662
+ finalSource,
2663
+ columns
2664
+ ) => {
2665
+ let sourceMapping = new Map();
2666
+ let nameMapping = new Map();
2667
+ const sourceIndexMapping = [];
2668
+ const nameIndexMapping = [];
2669
+ const nameIndexValueMapping = [];
2670
+ let innerSourceIndex = -2;
2671
+ const innerSourceIndexMapping = [];
2672
+ const innerSourceIndexValueMapping = [];
2673
+ const innerSourceContents = [];
2674
+ const innerSourceContentLines = [];
2675
+ const innerNameIndexMapping = [];
2676
+ const innerNameIndexValueMapping = [];
2677
+ const innerSourceMapLineData = [];
2678
+ const findInnerMapping = (line, column) => {
2679
+ if (line > innerSourceMapLineData.length) return -1;
2680
+ const { mappingsData } = innerSourceMapLineData[line - 1];
2681
+ let l = 0;
2682
+ let r = mappingsData.length / 5;
2683
+ while (l < r) {
2684
+ let m = (l + r) >> 1;
2685
+ if (mappingsData[m * 5] <= column) {
2686
+ l = m + 1;
2687
+ } else {
2688
+ r = m;
2689
+ }
2690
+ }
2691
+ if (l === 0) return -1;
2692
+ return l - 1;
2693
+ };
2694
+ return streamChunksOfSourceMap(
2695
+ source,
2696
+ sourceMap,
2697
+ (
2698
+ chunk,
2699
+ generatedLine,
2700
+ generatedColumn,
2701
+ sourceIndex,
2702
+ originalLine,
2703
+ originalColumn,
2704
+ nameIndex
2705
+ ) => {
2706
+ // Check if this is a mapping to the inner source
2707
+ if (sourceIndex === innerSourceIndex) {
2708
+ // Check if there is a mapping in the inner source
2709
+ const idx = findInnerMapping(originalLine, originalColumn);
2710
+ if (idx !== -1) {
2711
+ const { chunks, mappingsData } = innerSourceMapLineData[
2712
+ originalLine - 1
2713
+ ];
2714
+ const mi = idx * 5;
2715
+ const innerSourceIndex = mappingsData[mi + 1];
2716
+ const innerOriginalLine = mappingsData[mi + 2];
2717
+ let innerOriginalColumn = mappingsData[mi + 3];
2718
+ let innerNameIndex = mappingsData[mi + 4];
2719
+ if (innerSourceIndex >= 0) {
2720
+ // Check for an identity mapping
2721
+ // where we are allowed to adjust the original column
2722
+ const innerChunk = chunks[idx];
2723
+ const innerGeneratedColumn = mappingsData[mi];
2724
+ const locationInChunk = originalColumn - innerGeneratedColumn;
2725
+ if (locationInChunk > 0) {
2726
+ let originalSourceLines =
2727
+ innerSourceIndex < innerSourceContentLines.length
2728
+ ? innerSourceContentLines[innerSourceIndex]
2729
+ : null;
2730
+ if (originalSourceLines === undefined) {
2731
+ const originalSource = innerSourceContents[innerSourceIndex];
2732
+ originalSourceLines = originalSource
2733
+ ? splitIntoLines(originalSource)
2734
+ : null;
2735
+ innerSourceContentLines[innerSourceIndex] = originalSourceLines;
2736
+ }
2737
+ if (originalSourceLines !== null) {
2738
+ const originalChunk =
2739
+ innerOriginalLine <= originalSourceLines.length
2740
+ ? originalSourceLines[innerOriginalLine - 1].slice(
2741
+ innerOriginalColumn,
2742
+ innerOriginalColumn + locationInChunk
2743
+ )
2744
+ : "";
2745
+ if (innerChunk.slice(0, locationInChunk) === originalChunk) {
2746
+ innerOriginalColumn += locationInChunk;
2747
+ innerNameIndex = -1;
2748
+ }
2749
+ }
2750
+ }
2751
+
2752
+ // We have a inner mapping to original source
2753
+
2754
+ // emit source when needed and compute global source index
2755
+ let sourceIndex =
2756
+ innerSourceIndex < innerSourceIndexMapping.length
2757
+ ? innerSourceIndexMapping[innerSourceIndex]
2758
+ : -2;
2759
+ if (sourceIndex === -2) {
2760
+ const [source, sourceContent] =
2761
+ innerSourceIndex < innerSourceIndexValueMapping.length
2762
+ ? innerSourceIndexValueMapping[innerSourceIndex]
2763
+ : [null, undefined];
2764
+ let globalIndex = sourceMapping.get(source);
2765
+ if (globalIndex === undefined) {
2766
+ sourceMapping.set(source, (globalIndex = sourceMapping.size));
2767
+ onSource(globalIndex, source, sourceContent);
2768
+ }
2769
+ sourceIndex = globalIndex;
2770
+ innerSourceIndexMapping[innerSourceIndex] = sourceIndex;
2771
+ }
2772
+
2773
+ // emit name when needed and compute global name index
2774
+ let finalNameIndex = -1;
2775
+ if (innerNameIndex >= 0) {
2776
+ // when we have a inner name
2777
+ finalNameIndex =
2778
+ innerNameIndex < innerNameIndexMapping.length
2779
+ ? innerNameIndexMapping[innerNameIndex]
2780
+ : -2;
2781
+ if (finalNameIndex === -2) {
2782
+ const name =
2783
+ innerNameIndex < innerNameIndexValueMapping.length
2784
+ ? innerNameIndexValueMapping[innerNameIndex]
2785
+ : undefined;
2786
+ if (name) {
2787
+ let globalIndex = nameMapping.get(name);
2788
+ if (globalIndex === undefined) {
2789
+ nameMapping.set(name, (globalIndex = nameMapping.size));
2790
+ onName(globalIndex, name);
2791
+ }
2792
+ finalNameIndex = globalIndex;
2793
+ } else {
2794
+ finalNameIndex = -1;
2795
+ }
2796
+ innerNameIndexMapping[innerNameIndex] = finalNameIndex;
2797
+ }
2798
+ } else if (nameIndex >= 0) {
2799
+ // when we don't have an inner name,
2800
+ // but we have an outer name
2801
+ // it can be used when inner original code equals to the name
2802
+ let originalSourceLines =
2803
+ innerSourceContentLines[innerSourceIndex];
2804
+ if (originalSourceLines === undefined) {
2805
+ const originalSource = innerSourceContents[innerSourceIndex];
2806
+ originalSourceLines = originalSource
2807
+ ? splitIntoLines(originalSource)
2808
+ : null;
2809
+ innerSourceContentLines[innerSourceIndex] = originalSourceLines;
2810
+ }
2811
+ if (originalSourceLines !== null) {
2812
+ const name = nameIndexValueMapping[nameIndex];
2813
+ const originalName =
2814
+ innerOriginalLine <= originalSourceLines.length
2815
+ ? originalSourceLines[innerOriginalLine - 1].slice(
2816
+ innerOriginalColumn,
2817
+ innerOriginalColumn + name.length
2818
+ )
2819
+ : "";
2820
+ if (name === originalName) {
2821
+ finalNameIndex =
2822
+ nameIndex < nameIndexMapping.length
2823
+ ? nameIndexMapping[nameIndex]
2824
+ : -2;
2825
+ if (finalNameIndex === -2) {
2826
+ const name = nameIndexValueMapping[nameIndex];
2827
+ if (name) {
2828
+ let globalIndex = nameMapping.get(name);
2829
+ if (globalIndex === undefined) {
2830
+ nameMapping.set(name, (globalIndex = nameMapping.size));
2831
+ onName(globalIndex, name);
2832
+ }
2833
+ finalNameIndex = globalIndex;
2834
+ } else {
2835
+ finalNameIndex = -1;
2836
+ }
2837
+ nameIndexMapping[nameIndex] = finalNameIndex;
2838
+ }
2839
+ }
2840
+ }
2841
+ }
2842
+ onChunk(
2843
+ chunk,
2844
+ generatedLine,
2845
+ generatedColumn,
2846
+ sourceIndex,
2847
+ innerOriginalLine,
2848
+ innerOriginalColumn,
2849
+ finalNameIndex
2850
+ );
2851
+ return;
2852
+ }
2853
+ }
2854
+
2855
+ // We have a mapping to the inner source, but no inner mapping
2856
+ if (removeInnerSource) {
2857
+ onChunk(chunk, generatedLine, generatedColumn, -1, -1, -1, -1);
2858
+ return;
2859
+ } else {
2860
+ if (sourceIndexMapping[sourceIndex] === -2) {
2861
+ let globalIndex = sourceMapping.get(innerSourceName);
2862
+ if (globalIndex === undefined) {
2863
+ sourceMapping.set(source, (globalIndex = sourceMapping.size));
2864
+ onSource(globalIndex, innerSourceName, innerSource);
2865
+ }
2866
+ sourceIndexMapping[sourceIndex] = globalIndex;
2867
+ }
2868
+ }
2869
+ }
2870
+
2871
+ const finalSourceIndex =
2872
+ sourceIndex < 0 || sourceIndex >= sourceIndexMapping.length
2873
+ ? -1
2874
+ : sourceIndexMapping[sourceIndex];
2875
+ if (finalSourceIndex < 0) {
2876
+ // no source, so we make it a generated chunk
2877
+ onChunk(chunk, generatedLine, generatedColumn, -1, -1, -1, -1);
2878
+ } else {
2879
+ // Pass through the chunk with mapping
2880
+ let finalNameIndex = -1;
2881
+ if (nameIndex >= 0 && nameIndex < nameIndexMapping.length) {
2882
+ finalNameIndex = nameIndexMapping[nameIndex];
2883
+ if (finalNameIndex === -2) {
2884
+ const name = nameIndexValueMapping[nameIndex];
2885
+ let globalIndex = nameMapping.get(name);
2886
+ if (globalIndex === undefined) {
2887
+ nameMapping.set(name, (globalIndex = nameMapping.size));
2888
+ onName(globalIndex, name);
2889
+ }
2890
+ finalNameIndex = globalIndex;
2891
+ nameIndexMapping[nameIndex] = finalNameIndex;
2892
+ }
2893
+ }
2894
+ onChunk(
2895
+ chunk,
2896
+ generatedLine,
2897
+ generatedColumn,
2898
+ finalSourceIndex,
2899
+ originalLine,
2900
+ originalColumn,
2901
+ finalNameIndex
2902
+ );
2903
+ }
2904
+ },
2905
+ (i, source, sourceContent) => {
2906
+ if (source === innerSourceName) {
2907
+ innerSourceIndex = i;
2908
+ if (innerSource !== undefined) sourceContent = innerSource;
2909
+ else innerSource = sourceContent;
2910
+ sourceIndexMapping[i] = -2;
2911
+ streamChunksOfSourceMap(
2912
+ sourceContent,
2913
+ innerSourceMap,
2914
+ (
2915
+ chunk,
2916
+ generatedLine,
2917
+ generatedColumn,
2918
+ sourceIndex,
2919
+ originalLine,
2920
+ originalColumn,
2921
+ nameIndex
2922
+ ) => {
2923
+ while (innerSourceMapLineData.length < generatedLine) {
2924
+ innerSourceMapLineData.push({
2925
+ mappingsData: [],
2926
+ chunks: []
2927
+ });
2928
+ }
2929
+ const data = innerSourceMapLineData[generatedLine - 1];
2930
+ data.mappingsData.push(
2931
+ generatedColumn,
2932
+ sourceIndex,
2933
+ originalLine,
2934
+ originalColumn,
2935
+ nameIndex
2936
+ );
2937
+ data.chunks.push(chunk);
2938
+ },
2939
+ (i, source, sourceContent) => {
2940
+ innerSourceContents[i] = sourceContent;
2941
+ innerSourceContentLines[i] = undefined;
2942
+ innerSourceIndexMapping[i] = -2;
2943
+ innerSourceIndexValueMapping[i] = [source, sourceContent];
2944
+ },
2945
+ (i, name) => {
2946
+ innerNameIndexMapping[i] = -2;
2947
+ innerNameIndexValueMapping[i] = name;
2948
+ },
2949
+ false,
2950
+ columns
2951
+ );
2952
+ } else {
2953
+ let globalIndex = sourceMapping.get(source);
2954
+ if (globalIndex === undefined) {
2955
+ sourceMapping.set(source, (globalIndex = sourceMapping.size));
2956
+ onSource(globalIndex, source, sourceContent);
2957
+ }
2958
+ sourceIndexMapping[i] = globalIndex;
2959
+ }
2960
+ },
2961
+ (i, name) => {
2962
+ nameIndexMapping[i] = -2;
2963
+ nameIndexValueMapping[i] = name;
2964
+ },
2965
+ finalSource,
2966
+ columns
2967
+ );
2968
+ };
2969
+
2970
+ module.exports = streamChunksOfCombinedSourceMap;
2971
+
2972
+
2973
+ /***/ }),
2974
+
2975
+ /***/ 264:
2976
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
2977
+
2978
+ "use strict";
2979
+ /*
2980
+ MIT License http://www.opensource.org/licenses/mit-license.php
2981
+ Author Tobias Koppers @sokra
2982
+ */
2983
+
2984
+
2985
+
2986
+ const getGeneratedSourceInfo = __nccwpck_require__(849);
2987
+ const splitIntoLines = __nccwpck_require__(79);
2988
+
2989
+ const streamChunksOfRawSource = (source, onChunk, onSource, onName) => {
2990
+ let line = 1;
2991
+ const matches = splitIntoLines(source);
2992
+ let match;
2993
+ for (match of matches) {
2994
+ onChunk(match, line, 0, -1, -1, -1, -1);
2995
+ line++;
2996
+ }
2997
+ return matches.length === 0 || match.endsWith("\n")
2998
+ ? {
2999
+ generatedLine: matches.length + 1,
3000
+ generatedColumn: 0
3001
+ }
3002
+ : {
3003
+ generatedLine: matches.length,
3004
+ generatedColumn: match.length
3005
+ };
3006
+ };
3007
+
3008
+ module.exports = (source, onChunk, onSource, onName, finalSource) => {
3009
+ return finalSource
3010
+ ? getGeneratedSourceInfo(source)
3011
+ : streamChunksOfRawSource(source, onChunk, onSource, onName);
3012
+ };
3013
+
3014
+
3015
+ /***/ }),
3016
+
3017
+ /***/ 280:
3018
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
3019
+
3020
+ "use strict";
3021
+ /*
3022
+ MIT License http://www.opensource.org/licenses/mit-license.php
3023
+ Author Tobias Koppers @sokra
3024
+ */
3025
+
3026
+
3027
+
3028
+ const getGeneratedSourceInfo = __nccwpck_require__(849);
3029
+ const getSource = __nccwpck_require__(177);
3030
+ const readMappings = __nccwpck_require__(213);
3031
+ const splitIntoLines = __nccwpck_require__(79);
3032
+
3033
+ const streamChunksOfSourceMapFull = (
3034
+ source,
3035
+ sourceMap,
3036
+ onChunk,
3037
+ onSource,
3038
+ onName
3039
+ ) => {
3040
+ const lines = splitIntoLines(source);
3041
+ if (lines.length === 0) {
3042
+ return {
3043
+ generatedLine: 1,
3044
+ generatedColumn: 0
3045
+ };
3046
+ }
3047
+ const { sources, sourcesContent, names, mappings } = sourceMap;
3048
+ for (let i = 0; i < sources.length; i++) {
3049
+ onSource(
3050
+ i,
3051
+ getSource(sourceMap, i),
3052
+ (sourcesContent && sourcesContent[i]) || undefined
3053
+ );
3054
+ }
3055
+ if (names) {
3056
+ for (let i = 0; i < names.length; i++) {
3057
+ onName(i, names[i]);
3058
+ }
3059
+ }
3060
+
3061
+ const lastLine = lines[lines.length - 1];
3062
+ const lastNewLine = lastLine.endsWith("\n");
3063
+ const finalLine = lastNewLine ? lines.length + 1 : lines.length;
3064
+ const finalColumn = lastNewLine ? 0 : lastLine.length;
3065
+
3066
+ let currentGeneratedLine = 1;
3067
+ let currentGeneratedColumn = 0;
3068
+
3069
+ let mappingActive = false;
3070
+ let activeMappingSourceIndex = -1;
3071
+ let activeMappingOriginalLine = -1;
3072
+ let activeMappingOriginalColumn = -1;
3073
+ let activeMappingNameIndex = -1;
3074
+
3075
+ const onMapping = (
3076
+ generatedLine,
3077
+ generatedColumn,
3078
+ sourceIndex,
3079
+ originalLine,
3080
+ originalColumn,
3081
+ nameIndex
3082
+ ) => {
3083
+ if (mappingActive && currentGeneratedLine <= lines.length) {
3084
+ let chunk;
3085
+ const mappingLine = currentGeneratedLine;
3086
+ const mappingColumn = currentGeneratedColumn;
3087
+ const line = lines[currentGeneratedLine - 1];
3088
+ if (generatedLine !== currentGeneratedLine) {
3089
+ chunk = line.slice(currentGeneratedColumn);
3090
+ currentGeneratedLine++;
3091
+ currentGeneratedColumn = 0;
3092
+ } else {
3093
+ chunk = line.slice(currentGeneratedColumn, generatedColumn);
3094
+ currentGeneratedColumn = generatedColumn;
3095
+ }
3096
+ if (chunk) {
3097
+ onChunk(
3098
+ chunk,
3099
+ mappingLine,
3100
+ mappingColumn,
3101
+ activeMappingSourceIndex,
3102
+ activeMappingOriginalLine,
3103
+ activeMappingOriginalColumn,
3104
+ activeMappingNameIndex
3105
+ );
3106
+ }
3107
+ mappingActive = false;
3108
+ }
3109
+ if (generatedLine > currentGeneratedLine && currentGeneratedColumn > 0) {
3110
+ if (currentGeneratedLine <= lines.length) {
3111
+ const chunk = lines[currentGeneratedLine - 1].slice(
3112
+ currentGeneratedColumn
3113
+ );
3114
+ onChunk(
3115
+ chunk,
3116
+ currentGeneratedLine,
3117
+ currentGeneratedColumn,
3118
+ -1,
3119
+ -1,
3120
+ -1,
3121
+ -1
3122
+ );
3123
+ }
3124
+ currentGeneratedLine++;
3125
+ currentGeneratedColumn = 0;
3126
+ }
3127
+ while (generatedLine > currentGeneratedLine) {
3128
+ if (currentGeneratedLine <= lines.length) {
3129
+ onChunk(
3130
+ lines[currentGeneratedLine - 1],
3131
+ currentGeneratedLine,
3132
+ 0,
3133
+ -1,
3134
+ -1,
3135
+ -1,
3136
+ -1
3137
+ );
3138
+ }
3139
+ currentGeneratedLine++;
3140
+ }
3141
+ if (generatedColumn > currentGeneratedColumn) {
3142
+ if (currentGeneratedLine <= lines.length) {
3143
+ const chunk = lines[currentGeneratedLine - 1].slice(
3144
+ currentGeneratedColumn,
3145
+ generatedColumn
3146
+ );
3147
+ onChunk(
3148
+ chunk,
3149
+ currentGeneratedLine,
3150
+ currentGeneratedColumn,
3151
+ -1,
3152
+ -1,
3153
+ -1,
3154
+ -1
3155
+ );
3156
+ }
3157
+ currentGeneratedColumn = generatedColumn;
3158
+ }
3159
+ if (
3160
+ sourceIndex >= 0 &&
3161
+ (generatedLine < finalLine ||
3162
+ (generatedLine === finalLine && generatedColumn < finalColumn))
3163
+ ) {
3164
+ mappingActive = true;
3165
+ activeMappingSourceIndex = sourceIndex;
3166
+ activeMappingOriginalLine = originalLine;
3167
+ activeMappingOriginalColumn = originalColumn;
3168
+ activeMappingNameIndex = nameIndex;
3169
+ }
3170
+ };
3171
+ readMappings(mappings, onMapping);
3172
+ onMapping(finalLine, finalColumn, -1, -1, -1, -1);
3173
+ return {
3174
+ generatedLine: finalLine,
3175
+ generatedColumn: finalColumn
3176
+ };
3177
+ };
3178
+
3179
+ const streamChunksOfSourceMapLinesFull = (
3180
+ source,
3181
+ sourceMap,
3182
+ onChunk,
3183
+ onSource,
3184
+ _onName
3185
+ ) => {
3186
+ const lines = splitIntoLines(source);
3187
+ if (lines.length === 0) {
3188
+ return {
3189
+ generatedLine: 1,
3190
+ generatedColumn: 0
3191
+ };
3192
+ }
3193
+ const { sources, sourcesContent, mappings } = sourceMap;
3194
+ for (let i = 0; i < sources.length; i++) {
3195
+ onSource(
3196
+ i,
3197
+ getSource(sourceMap, i),
3198
+ (sourcesContent && sourcesContent[i]) || undefined
3199
+ );
3200
+ }
3201
+
3202
+ let currentGeneratedLine = 1;
3203
+
3204
+ const onMapping = (
3205
+ generatedLine,
3206
+ _generatedColumn,
3207
+ sourceIndex,
3208
+ originalLine,
3209
+ originalColumn,
3210
+ _nameIndex
3211
+ ) => {
3212
+ if (
3213
+ sourceIndex < 0 ||
3214
+ generatedLine < currentGeneratedLine ||
3215
+ generatedLine > lines.length
3216
+ ) {
3217
+ return;
3218
+ }
3219
+ while (generatedLine > currentGeneratedLine) {
3220
+ if (currentGeneratedLine <= lines.length) {
3221
+ onChunk(
3222
+ lines[currentGeneratedLine - 1],
3223
+ currentGeneratedLine,
3224
+ 0,
3225
+ -1,
3226
+ -1,
3227
+ -1,
3228
+ -1
3229
+ );
3230
+ }
3231
+ currentGeneratedLine++;
3232
+ }
3233
+ if (generatedLine <= lines.length) {
3234
+ onChunk(
3235
+ lines[generatedLine - 1],
3236
+ generatedLine,
3237
+ 0,
3238
+ sourceIndex,
3239
+ originalLine,
3240
+ originalColumn,
3241
+ -1
3242
+ );
3243
+ currentGeneratedLine++;
3244
+ }
3245
+ };
3246
+ readMappings(mappings, onMapping);
3247
+ for (; currentGeneratedLine <= lines.length; currentGeneratedLine++) {
3248
+ onChunk(
3249
+ lines[currentGeneratedLine - 1],
3250
+ currentGeneratedLine,
3251
+ 0,
3252
+ -1,
3253
+ -1,
3254
+ -1,
3255
+ -1
3256
+ );
3257
+ }
3258
+
3259
+ const lastLine = lines[lines.length - 1];
3260
+ const lastNewLine = lastLine.endsWith("\n");
3261
+
3262
+ const finalLine = lastNewLine ? lines.length + 1 : lines.length;
3263
+ const finalColumn = lastNewLine ? 0 : lastLine.length;
3264
+
3265
+ return {
3266
+ generatedLine: finalLine,
3267
+ generatedColumn: finalColumn
3268
+ };
3269
+ };
3270
+
3271
+ const streamChunksOfSourceMapFinal = (
3272
+ source,
3273
+ sourceMap,
3274
+ onChunk,
3275
+ onSource,
3276
+ onName
3277
+ ) => {
3278
+ const result = getGeneratedSourceInfo(source);
3279
+ const { generatedLine: finalLine, generatedColumn: finalColumn } = result;
3280
+
3281
+ if (finalLine === 1 && finalColumn === 0) return result;
3282
+ const { sources, sourcesContent, names, mappings } = sourceMap;
3283
+ for (let i = 0; i < sources.length; i++) {
3284
+ onSource(
3285
+ i,
3286
+ getSource(sourceMap, i),
3287
+ (sourcesContent && sourcesContent[i]) || undefined
3288
+ );
3289
+ }
3290
+ if (names) {
3291
+ for (let i = 0; i < names.length; i++) {
3292
+ onName(i, names[i]);
3293
+ }
3294
+ }
3295
+
3296
+ let mappingActiveLine = 0;
3297
+
3298
+ const onMapping = (
3299
+ generatedLine,
3300
+ generatedColumn,
3301
+ sourceIndex,
3302
+ originalLine,
3303
+ originalColumn,
3304
+ nameIndex
3305
+ ) => {
3306
+ if (
3307
+ generatedLine >= finalLine &&
3308
+ (generatedColumn >= finalColumn || generatedLine > finalLine)
3309
+ ) {
3310
+ return;
3311
+ }
3312
+ if (sourceIndex >= 0) {
3313
+ onChunk(
3314
+ undefined,
3315
+ generatedLine,
3316
+ generatedColumn,
3317
+ sourceIndex,
3318
+ originalLine,
3319
+ originalColumn,
3320
+ nameIndex
3321
+ );
3322
+ mappingActiveLine = generatedLine;
3323
+ } else if (mappingActiveLine === generatedLine) {
3324
+ onChunk(undefined, generatedLine, generatedColumn, -1, -1, -1, -1);
3325
+ mappingActiveLine = 0;
3326
+ }
3327
+ };
3328
+ readMappings(mappings, onMapping);
3329
+ return result;
3330
+ };
3331
+
3332
+ const streamChunksOfSourceMapLinesFinal = (
3333
+ source,
3334
+ sourceMap,
3335
+ onChunk,
3336
+ onSource,
3337
+ _onName
3338
+ ) => {
3339
+ const result = getGeneratedSourceInfo(source);
3340
+ const { generatedLine, generatedColumn } = result;
3341
+ if (generatedLine === 1 && generatedColumn === 0) {
3342
+ return {
3343
+ generatedLine: 1,
3344
+ generatedColumn: 0
3345
+ };
3346
+ }
3347
+
3348
+ const { sources, sourcesContent, mappings } = sourceMap;
3349
+ for (let i = 0; i < sources.length; i++) {
3350
+ onSource(
3351
+ i,
3352
+ getSource(sourceMap, i),
3353
+ (sourcesContent && sourcesContent[i]) || undefined
3354
+ );
3355
+ }
3356
+
3357
+ const finalLine = generatedColumn === 0 ? generatedLine - 1 : generatedLine;
3358
+
3359
+ let currentGeneratedLine = 1;
3360
+
3361
+ const onMapping = (
3362
+ generatedLine,
3363
+ _generatedColumn,
3364
+ sourceIndex,
3365
+ originalLine,
3366
+ originalColumn,
3367
+ _nameIndex
3368
+ ) => {
3369
+ if (
3370
+ sourceIndex >= 0 &&
3371
+ currentGeneratedLine <= generatedLine &&
3372
+ generatedLine <= finalLine
3373
+ ) {
3374
+ onChunk(
3375
+ undefined,
3376
+ generatedLine,
3377
+ 0,
3378
+ sourceIndex,
3379
+ originalLine,
3380
+ originalColumn,
3381
+ -1
3382
+ );
3383
+ currentGeneratedLine = generatedLine + 1;
3384
+ }
3385
+ };
3386
+ readMappings(mappings, onMapping);
3387
+ return result;
3388
+ };
3389
+
3390
+ module.exports = (
3391
+ source,
3392
+ sourceMap,
3393
+ onChunk,
3394
+ onSource,
3395
+ onName,
3396
+ finalSource,
3397
+ columns
3398
+ ) => {
3399
+ if (columns) {
3400
+ return finalSource
3401
+ ? streamChunksOfSourceMapFinal(
3402
+ source,
3403
+ sourceMap,
3404
+ onChunk,
3405
+ onSource,
3406
+ onName
3407
+ )
3408
+ : streamChunksOfSourceMapFull(
3409
+ source,
3410
+ sourceMap,
3411
+ onChunk,
3412
+ onSource,
3413
+ onName
3414
+ );
3415
+ } else {
3416
+ return finalSource
3417
+ ? streamChunksOfSourceMapLinesFinal(
3418
+ source,
3419
+ sourceMap,
3420
+ onChunk,
3421
+ onSource,
3422
+ onName
3423
+ )
3424
+ : streamChunksOfSourceMapLinesFull(
3425
+ source,
3426
+ sourceMap,
3427
+ onChunk,
3428
+ onSource,
3429
+ onName
3430
+ );
3431
+ }
3432
+ };
3433
+
3434
+
3435
+ /***/ }),
3436
+
3437
+ /***/ 932:
3438
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
3439
+
3440
+ /*
3441
+ MIT License http://www.opensource.org/licenses/mit-license.php
3442
+ Author Tobias Koppers @sokra
3443
+ */
3444
+
3445
+ const defineExport = (name, fn) => {
3446
+ let value;
3447
+ Object.defineProperty(exports, name, {
3448
+ get: () => {
3449
+ if (fn !== undefined) {
3450
+ value = fn();
3451
+ fn = undefined;
3452
+ }
3453
+ return value;
3454
+ },
3455
+ configurable: true
3456
+ });
3457
+ };
3458
+
3459
+ defineExport("Source", () => __nccwpck_require__(313));
3460
+
3461
+ defineExport("RawSource", () => __nccwpck_require__(798));
3462
+ defineExport("OriginalSource", () => __nccwpck_require__(118));
3463
+ defineExport("SourceMapSource", () => __nccwpck_require__(221));
3464
+ defineExport("CachedSource", () => __nccwpck_require__(337));
3465
+ defineExport("ConcatSource", () => __nccwpck_require__(634));
3466
+ defineExport("ReplaceSource", () => __nccwpck_require__(395));
3467
+ defineExport("PrefixSource", () => __nccwpck_require__(234));
3468
+ defineExport("SizeOnlySource", () => __nccwpck_require__(928));
3469
+ defineExport("CompatSource", () => __nccwpck_require__(615));
3470
+
3471
+
3472
+ /***/ })
3473
+
3474
+ /******/ });
3475
+ /************************************************************************/
3476
+ /******/ // The module cache
3477
+ /******/ var __webpack_module_cache__ = {};
3478
+ /******/
3479
+ /******/ // The require function
3480
+ /******/ function __nccwpck_require__(moduleId) {
3481
+ /******/ // Check if module is in cache
3482
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
3483
+ /******/ if (cachedModule !== undefined) {
3484
+ /******/ return cachedModule.exports;
3485
+ /******/ }
3486
+ /******/ // Create a new module (and put it into the cache)
3487
+ /******/ var module = __webpack_module_cache__[moduleId] = {
3488
+ /******/ // no module.id needed
3489
+ /******/ // no module.loaded needed
3490
+ /******/ exports: {}
3491
+ /******/ };
3492
+ /******/
3493
+ /******/ // Execute the module function
3494
+ /******/ var threw = true;
3495
+ /******/ try {
3496
+ /******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
3497
+ /******/ threw = false;
3498
+ /******/ } finally {
3499
+ /******/ if(threw) delete __webpack_module_cache__[moduleId];
3500
+ /******/ }
3501
+ /******/
3502
+ /******/ // Return the exports of the module
3503
+ /******/ return module.exports;
3504
+ /******/ }
3505
+ /******/
3506
+ /************************************************************************/
3507
+ /******/ /* webpack/runtime/compat */
3508
+ /******/
3509
+ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
3510
+ /******/
3511
+ /************************************************************************/
3512
+ /******/
3513
+ /******/ // startup
3514
+ /******/ // Load entry module and return exports
3515
+ /******/ // This entry module is referenced by other modules so it can't be inlined
3516
+ /******/ var __webpack_exports__ = __nccwpck_require__(932);
3517
+ /******/ module.exports = __webpack_exports__;
3518
+ /******/
3519
+ /******/ })()
3520
+ ;