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