@builder.io/dev-tools 1.6.48-dev.202505142147.6bb62701 → 1.6.49

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.
package/webpack/index.mjs CHANGED
@@ -1,2874 +1,30 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __commonJS = (cb, mod) => function __require() {
10
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
29
-
30
- // node_modules/webpack-sources/lib/Source.js
31
- var require_Source = __commonJS({
32
- "node_modules/webpack-sources/lib/Source.js"(exports, module) {
33
- "use strict";
34
- var Source = class {
35
- source() {
36
- throw new Error("Abstract");
37
- }
38
- buffer() {
39
- const source = this.source();
40
- if (Buffer.isBuffer(source)) return source;
41
- return Buffer.from(source, "utf-8");
42
- }
43
- size() {
44
- return this.buffer().length;
45
- }
46
- map(options) {
47
- return null;
48
- }
49
- sourceAndMap(options) {
50
- return {
51
- source: this.source(),
52
- map: this.map(options)
53
- };
54
- }
55
- updateHash(hash) {
56
- throw new Error("Abstract");
57
- }
58
- };
59
- module.exports = Source;
60
- }
61
- });
62
-
63
- // node_modules/webpack-sources/lib/helpers/getGeneratedSourceInfo.js
64
- var require_getGeneratedSourceInfo = __commonJS({
65
- "node_modules/webpack-sources/lib/helpers/getGeneratedSourceInfo.js"(exports, module) {
66
- "use strict";
67
- var CHAR_CODE_NEW_LINE = "\n".charCodeAt(0);
68
- var getGeneratedSourceInfo = (source) => {
69
- if (source === void 0) {
70
- return {};
71
- }
72
- const lastLineStart = source.lastIndexOf("\n");
73
- if (lastLineStart === -1) {
74
- return {
75
- generatedLine: 1,
76
- generatedColumn: source.length,
77
- source
78
- };
79
- }
80
- let generatedLine = 2;
81
- for (let i = 0; i < lastLineStart; i++) {
82
- if (source.charCodeAt(i) === CHAR_CODE_NEW_LINE) generatedLine++;
83
- }
84
- return {
85
- generatedLine,
86
- generatedColumn: source.length - lastLineStart - 1,
87
- source
88
- };
89
- };
90
- module.exports = getGeneratedSourceInfo;
91
- }
92
- });
93
-
94
- // node_modules/webpack-sources/lib/helpers/splitIntoLines.js
95
- var require_splitIntoLines = __commonJS({
96
- "node_modules/webpack-sources/lib/helpers/splitIntoLines.js"(exports, module) {
97
- var splitIntoLines = (str) => {
98
- const results = [];
99
- const len = str.length;
100
- let i = 0;
101
- for (; i < len; ) {
102
- const cc = str.charCodeAt(i);
103
- if (cc === 10) {
104
- results.push("\n");
105
- i++;
106
- } else {
107
- let j = i + 1;
108
- while (j < len && str.charCodeAt(j) !== 10) j++;
109
- results.push(str.slice(i, j + 1));
110
- i = j + 1;
111
- }
112
- }
113
- return results;
114
- };
115
- module.exports = splitIntoLines;
116
- }
117
- });
118
-
119
- // node_modules/webpack-sources/lib/helpers/streamChunksOfRawSource.js
120
- var require_streamChunksOfRawSource = __commonJS({
121
- "node_modules/webpack-sources/lib/helpers/streamChunksOfRawSource.js"(exports, module) {
122
- "use strict";
123
- var getGeneratedSourceInfo = require_getGeneratedSourceInfo();
124
- var splitIntoLines = require_splitIntoLines();
125
- var streamChunksOfRawSource = (source, onChunk, onSource, onName) => {
126
- let line = 1;
127
- const matches = splitIntoLines(source);
128
- let match;
129
- for (match of matches) {
130
- onChunk(match, line, 0, -1, -1, -1, -1);
131
- line++;
132
- }
133
- return matches.length === 0 || match.endsWith("\n") ? {
134
- generatedLine: matches.length + 1,
135
- generatedColumn: 0
136
- } : {
137
- generatedLine: matches.length,
138
- generatedColumn: match.length
139
- };
140
- };
141
- module.exports = (source, onChunk, onSource, onName, finalSource) => {
142
- return finalSource ? getGeneratedSourceInfo(source) : streamChunksOfRawSource(source, onChunk, onSource, onName);
143
- };
144
- }
145
- });
146
-
147
- // node_modules/webpack-sources/lib/RawSource.js
148
- var require_RawSource = __commonJS({
149
- "node_modules/webpack-sources/lib/RawSource.js"(exports, module) {
150
- "use strict";
151
- var streamChunksOfRawSource = require_streamChunksOfRawSource();
152
- var Source = require_Source();
153
- var RawSource = class extends Source {
154
- constructor(value, convertToString = false) {
155
- super();
156
- const isBuffer = Buffer.isBuffer(value);
157
- if (!isBuffer && typeof value !== "string") {
158
- throw new TypeError("argument 'value' must be either string of Buffer");
159
- }
160
- this._valueIsBuffer = !convertToString && isBuffer;
161
- this._value = convertToString && isBuffer ? void 0 : value;
162
- this._valueAsBuffer = isBuffer ? value : void 0;
163
- this._valueAsString = isBuffer ? void 0 : value;
164
- }
165
- isBuffer() {
166
- return this._valueIsBuffer;
167
- }
168
- source() {
169
- if (this._value === void 0) {
170
- this._value = this._valueAsBuffer.toString("utf-8");
171
- }
172
- return this._value;
173
- }
174
- buffer() {
175
- if (this._valueAsBuffer === void 0) {
176
- this._valueAsBuffer = Buffer.from(this._value, "utf-8");
177
- }
178
- return this._valueAsBuffer;
179
- }
180
- map(options) {
181
- return null;
182
- }
183
- /**
184
- * @param {object} options options
185
- * @param {function(string, number, number, number, number, number, number): void} onChunk called for each chunk of code
186
- * @param {function(number, string, string)} onSource called for each source
187
- * @param {function(number, string)} onName called for each name
188
- * @returns {void}
189
- */
190
- streamChunks(options, onChunk, onSource, onName) {
191
- if (this._value === void 0) {
192
- this._value = Buffer.from(this._valueAsBuffer, "utf-8");
193
- }
194
- if (this._valueAsString === void 0) {
195
- this._valueAsString = typeof this._value === "string" ? this._value : this._value.toString("utf-8");
196
- }
197
- return streamChunksOfRawSource(
198
- this._valueAsString,
199
- onChunk,
200
- onSource,
201
- onName,
202
- !!(options && options.finalSource)
203
- );
204
- }
205
- updateHash(hash) {
206
- if (this._valueAsBuffer === void 0) {
207
- this._valueAsBuffer = Buffer.from(this._value, "utf-8");
208
- }
209
- hash.update("RawSource");
210
- hash.update(this._valueAsBuffer);
211
- }
212
- };
213
- module.exports = RawSource;
214
- }
215
- });
216
-
217
- // node_modules/webpack-sources/lib/helpers/createMappingsSerializer.js
218
- var require_createMappingsSerializer = __commonJS({
219
- "node_modules/webpack-sources/lib/helpers/createMappingsSerializer.js"(exports, module) {
220
- "use strict";
221
- var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(
222
- ""
223
- );
224
- var CONTINUATION_BIT = 32;
225
- var createMappingsSerializer = (options) => {
226
- const linesOnly = options && options.columns === false;
227
- return linesOnly ? createLinesOnlyMappingsSerializer() : createFullMappingsSerializer();
228
- };
229
- var createFullMappingsSerializer = () => {
230
- let currentLine = 1;
231
- let currentColumn = 0;
232
- let currentSourceIndex = 0;
233
- let currentOriginalLine = 1;
234
- let currentOriginalColumn = 0;
235
- let currentNameIndex = 0;
236
- let activeMapping = false;
237
- let activeName = false;
238
- let initial = true;
239
- return (generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
240
- if (activeMapping && currentLine === generatedLine) {
241
- if (sourceIndex === currentSourceIndex && originalLine === currentOriginalLine && originalColumn === currentOriginalColumn && !activeName && nameIndex < 0) {
242
- return "";
243
- }
244
- } else {
245
- if (sourceIndex < 0) {
246
- return "";
247
- }
248
- }
249
- let str;
250
- if (currentLine < generatedLine) {
251
- str = ";".repeat(generatedLine - currentLine);
252
- currentLine = generatedLine;
253
- currentColumn = 0;
254
- initial = false;
255
- } else if (initial) {
256
- str = "";
257
- initial = false;
258
- } else {
259
- str = ",";
260
- }
261
- const writeValue = (value) => {
262
- const sign = value >>> 31 & 1;
263
- const mask = value >> 31;
264
- const absValue = value + mask ^ mask;
265
- let data = absValue << 1 | sign;
266
- for (; ; ) {
267
- const sextet = data & 31;
268
- data >>= 5;
269
- if (data === 0) {
270
- str += ALPHABET[sextet];
271
- break;
272
- } else {
273
- str += ALPHABET[sextet | CONTINUATION_BIT];
274
- }
275
- }
276
- };
277
- writeValue(generatedColumn - currentColumn);
278
- currentColumn = generatedColumn;
279
- if (sourceIndex >= 0) {
280
- activeMapping = true;
281
- if (sourceIndex === currentSourceIndex) {
282
- str += "A";
283
- } else {
284
- writeValue(sourceIndex - currentSourceIndex);
285
- currentSourceIndex = sourceIndex;
286
- }
287
- writeValue(originalLine - currentOriginalLine);
288
- currentOriginalLine = originalLine;
289
- if (originalColumn === currentOriginalColumn) {
290
- str += "A";
291
- } else {
292
- writeValue(originalColumn - currentOriginalColumn);
293
- currentOriginalColumn = originalColumn;
294
- }
295
- if (nameIndex >= 0) {
296
- writeValue(nameIndex - currentNameIndex);
297
- currentNameIndex = nameIndex;
298
- activeName = true;
299
- } else {
300
- activeName = false;
301
- }
302
- } else {
303
- activeMapping = false;
304
- }
305
- return str;
306
- };
307
- };
308
- var createLinesOnlyMappingsSerializer = () => {
309
- let lastWrittenLine = 0;
310
- let currentLine = 1;
311
- let currentSourceIndex = 0;
312
- let currentOriginalLine = 1;
313
- return (generatedLine, _generatedColumn, sourceIndex, originalLine, _originalColumn, _nameIndex) => {
314
- if (sourceIndex < 0) {
315
- return "";
316
- }
317
- if (lastWrittenLine === generatedLine) {
318
- return "";
319
- }
320
- let str;
321
- const writeValue = (value) => {
322
- const sign = value >>> 31 & 1;
323
- const mask = value >> 31;
324
- const absValue = value + mask ^ mask;
325
- let data = absValue << 1 | sign;
326
- for (; ; ) {
327
- const sextet = data & 31;
328
- data >>= 5;
329
- if (data === 0) {
330
- str += ALPHABET[sextet];
331
- break;
332
- } else {
333
- str += ALPHABET[sextet | CONTINUATION_BIT];
334
- }
335
- }
336
- };
337
- lastWrittenLine = generatedLine;
338
- if (generatedLine === currentLine + 1) {
339
- currentLine = generatedLine;
340
- if (sourceIndex === currentSourceIndex) {
341
- currentSourceIndex = sourceIndex;
342
- if (originalLine === currentOriginalLine + 1) {
343
- currentOriginalLine = originalLine;
344
- return ";AACA";
345
- } else {
346
- str = ";AA";
347
- writeValue(originalLine - currentOriginalLine);
348
- currentOriginalLine = originalLine;
349
- return str + "A";
350
- }
351
- } else {
352
- str = ";A";
353
- writeValue(sourceIndex - currentSourceIndex);
354
- currentSourceIndex = sourceIndex;
355
- writeValue(originalLine - currentOriginalLine);
356
- currentOriginalLine = originalLine;
357
- return str + "A";
358
- }
359
- } else {
360
- str = ";".repeat(generatedLine - currentLine);
361
- currentLine = generatedLine;
362
- if (sourceIndex === currentSourceIndex) {
363
- currentSourceIndex = sourceIndex;
364
- if (originalLine === currentOriginalLine + 1) {
365
- currentOriginalLine = originalLine;
366
- return str + "AACA";
367
- } else {
368
- str += "AA";
369
- writeValue(originalLine - currentOriginalLine);
370
- currentOriginalLine = originalLine;
371
- return str + "A";
372
- }
373
- } else {
374
- str += "A";
375
- writeValue(sourceIndex - currentSourceIndex);
376
- currentSourceIndex = sourceIndex;
377
- writeValue(originalLine - currentOriginalLine);
378
- currentOriginalLine = originalLine;
379
- return str + "A";
380
- }
381
- }
382
- };
383
- };
384
- module.exports = createMappingsSerializer;
385
- }
386
- });
387
-
388
- // node_modules/webpack-sources/lib/helpers/getFromStreamChunks.js
389
- var require_getFromStreamChunks = __commonJS({
390
- "node_modules/webpack-sources/lib/helpers/getFromStreamChunks.js"(exports) {
391
- "use strict";
392
- var createMappingsSerializer = require_createMappingsSerializer();
393
- exports.getSourceAndMap = (inputSource, options) => {
394
- let code = "";
395
- let mappings = "";
396
- let sources = [];
397
- let sourcesContent = [];
398
- let names = [];
399
- const addMapping = createMappingsSerializer(options);
400
- const { source } = inputSource.streamChunks(
401
- Object.assign({}, options, { finalSource: true }),
402
- (chunk, generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
403
- if (chunk !== void 0) code += chunk;
404
- mappings += addMapping(
405
- generatedLine,
406
- generatedColumn,
407
- sourceIndex,
408
- originalLine,
409
- originalColumn,
410
- nameIndex
411
- );
412
- },
413
- (sourceIndex, source2, sourceContent) => {
414
- while (sources.length < sourceIndex) {
415
- sources.push(null);
416
- }
417
- sources[sourceIndex] = source2;
418
- if (sourceContent !== void 0) {
419
- while (sourcesContent.length < sourceIndex) {
420
- sourcesContent.push(null);
421
- }
422
- sourcesContent[sourceIndex] = sourceContent;
423
- }
424
- },
425
- (nameIndex, name) => {
426
- while (names.length < nameIndex) {
427
- names.push(null);
428
- }
429
- names[nameIndex] = name;
430
- }
431
- );
432
- return {
433
- source: source !== void 0 ? source : code,
434
- map: mappings.length > 0 ? {
435
- version: 3,
436
- file: "x",
437
- mappings,
438
- sources,
439
- sourcesContent: sourcesContent.length > 0 ? sourcesContent : void 0,
440
- names
441
- } : null
442
- };
443
- };
444
- exports.getMap = (source, options) => {
445
- let mappings = "";
446
- let sources = [];
447
- let sourcesContent = [];
448
- let names = [];
449
- const addMapping = createMappingsSerializer(options);
450
- source.streamChunks(
451
- Object.assign({}, options, { source: false, finalSource: true }),
452
- (chunk, generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
453
- mappings += addMapping(
454
- generatedLine,
455
- generatedColumn,
456
- sourceIndex,
457
- originalLine,
458
- originalColumn,
459
- nameIndex
460
- );
461
- },
462
- (sourceIndex, source2, sourceContent) => {
463
- while (sources.length < sourceIndex) {
464
- sources.push(null);
465
- }
466
- sources[sourceIndex] = source2;
467
- if (sourceContent !== void 0) {
468
- while (sourcesContent.length < sourceIndex) {
469
- sourcesContent.push(null);
470
- }
471
- sourcesContent[sourceIndex] = sourceContent;
472
- }
473
- },
474
- (nameIndex, name) => {
475
- while (names.length < nameIndex) {
476
- names.push(null);
477
- }
478
- names[nameIndex] = name;
479
- }
480
- );
481
- return mappings.length > 0 ? {
482
- version: 3,
483
- file: "x",
484
- mappings,
485
- sources,
486
- sourcesContent: sourcesContent.length > 0 ? sourcesContent : void 0,
487
- names
488
- } : null;
489
- };
490
- }
491
- });
492
-
493
- // node_modules/webpack-sources/lib/helpers/splitIntoPotentialTokens.js
494
- var require_splitIntoPotentialTokens = __commonJS({
495
- "node_modules/webpack-sources/lib/helpers/splitIntoPotentialTokens.js"(exports, module) {
496
- var splitIntoPotentialTokens = (str) => {
497
- const len = str.length;
498
- if (len === 0) return null;
499
- const results = [];
500
- let i = 0;
501
- for (; i < len; ) {
502
- const s = i;
503
- block: {
504
- let cc = str.charCodeAt(i);
505
- while (cc !== 10 && cc !== 59 && cc !== 123 && cc !== 125) {
506
- if (++i >= len) break block;
507
- cc = str.charCodeAt(i);
508
- }
509
- while (cc === 59 || cc === 32 || cc === 123 || cc === 125 || cc === 13 || cc === 9) {
510
- if (++i >= len) break block;
511
- cc = str.charCodeAt(i);
512
- }
513
- if (cc === 10) {
514
- i++;
515
- }
516
- }
517
- results.push(str.slice(s, i));
518
- }
519
- return results;
520
- };
521
- module.exports = splitIntoPotentialTokens;
522
- }
523
- });
524
-
525
- // node_modules/webpack-sources/lib/OriginalSource.js
526
- var require_OriginalSource = __commonJS({
527
- "node_modules/webpack-sources/lib/OriginalSource.js"(exports, module) {
528
- "use strict";
529
- var { getMap, getSourceAndMap } = require_getFromStreamChunks();
530
- var splitIntoLines = require_splitIntoLines();
531
- var getGeneratedSourceInfo = require_getGeneratedSourceInfo();
532
- var Source = require_Source();
533
- var splitIntoPotentialTokens = require_splitIntoPotentialTokens();
534
- var OriginalSource = class extends Source {
535
- constructor(value, name) {
536
- super();
537
- const isBuffer = Buffer.isBuffer(value);
538
- this._value = isBuffer ? void 0 : value;
539
- this._valueAsBuffer = isBuffer ? value : void 0;
540
- this._name = name;
541
- }
542
- getName() {
543
- return this._name;
544
- }
545
- source() {
546
- if (this._value === void 0) {
547
- this._value = this._valueAsBuffer.toString("utf-8");
548
- }
549
- return this._value;
550
- }
551
- buffer() {
552
- if (this._valueAsBuffer === void 0) {
553
- this._valueAsBuffer = Buffer.from(this._value, "utf-8");
554
- }
555
- return this._valueAsBuffer;
556
- }
557
- map(options) {
558
- return getMap(this, options);
559
- }
560
- sourceAndMap(options) {
561
- return getSourceAndMap(this, options);
562
- }
563
- /**
564
- * @param {object} options options
565
- * @param {function(string, number, number, number, number, number, number): void} onChunk called for each chunk of code
566
- * @param {function(number, string, string)} onSource called for each source
567
- * @param {function(number, string)} onName called for each name
568
- * @returns {void}
569
- */
570
- streamChunks(options, onChunk, onSource, onName) {
571
- if (this._value === void 0) {
572
- this._value = this._valueAsBuffer.toString("utf-8");
573
- }
574
- onSource(0, this._name, this._value);
575
- const finalSource = !!(options && options.finalSource);
576
- if (!options || options.columns !== false) {
577
- const matches = splitIntoPotentialTokens(this._value);
578
- let line = 1;
579
- let column = 0;
580
- if (matches !== null) {
581
- for (const match of matches) {
582
- const isEndOfLine = match.endsWith("\n");
583
- if (isEndOfLine && match.length === 1) {
584
- if (!finalSource) onChunk(match, line, column, -1, -1, -1, -1);
585
- } else {
586
- const chunk = finalSource ? void 0 : match;
587
- onChunk(chunk, line, column, 0, line, column, -1);
588
- }
589
- if (isEndOfLine) {
590
- line++;
591
- column = 0;
592
- } else {
593
- column += match.length;
594
- }
595
- }
596
- }
597
- return {
598
- generatedLine: line,
599
- generatedColumn: column,
600
- source: finalSource ? this._value : void 0
601
- };
602
- } else if (finalSource) {
603
- const result = getGeneratedSourceInfo(this._value);
604
- const { generatedLine, generatedColumn } = result;
605
- if (generatedColumn === 0) {
606
- for (let line = 1; line < generatedLine; line++)
607
- onChunk(void 0, line, 0, 0, line, 0, -1);
608
- } else {
609
- for (let line = 1; line <= generatedLine; line++)
610
- onChunk(void 0, line, 0, 0, line, 0, -1);
611
- }
612
- return result;
613
- } else {
614
- let line = 1;
615
- const matches = splitIntoLines(this._value);
616
- let match;
617
- for (match of matches) {
618
- onChunk(finalSource ? void 0 : match, line, 0, 0, line, 0, -1);
619
- line++;
620
- }
621
- return matches.length === 0 || match.endsWith("\n") ? {
622
- generatedLine: matches.length + 1,
623
- generatedColumn: 0,
624
- source: finalSource ? this._value : void 0
625
- } : {
626
- generatedLine: matches.length,
627
- generatedColumn: match.length,
628
- source: finalSource ? this._value : void 0
629
- };
630
- }
631
- }
632
- updateHash(hash) {
633
- if (this._valueAsBuffer === void 0) {
634
- this._valueAsBuffer = Buffer.from(this._value, "utf-8");
635
- }
636
- hash.update("OriginalSource");
637
- hash.update(this._valueAsBuffer);
638
- hash.update(this._name || "");
639
- }
640
- };
641
- module.exports = OriginalSource;
642
- }
643
- });
644
-
645
- // node_modules/webpack-sources/lib/helpers/getSource.js
646
- var require_getSource = __commonJS({
647
- "node_modules/webpack-sources/lib/helpers/getSource.js"(exports, module) {
648
- "use strict";
649
- var getSource = (sourceMap, index) => {
650
- if (index < 0) return null;
651
- const { sourceRoot, sources } = sourceMap;
652
- const source = sources[index];
653
- if (!sourceRoot) return source;
654
- if (sourceRoot.endsWith("/")) return sourceRoot + source;
655
- return sourceRoot + "/" + source;
656
- };
657
- module.exports = getSource;
658
- }
659
- });
660
-
661
- // node_modules/webpack-sources/lib/helpers/readMappings.js
662
- var require_readMappings = __commonJS({
663
- "node_modules/webpack-sources/lib/helpers/readMappings.js"(exports, module) {
664
- "use strict";
665
- var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
666
- var CONTINUATION_BIT = 32;
667
- var END_SEGMENT_BIT = 64;
668
- var NEXT_LINE = END_SEGMENT_BIT | 1;
669
- var INVALID = END_SEGMENT_BIT | 2;
670
- var DATA_MASK = 31;
671
- var ccToValue = new Uint8Array("z".charCodeAt(0) + 1);
672
- {
673
- ccToValue.fill(INVALID);
674
- for (let i = 0; i < ALPHABET.length; i++) {
675
- ccToValue[ALPHABET.charCodeAt(i)] = i;
676
- }
677
- ccToValue[",".charCodeAt(0)] = END_SEGMENT_BIT;
678
- ccToValue[";".charCodeAt(0)] = NEXT_LINE;
679
- }
680
- var ccMax = ccToValue.length - 1;
681
- var readMappings = (mappings, onMapping) => {
682
- const currentData = new Uint32Array([0, 0, 1, 0, 0]);
683
- let currentDataPos = 0;
684
- let currentValue = 0;
685
- let currentValuePos = 0;
686
- let generatedLine = 1;
687
- let generatedColumn = -1;
688
- for (let i = 0; i < mappings.length; i++) {
689
- const cc = mappings.charCodeAt(i);
690
- if (cc > ccMax) continue;
691
- const value = ccToValue[cc];
692
- if ((value & END_SEGMENT_BIT) !== 0) {
693
- if (currentData[0] > generatedColumn) {
694
- if (currentDataPos === 1) {
695
- onMapping(generatedLine, currentData[0], -1, -1, -1, -1);
696
- } else if (currentDataPos === 4) {
697
- onMapping(
698
- generatedLine,
699
- currentData[0],
700
- currentData[1],
701
- currentData[2],
702
- currentData[3],
703
- -1
704
- );
705
- } else if (currentDataPos === 5) {
706
- onMapping(
707
- generatedLine,
708
- currentData[0],
709
- currentData[1],
710
- currentData[2],
711
- currentData[3],
712
- currentData[4]
713
- );
714
- }
715
- generatedColumn = currentData[0];
716
- }
717
- currentDataPos = 0;
718
- if (value === NEXT_LINE) {
719
- generatedLine++;
720
- currentData[0] = 0;
721
- generatedColumn = -1;
722
- }
723
- } else if ((value & CONTINUATION_BIT) === 0) {
724
- currentValue |= value << currentValuePos;
725
- const finalValue = currentValue & 1 ? -(currentValue >> 1) : currentValue >> 1;
726
- currentData[currentDataPos++] += finalValue;
727
- currentValuePos = 0;
728
- currentValue = 0;
729
- } else {
730
- currentValue |= (value & DATA_MASK) << currentValuePos;
731
- currentValuePos += 5;
732
- }
733
- }
734
- if (currentDataPos === 1) {
735
- onMapping(generatedLine, currentData[0], -1, -1, -1, -1);
736
- } else if (currentDataPos === 4) {
737
- onMapping(
738
- generatedLine,
739
- currentData[0],
740
- currentData[1],
741
- currentData[2],
742
- currentData[3],
743
- -1
744
- );
745
- } else if (currentDataPos === 5) {
746
- onMapping(
747
- generatedLine,
748
- currentData[0],
749
- currentData[1],
750
- currentData[2],
751
- currentData[3],
752
- currentData[4]
753
- );
754
- }
755
- };
756
- module.exports = readMappings;
757
- }
758
- });
759
-
760
- // node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js
761
- var require_streamChunksOfSourceMap = __commonJS({
762
- "node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js"(exports, module) {
763
- "use strict";
764
- var getGeneratedSourceInfo = require_getGeneratedSourceInfo();
765
- var getSource = require_getSource();
766
- var readMappings = require_readMappings();
767
- var splitIntoLines = require_splitIntoLines();
768
- var streamChunksOfSourceMapFull = (source, sourceMap, onChunk, onSource, onName) => {
769
- const lines = splitIntoLines(source);
770
- if (lines.length === 0) {
771
- return {
772
- generatedLine: 1,
773
- generatedColumn: 0
774
- };
775
- }
776
- const { sources, sourcesContent, names, mappings } = sourceMap;
777
- for (let i = 0; i < sources.length; i++) {
778
- onSource(
779
- i,
780
- getSource(sourceMap, i),
781
- sourcesContent && sourcesContent[i] || void 0
782
- );
783
- }
784
- if (names) {
785
- for (let i = 0; i < names.length; i++) {
786
- onName(i, names[i]);
787
- }
788
- }
789
- const lastLine = lines[lines.length - 1];
790
- const lastNewLine = lastLine.endsWith("\n");
791
- const finalLine = lastNewLine ? lines.length + 1 : lines.length;
792
- const finalColumn = lastNewLine ? 0 : lastLine.length;
793
- let currentGeneratedLine = 1;
794
- let currentGeneratedColumn = 0;
795
- let mappingActive = false;
796
- let activeMappingSourceIndex = -1;
797
- let activeMappingOriginalLine = -1;
798
- let activeMappingOriginalColumn = -1;
799
- let activeMappingNameIndex = -1;
800
- const onMapping = (generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
801
- if (mappingActive && currentGeneratedLine <= lines.length) {
802
- let chunk;
803
- const mappingLine = currentGeneratedLine;
804
- const mappingColumn = currentGeneratedColumn;
805
- const line = lines[currentGeneratedLine - 1];
806
- if (generatedLine !== currentGeneratedLine) {
807
- chunk = line.slice(currentGeneratedColumn);
808
- currentGeneratedLine++;
809
- currentGeneratedColumn = 0;
810
- } else {
811
- chunk = line.slice(currentGeneratedColumn, generatedColumn);
812
- currentGeneratedColumn = generatedColumn;
813
- }
814
- if (chunk) {
815
- onChunk(
816
- chunk,
817
- mappingLine,
818
- mappingColumn,
819
- activeMappingSourceIndex,
820
- activeMappingOriginalLine,
821
- activeMappingOriginalColumn,
822
- activeMappingNameIndex
823
- );
824
- }
825
- mappingActive = false;
826
- }
827
- if (generatedLine > currentGeneratedLine && currentGeneratedColumn > 0) {
828
- if (currentGeneratedLine <= lines.length) {
829
- const chunk = lines[currentGeneratedLine - 1].slice(
830
- currentGeneratedColumn
831
- );
832
- onChunk(
833
- chunk,
834
- currentGeneratedLine,
835
- currentGeneratedColumn,
836
- -1,
837
- -1,
838
- -1,
839
- -1
840
- );
841
- }
842
- currentGeneratedLine++;
843
- currentGeneratedColumn = 0;
844
- }
845
- while (generatedLine > currentGeneratedLine) {
846
- if (currentGeneratedLine <= lines.length) {
847
- onChunk(
848
- lines[currentGeneratedLine - 1],
849
- currentGeneratedLine,
850
- 0,
851
- -1,
852
- -1,
853
- -1,
854
- -1
855
- );
856
- }
857
- currentGeneratedLine++;
858
- }
859
- if (generatedColumn > currentGeneratedColumn) {
860
- if (currentGeneratedLine <= lines.length) {
861
- const chunk = lines[currentGeneratedLine - 1].slice(
862
- currentGeneratedColumn,
863
- generatedColumn
864
- );
865
- onChunk(
866
- chunk,
867
- currentGeneratedLine,
868
- currentGeneratedColumn,
869
- -1,
870
- -1,
871
- -1,
872
- -1
873
- );
874
- }
875
- currentGeneratedColumn = generatedColumn;
876
- }
877
- if (sourceIndex >= 0 && (generatedLine < finalLine || generatedLine === finalLine && generatedColumn < finalColumn)) {
878
- mappingActive = true;
879
- activeMappingSourceIndex = sourceIndex;
880
- activeMappingOriginalLine = originalLine;
881
- activeMappingOriginalColumn = originalColumn;
882
- activeMappingNameIndex = nameIndex;
883
- }
884
- };
885
- readMappings(mappings, onMapping);
886
- onMapping(finalLine, finalColumn, -1, -1, -1, -1);
887
- return {
888
- generatedLine: finalLine,
889
- generatedColumn: finalColumn
890
- };
891
- };
892
- var streamChunksOfSourceMapLinesFull = (source, sourceMap, onChunk, onSource, _onName) => {
893
- const lines = splitIntoLines(source);
894
- if (lines.length === 0) {
895
- return {
896
- generatedLine: 1,
897
- generatedColumn: 0
898
- };
899
- }
900
- const { sources, sourcesContent, mappings } = sourceMap;
901
- for (let i = 0; i < sources.length; i++) {
902
- onSource(
903
- i,
904
- getSource(sourceMap, i),
905
- sourcesContent && sourcesContent[i] || void 0
906
- );
907
- }
908
- let currentGeneratedLine = 1;
909
- const onMapping = (generatedLine, _generatedColumn, sourceIndex, originalLine, originalColumn, _nameIndex) => {
910
- if (sourceIndex < 0 || generatedLine < currentGeneratedLine || generatedLine > lines.length) {
911
- return;
912
- }
913
- while (generatedLine > currentGeneratedLine) {
914
- if (currentGeneratedLine <= lines.length) {
915
- onChunk(
916
- lines[currentGeneratedLine - 1],
917
- currentGeneratedLine,
918
- 0,
919
- -1,
920
- -1,
921
- -1,
922
- -1
923
- );
924
- }
925
- currentGeneratedLine++;
926
- }
927
- if (generatedLine <= lines.length) {
928
- onChunk(
929
- lines[generatedLine - 1],
930
- generatedLine,
931
- 0,
932
- sourceIndex,
933
- originalLine,
934
- originalColumn,
935
- -1
936
- );
937
- currentGeneratedLine++;
938
- }
939
- };
940
- readMappings(mappings, onMapping);
941
- for (; currentGeneratedLine <= lines.length; currentGeneratedLine++) {
942
- onChunk(
943
- lines[currentGeneratedLine - 1],
944
- currentGeneratedLine,
945
- 0,
946
- -1,
947
- -1,
948
- -1,
949
- -1
950
- );
951
- }
952
- const lastLine = lines[lines.length - 1];
953
- const lastNewLine = lastLine.endsWith("\n");
954
- const finalLine = lastNewLine ? lines.length + 1 : lines.length;
955
- const finalColumn = lastNewLine ? 0 : lastLine.length;
956
- return {
957
- generatedLine: finalLine,
958
- generatedColumn: finalColumn
959
- };
960
- };
961
- var streamChunksOfSourceMapFinal = (source, sourceMap, onChunk, onSource, onName) => {
962
- const result = getGeneratedSourceInfo(source);
963
- const { generatedLine: finalLine, generatedColumn: finalColumn } = result;
964
- if (finalLine === 1 && finalColumn === 0) return result;
965
- const { sources, sourcesContent, names, mappings } = sourceMap;
966
- for (let i = 0; i < sources.length; i++) {
967
- onSource(
968
- i,
969
- getSource(sourceMap, i),
970
- sourcesContent && sourcesContent[i] || void 0
971
- );
972
- }
973
- if (names) {
974
- for (let i = 0; i < names.length; i++) {
975
- onName(i, names[i]);
976
- }
977
- }
978
- let mappingActiveLine = 0;
979
- const onMapping = (generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
980
- if (generatedLine >= finalLine && (generatedColumn >= finalColumn || generatedLine > finalLine)) {
981
- return;
982
- }
983
- if (sourceIndex >= 0) {
984
- onChunk(
985
- void 0,
986
- generatedLine,
987
- generatedColumn,
988
- sourceIndex,
989
- originalLine,
990
- originalColumn,
991
- nameIndex
992
- );
993
- mappingActiveLine = generatedLine;
994
- } else if (mappingActiveLine === generatedLine) {
995
- onChunk(void 0, generatedLine, generatedColumn, -1, -1, -1, -1);
996
- mappingActiveLine = 0;
997
- }
998
- };
999
- readMappings(mappings, onMapping);
1000
- return result;
1001
- };
1002
- var streamChunksOfSourceMapLinesFinal = (source, sourceMap, onChunk, onSource, _onName) => {
1003
- const result = getGeneratedSourceInfo(source);
1004
- const { generatedLine, generatedColumn } = result;
1005
- if (generatedLine === 1 && generatedColumn === 0) {
1006
- return {
1007
- generatedLine: 1,
1008
- generatedColumn: 0
1009
- };
1010
- }
1011
- const { sources, sourcesContent, mappings } = sourceMap;
1012
- for (let i = 0; i < sources.length; i++) {
1013
- onSource(
1014
- i,
1015
- getSource(sourceMap, i),
1016
- sourcesContent && sourcesContent[i] || void 0
1017
- );
1018
- }
1019
- const finalLine = generatedColumn === 0 ? generatedLine - 1 : generatedLine;
1020
- let currentGeneratedLine = 1;
1021
- const onMapping = (generatedLine2, _generatedColumn, sourceIndex, originalLine, originalColumn, _nameIndex) => {
1022
- if (sourceIndex >= 0 && currentGeneratedLine <= generatedLine2 && generatedLine2 <= finalLine) {
1023
- onChunk(
1024
- void 0,
1025
- generatedLine2,
1026
- 0,
1027
- sourceIndex,
1028
- originalLine,
1029
- originalColumn,
1030
- -1
1031
- );
1032
- currentGeneratedLine = generatedLine2 + 1;
1033
- }
1034
- };
1035
- readMappings(mappings, onMapping);
1036
- return result;
1037
- };
1038
- module.exports = (source, sourceMap, onChunk, onSource, onName, finalSource, columns) => {
1039
- if (columns) {
1040
- return finalSource ? streamChunksOfSourceMapFinal(
1041
- source,
1042
- sourceMap,
1043
- onChunk,
1044
- onSource,
1045
- onName
1046
- ) : streamChunksOfSourceMapFull(
1047
- source,
1048
- sourceMap,
1049
- onChunk,
1050
- onSource,
1051
- onName
1052
- );
1053
- } else {
1054
- return finalSource ? streamChunksOfSourceMapLinesFinal(
1055
- source,
1056
- sourceMap,
1057
- onChunk,
1058
- onSource,
1059
- onName
1060
- ) : streamChunksOfSourceMapLinesFull(
1061
- source,
1062
- sourceMap,
1063
- onChunk,
1064
- onSource,
1065
- onName
1066
- );
1067
- }
1068
- };
1069
- }
1070
- });
1071
-
1072
- // node_modules/webpack-sources/lib/helpers/streamChunksOfCombinedSourceMap.js
1073
- var require_streamChunksOfCombinedSourceMap = __commonJS({
1074
- "node_modules/webpack-sources/lib/helpers/streamChunksOfCombinedSourceMap.js"(exports, module) {
1075
- "use strict";
1076
- var streamChunksOfSourceMap = require_streamChunksOfSourceMap();
1077
- var splitIntoLines = require_splitIntoLines();
1078
- var streamChunksOfCombinedSourceMap = (source, sourceMap, innerSourceName, innerSource, innerSourceMap, removeInnerSource, onChunk, onSource, onName, finalSource, columns) => {
1079
- let sourceMapping = /* @__PURE__ */ new Map();
1080
- let nameMapping = /* @__PURE__ */ new Map();
1081
- const sourceIndexMapping = [];
1082
- const nameIndexMapping = [];
1083
- const nameIndexValueMapping = [];
1084
- let innerSourceIndex = -2;
1085
- const innerSourceIndexMapping = [];
1086
- const innerSourceIndexValueMapping = [];
1087
- const innerSourceContents = [];
1088
- const innerSourceContentLines = [];
1089
- const innerNameIndexMapping = [];
1090
- const innerNameIndexValueMapping = [];
1091
- const innerSourceMapLineData = [];
1092
- const findInnerMapping = (line, column) => {
1093
- if (line > innerSourceMapLineData.length) return -1;
1094
- const { mappingsData } = innerSourceMapLineData[line - 1];
1095
- let l = 0;
1096
- let r = mappingsData.length / 5;
1097
- while (l < r) {
1098
- let m = l + r >> 1;
1099
- if (mappingsData[m * 5] <= column) {
1100
- l = m + 1;
1101
- } else {
1102
- r = m;
1103
- }
1104
- }
1105
- if (l === 0) return -1;
1106
- return l - 1;
1107
- };
1108
- return streamChunksOfSourceMap(
1109
- source,
1110
- sourceMap,
1111
- (chunk, generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
1112
- if (sourceIndex === innerSourceIndex) {
1113
- const idx = findInnerMapping(originalLine, originalColumn);
1114
- if (idx !== -1) {
1115
- const { chunks, mappingsData } = innerSourceMapLineData[originalLine - 1];
1116
- const mi = idx * 5;
1117
- const innerSourceIndex2 = mappingsData[mi + 1];
1118
- const innerOriginalLine = mappingsData[mi + 2];
1119
- let innerOriginalColumn = mappingsData[mi + 3];
1120
- let innerNameIndex = mappingsData[mi + 4];
1121
- if (innerSourceIndex2 >= 0) {
1122
- const innerChunk = chunks[idx];
1123
- const innerGeneratedColumn = mappingsData[mi];
1124
- const locationInChunk = originalColumn - innerGeneratedColumn;
1125
- if (locationInChunk > 0) {
1126
- let originalSourceLines = innerSourceIndex2 < innerSourceContentLines.length ? innerSourceContentLines[innerSourceIndex2] : null;
1127
- if (originalSourceLines === void 0) {
1128
- const originalSource = innerSourceContents[innerSourceIndex2];
1129
- originalSourceLines = originalSource ? splitIntoLines(originalSource) : null;
1130
- innerSourceContentLines[innerSourceIndex2] = originalSourceLines;
1131
- }
1132
- if (originalSourceLines !== null) {
1133
- const originalChunk = innerOriginalLine <= originalSourceLines.length ? originalSourceLines[innerOriginalLine - 1].slice(
1134
- innerOriginalColumn,
1135
- innerOriginalColumn + locationInChunk
1136
- ) : "";
1137
- if (innerChunk.slice(0, locationInChunk) === originalChunk) {
1138
- innerOriginalColumn += locationInChunk;
1139
- innerNameIndex = -1;
1140
- }
1141
- }
1142
- }
1143
- let sourceIndex2 = innerSourceIndex2 < innerSourceIndexMapping.length ? innerSourceIndexMapping[innerSourceIndex2] : -2;
1144
- if (sourceIndex2 === -2) {
1145
- const [source2, sourceContent] = innerSourceIndex2 < innerSourceIndexValueMapping.length ? innerSourceIndexValueMapping[innerSourceIndex2] : [null, void 0];
1146
- let globalIndex = sourceMapping.get(source2);
1147
- if (globalIndex === void 0) {
1148
- sourceMapping.set(source2, globalIndex = sourceMapping.size);
1149
- onSource(globalIndex, source2, sourceContent);
1150
- }
1151
- sourceIndex2 = globalIndex;
1152
- innerSourceIndexMapping[innerSourceIndex2] = sourceIndex2;
1153
- }
1154
- let finalNameIndex = -1;
1155
- if (innerNameIndex >= 0) {
1156
- finalNameIndex = innerNameIndex < innerNameIndexMapping.length ? innerNameIndexMapping[innerNameIndex] : -2;
1157
- if (finalNameIndex === -2) {
1158
- const name = innerNameIndex < innerNameIndexValueMapping.length ? innerNameIndexValueMapping[innerNameIndex] : void 0;
1159
- if (name) {
1160
- let globalIndex = nameMapping.get(name);
1161
- if (globalIndex === void 0) {
1162
- nameMapping.set(name, globalIndex = nameMapping.size);
1163
- onName(globalIndex, name);
1164
- }
1165
- finalNameIndex = globalIndex;
1166
- } else {
1167
- finalNameIndex = -1;
1168
- }
1169
- innerNameIndexMapping[innerNameIndex] = finalNameIndex;
1170
- }
1171
- } else if (nameIndex >= 0) {
1172
- let originalSourceLines = innerSourceContentLines[innerSourceIndex2];
1173
- if (originalSourceLines === void 0) {
1174
- const originalSource = innerSourceContents[innerSourceIndex2];
1175
- originalSourceLines = originalSource ? splitIntoLines(originalSource) : null;
1176
- innerSourceContentLines[innerSourceIndex2] = originalSourceLines;
1177
- }
1178
- if (originalSourceLines !== null) {
1179
- const name = nameIndexValueMapping[nameIndex];
1180
- const originalName = innerOriginalLine <= originalSourceLines.length ? originalSourceLines[innerOriginalLine - 1].slice(
1181
- innerOriginalColumn,
1182
- innerOriginalColumn + name.length
1183
- ) : "";
1184
- if (name === originalName) {
1185
- finalNameIndex = nameIndex < nameIndexMapping.length ? nameIndexMapping[nameIndex] : -2;
1186
- if (finalNameIndex === -2) {
1187
- const name2 = nameIndexValueMapping[nameIndex];
1188
- if (name2) {
1189
- let globalIndex = nameMapping.get(name2);
1190
- if (globalIndex === void 0) {
1191
- nameMapping.set(name2, globalIndex = nameMapping.size);
1192
- onName(globalIndex, name2);
1193
- }
1194
- finalNameIndex = globalIndex;
1195
- } else {
1196
- finalNameIndex = -1;
1197
- }
1198
- nameIndexMapping[nameIndex] = finalNameIndex;
1199
- }
1200
- }
1201
- }
1202
- }
1203
- onChunk(
1204
- chunk,
1205
- generatedLine,
1206
- generatedColumn,
1207
- sourceIndex2,
1208
- innerOriginalLine,
1209
- innerOriginalColumn,
1210
- finalNameIndex
1211
- );
1212
- return;
1213
- }
1214
- }
1215
- if (removeInnerSource) {
1216
- onChunk(chunk, generatedLine, generatedColumn, -1, -1, -1, -1);
1217
- return;
1218
- } else {
1219
- if (sourceIndexMapping[sourceIndex] === -2) {
1220
- let globalIndex = sourceMapping.get(innerSourceName);
1221
- if (globalIndex === void 0) {
1222
- sourceMapping.set(source, globalIndex = sourceMapping.size);
1223
- onSource(globalIndex, innerSourceName, innerSource);
1224
- }
1225
- sourceIndexMapping[sourceIndex] = globalIndex;
1226
- }
1227
- }
1228
- }
1229
- const finalSourceIndex = sourceIndex < 0 || sourceIndex >= sourceIndexMapping.length ? -1 : sourceIndexMapping[sourceIndex];
1230
- if (finalSourceIndex < 0) {
1231
- onChunk(chunk, generatedLine, generatedColumn, -1, -1, -1, -1);
1232
- } else {
1233
- let finalNameIndex = -1;
1234
- if (nameIndex >= 0 && nameIndex < nameIndexMapping.length) {
1235
- finalNameIndex = nameIndexMapping[nameIndex];
1236
- if (finalNameIndex === -2) {
1237
- const name = nameIndexValueMapping[nameIndex];
1238
- let globalIndex = nameMapping.get(name);
1239
- if (globalIndex === void 0) {
1240
- nameMapping.set(name, globalIndex = nameMapping.size);
1241
- onName(globalIndex, name);
1242
- }
1243
- finalNameIndex = globalIndex;
1244
- nameIndexMapping[nameIndex] = finalNameIndex;
1245
- }
1246
- }
1247
- onChunk(
1248
- chunk,
1249
- generatedLine,
1250
- generatedColumn,
1251
- finalSourceIndex,
1252
- originalLine,
1253
- originalColumn,
1254
- finalNameIndex
1255
- );
1256
- }
1257
- },
1258
- (i, source2, sourceContent) => {
1259
- if (source2 === innerSourceName) {
1260
- innerSourceIndex = i;
1261
- if (innerSource !== void 0) sourceContent = innerSource;
1262
- else innerSource = sourceContent;
1263
- sourceIndexMapping[i] = -2;
1264
- streamChunksOfSourceMap(
1265
- sourceContent,
1266
- innerSourceMap,
1267
- (chunk, generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
1268
- while (innerSourceMapLineData.length < generatedLine) {
1269
- innerSourceMapLineData.push({
1270
- mappingsData: [],
1271
- chunks: []
1272
- });
1273
- }
1274
- const data = innerSourceMapLineData[generatedLine - 1];
1275
- data.mappingsData.push(
1276
- generatedColumn,
1277
- sourceIndex,
1278
- originalLine,
1279
- originalColumn,
1280
- nameIndex
1281
- );
1282
- data.chunks.push(chunk);
1283
- },
1284
- (i2, source3, sourceContent2) => {
1285
- innerSourceContents[i2] = sourceContent2;
1286
- innerSourceContentLines[i2] = void 0;
1287
- innerSourceIndexMapping[i2] = -2;
1288
- innerSourceIndexValueMapping[i2] = [source3, sourceContent2];
1289
- },
1290
- (i2, name) => {
1291
- innerNameIndexMapping[i2] = -2;
1292
- innerNameIndexValueMapping[i2] = name;
1293
- },
1294
- false,
1295
- columns
1296
- );
1297
- } else {
1298
- let globalIndex = sourceMapping.get(source2);
1299
- if (globalIndex === void 0) {
1300
- sourceMapping.set(source2, globalIndex = sourceMapping.size);
1301
- onSource(globalIndex, source2, sourceContent);
1302
- }
1303
- sourceIndexMapping[i] = globalIndex;
1304
- }
1305
- },
1306
- (i, name) => {
1307
- nameIndexMapping[i] = -2;
1308
- nameIndexValueMapping[i] = name;
1309
- },
1310
- finalSource,
1311
- columns
1312
- );
1313
- };
1314
- module.exports = streamChunksOfCombinedSourceMap;
1315
- }
1316
- });
1317
-
1318
- // node_modules/webpack-sources/lib/SourceMapSource.js
1319
- var require_SourceMapSource = __commonJS({
1320
- "node_modules/webpack-sources/lib/SourceMapSource.js"(exports, module) {
1321
- "use strict";
1322
- var Source = require_Source();
1323
- var streamChunksOfSourceMap = require_streamChunksOfSourceMap();
1324
- var streamChunksOfCombinedSourceMap = require_streamChunksOfCombinedSourceMap();
1325
- var { getMap, getSourceAndMap } = require_getFromStreamChunks();
1326
- var SourceMapSource = class extends Source {
1327
- constructor(value, name, sourceMap, originalSource, innerSourceMap, removeOriginalSource) {
1328
- super();
1329
- const valueIsBuffer = Buffer.isBuffer(value);
1330
- this._valueAsString = valueIsBuffer ? void 0 : value;
1331
- this._valueAsBuffer = valueIsBuffer ? value : void 0;
1332
- this._name = name;
1333
- this._hasSourceMap = !!sourceMap;
1334
- const sourceMapIsBuffer = Buffer.isBuffer(sourceMap);
1335
- const sourceMapIsString = typeof sourceMap === "string";
1336
- this._sourceMapAsObject = sourceMapIsBuffer || sourceMapIsString ? void 0 : sourceMap;
1337
- this._sourceMapAsString = sourceMapIsString ? sourceMap : void 0;
1338
- this._sourceMapAsBuffer = sourceMapIsBuffer ? sourceMap : void 0;
1339
- this._hasOriginalSource = !!originalSource;
1340
- const originalSourceIsBuffer = Buffer.isBuffer(originalSource);
1341
- this._originalSourceAsString = originalSourceIsBuffer ? void 0 : originalSource;
1342
- this._originalSourceAsBuffer = originalSourceIsBuffer ? originalSource : void 0;
1343
- this._hasInnerSourceMap = !!innerSourceMap;
1344
- const innerSourceMapIsBuffer = Buffer.isBuffer(innerSourceMap);
1345
- const innerSourceMapIsString = typeof innerSourceMap === "string";
1346
- this._innerSourceMapAsObject = innerSourceMapIsBuffer || innerSourceMapIsString ? void 0 : innerSourceMap;
1347
- this._innerSourceMapAsString = innerSourceMapIsString ? innerSourceMap : void 0;
1348
- this._innerSourceMapAsBuffer = innerSourceMapIsBuffer ? innerSourceMap : void 0;
1349
- this._removeOriginalSource = removeOriginalSource;
1350
- }
1351
- _ensureValueBuffer() {
1352
- if (this._valueAsBuffer === void 0) {
1353
- this._valueAsBuffer = Buffer.from(this._valueAsString, "utf-8");
1354
- }
1355
- }
1356
- _ensureValueString() {
1357
- if (this._valueAsString === void 0) {
1358
- this._valueAsString = this._valueAsBuffer.toString("utf-8");
1359
- }
1360
- }
1361
- _ensureOriginalSourceBuffer() {
1362
- if (this._originalSourceAsBuffer === void 0 && this._hasOriginalSource) {
1363
- this._originalSourceAsBuffer = Buffer.from(
1364
- this._originalSourceAsString,
1365
- "utf-8"
1366
- );
1367
- }
1368
- }
1369
- _ensureOriginalSourceString() {
1370
- if (this._originalSourceAsString === void 0 && this._hasOriginalSource) {
1371
- this._originalSourceAsString = this._originalSourceAsBuffer.toString(
1372
- "utf-8"
1373
- );
1374
- }
1375
- }
1376
- _ensureInnerSourceMapObject() {
1377
- if (this._innerSourceMapAsObject === void 0 && this._hasInnerSourceMap) {
1378
- this._ensureInnerSourceMapString();
1379
- this._innerSourceMapAsObject = JSON.parse(this._innerSourceMapAsString);
1380
- }
1381
- }
1382
- _ensureInnerSourceMapBuffer() {
1383
- if (this._innerSourceMapAsBuffer === void 0 && this._hasInnerSourceMap) {
1384
- this._ensureInnerSourceMapString();
1385
- this._innerSourceMapAsBuffer = Buffer.from(
1386
- this._innerSourceMapAsString,
1387
- "utf-8"
1388
- );
1389
- }
1390
- }
1391
- _ensureInnerSourceMapString() {
1392
- if (this._innerSourceMapAsString === void 0 && this._hasInnerSourceMap) {
1393
- if (this._innerSourceMapAsBuffer !== void 0) {
1394
- this._innerSourceMapAsString = this._innerSourceMapAsBuffer.toString(
1395
- "utf-8"
1396
- );
1397
- } else {
1398
- this._innerSourceMapAsString = JSON.stringify(
1399
- this._innerSourceMapAsObject
1400
- );
1401
- }
1402
- }
1403
- }
1404
- _ensureSourceMapObject() {
1405
- if (this._sourceMapAsObject === void 0) {
1406
- this._ensureSourceMapString();
1407
- this._sourceMapAsObject = JSON.parse(this._sourceMapAsString);
1408
- }
1409
- }
1410
- _ensureSourceMapBuffer() {
1411
- if (this._sourceMapAsBuffer === void 0) {
1412
- this._ensureSourceMapString();
1413
- this._sourceMapAsBuffer = Buffer.from(this._sourceMapAsString, "utf-8");
1414
- }
1415
- }
1416
- _ensureSourceMapString() {
1417
- if (this._sourceMapAsString === void 0) {
1418
- if (this._sourceMapAsBuffer !== void 0) {
1419
- this._sourceMapAsString = this._sourceMapAsBuffer.toString("utf-8");
1420
- } else {
1421
- this._sourceMapAsString = JSON.stringify(this._sourceMapAsObject);
1422
- }
1423
- }
1424
- }
1425
- getArgsAsBuffers() {
1426
- this._ensureValueBuffer();
1427
- this._ensureSourceMapBuffer();
1428
- this._ensureOriginalSourceBuffer();
1429
- this._ensureInnerSourceMapBuffer();
1430
- return [
1431
- this._valueAsBuffer,
1432
- this._name,
1433
- this._sourceMapAsBuffer,
1434
- this._originalSourceAsBuffer,
1435
- this._innerSourceMapAsBuffer,
1436
- this._removeOriginalSource
1437
- ];
1438
- }
1439
- buffer() {
1440
- this._ensureValueBuffer();
1441
- return this._valueAsBuffer;
1442
- }
1443
- source() {
1444
- this._ensureValueString();
1445
- return this._valueAsString;
1446
- }
1447
- map(options) {
1448
- if (!this._hasInnerSourceMap) {
1449
- this._ensureSourceMapObject();
1450
- return this._sourceMapAsObject;
1451
- }
1452
- return getMap(this, options);
1453
- }
1454
- sourceAndMap(options) {
1455
- if (!this._hasInnerSourceMap) {
1456
- this._ensureValueString();
1457
- this._ensureSourceMapObject();
1458
- return {
1459
- source: this._valueAsString,
1460
- map: this._sourceMapAsObject
1461
- };
1462
- }
1463
- return getSourceAndMap(this, options);
1464
- }
1465
- streamChunks(options, onChunk, onSource, onName) {
1466
- this._ensureValueString();
1467
- this._ensureSourceMapObject();
1468
- this._ensureOriginalSourceString();
1469
- if (this._hasInnerSourceMap) {
1470
- this._ensureInnerSourceMapObject();
1471
- return streamChunksOfCombinedSourceMap(
1472
- this._valueAsString,
1473
- this._sourceMapAsObject,
1474
- this._name,
1475
- this._originalSourceAsString,
1476
- this._innerSourceMapAsObject,
1477
- this._removeOriginalSource,
1478
- onChunk,
1479
- onSource,
1480
- onName,
1481
- !!(options && options.finalSource),
1482
- !!(options && options.columns !== false)
1483
- );
1484
- } else {
1485
- return streamChunksOfSourceMap(
1486
- this._valueAsString,
1487
- this._sourceMapAsObject,
1488
- onChunk,
1489
- onSource,
1490
- onName,
1491
- !!(options && options.finalSource),
1492
- !!(options && options.columns !== false)
1493
- );
1494
- }
1495
- }
1496
- updateHash(hash) {
1497
- this._ensureValueBuffer();
1498
- this._ensureSourceMapBuffer();
1499
- this._ensureOriginalSourceBuffer();
1500
- this._ensureInnerSourceMapBuffer();
1501
- hash.update("SourceMapSource");
1502
- hash.update(this._valueAsBuffer);
1503
- hash.update(this._sourceMapAsBuffer);
1504
- if (this._hasOriginalSource) {
1505
- hash.update(this._originalSourceAsBuffer);
1506
- }
1507
- if (this._hasInnerSourceMap) {
1508
- hash.update(this._innerSourceMapAsBuffer);
1509
- }
1510
- hash.update(this._removeOriginalSource ? "true" : "false");
1511
- }
1512
- };
1513
- module.exports = SourceMapSource;
1514
- }
1515
- });
1516
-
1517
- // node_modules/webpack-sources/lib/helpers/streamChunks.js
1518
- var require_streamChunks = __commonJS({
1519
- "node_modules/webpack-sources/lib/helpers/streamChunks.js"(exports, module) {
1520
- "use strict";
1521
- var streamChunksOfRawSource = require_streamChunksOfRawSource();
1522
- var streamChunksOfSourceMap = require_streamChunksOfSourceMap();
1523
- module.exports = (source, options, onChunk, onSource, onName) => {
1524
- if (typeof source.streamChunks === "function") {
1525
- return source.streamChunks(options, onChunk, onSource, onName);
1526
- } else {
1527
- const sourceAndMap = source.sourceAndMap(options);
1528
- if (sourceAndMap.map) {
1529
- return streamChunksOfSourceMap(
1530
- sourceAndMap.source,
1531
- sourceAndMap.map,
1532
- onChunk,
1533
- onSource,
1534
- onName,
1535
- !!(options && options.finalSource),
1536
- !!(options && options.columns !== false)
1537
- );
1538
- } else {
1539
- return streamChunksOfRawSource(
1540
- sourceAndMap.source,
1541
- onChunk,
1542
- onSource,
1543
- onName,
1544
- !!(options && options.finalSource)
1545
- );
1546
- }
1547
- }
1548
- };
1549
- }
1550
- });
1551
-
1552
- // node_modules/webpack-sources/lib/helpers/streamAndGetSourceAndMap.js
1553
- var require_streamAndGetSourceAndMap = __commonJS({
1554
- "node_modules/webpack-sources/lib/helpers/streamAndGetSourceAndMap.js"(exports, module) {
1555
- "use strict";
1556
- var createMappingsSerializer = require_createMappingsSerializer();
1557
- var streamChunks = require_streamChunks();
1558
- var streamAndGetSourceAndMap = (inputSource, options, onChunk, onSource, onName) => {
1559
- let code = "";
1560
- let mappings = "";
1561
- let sources = [];
1562
- let sourcesContent = [];
1563
- let names = [];
1564
- const addMapping = createMappingsSerializer(
1565
- Object.assign({}, options, { columns: true })
1566
- );
1567
- const finalSource = !!(options && options.finalSource);
1568
- const { generatedLine, generatedColumn, source } = streamChunks(
1569
- inputSource,
1570
- options,
1571
- (chunk, generatedLine2, generatedColumn2, sourceIndex, originalLine, originalColumn, nameIndex) => {
1572
- if (chunk !== void 0) code += chunk;
1573
- mappings += addMapping(
1574
- generatedLine2,
1575
- generatedColumn2,
1576
- sourceIndex,
1577
- originalLine,
1578
- originalColumn,
1579
- nameIndex
1580
- );
1581
- return onChunk(
1582
- finalSource ? void 0 : chunk,
1583
- generatedLine2,
1584
- generatedColumn2,
1585
- sourceIndex,
1586
- originalLine,
1587
- originalColumn,
1588
- nameIndex
1589
- );
1590
- },
1591
- (sourceIndex, source2, sourceContent) => {
1592
- while (sources.length < sourceIndex) {
1593
- sources.push(null);
1594
- }
1595
- sources[sourceIndex] = source2;
1596
- if (sourceContent !== void 0) {
1597
- while (sourcesContent.length < sourceIndex) {
1598
- sourcesContent.push(null);
1599
- }
1600
- sourcesContent[sourceIndex] = sourceContent;
1601
- }
1602
- return onSource(sourceIndex, source2, sourceContent);
1603
- },
1604
- (nameIndex, name) => {
1605
- while (names.length < nameIndex) {
1606
- names.push(null);
1607
- }
1608
- names[nameIndex] = name;
1609
- return onName(nameIndex, name);
1610
- }
1611
- );
1612
- const resultSource = source !== void 0 ? source : code;
1613
- return {
1614
- result: {
1615
- generatedLine,
1616
- generatedColumn,
1617
- source: finalSource ? resultSource : void 0
1618
- },
1619
- source: resultSource,
1620
- map: mappings.length > 0 ? {
1621
- version: 3,
1622
- file: "x",
1623
- mappings,
1624
- sources,
1625
- sourcesContent: sourcesContent.length > 0 ? sourcesContent : void 0,
1626
- names
1627
- } : null
1628
- };
1629
- };
1630
- module.exports = streamAndGetSourceAndMap;
1631
- }
1632
- });
1633
-
1634
- // node_modules/webpack-sources/lib/CachedSource.js
1635
- var require_CachedSource = __commonJS({
1636
- "node_modules/webpack-sources/lib/CachedSource.js"(exports, module) {
1637
- "use strict";
1638
- var Source = require_Source();
1639
- var streamChunksOfSourceMap = require_streamChunksOfSourceMap();
1640
- var streamChunksOfRawSource = require_streamChunksOfRawSource();
1641
- var streamAndGetSourceAndMap = require_streamAndGetSourceAndMap();
1642
- var mapToBufferedMap = (map) => {
1643
- if (typeof map !== "object" || !map) return map;
1644
- const bufferedMap = Object.assign({}, map);
1645
- if (map.mappings) {
1646
- bufferedMap.mappings = Buffer.from(map.mappings, "utf-8");
1647
- }
1648
- if (map.sourcesContent) {
1649
- bufferedMap.sourcesContent = map.sourcesContent.map(
1650
- (str) => str && Buffer.from(str, "utf-8")
1651
- );
1652
- }
1653
- return bufferedMap;
1654
- };
1655
- var bufferedMapToMap = (bufferedMap) => {
1656
- if (typeof bufferedMap !== "object" || !bufferedMap) return bufferedMap;
1657
- const map = Object.assign({}, bufferedMap);
1658
- if (bufferedMap.mappings) {
1659
- map.mappings = bufferedMap.mappings.toString("utf-8");
1660
- }
1661
- if (bufferedMap.sourcesContent) {
1662
- map.sourcesContent = bufferedMap.sourcesContent.map(
1663
- (buffer) => buffer && buffer.toString("utf-8")
1664
- );
1665
- }
1666
- return map;
1667
- };
1668
- var CachedSource = class extends Source {
1669
- constructor(source, cachedData) {
1670
- super();
1671
- this._source = source;
1672
- this._cachedSourceType = cachedData ? cachedData.source : void 0;
1673
- this._cachedSource = void 0;
1674
- this._cachedBuffer = cachedData ? cachedData.buffer : void 0;
1675
- this._cachedSize = cachedData ? cachedData.size : void 0;
1676
- this._cachedMaps = cachedData ? cachedData.maps : /* @__PURE__ */ new Map();
1677
- this._cachedHashUpdate = cachedData ? cachedData.hash : void 0;
1678
- }
1679
- getCachedData() {
1680
- const bufferedMaps = /* @__PURE__ */ new Map();
1681
- for (const pair of this._cachedMaps) {
1682
- let cacheEntry = pair[1];
1683
- if (cacheEntry.bufferedMap === void 0) {
1684
- cacheEntry.bufferedMap = mapToBufferedMap(
1685
- this._getMapFromCacheEntry(cacheEntry)
1686
- );
1687
- }
1688
- bufferedMaps.set(pair[0], {
1689
- map: void 0,
1690
- bufferedMap: cacheEntry.bufferedMap
1691
- });
1692
- }
1693
- if (this._cachedSource) {
1694
- this.buffer();
1695
- }
1696
- return {
1697
- buffer: this._cachedBuffer,
1698
- source: this._cachedSourceType !== void 0 ? this._cachedSourceType : typeof this._cachedSource === "string" ? true : Buffer.isBuffer(this._cachedSource) ? false : void 0,
1699
- size: this._cachedSize,
1700
- maps: bufferedMaps,
1701
- hash: this._cachedHashUpdate
1702
- };
1703
- }
1704
- originalLazy() {
1705
- return this._source;
1706
- }
1707
- original() {
1708
- if (typeof this._source === "function") this._source = this._source();
1709
- return this._source;
1710
- }
1711
- source() {
1712
- const source = this._getCachedSource();
1713
- if (source !== void 0) return source;
1714
- return this._cachedSource = this.original().source();
1715
- }
1716
- _getMapFromCacheEntry(cacheEntry) {
1717
- if (cacheEntry.map !== void 0) {
1718
- return cacheEntry.map;
1719
- } else if (cacheEntry.bufferedMap !== void 0) {
1720
- return cacheEntry.map = bufferedMapToMap(cacheEntry.bufferedMap);
1721
- }
1722
- }
1723
- _getCachedSource() {
1724
- if (this._cachedSource !== void 0) return this._cachedSource;
1725
- if (this._cachedBuffer && this._cachedSourceType !== void 0) {
1726
- return this._cachedSource = this._cachedSourceType ? this._cachedBuffer.toString("utf-8") : this._cachedBuffer;
1727
- }
1728
- }
1729
- buffer() {
1730
- if (this._cachedBuffer !== void 0) return this._cachedBuffer;
1731
- if (this._cachedSource !== void 0) {
1732
- if (Buffer.isBuffer(this._cachedSource)) {
1733
- return this._cachedBuffer = this._cachedSource;
1734
- }
1735
- return this._cachedBuffer = Buffer.from(this._cachedSource, "utf-8");
1736
- }
1737
- if (typeof this.original().buffer === "function") {
1738
- return this._cachedBuffer = this.original().buffer();
1739
- }
1740
- const bufferOrString = this.source();
1741
- if (Buffer.isBuffer(bufferOrString)) {
1742
- return this._cachedBuffer = bufferOrString;
1743
- }
1744
- return this._cachedBuffer = Buffer.from(bufferOrString, "utf-8");
1745
- }
1746
- size() {
1747
- if (this._cachedSize !== void 0) return this._cachedSize;
1748
- if (this._cachedBuffer !== void 0) {
1749
- return this._cachedSize = this._cachedBuffer.length;
1750
- }
1751
- const source = this._getCachedSource();
1752
- if (source !== void 0) {
1753
- return this._cachedSize = Buffer.byteLength(source);
1754
- }
1755
- return this._cachedSize = this.original().size();
1756
- }
1757
- sourceAndMap(options) {
1758
- const key = options ? JSON.stringify(options) : "{}";
1759
- const cacheEntry = this._cachedMaps.get(key);
1760
- if (cacheEntry !== void 0) {
1761
- const map2 = this._getMapFromCacheEntry(cacheEntry);
1762
- return { source: this.source(), map: map2 };
1763
- }
1764
- let source = this._getCachedSource();
1765
- let map;
1766
- if (source !== void 0) {
1767
- map = this.original().map(options);
1768
- } else {
1769
- const sourceAndMap = this.original().sourceAndMap(options);
1770
- source = sourceAndMap.source;
1771
- map = sourceAndMap.map;
1772
- this._cachedSource = source;
1773
- }
1774
- this._cachedMaps.set(key, {
1775
- map,
1776
- bufferedMap: void 0
1777
- });
1778
- return { source, map };
1779
- }
1780
- streamChunks(options, onChunk, onSource, onName) {
1781
- const key = options ? JSON.stringify(options) : "{}";
1782
- if (this._cachedMaps.has(key) && (this._cachedBuffer !== void 0 || this._cachedSource !== void 0)) {
1783
- const { source: source2, map: map2 } = this.sourceAndMap(options);
1784
- if (map2) {
1785
- return streamChunksOfSourceMap(
1786
- source2,
1787
- map2,
1788
- onChunk,
1789
- onSource,
1790
- onName,
1791
- !!(options && options.finalSource),
1792
- true
1793
- );
1794
- } else {
1795
- return streamChunksOfRawSource(
1796
- source2,
1797
- onChunk,
1798
- onSource,
1799
- onName,
1800
- !!(options && options.finalSource)
1801
- );
1802
- }
1803
- }
1804
- const { result, source, map } = streamAndGetSourceAndMap(
1805
- this.original(),
1806
- options,
1807
- onChunk,
1808
- onSource,
1809
- onName
1810
- );
1811
- this._cachedSource = source;
1812
- this._cachedMaps.set(key, {
1813
- map,
1814
- bufferedMap: void 0
1815
- });
1816
- return result;
1817
- }
1818
- map(options) {
1819
- const key = options ? JSON.stringify(options) : "{}";
1820
- const cacheEntry = this._cachedMaps.get(key);
1821
- if (cacheEntry !== void 0) {
1822
- return this._getMapFromCacheEntry(cacheEntry);
1823
- }
1824
- const map = this.original().map(options);
1825
- this._cachedMaps.set(key, {
1826
- map,
1827
- bufferedMap: void 0
1828
- });
1829
- return map;
1830
- }
1831
- updateHash(hash) {
1832
- if (this._cachedHashUpdate !== void 0) {
1833
- for (const item of this._cachedHashUpdate) hash.update(item);
1834
- return;
1835
- }
1836
- const update = [];
1837
- let currentString = void 0;
1838
- const tracker = {
1839
- update: (item) => {
1840
- if (typeof item === "string" && item.length < 10240) {
1841
- if (currentString === void 0) {
1842
- currentString = item;
1843
- } else {
1844
- currentString += item;
1845
- if (currentString.length > 102400) {
1846
- update.push(Buffer.from(currentString));
1847
- currentString = void 0;
1848
- }
1849
- }
1850
- } else {
1851
- if (currentString !== void 0) {
1852
- update.push(Buffer.from(currentString));
1853
- currentString = void 0;
1854
- }
1855
- update.push(item);
1856
- }
1857
- }
1858
- };
1859
- this.original().updateHash(tracker);
1860
- if (currentString !== void 0) {
1861
- update.push(Buffer.from(currentString));
1862
- }
1863
- for (const item of update) hash.update(item);
1864
- this._cachedHashUpdate = update;
1865
- }
1866
- };
1867
- module.exports = CachedSource;
1868
- }
1869
- });
1870
-
1871
- // node_modules/webpack-sources/lib/ConcatSource.js
1872
- var require_ConcatSource = __commonJS({
1873
- "node_modules/webpack-sources/lib/ConcatSource.js"(exports, module) {
1874
- "use strict";
1875
- var Source = require_Source();
1876
- var RawSource = require_RawSource();
1877
- var streamChunks = require_streamChunks();
1878
- var { getMap, getSourceAndMap } = require_getFromStreamChunks();
1879
- var stringsAsRawSources = /* @__PURE__ */ new WeakSet();
1880
- var ConcatSource2 = class _ConcatSource extends Source {
1881
- constructor() {
1882
- super();
1883
- this._children = [];
1884
- for (let i = 0; i < arguments.length; i++) {
1885
- const item = arguments[i];
1886
- if (item instanceof _ConcatSource) {
1887
- for (const child of item._children) {
1888
- this._children.push(child);
1889
- }
1890
- } else {
1891
- this._children.push(item);
1892
- }
1893
- }
1894
- this._isOptimized = arguments.length === 0;
1895
- }
1896
- getChildren() {
1897
- if (!this._isOptimized) this._optimize();
1898
- return this._children;
1899
- }
1900
- add(item) {
1901
- if (item instanceof _ConcatSource) {
1902
- for (const child of item._children) {
1903
- this._children.push(child);
1904
- }
1905
- } else {
1906
- this._children.push(item);
1907
- }
1908
- this._isOptimized = false;
1909
- }
1910
- addAllSkipOptimizing(items) {
1911
- for (const item of items) {
1912
- this._children.push(item);
1913
- }
1914
- }
1915
- buffer() {
1916
- if (!this._isOptimized) this._optimize();
1917
- const buffers = [];
1918
- for (const child of this._children) {
1919
- if (typeof child.buffer === "function") {
1920
- buffers.push(child.buffer());
1921
- } else {
1922
- const bufferOrString = child.source();
1923
- if (Buffer.isBuffer(bufferOrString)) {
1924
- buffers.push(bufferOrString);
1925
- } else {
1926
- buffers.push(Buffer.from(bufferOrString, "utf-8"));
1927
- }
1928
- }
1929
- }
1930
- return Buffer.concat(buffers);
1931
- }
1932
- source() {
1933
- if (!this._isOptimized) this._optimize();
1934
- let source = "";
1935
- for (const child of this._children) {
1936
- source += child.source();
1937
- }
1938
- return source;
1939
- }
1940
- size() {
1941
- if (!this._isOptimized) this._optimize();
1942
- let size = 0;
1943
- for (const child of this._children) {
1944
- size += child.size();
1945
- }
1946
- return size;
1947
- }
1948
- map(options) {
1949
- return getMap(this, options);
1950
- }
1951
- sourceAndMap(options) {
1952
- return getSourceAndMap(this, options);
1953
- }
1954
- streamChunks(options, onChunk, onSource, onName) {
1955
- if (!this._isOptimized) this._optimize();
1956
- if (this._children.length === 1)
1957
- return this._children[0].streamChunks(options, onChunk, onSource, onName);
1958
- let currentLineOffset = 0;
1959
- let currentColumnOffset = 0;
1960
- let sourceMapping = /* @__PURE__ */ new Map();
1961
- let nameMapping = /* @__PURE__ */ new Map();
1962
- const finalSource = !!(options && options.finalSource);
1963
- let code = "";
1964
- let needToCloseMapping = false;
1965
- for (const item of this._children) {
1966
- const sourceIndexMapping = [];
1967
- const nameIndexMapping = [];
1968
- let lastMappingLine = 0;
1969
- const { generatedLine, generatedColumn, source } = streamChunks(
1970
- item,
1971
- options,
1972
- // eslint-disable-next-line no-loop-func
1973
- (chunk, generatedLine2, generatedColumn2, sourceIndex, originalLine, originalColumn, nameIndex) => {
1974
- const line = generatedLine2 + currentLineOffset;
1975
- const column = generatedLine2 === 1 ? generatedColumn2 + currentColumnOffset : generatedColumn2;
1976
- if (needToCloseMapping) {
1977
- if (generatedLine2 !== 1 || generatedColumn2 !== 0) {
1978
- onChunk(
1979
- void 0,
1980
- currentLineOffset + 1,
1981
- currentColumnOffset,
1982
- -1,
1983
- -1,
1984
- -1,
1985
- -1
1986
- );
1987
- }
1988
- needToCloseMapping = false;
1989
- }
1990
- const resultSourceIndex = sourceIndex < 0 || sourceIndex >= sourceIndexMapping.length ? -1 : sourceIndexMapping[sourceIndex];
1991
- const resultNameIndex = nameIndex < 0 || nameIndex >= nameIndexMapping.length ? -1 : nameIndexMapping[nameIndex];
1992
- lastMappingLine = resultSourceIndex < 0 ? 0 : generatedLine2;
1993
- if (finalSource) {
1994
- if (chunk !== void 0) code += chunk;
1995
- if (resultSourceIndex >= 0) {
1996
- onChunk(
1997
- void 0,
1998
- line,
1999
- column,
2000
- resultSourceIndex,
2001
- originalLine,
2002
- originalColumn,
2003
- resultNameIndex
2004
- );
2005
- }
2006
- } else {
2007
- if (resultSourceIndex < 0) {
2008
- onChunk(chunk, line, column, -1, -1, -1, -1);
2009
- } else {
2010
- onChunk(
2011
- chunk,
2012
- line,
2013
- column,
2014
- resultSourceIndex,
2015
- originalLine,
2016
- originalColumn,
2017
- resultNameIndex
2018
- );
2019
- }
2020
- }
2021
- },
2022
- (i, source2, sourceContent) => {
2023
- let globalIndex = sourceMapping.get(source2);
2024
- if (globalIndex === void 0) {
2025
- sourceMapping.set(source2, globalIndex = sourceMapping.size);
2026
- onSource(globalIndex, source2, sourceContent);
2027
- }
2028
- sourceIndexMapping[i] = globalIndex;
2029
- },
2030
- (i, name) => {
2031
- let globalIndex = nameMapping.get(name);
2032
- if (globalIndex === void 0) {
2033
- nameMapping.set(name, globalIndex = nameMapping.size);
2034
- onName(globalIndex, name);
2035
- }
2036
- nameIndexMapping[i] = globalIndex;
2037
- }
2038
- );
2039
- if (source !== void 0) code += source;
2040
- if (needToCloseMapping) {
2041
- if (generatedLine !== 1 || generatedColumn !== 0) {
2042
- onChunk(
2043
- void 0,
2044
- currentLineOffset + 1,
2045
- currentColumnOffset,
2046
- -1,
2047
- -1,
2048
- -1,
2049
- -1
2050
- );
2051
- needToCloseMapping = false;
2052
- }
2053
- }
2054
- if (generatedLine > 1) {
2055
- currentColumnOffset = generatedColumn;
2056
- } else {
2057
- currentColumnOffset += generatedColumn;
2058
- }
2059
- needToCloseMapping = needToCloseMapping || finalSource && lastMappingLine === generatedLine;
2060
- currentLineOffset += generatedLine - 1;
2061
- }
2062
- return {
2063
- generatedLine: currentLineOffset + 1,
2064
- generatedColumn: currentColumnOffset,
2065
- source: finalSource ? code : void 0
2066
- };
2067
- }
2068
- updateHash(hash) {
2069
- if (!this._isOptimized) this._optimize();
2070
- hash.update("ConcatSource");
2071
- for (const item of this._children) {
2072
- item.updateHash(hash);
2073
- }
2074
- }
2075
- _optimize() {
2076
- const newChildren = [];
2077
- let currentString = void 0;
2078
- let currentRawSources = void 0;
2079
- const addStringToRawSources = (string) => {
2080
- if (currentRawSources === void 0) {
2081
- currentRawSources = string;
2082
- } else if (Array.isArray(currentRawSources)) {
2083
- currentRawSources.push(string);
2084
- } else {
2085
- currentRawSources = [
2086
- typeof currentRawSources === "string" ? currentRawSources : currentRawSources.source(),
2087
- string
2088
- ];
2089
- }
2090
- };
2091
- const addSourceToRawSources = (source) => {
2092
- if (currentRawSources === void 0) {
2093
- currentRawSources = source;
2094
- } else if (Array.isArray(currentRawSources)) {
2095
- currentRawSources.push(source.source());
2096
- } else {
2097
- currentRawSources = [
2098
- typeof currentRawSources === "string" ? currentRawSources : currentRawSources.source(),
2099
- source.source()
2100
- ];
2101
- }
2102
- };
2103
- const mergeRawSources = () => {
2104
- if (Array.isArray(currentRawSources)) {
2105
- const rawSource = new RawSource(currentRawSources.join(""));
2106
- stringsAsRawSources.add(rawSource);
2107
- newChildren.push(rawSource);
2108
- } else if (typeof currentRawSources === "string") {
2109
- const rawSource = new RawSource(currentRawSources);
2110
- stringsAsRawSources.add(rawSource);
2111
- newChildren.push(rawSource);
2112
- } else {
2113
- newChildren.push(currentRawSources);
2114
- }
2115
- };
2116
- for (const child of this._children) {
2117
- if (typeof child === "string") {
2118
- if (currentString === void 0) {
2119
- currentString = child;
2120
- } else {
2121
- currentString += child;
2122
- }
2123
- } else {
2124
- if (currentString !== void 0) {
2125
- addStringToRawSources(currentString);
2126
- currentString = void 0;
2127
- }
2128
- if (stringsAsRawSources.has(child)) {
2129
- addSourceToRawSources(child);
2130
- } else {
2131
- if (currentRawSources !== void 0) {
2132
- mergeRawSources();
2133
- currentRawSources = void 0;
2134
- }
2135
- newChildren.push(child);
2136
- }
2137
- }
2138
- }
2139
- if (currentString !== void 0) {
2140
- addStringToRawSources(currentString);
2141
- }
2142
- if (currentRawSources !== void 0) {
2143
- mergeRawSources();
2144
- }
2145
- this._children = newChildren;
2146
- this._isOptimized = true;
2147
- }
2148
- };
2149
- module.exports = ConcatSource2;
2150
- }
2151
- });
2152
-
2153
- // node_modules/webpack-sources/lib/ReplaceSource.js
2154
- var require_ReplaceSource = __commonJS({
2155
- "node_modules/webpack-sources/lib/ReplaceSource.js"(exports, module) {
2156
- "use strict";
2157
- var { getMap, getSourceAndMap } = require_getFromStreamChunks();
2158
- var streamChunks = require_streamChunks();
2159
- var Source = require_Source();
2160
- var splitIntoLines = require_splitIntoLines();
2161
- var hasStableSort = typeof process === "object" && process.versions && typeof process.versions.v8 === "string" && !/^[0-6]\./.test(process.versions.v8);
2162
- var MAX_SOURCE_POSITION = 536870912;
2163
- var Replacement = class {
2164
- constructor(start, end, content, name) {
2165
- this.start = start;
2166
- this.end = end;
2167
- this.content = content;
2168
- this.name = name;
2169
- if (!hasStableSort) {
2170
- this.index = -1;
2171
- }
2172
- }
2173
- };
2174
- var ReplaceSource = class extends Source {
2175
- constructor(source, name) {
2176
- super();
2177
- this._source = source;
2178
- this._name = name;
2179
- this._replacements = [];
2180
- this._isSorted = true;
2181
- }
2182
- getName() {
2183
- return this._name;
2184
- }
2185
- getReplacements() {
2186
- this._sortReplacements();
2187
- return this._replacements;
2188
- }
2189
- replace(start, end, newValue, name) {
2190
- if (typeof newValue !== "string")
2191
- throw new Error(
2192
- "insertion must be a string, but is a " + typeof newValue
2193
- );
2194
- this._replacements.push(new Replacement(start, end, newValue, name));
2195
- this._isSorted = false;
2196
- }
2197
- insert(pos, newValue, name) {
2198
- if (typeof newValue !== "string")
2199
- throw new Error(
2200
- "insertion must be a string, but is a " + typeof newValue + ": " + newValue
2201
- );
2202
- this._replacements.push(new Replacement(pos, pos - 1, newValue, name));
2203
- this._isSorted = false;
2204
- }
2205
- source() {
2206
- if (this._replacements.length === 0) {
2207
- return this._source.source();
2208
- }
2209
- let current = this._source.source();
2210
- let pos = 0;
2211
- const result = [];
2212
- this._sortReplacements();
2213
- for (const replacement of this._replacements) {
2214
- const start = Math.floor(replacement.start);
2215
- const end = Math.floor(replacement.end + 1);
2216
- if (pos < start) {
2217
- const offset = start - pos;
2218
- result.push(current.slice(0, offset));
2219
- current = current.slice(offset);
2220
- pos = start;
2221
- }
2222
- result.push(replacement.content);
2223
- if (pos < end) {
2224
- const offset = end - pos;
2225
- current = current.slice(offset);
2226
- pos = end;
2227
- }
2228
- }
2229
- result.push(current);
2230
- return result.join("");
2231
- }
2232
- map(options) {
2233
- if (this._replacements.length === 0) {
2234
- return this._source.map(options);
2235
- }
2236
- return getMap(this, options);
2237
- }
2238
- sourceAndMap(options) {
2239
- if (this._replacements.length === 0) {
2240
- return this._source.sourceAndMap(options);
2241
- }
2242
- return getSourceAndMap(this, options);
2243
- }
2244
- original() {
2245
- return this._source;
2246
- }
2247
- _sortReplacements() {
2248
- if (this._isSorted) return;
2249
- if (hasStableSort) {
2250
- this._replacements.sort(function(a, b) {
2251
- const diff1 = a.start - b.start;
2252
- if (diff1 !== 0) return diff1;
2253
- const diff2 = a.end - b.end;
2254
- if (diff2 !== 0) return diff2;
2255
- return 0;
2256
- });
2257
- } else {
2258
- this._replacements.forEach((repl, i) => repl.index = i);
2259
- this._replacements.sort(function(a, b) {
2260
- const diff1 = a.start - b.start;
2261
- if (diff1 !== 0) return diff1;
2262
- const diff2 = a.end - b.end;
2263
- if (diff2 !== 0) return diff2;
2264
- return a.index - b.index;
2265
- });
2266
- }
2267
- this._isSorted = true;
2268
- }
2269
- streamChunks(options, onChunk, onSource, onName) {
2270
- this._sortReplacements();
2271
- const repls = this._replacements;
2272
- let pos = 0;
2273
- let i = 0;
2274
- let replacmentEnd = -1;
2275
- let nextReplacement = i < repls.length ? Math.floor(repls[i].start) : MAX_SOURCE_POSITION;
2276
- let generatedLineOffset = 0;
2277
- let generatedColumnOffset = 0;
2278
- let generatedColumnOffsetLine = 0;
2279
- const sourceContents = [];
2280
- const nameMapping = /* @__PURE__ */ new Map();
2281
- const nameIndexMapping = [];
2282
- const checkOriginalContent = (sourceIndex, line2, column, expectedChunk) => {
2283
- let content = sourceIndex < sourceContents.length ? sourceContents[sourceIndex] : void 0;
2284
- if (content === void 0) return false;
2285
- if (typeof content === "string") {
2286
- content = splitIntoLines(content);
2287
- sourceContents[sourceIndex] = content;
2288
- }
2289
- const contentLine = line2 <= content.length ? content[line2 - 1] : null;
2290
- if (contentLine === null) return false;
2291
- return contentLine.slice(column, column + expectedChunk.length) === expectedChunk;
2292
- };
2293
- let { generatedLine, generatedColumn } = streamChunks(
2294
- this._source,
2295
- Object.assign({}, options, { finalSource: false }),
2296
- (chunk, generatedLine2, generatedColumn2, sourceIndex, originalLine, originalColumn, nameIndex) => {
2297
- let chunkPos = 0;
2298
- let endPos = pos + chunk.length;
2299
- if (replacmentEnd > pos) {
2300
- if (replacmentEnd >= endPos) {
2301
- const line3 = generatedLine2 + generatedLineOffset;
2302
- if (chunk.endsWith("\n")) {
2303
- generatedLineOffset--;
2304
- if (generatedColumnOffsetLine === line3) {
2305
- generatedColumnOffset += generatedColumn2;
2306
- }
2307
- } else if (generatedColumnOffsetLine === line3) {
2308
- generatedColumnOffset -= chunk.length;
2309
- } else {
2310
- generatedColumnOffset = -chunk.length;
2311
- generatedColumnOffsetLine = line3;
2312
- }
2313
- pos = endPos;
2314
- return;
2315
- }
2316
- chunkPos = replacmentEnd - pos;
2317
- if (checkOriginalContent(
2318
- sourceIndex,
2319
- originalLine,
2320
- originalColumn,
2321
- chunk.slice(0, chunkPos)
2322
- )) {
2323
- originalColumn += chunkPos;
2324
- }
2325
- pos += chunkPos;
2326
- const line2 = generatedLine2 + generatedLineOffset;
2327
- if (generatedColumnOffsetLine === line2) {
2328
- generatedColumnOffset -= chunkPos;
2329
- } else {
2330
- generatedColumnOffset = -chunkPos;
2331
- generatedColumnOffsetLine = line2;
2332
- }
2333
- generatedColumn2 += chunkPos;
2334
- }
2335
- if (nextReplacement < endPos) {
2336
- do {
2337
- let line2 = generatedLine2 + generatedLineOffset;
2338
- if (nextReplacement > pos) {
2339
- const offset2 = nextReplacement - pos;
2340
- const chunkSlice = chunk.slice(chunkPos, chunkPos + offset2);
2341
- onChunk(
2342
- chunkSlice,
2343
- line2,
2344
- generatedColumn2 + (line2 === generatedColumnOffsetLine ? generatedColumnOffset : 0),
2345
- sourceIndex,
2346
- originalLine,
2347
- originalColumn,
2348
- nameIndex < 0 || nameIndex >= nameIndexMapping.length ? -1 : nameIndexMapping[nameIndex]
2349
- );
2350
- generatedColumn2 += offset2;
2351
- chunkPos += offset2;
2352
- pos = nextReplacement;
2353
- if (checkOriginalContent(
2354
- sourceIndex,
2355
- originalLine,
2356
- originalColumn,
2357
- chunkSlice
2358
- )) {
2359
- originalColumn += chunkSlice.length;
2360
- }
2361
- }
2362
- const { content, name } = repls[i];
2363
- let matches2 = splitIntoLines(content);
2364
- let replacementNameIndex = nameIndex;
2365
- if (sourceIndex >= 0 && name) {
2366
- let globalIndex = nameMapping.get(name);
2367
- if (globalIndex === void 0) {
2368
- globalIndex = nameMapping.size;
2369
- nameMapping.set(name, globalIndex);
2370
- onName(globalIndex, name);
2371
- }
2372
- replacementNameIndex = globalIndex;
2373
- }
2374
- for (let m = 0; m < matches2.length; m++) {
2375
- const contentLine = matches2[m];
2376
- onChunk(
2377
- contentLine,
2378
- line2,
2379
- generatedColumn2 + (line2 === generatedColumnOffsetLine ? generatedColumnOffset : 0),
2380
- sourceIndex,
2381
- originalLine,
2382
- originalColumn,
2383
- replacementNameIndex
2384
- );
2385
- replacementNameIndex = -1;
2386
- if (m === matches2.length - 1 && !contentLine.endsWith("\n")) {
2387
- if (generatedColumnOffsetLine === line2) {
2388
- generatedColumnOffset += contentLine.length;
2389
- } else {
2390
- generatedColumnOffset = contentLine.length;
2391
- generatedColumnOffsetLine = line2;
2392
- }
2393
- } else {
2394
- generatedLineOffset++;
2395
- line2++;
2396
- generatedColumnOffset = -generatedColumn2;
2397
- generatedColumnOffsetLine = line2;
2398
- }
2399
- }
2400
- replacmentEnd = Math.max(
2401
- replacmentEnd,
2402
- Math.floor(repls[i].end + 1)
2403
- );
2404
- i++;
2405
- nextReplacement = i < repls.length ? Math.floor(repls[i].start) : MAX_SOURCE_POSITION;
2406
- const offset = chunk.length - endPos + replacmentEnd - chunkPos;
2407
- if (offset > 0) {
2408
- if (replacmentEnd >= endPos) {
2409
- let line4 = generatedLine2 + generatedLineOffset;
2410
- if (chunk.endsWith("\n")) {
2411
- generatedLineOffset--;
2412
- if (generatedColumnOffsetLine === line4) {
2413
- generatedColumnOffset += generatedColumn2;
2414
- }
2415
- } else if (generatedColumnOffsetLine === line4) {
2416
- generatedColumnOffset -= chunk.length - chunkPos;
2417
- } else {
2418
- generatedColumnOffset = chunkPos - chunk.length;
2419
- generatedColumnOffsetLine = line4;
2420
- }
2421
- pos = endPos;
2422
- return;
2423
- }
2424
- const line3 = generatedLine2 + generatedLineOffset;
2425
- if (checkOriginalContent(
2426
- sourceIndex,
2427
- originalLine,
2428
- originalColumn,
2429
- chunk.slice(chunkPos, chunkPos + offset)
2430
- )) {
2431
- originalColumn += offset;
2432
- }
2433
- chunkPos += offset;
2434
- pos += offset;
2435
- if (generatedColumnOffsetLine === line3) {
2436
- generatedColumnOffset -= offset;
2437
- } else {
2438
- generatedColumnOffset = -offset;
2439
- generatedColumnOffsetLine = line3;
2440
- }
2441
- generatedColumn2 += offset;
2442
- }
2443
- } while (nextReplacement < endPos);
2444
- }
2445
- if (chunkPos < chunk.length) {
2446
- const chunkSlice = chunkPos === 0 ? chunk : chunk.slice(chunkPos);
2447
- const line2 = generatedLine2 + generatedLineOffset;
2448
- onChunk(
2449
- chunkSlice,
2450
- line2,
2451
- generatedColumn2 + (line2 === generatedColumnOffsetLine ? generatedColumnOffset : 0),
2452
- sourceIndex,
2453
- originalLine,
2454
- originalColumn,
2455
- nameIndex < 0 ? -1 : nameIndexMapping[nameIndex]
2456
- );
2457
- }
2458
- pos = endPos;
2459
- },
2460
- (sourceIndex, source, sourceContent) => {
2461
- while (sourceContents.length < sourceIndex)
2462
- sourceContents.push(void 0);
2463
- sourceContents[sourceIndex] = sourceContent;
2464
- onSource(sourceIndex, source, sourceContent);
2465
- },
2466
- (nameIndex, name) => {
2467
- let globalIndex = nameMapping.get(name);
2468
- if (globalIndex === void 0) {
2469
- globalIndex = nameMapping.size;
2470
- nameMapping.set(name, globalIndex);
2471
- onName(globalIndex, name);
2472
- }
2473
- nameIndexMapping[nameIndex] = globalIndex;
2474
- }
2475
- );
2476
- let remainer = "";
2477
- for (; i < repls.length; i++) {
2478
- remainer += repls[i].content;
2479
- }
2480
- let line = generatedLine + generatedLineOffset;
2481
- let matches = splitIntoLines(remainer);
2482
- for (let m = 0; m < matches.length; m++) {
2483
- const contentLine = matches[m];
2484
- onChunk(
2485
- contentLine,
2486
- line,
2487
- generatedColumn + (line === generatedColumnOffsetLine ? generatedColumnOffset : 0),
2488
- -1,
2489
- -1,
2490
- -1,
2491
- -1
2492
- );
2493
- if (m === matches.length - 1 && !contentLine.endsWith("\n")) {
2494
- if (generatedColumnOffsetLine === line) {
2495
- generatedColumnOffset += contentLine.length;
2496
- } else {
2497
- generatedColumnOffset = contentLine.length;
2498
- generatedColumnOffsetLine = line;
2499
- }
2500
- } else {
2501
- generatedLineOffset++;
2502
- line++;
2503
- generatedColumnOffset = -generatedColumn;
2504
- generatedColumnOffsetLine = line;
2505
- }
2506
- }
2507
- return {
2508
- generatedLine: line,
2509
- generatedColumn: generatedColumn + (line === generatedColumnOffsetLine ? generatedColumnOffset : 0)
2510
- };
2511
- }
2512
- updateHash(hash) {
2513
- this._sortReplacements();
2514
- hash.update("ReplaceSource");
2515
- this._source.updateHash(hash);
2516
- hash.update(this._name || "");
2517
- for (const repl of this._replacements) {
2518
- hash.update(`${repl.start}${repl.end}${repl.content}${repl.name}`);
2519
- }
2520
- }
2521
- };
2522
- module.exports = ReplaceSource;
2523
- }
2524
- });
2525
-
2526
- // node_modules/webpack-sources/lib/PrefixSource.js
2527
- var require_PrefixSource = __commonJS({
2528
- "node_modules/webpack-sources/lib/PrefixSource.js"(exports, module) {
2529
- "use strict";
2530
- var Source = require_Source();
2531
- var RawSource = require_RawSource();
2532
- var streamChunks = require_streamChunks();
2533
- var { getMap, getSourceAndMap } = require_getFromStreamChunks();
2534
- var REPLACE_REGEX = /\n(?=.|\s)/g;
2535
- var PrefixSource = class extends Source {
2536
- constructor(prefix, source) {
2537
- super();
2538
- this._source = typeof source === "string" || Buffer.isBuffer(source) ? new RawSource(source, true) : source;
2539
- this._prefix = prefix;
2540
- }
2541
- getPrefix() {
2542
- return this._prefix;
2543
- }
2544
- original() {
2545
- return this._source;
2546
- }
2547
- source() {
2548
- const node = this._source.source();
2549
- const prefix = this._prefix;
2550
- return prefix + node.replace(REPLACE_REGEX, "\n" + prefix);
2551
- }
2552
- // TODO efficient buffer() implementation
2553
- map(options) {
2554
- return getMap(this, options);
2555
- }
2556
- sourceAndMap(options) {
2557
- return getSourceAndMap(this, options);
2558
- }
2559
- streamChunks(options, onChunk, onSource, onName) {
2560
- const prefix = this._prefix;
2561
- const prefixOffset = prefix.length;
2562
- const linesOnly = !!(options && options.columns === false);
2563
- const { generatedLine, generatedColumn, source } = streamChunks(
2564
- this._source,
2565
- options,
2566
- (chunk, generatedLine2, generatedColumn2, sourceIndex, originalLine, originalColumn, nameIndex) => {
2567
- if (generatedColumn2 !== 0) {
2568
- generatedColumn2 += prefixOffset;
2569
- } else if (chunk !== void 0) {
2570
- if (linesOnly || sourceIndex < 0) {
2571
- chunk = prefix + chunk;
2572
- } else if (prefixOffset > 0) {
2573
- onChunk(prefix, generatedLine2, generatedColumn2, -1, -1, -1, -1);
2574
- generatedColumn2 += prefixOffset;
2575
- }
2576
- } else if (!linesOnly) {
2577
- generatedColumn2 += prefixOffset;
2578
- }
2579
- onChunk(
2580
- chunk,
2581
- generatedLine2,
2582
- generatedColumn2,
2583
- sourceIndex,
2584
- originalLine,
2585
- originalColumn,
2586
- nameIndex
2587
- );
2588
- },
2589
- onSource,
2590
- onName
2591
- );
2592
- return {
2593
- generatedLine,
2594
- generatedColumn: generatedColumn === 0 ? 0 : prefixOffset + generatedColumn,
2595
- source: source !== void 0 ? prefix + source.replace(REPLACE_REGEX, "\n" + prefix) : void 0
2596
- };
2597
- }
2598
- updateHash(hash) {
2599
- hash.update("PrefixSource");
2600
- this._source.updateHash(hash);
2601
- hash.update(this._prefix);
2602
- }
2603
- };
2604
- module.exports = PrefixSource;
2605
- }
2606
- });
2607
-
2608
- // node_modules/webpack-sources/lib/SizeOnlySource.js
2609
- var require_SizeOnlySource = __commonJS({
2610
- "node_modules/webpack-sources/lib/SizeOnlySource.js"(exports, module) {
2611
- "use strict";
2612
- var Source = require_Source();
2613
- var SizeOnlySource = class extends Source {
2614
- constructor(size) {
2615
- super();
2616
- this._size = size;
2617
- }
2618
- _error() {
2619
- return new Error(
2620
- "Content and Map of this Source is not available (only size() is supported)"
2621
- );
2622
- }
2623
- size() {
2624
- return this._size;
2625
- }
2626
- source() {
2627
- throw this._error();
2628
- }
2629
- buffer() {
2630
- throw this._error();
2631
- }
2632
- map(options) {
2633
- throw this._error();
2634
- }
2635
- updateHash() {
2636
- throw this._error();
2637
- }
2638
- };
2639
- module.exports = SizeOnlySource;
2640
- }
2641
- });
2642
-
2643
- // node_modules/webpack-sources/lib/CompatSource.js
2644
- var require_CompatSource = __commonJS({
2645
- "node_modules/webpack-sources/lib/CompatSource.js"(exports, module) {
2646
- "use strict";
2647
- var Source = require_Source();
2648
- var CompatSource = class _CompatSource extends Source {
2649
- static from(sourceLike) {
2650
- return sourceLike instanceof Source ? sourceLike : new _CompatSource(sourceLike);
2651
- }
2652
- constructor(sourceLike) {
2653
- super();
2654
- this._sourceLike = sourceLike;
2655
- }
2656
- source() {
2657
- return this._sourceLike.source();
2658
- }
2659
- buffer() {
2660
- if (typeof this._sourceLike.buffer === "function") {
2661
- return this._sourceLike.buffer();
2662
- }
2663
- return super.buffer();
2664
- }
2665
- size() {
2666
- if (typeof this._sourceLike.size === "function") {
2667
- return this._sourceLike.size();
2668
- }
2669
- return super.size();
2670
- }
2671
- map(options) {
2672
- if (typeof this._sourceLike.map === "function") {
2673
- return this._sourceLike.map(options);
2674
- }
2675
- return super.map(options);
2676
- }
2677
- sourceAndMap(options) {
2678
- if (typeof this._sourceLike.sourceAndMap === "function") {
2679
- return this._sourceLike.sourceAndMap(options);
2680
- }
2681
- return super.sourceAndMap(options);
2682
- }
2683
- updateHash(hash) {
2684
- if (typeof this._sourceLike.updateHash === "function") {
2685
- return this._sourceLike.updateHash(hash);
2686
- }
2687
- if (typeof this._sourceLike.map === "function") {
2688
- throw new Error(
2689
- "A Source-like object with a 'map' method must also provide an 'updateHash' method"
2690
- );
2691
- }
2692
- hash.update(this.buffer());
2693
- }
2694
- };
2695
- module.exports = CompatSource;
2696
- }
2697
- });
2698
-
2699
- // node_modules/webpack-sources/lib/index.js
2700
- var require_lib = __commonJS({
2701
- "node_modules/webpack-sources/lib/index.js"(exports) {
2702
- var defineExport = (name, fn) => {
2703
- let value;
2704
- Object.defineProperty(exports, name, {
2705
- get: () => {
2706
- if (fn !== void 0) {
2707
- value = fn();
2708
- fn = void 0;
2709
- }
2710
- return value;
2711
- },
2712
- configurable: true
2713
- });
2714
- };
2715
- defineExport("Source", () => require_Source());
2716
- defineExport("RawSource", () => require_RawSource());
2717
- defineExport("OriginalSource", () => require_OriginalSource());
2718
- defineExport("SourceMapSource", () => require_SourceMapSource());
2719
- defineExport("CachedSource", () => require_CachedSource());
2720
- defineExport("ConcatSource", () => require_ConcatSource());
2721
- defineExport("ReplaceSource", () => require_ReplaceSource());
2722
- defineExport("PrefixSource", () => require_PrefixSource());
2723
- defineExport("SizeOnlySource", () => require_SizeOnlySource());
2724
- defineExport("CompatSource", () => require_CompatSource());
2725
- }
2726
- });
2727
-
2728
- // packages/dev-tools/webpack/main.ts
2729
- var import_webpack_sources = __toESM(require_lib(), 1);
2730
- import { basename, join } from "path";
2731
- import { existsSync, readFileSync, writeFileSync } from "fs";
2732
- import { createDevTools } from "../core/index.mjs";
2733
- import { createDevToolsNodeSys } from "../node/index.mjs";
2734
- import { createDevToolsServer } from "../server/index.mjs";
2735
- var PLUGIN_NAME = "BuilderDevToolsPlugin";
2736
- var devToolsSetupPromise = null;
2737
- async function setupDevTools(opts) {
2738
- const sys = await createDevToolsNodeSys({
2739
- cwd: process.cwd()
2740
- });
2741
- sys.debug("webpack setupDevTools init");
2742
- const devTools = await createDevTools(sys);
2743
- const server = await createDevToolsServer({
2744
- ...devTools,
2745
- getClientId: () => "webpack-builder-dev-tools",
2746
- closeAppServer: async () => {
2747
- },
2748
- restartAppServer: async () => {
2749
- sys.debug("restart server");
2750
- const configPaths = [
2751
- "next.config.js",
2752
- "next.config.ts",
2753
- "next.config.mjs",
2754
- "webpack.config.js",
2755
- "webpack.config.ts"
2756
- ].map((c) => join(sys.getAppRootDir(), c));
2757
- for (const configPath of configPaths) {
2758
- if (existsSync(configPath)) {
2759
- sys.debug(`restart server: ${configPath}`);
2760
- writeFileSync(
2761
- configPath,
2762
- readFileSync(configPath, {
2763
- encoding: "utf-8"
2764
- })
2765
- );
2766
- await new Promise((r) => setTimeout(r, 50));
2767
- return;
2768
- }
2769
- }
2770
- },
2771
- enableAppWatch: async (enable) => {
2772
- return enable;
2773
- },
2774
- ...sys,
2775
- ...opts
2776
- });
2777
- sys.debug("webpack setupDevTools done");
2778
- return {
2779
- server,
2780
- sys
2781
- };
2782
- }
2783
- var BuilderDevToolsPlugin = class {
2784
- constructor(opts) {
2785
- __publicField(this, "opts");
2786
- this.opts = opts || {};
2787
- if (typeof this.opts.enabled !== "boolean") {
2788
- this.opts.enabled = process.env.NODE_ENV !== "production";
2789
- }
2790
- if (this.opts.enabled && devToolsSetupPromise == null) {
2791
- devToolsSetupPromise = setupDevTools(this.opts);
2792
- }
2793
- }
2794
- apply(c) {
2795
- if (this.opts.enabled === false) {
2796
- return;
2797
- }
2798
- const compiler = c;
2799
- const stage = compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS;
2800
- const cache = /* @__PURE__ */ new WeakMap();
2801
- compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
2802
- compilation.hooks.processAssets.tapAsync(
2803
- {
2804
- name: PLUGIN_NAME,
2805
- stage
2806
- },
2807
- async (_, callback) => {
2808
- if (devToolsSetupPromise == null) {
2809
- return;
2810
- }
2811
- for (const chunk of compilation.chunks) {
2812
- for (const file of chunk.files) {
2813
- const fileName = basename(file);
2814
- const { server, sys } = await devToolsSetupPromise;
2815
- if (sys.getFrameworks().some((f) => f.name === "next") && fileName !== "webpack.js") {
2816
- continue;
2817
- }
2818
- sys.getAppRootDir = () => compiler.context;
2819
- const url = new URL(`/~builder-dev-tools.js`, server.getUrl());
2820
- let c2 = `
2
+ var wt=Object.create;var ae=Object.defineProperty;var Tt=Object.getOwnPropertyDescriptor;var Ct=Object.getOwnPropertyNames;var zt=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty;var qt=(n,e,t)=>e in n?ae(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var j=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Nt=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ct(e))!Et.call(n,i)&&i!==t&&ae(n,i,{get:()=>e[i],enumerable:!(s=Tt(e,i))||s.enumerable});return n};var jt=(n,e,t)=>(t=n!=null?wt(zt(n)):{},Nt(e||!n||!n.__esModule?ae(t,"default",{value:n,enumerable:!0}):t,n));var we=(n,e,t)=>qt(n,typeof e!="symbol"?e+"":e,t);var G=j((Us,Te)=>{"use strict";var he=class{source(){throw new Error("Abstract")}buffer(){let e=this.source();return Buffer.isBuffer(e)?e:Buffer.from(e,"utf-8")}size(){return this.buffer().length}map(e){return null}sourceAndMap(e){return{source:this.source(),map:this.map(e)}}updateHash(e){throw new Error("Abstract")}};Te.exports=he});var re=j((Fs,Ce)=>{"use strict";var xt=n=>{if(n===void 0)return{};let e=n.lastIndexOf(`
3
+ `);if(e===-1)return{generatedLine:1,generatedColumn:n.length,source:n};let t=2;for(let s=0;s<e;s++)n.charCodeAt(s)===10&&t++;return{generatedLine:t,generatedColumn:n.length-e-1,source:n}};Ce.exports=xt});var X=j((Js,ze)=>{var kt=n=>{let e=[],t=n.length,s=0;for(;s<t;)if(n.charCodeAt(s)===10)e.push(`
4
+ `),s++;else{let r=s+1;for(;r<t&&n.charCodeAt(r)!==10;)r++;e.push(n.slice(s,r+1)),s=r+1}return e};ze.exports=kt});var ne=j((Xs,Ee)=>{"use strict";var It=re(),Dt=X(),Rt=(n,e,t,s)=>{let i=1,r=Dt(n),f;for(f of r)e(f,i,0,-1,-1,-1,-1),i++;return r.length===0||f.endsWith(`
5
+ `)?{generatedLine:r.length+1,generatedColumn:0}:{generatedLine:r.length,generatedColumn:f.length}};Ee.exports=(n,e,t,s,i)=>i?It(n):Rt(n,e,t,s)});var ie=j(($s,qe)=>{"use strict";var Lt=ne(),Ht=G(),de=class extends Ht{constructor(e,t=!1){super();let s=Buffer.isBuffer(e);if(!s&&typeof e!="string")throw new TypeError("argument 'value' must be either string of Buffer");this._valueIsBuffer=!t&&s,this._value=t&&s?void 0:e,this._valueAsBuffer=s?e:void 0,this._valueAsString=s?void 0:e}isBuffer(){return this._valueIsBuffer}source(){return this._value===void 0&&(this._value=this._valueAsBuffer.toString("utf-8")),this._value}buffer(){return this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),this._valueAsBuffer}map(e){return null}streamChunks(e,t,s,i){return this._value===void 0&&(this._value=Buffer.from(this._valueAsBuffer,"utf-8")),this._valueAsString===void 0&&(this._valueAsString=typeof this._value=="string"?this._value:this._value.toString("utf-8")),Lt(this._valueAsString,t,s,i,!!(e&&e.finalSource))}updateHash(e){this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),e.update("RawSource"),e.update(this._valueAsBuffer)}};qe.exports=de});var pe=j((Ks,je)=>{"use strict";var ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ne=32,Pt=n=>n&&n.columns===!1?Gt():Wt(),Wt=()=>{let n=1,e=0,t=0,s=1,i=0,r=0,f=!1,u=!1,h=!0;return(o,a,l,d,m,c)=>{if(f&&n===o){if(l===t&&d===s&&m===i&&!u&&c<0)return""}else if(l<0)return"";let _;n<o?(_=";".repeat(o-n),n=o,e=0,h=!1):h?(_="",h=!1):_=",";let g=A=>{let O=A>>>31&1,y=A>>31,E=(A+y^y)<<1|O;for(;;){let p=E&31;if(E>>=5,E===0){_+=ue[p];break}else _+=ue[p|Ne]}};return g(a-e),e=a,l>=0?(f=!0,l===t?_+="A":(g(l-t),t=l),g(d-s),s=d,m===i?_+="A":(g(m-i),i=m),c>=0?(g(c-r),r=c,u=!0):u=!1):f=!1,_}},Gt=()=>{let n=0,e=1,t=0,s=1;return(i,r,f,u,h,o)=>{if(f<0||n===i)return"";let a,l=d=>{let m=d>>>31&1,c=d>>31,g=(d+c^c)<<1|m;for(;;){let A=g&31;if(g>>=5,g===0){a+=ue[A];break}else a+=ue[A|Ne]}};return n=i,i===e+1?(e=i,f===t?(t=f,u===s+1?(s=u,";AACA"):(a=";AA",l(u-s),s=u,a+"A")):(a=";A",l(f-t),t=f,l(u-s),s=u,a+"A")):(a=";".repeat(i-e),e=i,f===t?(t=f,u===s+1?(s=u,a+"AACA"):(a+="AA",l(u-s),s=u,a+"A")):(a+="A",l(f-t),t=f,l(u-s),s=u,a+"A"))}};je.exports=Pt});var $=j(_e=>{"use strict";var xe=pe();_e.getSourceAndMap=(n,e)=>{let t="",s="",i=[],r=[],f=[],u=xe(e),{source:h}=n.streamChunks(Object.assign({},e,{finalSource:!0}),(o,a,l,d,m,c,_)=>{o!==void 0&&(t+=o),s+=u(a,l,d,m,c,_)},(o,a,l)=>{for(;i.length<o;)i.push(null);if(i[o]=a,l!==void 0){for(;r.length<o;)r.push(null);r[o]=l}},(o,a)=>{for(;f.length<o;)f.push(null);f[o]=a});return{source:h!==void 0?h:t,map:s.length>0?{version:3,file:"x",mappings:s,sources:i,sourcesContent:r.length>0?r:void 0,names:f}:null}};_e.getMap=(n,e)=>{let t="",s=[],i=[],r=[],f=xe(e);return n.streamChunks(Object.assign({},e,{source:!1,finalSource:!0}),(u,h,o,a,l,d,m)=>{t+=f(h,o,a,l,d,m)},(u,h,o)=>{for(;s.length<u;)s.push(null);if(s[u]=h,o!==void 0){for(;i.length<u;)i.push(null);i[u]=o}},(u,h)=>{for(;r.length<u;)r.push(null);r[u]=h}),t.length>0?{version:3,file:"x",mappings:t,sources:s,sourcesContent:i.length>0?i:void 0,names:r}:null}});var Ie=j((Ys,ke)=>{var Vt=n=>{let e=n.length;if(e===0)return null;let t=[],s=0;for(;s<e;){let i=s;e:{let r=n.charCodeAt(s);for(;r!==10&&r!==59&&r!==123&&r!==125;){if(++s>=e)break e;r=n.charCodeAt(s)}for(;r===59||r===32||r===123||r===125||r===13||r===9;){if(++s>=e)break e;r=n.charCodeAt(s)}r===10&&s++}t.push(n.slice(i,s))}return t};ke.exports=Vt});var Re=j((Zs,De)=>{"use strict";var{getMap:Ut,getSourceAndMap:Ft}=$(),Jt=X(),Xt=re(),$t=G(),Kt=Ie(),ge=class extends $t{constructor(e,t){super();let s=Buffer.isBuffer(e);this._value=s?void 0:e,this._valueAsBuffer=s?e:void 0,this._name=t}getName(){return this._name}source(){return this._value===void 0&&(this._value=this._valueAsBuffer.toString("utf-8")),this._value}buffer(){return this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),this._valueAsBuffer}map(e){return Ut(this,e)}sourceAndMap(e){return Ft(this,e)}streamChunks(e,t,s,i){this._value===void 0&&(this._value=this._valueAsBuffer.toString("utf-8")),s(0,this._name,this._value);let r=!!(e&&e.finalSource);if(!e||e.columns!==!1){let f=Kt(this._value),u=1,h=0;if(f!==null)for(let o of f){let a=o.endsWith(`
6
+ `);a&&o.length===1?r||t(o,u,h,-1,-1,-1,-1):t(r?void 0:o,u,h,0,u,h,-1),a?(u++,h=0):h+=o.length}return{generatedLine:u,generatedColumn:h,source:r?this._value:void 0}}else if(r){let f=Xt(this._value),{generatedLine:u,generatedColumn:h}=f;if(h===0)for(let o=1;o<u;o++)t(void 0,o,0,0,o,0,-1);else for(let o=1;o<=u;o++)t(void 0,o,0,0,o,0,-1);return f}else{let f=1,u=Jt(this._value),h;for(h of u)t(r?void 0:h,f,0,0,f,0,-1),f++;return u.length===0||h.endsWith(`
7
+ `)?{generatedLine:u.length+1,generatedColumn:0,source:r?this._value:void 0}:{generatedLine:u.length,generatedColumn:h.length,source:r?this._value:void 0}}}updateHash(e){this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),e.update("OriginalSource"),e.update(this._valueAsBuffer),e.update(this._name||"")}};De.exports=ge});var He=j((er,Le)=>{"use strict";var Qt=(n,e)=>{if(e<0)return null;let{sourceRoot:t,sources:s}=n,i=s[e];return t?t.endsWith("/")?t+i:t+"/"+i:i};Le.exports=Qt});var Ge=j((tr,We)=>{"use strict";var Pe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K=new Uint8Array(123);{K.fill(66);for(let n=0;n<Pe.length;n++)K[Pe.charCodeAt(n)]=n;K[44]=64,K[59]=65}var Yt=K.length-1,Zt=(n,e)=>{let t=new Uint32Array([0,0,1,0,0]),s=0,i=0,r=0,f=1,u=-1;for(let h=0;h<n.length;h++){let o=n.charCodeAt(h);if(o>Yt)continue;let a=K[o];if(a&64)t[0]>u&&(s===1?e(f,t[0],-1,-1,-1,-1):s===4?e(f,t[0],t[1],t[2],t[3],-1):s===5&&e(f,t[0],t[1],t[2],t[3],t[4]),u=t[0]),s=0,a===65&&(f++,t[0]=0,u=-1);else if(a&32)i|=(a&31)<<r,r+=5;else{i|=a<<r;let l=i&1?-(i>>1):i>>1;t[s++]+=l,r=0,i=0}}s===1?e(f,t[0],-1,-1,-1,-1):s===4?e(f,t[0],t[1],t[2],t[3],-1):s===5&&e(f,t[0],t[1],t[2],t[3],t[4])};We.exports=Zt});var Q=j((sr,Fe)=>{"use strict";var Ve=re(),fe=He(),ce=Ge(),Ue=X(),es=(n,e,t,s,i)=>{let r=Ue(n);if(r.length===0)return{generatedLine:1,generatedColumn:0};let{sources:f,sourcesContent:u,names:h,mappings:o}=e;for(let p=0;p<f.length;p++)s(p,fe(e,p),u&&u[p]||void 0);if(h)for(let p=0;p<h.length;p++)i(p,h[p]);let a=r[r.length-1],l=a.endsWith(`
8
+ `),d=l?r.length+1:r.length,m=l?0:a.length,c=1,_=0,g=!1,A=-1,O=-1,y=-1,v=-1,E=(p,B,q,w,b,T)=>{if(g&&c<=r.length){let S,M=c,N=_,z=r[c-1];p!==c?(S=z.slice(_),c++,_=0):(S=z.slice(_,B),_=B),S&&t(S,M,N,A,O,y,v),g=!1}if(p>c&&_>0){if(c<=r.length){let S=r[c-1].slice(_);t(S,c,_,-1,-1,-1,-1)}c++,_=0}for(;p>c;)c<=r.length&&t(r[c-1],c,0,-1,-1,-1,-1),c++;if(B>_){if(c<=r.length){let S=r[c-1].slice(_,B);t(S,c,_,-1,-1,-1,-1)}_=B}q>=0&&(p<d||p===d&&B<m)&&(g=!0,A=q,O=w,y=b,v=T)};return ce(o,E),E(d,m,-1,-1,-1,-1),{generatedLine:d,generatedColumn:m}},ts=(n,e,t,s,i)=>{let r=Ue(n);if(r.length===0)return{generatedLine:1,generatedColumn:0};let{sources:f,sourcesContent:u,mappings:h}=e;for(let _=0;_<f.length;_++)s(_,fe(e,_),u&&u[_]||void 0);let o=1;for(ce(h,(_,g,A,O,y,v)=>{if(!(A<0||_<o||_>r.length)){for(;_>o;)o<=r.length&&t(r[o-1],o,0,-1,-1,-1,-1),o++;_<=r.length&&(t(r[_-1],_,0,A,O,y,-1),o++)}});o<=r.length;o++)t(r[o-1],o,0,-1,-1,-1,-1);let l=r[r.length-1],d=l.endsWith(`
9
+ `),m=d?r.length+1:r.length,c=d?0:l.length;return{generatedLine:m,generatedColumn:c}},ss=(n,e,t,s,i)=>{let r=Ve(n),{generatedLine:f,generatedColumn:u}=r;if(f===1&&u===0)return r;let{sources:h,sourcesContent:o,names:a,mappings:l}=e;for(let c=0;c<h.length;c++)s(c,fe(e,c),o&&o[c]||void 0);if(a)for(let c=0;c<a.length;c++)i(c,a[c]);let d=0;return ce(l,(c,_,g,A,O,y)=>{c>=f&&(_>=u||c>f)||(g>=0?(t(void 0,c,_,g,A,O,y),d=c):d===c&&(t(void 0,c,_,-1,-1,-1,-1),d=0))}),r},rs=(n,e,t,s,i)=>{let r=Ve(n),{generatedLine:f,generatedColumn:u}=r;if(f===1&&u===0)return{generatedLine:1,generatedColumn:0};let{sources:h,sourcesContent:o,mappings:a}=e;for(let c=0;c<h.length;c++)s(c,fe(e,c),o&&o[c]||void 0);let l=u===0?f-1:f,d=1;return ce(a,(c,_,g,A,O,y)=>{g>=0&&d<=c&&c<=l&&(t(void 0,c,0,g,A,O,-1),d=c+1)}),r};Fe.exports=(n,e,t,s,i,r,f)=>f?r?ss(n,e,t,s,i):es(n,e,t,s,i):r?rs(n,e,t,s,i):ts(n,e,t,s,i)});var Ke=j((rr,$e)=>{"use strict";var Je=Q(),Xe=X(),ns=(n,e,t,s,i,r,f,u,h,o,a)=>{let l=new Map,d=new Map,m=[],c=[],_=[],g=-2,A=[],O=[],y=[],v=[],E=[],p=[],B=[],q=(w,b)=>{if(w>B.length)return-1;let{mappingsData:T}=B[w-1],S=0,M=T.length/5;for(;S<M;){let N=S+M>>1;T[N*5]<=b?S=N+1:M=N}return S===0?-1:S-1};return Je(n,e,(w,b,T,S,M,N,z)=>{if(S===g){let R=q(M,N);if(R!==-1){let{chunks:L,mappingsData:I}=B[M-1],H=R*5,C=I[H+1],k=I[H+2],F=I[H+3],U=I[H+4];if(C>=0){let Ot=L[R],yt=I[H],Z=N-yt;if(Z>0){let x=C<v.length?v[C]:null;if(x===void 0){let D=y[C];x=D?Xe(D):null,v[C]=x}if(x!==null){let D=k<=x.length?x[k-1].slice(F,F+Z):"";Ot.slice(0,Z)===D&&(F+=Z,U=-1)}}let ee=C<A.length?A[C]:-2;if(ee===-2){let[x,D]=C<O.length?O[C]:[null,void 0],J=l.get(x);J===void 0&&(l.set(x,J=l.size),u(J,x,D)),ee=J,A[C]=ee}let W=-1;if(U>=0){if(W=U<E.length?E[U]:-2,W===-2){let x=U<p.length?p[U]:void 0;if(x){let D=d.get(x);D===void 0&&(d.set(x,D=d.size),h(D,x)),W=D}else W=-1;E[U]=W}}else if(z>=0){let x=v[C];if(x===void 0){let D=y[C];x=D?Xe(D):null,v[C]=x}if(x!==null){let D=_[z],J=k<=x.length?x[k-1].slice(F,F+D.length):"";if(D===J&&(W=z<c.length?c[z]:-2,W===-2)){let te=_[z];if(te){let se=d.get(te);se===void 0&&(d.set(te,se=d.size),h(se,te)),W=se}else W=-1;c[z]=W}}}f(w,b,T,ee,k,F,W);return}}if(r){f(w,b,T,-1,-1,-1,-1);return}else if(m[S]===-2){let L=l.get(t);L===void 0&&(l.set(n,L=l.size),u(L,t,s)),m[S]=L}}let P=S<0||S>=m.length?-1:m[S];if(P<0)f(w,b,T,-1,-1,-1,-1);else{let R=-1;if(z>=0&&z<c.length&&(R=c[z],R===-2)){let L=_[z],I=d.get(L);I===void 0&&(d.set(L,I=d.size),h(I,L)),R=I,c[z]=R}f(w,b,T,P,M,N,R)}},(w,b,T)=>{if(b===t)g=w,s!==void 0?T=s:s=T,m[w]=-2,Je(T,i,(S,M,N,z,P,R,L)=>{for(;B.length<M;)B.push({mappingsData:[],chunks:[]});let I=B[M-1];I.mappingsData.push(N,z,P,R,L),I.chunks.push(S)},(S,M,N)=>{y[S]=N,v[S]=void 0,A[S]=-2,O[S]=[M,N]},(S,M)=>{E[S]=-2,p[S]=M},!1,a);else{let S=l.get(b);S===void 0&&(l.set(b,S=l.size),u(S,b,T)),m[w]=S}},(w,b)=>{c[w]=-2,_[w]=b},o,a)};$e.exports=ns});var Ye=j((nr,Qe)=>{"use strict";var is=G(),us=Q(),fs=Ke(),{getMap:cs,getSourceAndMap:os}=$(),Se=class extends is{constructor(e,t,s,i,r,f){super();let u=Buffer.isBuffer(e);this._valueAsString=u?void 0:e,this._valueAsBuffer=u?e:void 0,this._name=t,this._hasSourceMap=!!s;let h=Buffer.isBuffer(s),o=typeof s=="string";this._sourceMapAsObject=h||o?void 0:s,this._sourceMapAsString=o?s:void 0,this._sourceMapAsBuffer=h?s:void 0,this._hasOriginalSource=!!i;let a=Buffer.isBuffer(i);this._originalSourceAsString=a?void 0:i,this._originalSourceAsBuffer=a?i:void 0,this._hasInnerSourceMap=!!r;let l=Buffer.isBuffer(r),d=typeof r=="string";this._innerSourceMapAsObject=l||d?void 0:r,this._innerSourceMapAsString=d?r:void 0,this._innerSourceMapAsBuffer=l?r:void 0,this._removeOriginalSource=f}_ensureValueBuffer(){this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._valueAsString,"utf-8"))}_ensureValueString(){this._valueAsString===void 0&&(this._valueAsString=this._valueAsBuffer.toString("utf-8"))}_ensureOriginalSourceBuffer(){this._originalSourceAsBuffer===void 0&&this._hasOriginalSource&&(this._originalSourceAsBuffer=Buffer.from(this._originalSourceAsString,"utf-8"))}_ensureOriginalSourceString(){this._originalSourceAsString===void 0&&this._hasOriginalSource&&(this._originalSourceAsString=this._originalSourceAsBuffer.toString("utf-8"))}_ensureInnerSourceMapObject(){this._innerSourceMapAsObject===void 0&&this._hasInnerSourceMap&&(this._ensureInnerSourceMapString(),this._innerSourceMapAsObject=JSON.parse(this._innerSourceMapAsString))}_ensureInnerSourceMapBuffer(){this._innerSourceMapAsBuffer===void 0&&this._hasInnerSourceMap&&(this._ensureInnerSourceMapString(),this._innerSourceMapAsBuffer=Buffer.from(this._innerSourceMapAsString,"utf-8"))}_ensureInnerSourceMapString(){this._innerSourceMapAsString===void 0&&this._hasInnerSourceMap&&(this._innerSourceMapAsBuffer!==void 0?this._innerSourceMapAsString=this._innerSourceMapAsBuffer.toString("utf-8"):this._innerSourceMapAsString=JSON.stringify(this._innerSourceMapAsObject))}_ensureSourceMapObject(){this._sourceMapAsObject===void 0&&(this._ensureSourceMapString(),this._sourceMapAsObject=JSON.parse(this._sourceMapAsString))}_ensureSourceMapBuffer(){this._sourceMapAsBuffer===void 0&&(this._ensureSourceMapString(),this._sourceMapAsBuffer=Buffer.from(this._sourceMapAsString,"utf-8"))}_ensureSourceMapString(){this._sourceMapAsString===void 0&&(this._sourceMapAsBuffer!==void 0?this._sourceMapAsString=this._sourceMapAsBuffer.toString("utf-8"):this._sourceMapAsString=JSON.stringify(this._sourceMapAsObject))}getArgsAsBuffers(){return this._ensureValueBuffer(),this._ensureSourceMapBuffer(),this._ensureOriginalSourceBuffer(),this._ensureInnerSourceMapBuffer(),[this._valueAsBuffer,this._name,this._sourceMapAsBuffer,this._originalSourceAsBuffer,this._innerSourceMapAsBuffer,this._removeOriginalSource]}buffer(){return this._ensureValueBuffer(),this._valueAsBuffer}source(){return this._ensureValueString(),this._valueAsString}map(e){return this._hasInnerSourceMap?cs(this,e):(this._ensureSourceMapObject(),this._sourceMapAsObject)}sourceAndMap(e){return this._hasInnerSourceMap?os(this,e):(this._ensureValueString(),this._ensureSourceMapObject(),{source:this._valueAsString,map:this._sourceMapAsObject})}streamChunks(e,t,s,i){return this._ensureValueString(),this._ensureSourceMapObject(),this._ensureOriginalSourceString(),this._hasInnerSourceMap?(this._ensureInnerSourceMapObject(),fs(this._valueAsString,this._sourceMapAsObject,this._name,this._originalSourceAsString,this._innerSourceMapAsObject,this._removeOriginalSource,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1))):us(this._valueAsString,this._sourceMapAsObject,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1))}updateHash(e){this._ensureValueBuffer(),this._ensureSourceMapBuffer(),this._ensureOriginalSourceBuffer(),this._ensureInnerSourceMapBuffer(),e.update("SourceMapSource"),e.update(this._valueAsBuffer),e.update(this._sourceMapAsBuffer),this._hasOriginalSource&&e.update(this._originalSourceAsBuffer),this._hasInnerSourceMap&&e.update(this._innerSourceMapAsBuffer),e.update(this._removeOriginalSource?"true":"false")}};Qe.exports=Se});var Y=j((ir,Ze)=>{"use strict";var ls=ne(),as=Q();Ze.exports=(n,e,t,s,i)=>{if(typeof n.streamChunks=="function")return n.streamChunks(e,t,s,i);{let r=n.sourceAndMap(e);return r.map?as(r.source,r.map,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1)):ls(r.source,t,s,i,!!(e&&e.finalSource))}}});var tt=j((ur,et)=>{"use strict";var hs=pe(),ds=Y(),ps=(n,e,t,s,i)=>{let r="",f="",u=[],h=[],o=[],a=hs(Object.assign({},e,{columns:!0})),l=!!(e&&e.finalSource),{generatedLine:d,generatedColumn:m,source:c}=ds(n,e,(g,A,O,y,v,E,p)=>(g!==void 0&&(r+=g),f+=a(A,O,y,v,E,p),t(l?void 0:g,A,O,y,v,E,p)),(g,A,O)=>{for(;u.length<g;)u.push(null);if(u[g]=A,O!==void 0){for(;h.length<g;)h.push(null);h[g]=O}return s(g,A,O)},(g,A)=>{for(;o.length<g;)o.push(null);return o[g]=A,i(g,A)}),_=c!==void 0?c:r;return{result:{generatedLine:d,generatedColumn:m,source:l?_:void 0},source:_,map:f.length>0?{version:3,file:"x",mappings:f,sources:u,sourcesContent:h.length>0?h:void 0,names:o}:null}};et.exports=ps});var rt=j((fr,st)=>{"use strict";var _s=G(),gs=Q(),Ss=ne(),ms=tt(),As=n=>{if(typeof n!="object"||!n)return n;let e=Object.assign({},n);return n.mappings&&(e.mappings=Buffer.from(n.mappings,"utf-8")),n.sourcesContent&&(e.sourcesContent=n.sourcesContent.map(t=>t&&Buffer.from(t,"utf-8"))),e},Ms=n=>{if(typeof n!="object"||!n)return n;let e=Object.assign({},n);return n.mappings&&(e.mappings=n.mappings.toString("utf-8")),n.sourcesContent&&(e.sourcesContent=n.sourcesContent.map(t=>t&&t.toString("utf-8"))),e},me=class extends _s{constructor(e,t){super(),this._source=e,this._cachedSourceType=t?t.source:void 0,this._cachedSource=void 0,this._cachedBuffer=t?t.buffer:void 0,this._cachedSize=t?t.size:void 0,this._cachedMaps=t?t.maps:new Map,this._cachedHashUpdate=t?t.hash:void 0}getCachedData(){let e=new Map;for(let t of this._cachedMaps){let s=t[1];s.bufferedMap===void 0&&(s.bufferedMap=As(this._getMapFromCacheEntry(s))),e.set(t[0],{map:void 0,bufferedMap:s.bufferedMap})}return this._cachedSource&&this.buffer(),{buffer:this._cachedBuffer,source:this._cachedSourceType!==void 0?this._cachedSourceType:typeof this._cachedSource=="string"?!0:Buffer.isBuffer(this._cachedSource)?!1:void 0,size:this._cachedSize,maps:e,hash:this._cachedHashUpdate}}originalLazy(){return this._source}original(){return typeof this._source=="function"&&(this._source=this._source()),this._source}source(){let e=this._getCachedSource();return e!==void 0?e:this._cachedSource=this.original().source()}_getMapFromCacheEntry(e){if(e.map!==void 0)return e.map;if(e.bufferedMap!==void 0)return e.map=Ms(e.bufferedMap)}_getCachedSource(){if(this._cachedSource!==void 0)return this._cachedSource;if(this._cachedBuffer&&this._cachedSourceType!==void 0)return this._cachedSource=this._cachedSourceType?this._cachedBuffer.toString("utf-8"):this._cachedBuffer}buffer(){if(this._cachedBuffer!==void 0)return this._cachedBuffer;if(this._cachedSource!==void 0)return Buffer.isBuffer(this._cachedSource)?this._cachedBuffer=this._cachedSource:this._cachedBuffer=Buffer.from(this._cachedSource,"utf-8");if(typeof this.original().buffer=="function")return this._cachedBuffer=this.original().buffer();let e=this.source();return Buffer.isBuffer(e)?this._cachedBuffer=e:this._cachedBuffer=Buffer.from(e,"utf-8")}size(){if(this._cachedSize!==void 0)return this._cachedSize;if(this._cachedBuffer!==void 0)return this._cachedSize=this._cachedBuffer.length;let e=this._getCachedSource();return e!==void 0?this._cachedSize=Buffer.byteLength(e):this._cachedSize=this.original().size()}sourceAndMap(e){let t=e?JSON.stringify(e):"{}",s=this._cachedMaps.get(t);if(s!==void 0){let f=this._getMapFromCacheEntry(s);return{source:this.source(),map:f}}let i=this._getCachedSource(),r;if(i!==void 0)r=this.original().map(e);else{let f=this.original().sourceAndMap(e);i=f.source,r=f.map,this._cachedSource=i}return this._cachedMaps.set(t,{map:r,bufferedMap:void 0}),{source:i,map:r}}streamChunks(e,t,s,i){let r=e?JSON.stringify(e):"{}";if(this._cachedMaps.has(r)&&(this._cachedBuffer!==void 0||this._cachedSource!==void 0)){let{source:o,map:a}=this.sourceAndMap(e);return a?gs(o,a,t,s,i,!!(e&&e.finalSource),!0):Ss(o,t,s,i,!!(e&&e.finalSource))}let{result:f,source:u,map:h}=ms(this.original(),e,t,s,i);return this._cachedSource=u,this._cachedMaps.set(r,{map:h,bufferedMap:void 0}),f}map(e){let t=e?JSON.stringify(e):"{}",s=this._cachedMaps.get(t);if(s!==void 0)return this._getMapFromCacheEntry(s);let i=this.original().map(e);return this._cachedMaps.set(t,{map:i,bufferedMap:void 0}),i}updateHash(e){if(this._cachedHashUpdate!==void 0){for(let r of this._cachedHashUpdate)e.update(r);return}let t=[],s,i={update:r=>{typeof r=="string"&&r.length<10240?s===void 0?s=r:(s+=r,s.length>102400&&(t.push(Buffer.from(s)),s=void 0)):(s!==void 0&&(t.push(Buffer.from(s)),s=void 0),t.push(r))}};this.original().updateHash(i),s!==void 0&&t.push(Buffer.from(s));for(let r of t)e.update(r);this._cachedHashUpdate=t}};st.exports=me});var ut=j((cr,it)=>{"use strict";var Bs=G(),nt=ie(),vs=Y(),{getMap:bs,getSourceAndMap:Os}=$(),Ae=new WeakSet,Me=class n extends Bs{constructor(){super(),this._children=[];for(let e=0;e<arguments.length;e++){let t=arguments[e];if(t instanceof n)for(let s of t._children)this._children.push(s);else this._children.push(t)}this._isOptimized=arguments.length===0}getChildren(){return this._isOptimized||this._optimize(),this._children}add(e){if(e instanceof n)for(let t of e._children)this._children.push(t);else this._children.push(e);this._isOptimized=!1}addAllSkipOptimizing(e){for(let t of e)this._children.push(t)}buffer(){this._isOptimized||this._optimize();let e=[];for(let t of this._children)if(typeof t.buffer=="function")e.push(t.buffer());else{let s=t.source();Buffer.isBuffer(s)?e.push(s):e.push(Buffer.from(s,"utf-8"))}return Buffer.concat(e)}source(){this._isOptimized||this._optimize();let e="";for(let t of this._children)e+=t.source();return e}size(){this._isOptimized||this._optimize();let e=0;for(let t of this._children)e+=t.size();return e}map(e){return bs(this,e)}sourceAndMap(e){return Os(this,e)}streamChunks(e,t,s,i){if(this._isOptimized||this._optimize(),this._children.length===1)return this._children[0].streamChunks(e,t,s,i);let r=0,f=0,u=new Map,h=new Map,o=!!(e&&e.finalSource),a="",l=!1;for(let d of this._children){let m=[],c=[],_=0,{generatedLine:g,generatedColumn:A,source:O}=vs(d,e,(y,v,E,p,B,q,w)=>{let b=v+r,T=v===1?E+f:E;l&&((v!==1||E!==0)&&t(void 0,r+1,f,-1,-1,-1,-1),l=!1);let S=p<0||p>=m.length?-1:m[p],M=w<0||w>=c.length?-1:c[w];_=S<0?0:v,o?(y!==void 0&&(a+=y),S>=0&&t(void 0,b,T,S,B,q,M)):S<0?t(y,b,T,-1,-1,-1,-1):t(y,b,T,S,B,q,M)},(y,v,E)=>{let p=u.get(v);p===void 0&&(u.set(v,p=u.size),s(p,v,E)),m[y]=p},(y,v)=>{let E=h.get(v);E===void 0&&(h.set(v,E=h.size),i(E,v)),c[y]=E});O!==void 0&&(a+=O),l&&(g!==1||A!==0)&&(t(void 0,r+1,f,-1,-1,-1,-1),l=!1),g>1?f=A:f+=A,l=l||o&&_===g,r+=g-1}return{generatedLine:r+1,generatedColumn:f,source:o?a:void 0}}updateHash(e){this._isOptimized||this._optimize(),e.update("ConcatSource");for(let t of this._children)t.updateHash(e)}_optimize(){let e=[],t,s,i=u=>{s===void 0?s=u:Array.isArray(s)?s.push(u):s=[typeof s=="string"?s:s.source(),u]},r=u=>{s===void 0?s=u:Array.isArray(s)?s.push(u.source()):s=[typeof s=="string"?s:s.source(),u.source()]},f=()=>{if(Array.isArray(s)){let u=new nt(s.join(""));Ae.add(u),e.push(u)}else if(typeof s=="string"){let u=new nt(s);Ae.add(u),e.push(u)}else e.push(s)};for(let u of this._children)typeof u=="string"?t===void 0?t=u:t+=u:(t!==void 0&&(i(t),t=void 0),Ae.has(u)?r(u):(s!==void 0&&(f(),s=void 0),e.push(u)));t!==void 0&&i(t),s!==void 0&&f(),this._children=e,this._isOptimized=!0}};it.exports=Me});var lt=j((or,ot)=>{"use strict";var{getMap:ys,getSourceAndMap:ws}=$(),Ts=Y(),Cs=G(),Be=X(),ct=typeof process=="object"&&process.versions&&typeof process.versions.v8=="string"&&!/^[0-6]\./.test(process.versions.v8),ft=536870912,oe=class{constructor(e,t,s,i){this.start=e,this.end=t,this.content=s,this.name=i,ct||(this.index=-1)}},ve=class extends Cs{constructor(e,t){super(),this._source=e,this._name=t,this._replacements=[],this._isSorted=!0}getName(){return this._name}getReplacements(){return this._sortReplacements(),this._replacements}replace(e,t,s,i){if(typeof s!="string")throw new Error("insertion must be a string, but is a "+typeof s);this._replacements.push(new oe(e,t,s,i)),this._isSorted=!1}insert(e,t,s){if(typeof t!="string")throw new Error("insertion must be a string, but is a "+typeof t+": "+t);this._replacements.push(new oe(e,e-1,t,s)),this._isSorted=!1}source(){if(this._replacements.length===0)return this._source.source();let e=this._source.source(),t=0,s=[];this._sortReplacements();for(let i of this._replacements){let r=Math.floor(i.start),f=Math.floor(i.end+1);if(t<r){let u=r-t;s.push(e.slice(0,u)),e=e.slice(u),t=r}if(s.push(i.content),t<f){let u=f-t;e=e.slice(u),t=f}}return s.push(e),s.join("")}map(e){return this._replacements.length===0?this._source.map(e):ys(this,e)}sourceAndMap(e){return this._replacements.length===0?this._source.sourceAndMap(e):ws(this,e)}original(){return this._source}_sortReplacements(){this._isSorted||(ct?this._replacements.sort(function(e,t){let s=e.start-t.start;if(s!==0)return s;let i=e.end-t.end;return i!==0?i:0}):(this._replacements.forEach((e,t)=>e.index=t),this._replacements.sort(function(e,t){let s=e.start-t.start;if(s!==0)return s;let i=e.end-t.end;return i!==0?i:e.index-t.index})),this._isSorted=!0)}streamChunks(e,t,s,i){this._sortReplacements();let r=this._replacements,f=0,u=0,h=-1,o=u<r.length?Math.floor(r[u].start):ft,a=0,l=0,d=0,m=[],c=new Map,_=[],g=(p,B,q,w)=>{let b=p<m.length?m[p]:void 0;if(b===void 0)return!1;typeof b=="string"&&(b=Be(b),m[p]=b);let T=B<=b.length?b[B-1]:null;return T===null?!1:T.slice(q,q+w.length)===w},{generatedLine:A,generatedColumn:O}=Ts(this._source,Object.assign({},e,{finalSource:!1}),(p,B,q,w,b,T,S)=>{let M=0,N=f+p.length;if(h>f){if(h>=N){let P=B+a;p.endsWith(`
10
+ `)?(a--,d===P&&(l+=q)):d===P?l-=p.length:(l=-p.length,d=P),f=N;return}M=h-f,g(w,b,T,p.slice(0,M))&&(T+=M),f+=M;let z=B+a;d===z?l-=M:(l=-M,d=z),q+=M}if(o<N)do{let z=B+a;if(o>f){let C=o-f,k=p.slice(M,M+C);t(k,z,q+(z===d?l:0),w,b,T,S<0||S>=_.length?-1:_[S]),q+=C,M+=C,f=o,g(w,b,T,k)&&(T+=k.length)}let{content:P,name:R}=r[u],L=Be(P),I=S;if(w>=0&&R){let C=c.get(R);C===void 0&&(C=c.size,c.set(R,C),i(C,R)),I=C}for(let C=0;C<L.length;C++){let k=L[C];t(k,z,q+(z===d?l:0),w,b,T,I),I=-1,C===L.length-1&&!k.endsWith(`
11
+ `)?d===z?l+=k.length:(l=k.length,d=z):(a++,z++,l=-q,d=z)}h=Math.max(h,Math.floor(r[u].end+1)),u++,o=u<r.length?Math.floor(r[u].start):ft;let H=p.length-N+h-M;if(H>0){if(h>=N){let k=B+a;p.endsWith(`
12
+ `)?(a--,d===k&&(l+=q)):d===k?l-=p.length-M:(l=M-p.length,d=k),f=N;return}let C=B+a;g(w,b,T,p.slice(M,M+H))&&(T+=H),M+=H,f+=H,d===C?l-=H:(l=-H,d=C),q+=H}}while(o<N);if(M<p.length){let z=M===0?p:p.slice(M),P=B+a;t(z,P,q+(P===d?l:0),w,b,T,S<0?-1:_[S])}f=N},(p,B,q)=>{for(;m.length<p;)m.push(void 0);m[p]=q,s(p,B,q)},(p,B)=>{let q=c.get(B);q===void 0&&(q=c.size,c.set(B,q),i(q,B)),_[p]=q}),y="";for(;u<r.length;u++)y+=r[u].content;let v=A+a,E=Be(y);for(let p=0;p<E.length;p++){let B=E[p];t(B,v,O+(v===d?l:0),-1,-1,-1,-1),p===E.length-1&&!B.endsWith(`
13
+ `)?d===v?l+=B.length:(l=B.length,d=v):(a++,v++,l=-O,d=v)}return{generatedLine:v,generatedColumn:O+(v===d?l:0)}}updateHash(e){this._sortReplacements(),e.update("ReplaceSource"),this._source.updateHash(e),e.update(this._name||"");for(let t of this._replacements)e.update(`${t.start}${t.end}${t.content}${t.name}`)}};ot.exports=ve});var dt=j((lr,ht)=>{"use strict";var zs=G(),Es=ie(),qs=Y(),{getMap:Ns,getSourceAndMap:js}=$(),at=/\n(?=.|\s)/g,be=class extends zs{constructor(e,t){super(),this._source=typeof t=="string"||Buffer.isBuffer(t)?new Es(t,!0):t,this._prefix=e}getPrefix(){return this._prefix}original(){return this._source}source(){let e=this._source.source(),t=this._prefix;return t+e.replace(at,`
14
+ `+t)}map(e){return Ns(this,e)}sourceAndMap(e){return js(this,e)}streamChunks(e,t,s,i){let r=this._prefix,f=r.length,u=!!(e&&e.columns===!1),{generatedLine:h,generatedColumn:o,source:a}=qs(this._source,e,(l,d,m,c,_,g,A)=>{m!==0?m+=f:l!==void 0?u||c<0?l=r+l:f>0&&(t(r,d,m,-1,-1,-1,-1),m+=f):u||(m+=f),t(l,d,m,c,_,g,A)},s,i);return{generatedLine:h,generatedColumn:o===0?0:f+o,source:a!==void 0?r+a.replace(at,`
15
+ `+r):void 0}}updateHash(e){e.update("PrefixSource"),this._source.updateHash(e),e.update(this._prefix)}};ht.exports=be});var _t=j((ar,pt)=>{"use strict";var xs=G(),Oe=class extends xs{constructor(e){super(),this._size=e}_error(){return new Error("Content and Map of this Source is not available (only size() is supported)")}size(){return this._size}source(){throw this._error()}buffer(){throw this._error()}map(e){throw this._error()}updateHash(){throw this._error()}};pt.exports=Oe});var mt=j((hr,St)=>{"use strict";var gt=G(),ye=class n extends gt{static from(e){return e instanceof gt?e:new n(e)}constructor(e){super(),this._sourceLike=e}source(){return this._sourceLike.source()}buffer(){return typeof this._sourceLike.buffer=="function"?this._sourceLike.buffer():super.buffer()}size(){return typeof this._sourceLike.size=="function"?this._sourceLike.size():super.size()}map(e){return typeof this._sourceLike.map=="function"?this._sourceLike.map(e):super.map(e)}sourceAndMap(e){return typeof this._sourceLike.sourceAndMap=="function"?this._sourceLike.sourceAndMap(e):super.sourceAndMap(e)}updateHash(e){if(typeof this._sourceLike.updateHash=="function")return this._sourceLike.updateHash(e);if(typeof this._sourceLike.map=="function")throw new Error("A Source-like object with a 'map' method must also provide an 'updateHash' method");e.update(this.buffer())}};St.exports=ye});var Mt=j(At=>{var V=(n,e)=>{let t;Object.defineProperty(At,n,{get:()=>(e!==void 0&&(t=e(),e=void 0),t),configurable:!0})};V("Source",()=>G());V("RawSource",()=>ie());V("OriginalSource",()=>Re());V("SourceMapSource",()=>Ye());V("CachedSource",()=>rt());V("ConcatSource",()=>ut());V("ReplaceSource",()=>lt());V("PrefixSource",()=>dt());V("SizeOnlySource",()=>_t());V("CompatSource",()=>mt())});var bt=jt(Mt(),1);import{basename as ks,join as Is}from"path";import{existsSync as Ds,readFileSync as Rs,writeFileSync as Ls}from"fs";import{createDevTools as Hs}from"../core/index.mjs";import{createDevToolsNodeSys as Ps}from"../node/index.mjs";import{createDevToolsServer as Ws}from"../server/index.mjs";var Bt="BuilderDevToolsPlugin",le=null;async function Gs(n){let e=await Ps({cwd:process.cwd()});e.debug("webpack setupDevTools init");let t=await Hs(e),s=await Ws({...t,getClientId:()=>"webpack-builder-dev-tools",closeAppServer:async()=>{},restartAppServer:async()=>{e.debug("restart server");let i=["next.config.js","next.config.ts","next.config.mjs","webpack.config.js","webpack.config.ts"].map(r=>Is(e.getAppRootDir(),r));for(let r of i)if(Ds(r)){e.debug(`restart server: ${r}`),Ls(r,Rs(r,{encoding:"utf-8"})),await new Promise(f=>setTimeout(f,50));return}},enableAppWatch:async i=>i,...e,...n});return e.debug("webpack setupDevTools done"),{server:s,sys:e}}var vt=class{constructor(e){we(this,"opts");this.opts=e||{},typeof this.opts.enabled!="boolean"&&(this.opts.enabled=process.env.NODE_ENV!=="production"),this.opts.enabled&&le==null&&(le=Gs(this.opts))}apply(e){if(this.opts.enabled===!1)return;let t=e,s=t.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,i=new WeakMap;t.hooks.compilation.tap(Bt,r=>{r.hooks.processAssets.tapAsync({name:Bt,stage:s},async(f,u)=>{if(le!=null){for(let h of r.chunks)for(let o of h.files){let a=ks(o),{server:l,sys:d}=await le;if(d.getFrameworks().some(A=>A.name==="next")&&a!=="webpack.js")continue;d.getAppRootDir=()=>t.context;let m=new URL("/~builder-dev-tools.js",l.getUrl()),c=`
2821
16
  ;
2822
17
  /* Builder Devtools (Webpack) */
2823
- `;
2824
- c2 += `(() => {
2825
- `;
2826
- c2 += ` if (typeof document !== "undefined") {
2827
- `;
2828
- c2 += ` let devToolsScript = document.head.querySelector("script[data-builder-dev-tools]");
2829
- `;
2830
- c2 += ` if (!devToolsScript) {
2831
- `;
2832
- c2 += ` devToolsScript = document.createElement("script");
2833
- `;
2834
- c2 += ` devToolsScript.setAttribute("src", ${JSON.stringify(
2835
- url
2836
- )});
2837
- `;
2838
- c2 += ` devToolsScript.setAttribute("data-builder-dev-tools", "");
2839
- `;
2840
- c2 += ` devToolsScript.setAttribute("async", "");
2841
- `;
2842
- c2 += ` document.head.appendChild(devToolsScript);
2843
- `;
2844
- c2 += ` }
2845
- `;
2846
- c2 += ` }
2847
- `;
2848
- c2 += `})();
2849
- `;
2850
- const data = {
2851
- chunk,
2852
- filename: file
2853
- };
2854
- const inject = compilation.getPath(c2, data);
2855
- compilation.updateAsset(file, (old) => {
2856
- const cached = cache.get(old);
2857
- if (!cached || cached.inject !== inject) {
2858
- const source = new import_webpack_sources.ConcatSource(old, inject);
2859
- cache.set(old, { source, inject });
2860
- return source;
2861
- }
2862
- return cached.source;
2863
- });
2864
- }
2865
- }
2866
- callback();
2867
- }
2868
- );
2869
- });
2870
- }
2871
- };
2872
- export {
2873
- BuilderDevToolsPlugin
2874
- };
18
+ `;c+=`(() => {
19
+ `,c+=` if (typeof document !== "undefined") {
20
+ `,c+=` let devToolsScript = document.head.querySelector("script[data-builder-dev-tools]");
21
+ `,c+=` if (!devToolsScript) {
22
+ `,c+=` devToolsScript = document.createElement("script");
23
+ `,c+=` devToolsScript.setAttribute("src", ${JSON.stringify(m)});
24
+ `,c+=` devToolsScript.setAttribute("data-builder-dev-tools", "");
25
+ `,c+=` devToolsScript.setAttribute("async", "");
26
+ `,c+=` document.head.appendChild(devToolsScript);
27
+ `,c+=` }
28
+ `,c+=` }
29
+ `,c+=`})();
30
+ `;let _={chunk:h,filename:o},g=r.getPath(c,_);r.updateAsset(o,A=>{let O=i.get(A);if(!O||O.inject!==g){let y=new bt.ConcatSource(A,g);return i.set(A,{source:y,inject:g}),y}return O.source})}u()}})})}};export{vt as BuilderDevToolsPlugin};