jiek 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. package/{tests/fixtures/node_modules/.pnpm/@jiek+loader-esbuild@1.0.0_esbuild@0.20.2/node_modules/@jiek/loader-esbuild/LICENSE → LICENSE} +1 -1
  2. package/package.json +13 -8
  3. package/src/commands/build.ts +0 -91
  4. package/src/commands/publish.ts +0 -79
  5. package/src/index.ts +0 -6
  6. package/src/inner.ts +0 -11
  7. package/src/merge-package-json.ts +0 -19
  8. package/src/rollup/index.ts +0 -162
  9. package/src/rollup/plugins/globals.ts +0 -34
  10. package/src/rollup/plugins/skip.ts +0 -23
  11. package/src/rollup/utils/commonOptions.ts +0 -9
  12. package/src/rollup/utils/externalResolver.ts +0 -11
  13. package/src/rollup/utils/globalResolver.ts +0 -24
  14. package/src/rollup/utils/withMinify.ts +0 -16
  15. package/tests/build.spec.ts +0 -28
  16. package/tests/fixtures/node_modules/.bin/jiek +0 -17
  17. package/tests/fixtures/node_modules/.jiek/jiek+test-foo.rollup.config.js +0 -31
  18. package/tests/fixtures/node_modules/.modules.yaml +0 -95
  19. package/tests/fixtures/node_modules/.pnpm/@esbuild+darwin-arm64@0.20.2/node_modules/@esbuild/darwin-arm64/README.md +0 -3
  20. package/tests/fixtures/node_modules/.pnpm/@esbuild+darwin-arm64@0.20.2/node_modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
  21. package/tests/fixtures/node_modules/.pnpm/@esbuild+darwin-arm64@0.20.2/node_modules/@esbuild/darwin-arm64/package.json +0 -20
  22. package/tests/fixtures/node_modules/.pnpm/@jiek+loader-esbuild@1.0.0_esbuild@0.20.2/node_modules/@jiek/loader-esbuild/loader.js +0 -3
  23. package/tests/fixtures/node_modules/.pnpm/@jiek+loader-esbuild@1.0.0_esbuild@0.20.2/node_modules/@jiek/loader-esbuild/package.json +0 -8
  24. package/tests/fixtures/node_modules/.pnpm/debug@4.3.4/node_modules/debug/LICENSE +0 -20
  25. package/tests/fixtures/node_modules/.pnpm/debug@4.3.4/node_modules/debug/README.md +0 -481
  26. package/tests/fixtures/node_modules/.pnpm/debug@4.3.4/node_modules/debug/package.json +0 -59
  27. package/tests/fixtures/node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js +0 -269
  28. package/tests/fixtures/node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js +0 -274
  29. package/tests/fixtures/node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js +0 -10
  30. package/tests/fixtures/node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js +0 -263
  31. package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/LICENSE +0 -21
  32. package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/README.md +0 -50
  33. package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/dist/loader.d.ts +0 -3
  34. package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/dist/loader.js +0 -15
  35. package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/dist/node.d.ts +0 -23
  36. package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/dist/node.js +0 -4926
  37. package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/loader.js +0 -1
  38. package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/node_modules/.bin/esbuild +0 -14
  39. package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/package.json +0 -46
  40. package/tests/fixtures/node_modules/.pnpm/esbuild-register@3.5.0_esbuild@0.20.2/node_modules/esbuild-register/register.js +0 -3
  41. package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/LICENSE.md +0 -21
  42. package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/README.md +0 -3
  43. package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/bin/esbuild +0 -0
  44. package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/install.js +0 -288
  45. package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/lib/main.d.ts +0 -703
  46. package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/lib/main.js +0 -2436
  47. package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/node_modules/.bin/esbuild +0 -14
  48. package/tests/fixtures/node_modules/.pnpm/esbuild@0.20.2/node_modules/esbuild/package.json +0 -46
  49. package/tests/fixtures/node_modules/.pnpm/lock.yaml +0 -291
  50. package/tests/fixtures/node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js +0 -162
  51. package/tests/fixtures/node_modules/.pnpm/ms@2.1.2/node_modules/ms/license.md +0 -21
  52. package/tests/fixtures/node_modules/.pnpm/ms@2.1.2/node_modules/ms/package.json +0 -37
  53. package/tests/fixtures/node_modules/.pnpm/ms@2.1.2/node_modules/ms/readme.md +0 -60
  54. package/tests/fixtures/node_modules/.pnpm/node_modules/.bin/esbuild +0 -14
  55. package/tests/fixtures/package.json +0 -8
  56. package/tests/fixtures/packages/bar/package.json +0 -4
  57. package/tests/fixtures/packages/foo/dist/index.d.ts +0 -3
  58. package/tests/fixtures/packages/foo/dist/index.esm.d.ts +0 -3
  59. package/tests/fixtures/packages/foo/dist/index.esm.js +0 -6
  60. package/tests/fixtures/packages/foo/dist/index.esm.js.map +0 -1
  61. package/tests/fixtures/packages/foo/dist/index.esm.min.js +0 -2
  62. package/tests/fixtures/packages/foo/dist/index.esm.min.js.map +0 -1
  63. package/tests/fixtures/packages/foo/dist/index.iife.js +0 -15
  64. package/tests/fixtures/packages/foo/dist/index.iife.js.map +0 -1
  65. package/tests/fixtures/packages/foo/dist/index.iife.min.js +0 -2
  66. package/tests/fixtures/packages/foo/dist/index.iife.min.js.map +0 -1
  67. package/tests/fixtures/packages/foo/dist/index.umd.js +0 -16
  68. package/tests/fixtures/packages/foo/dist/index.umd.js.map +0 -1
  69. package/tests/fixtures/packages/foo/dist/index.umd.min.js +0 -2
  70. package/tests/fixtures/packages/foo/dist/index.umd.min.js.map +0 -1
  71. package/tests/fixtures/packages/foo/package.json +0 -7
  72. package/tests/fixtures/packages/foo/src/index.ts +0 -3
  73. package/tests/fixtures/pnpm-workspace.yaml +0 -2
  74. package/tests/publish.spec.ts +0 -31
@@ -1,4926 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault2(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getProtoOf = Object.getPrototypeOf;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
8
- var __commonJS = (callback, module2) => () => {
9
- if (!module2) {
10
- module2 = {exports: {}};
11
- callback(module2.exports, module2);
12
- }
13
- return module2.exports;
14
- };
15
- var __exportStar = (target, module2, desc) => {
16
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
17
- for (let key of __getOwnPropNames(module2))
18
- if (!__hasOwnProp.call(target, key) && key !== "default")
19
- __defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
20
- }
21
- return target;
22
- };
23
- var __toModule = (module2) => {
24
- return __exportStar(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
25
- };
26
-
27
- // node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js
28
- var require_base64 = __commonJS((exports) => {
29
- var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
30
- exports.encode = function(number) {
31
- if (0 <= number && number < intToCharMap.length) {
32
- return intToCharMap[number];
33
- }
34
- throw new TypeError("Must be between 0 and 63: " + number);
35
- };
36
- exports.decode = function(charCode) {
37
- var bigA = 65;
38
- var bigZ = 90;
39
- var littleA = 97;
40
- var littleZ = 122;
41
- var zero = 48;
42
- var nine = 57;
43
- var plus = 43;
44
- var slash = 47;
45
- var littleOffset = 26;
46
- var numberOffset = 52;
47
- if (bigA <= charCode && charCode <= bigZ) {
48
- return charCode - bigA;
49
- }
50
- if (littleA <= charCode && charCode <= littleZ) {
51
- return charCode - littleA + littleOffset;
52
- }
53
- if (zero <= charCode && charCode <= nine) {
54
- return charCode - zero + numberOffset;
55
- }
56
- if (charCode == plus) {
57
- return 62;
58
- }
59
- if (charCode == slash) {
60
- return 63;
61
- }
62
- return -1;
63
- };
64
- });
65
-
66
- // node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js
67
- var require_base64_vlq = __commonJS((exports) => {
68
- var base64 = require_base64();
69
- var VLQ_BASE_SHIFT = 5;
70
- var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
71
- var VLQ_BASE_MASK = VLQ_BASE - 1;
72
- var VLQ_CONTINUATION_BIT = VLQ_BASE;
73
- function toVLQSigned(aValue) {
74
- return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
75
- }
76
- function fromVLQSigned(aValue) {
77
- var isNegative = (aValue & 1) === 1;
78
- var shifted = aValue >> 1;
79
- return isNegative ? -shifted : shifted;
80
- }
81
- exports.encode = function base64VLQ_encode(aValue) {
82
- var encoded = "";
83
- var digit;
84
- var vlq = toVLQSigned(aValue);
85
- do {
86
- digit = vlq & VLQ_BASE_MASK;
87
- vlq >>>= VLQ_BASE_SHIFT;
88
- if (vlq > 0) {
89
- digit |= VLQ_CONTINUATION_BIT;
90
- }
91
- encoded += base64.encode(digit);
92
- } while (vlq > 0);
93
- return encoded;
94
- };
95
- exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
96
- var strLen = aStr.length;
97
- var result = 0;
98
- var shift = 0;
99
- var continuation, digit;
100
- do {
101
- if (aIndex >= strLen) {
102
- throw new Error("Expected more digits in base 64 VLQ value.");
103
- }
104
- digit = base64.decode(aStr.charCodeAt(aIndex++));
105
- if (digit === -1) {
106
- throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
107
- }
108
- continuation = !!(digit & VLQ_CONTINUATION_BIT);
109
- digit &= VLQ_BASE_MASK;
110
- result = result + (digit << shift);
111
- shift += VLQ_BASE_SHIFT;
112
- } while (continuation);
113
- aOutParam.value = fromVLQSigned(result);
114
- aOutParam.rest = aIndex;
115
- };
116
- });
117
-
118
- // node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js
119
- var require_util = __commonJS((exports) => {
120
- function getArg(aArgs, aName, aDefaultValue) {
121
- if (aName in aArgs) {
122
- return aArgs[aName];
123
- } else if (arguments.length === 3) {
124
- return aDefaultValue;
125
- } else {
126
- throw new Error('"' + aName + '" is a required argument.');
127
- }
128
- }
129
- exports.getArg = getArg;
130
- var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
131
- var dataUrlRegexp = /^data:.+\,.+$/;
132
- function urlParse(aUrl) {
133
- var match = aUrl.match(urlRegexp);
134
- if (!match) {
135
- return null;
136
- }
137
- return {
138
- scheme: match[1],
139
- auth: match[2],
140
- host: match[3],
141
- port: match[4],
142
- path: match[5]
143
- };
144
- }
145
- exports.urlParse = urlParse;
146
- function urlGenerate(aParsedUrl) {
147
- var url = "";
148
- if (aParsedUrl.scheme) {
149
- url += aParsedUrl.scheme + ":";
150
- }
151
- url += "//";
152
- if (aParsedUrl.auth) {
153
- url += aParsedUrl.auth + "@";
154
- }
155
- if (aParsedUrl.host) {
156
- url += aParsedUrl.host;
157
- }
158
- if (aParsedUrl.port) {
159
- url += ":" + aParsedUrl.port;
160
- }
161
- if (aParsedUrl.path) {
162
- url += aParsedUrl.path;
163
- }
164
- return url;
165
- }
166
- exports.urlGenerate = urlGenerate;
167
- function normalize(aPath) {
168
- var path = aPath;
169
- var url = urlParse(aPath);
170
- if (url) {
171
- if (!url.path) {
172
- return aPath;
173
- }
174
- path = url.path;
175
- }
176
- var isAbsolute = exports.isAbsolute(path);
177
- var parts = path.split(/\/+/);
178
- for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
179
- part = parts[i];
180
- if (part === ".") {
181
- parts.splice(i, 1);
182
- } else if (part === "..") {
183
- up++;
184
- } else if (up > 0) {
185
- if (part === "") {
186
- parts.splice(i + 1, up);
187
- up = 0;
188
- } else {
189
- parts.splice(i, 2);
190
- up--;
191
- }
192
- }
193
- }
194
- path = parts.join("/");
195
- if (path === "") {
196
- path = isAbsolute ? "/" : ".";
197
- }
198
- if (url) {
199
- url.path = path;
200
- return urlGenerate(url);
201
- }
202
- return path;
203
- }
204
- exports.normalize = normalize;
205
- function join2(aRoot, aPath) {
206
- if (aRoot === "") {
207
- aRoot = ".";
208
- }
209
- if (aPath === "") {
210
- aPath = ".";
211
- }
212
- var aPathUrl = urlParse(aPath);
213
- var aRootUrl = urlParse(aRoot);
214
- if (aRootUrl) {
215
- aRoot = aRootUrl.path || "/";
216
- }
217
- if (aPathUrl && !aPathUrl.scheme) {
218
- if (aRootUrl) {
219
- aPathUrl.scheme = aRootUrl.scheme;
220
- }
221
- return urlGenerate(aPathUrl);
222
- }
223
- if (aPathUrl || aPath.match(dataUrlRegexp)) {
224
- return aPath;
225
- }
226
- if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
227
- aRootUrl.host = aPath;
228
- return urlGenerate(aRootUrl);
229
- }
230
- var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
231
- if (aRootUrl) {
232
- aRootUrl.path = joined;
233
- return urlGenerate(aRootUrl);
234
- }
235
- return joined;
236
- }
237
- exports.join = join2;
238
- exports.isAbsolute = function(aPath) {
239
- return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
240
- };
241
- function relative(aRoot, aPath) {
242
- if (aRoot === "") {
243
- aRoot = ".";
244
- }
245
- aRoot = aRoot.replace(/\/$/, "");
246
- var level = 0;
247
- while (aPath.indexOf(aRoot + "/") !== 0) {
248
- var index = aRoot.lastIndexOf("/");
249
- if (index < 0) {
250
- return aPath;
251
- }
252
- aRoot = aRoot.slice(0, index);
253
- if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
254
- return aPath;
255
- }
256
- ++level;
257
- }
258
- return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
259
- }
260
- exports.relative = relative;
261
- var supportsNullProto = function() {
262
- var obj = Object.create(null);
263
- return !("__proto__" in obj);
264
- }();
265
- function identity(s) {
266
- return s;
267
- }
268
- function toSetString(aStr) {
269
- if (isProtoString(aStr)) {
270
- return "$" + aStr;
271
- }
272
- return aStr;
273
- }
274
- exports.toSetString = supportsNullProto ? identity : toSetString;
275
- function fromSetString(aStr) {
276
- if (isProtoString(aStr)) {
277
- return aStr.slice(1);
278
- }
279
- return aStr;
280
- }
281
- exports.fromSetString = supportsNullProto ? identity : fromSetString;
282
- function isProtoString(s) {
283
- if (!s) {
284
- return false;
285
- }
286
- var length = s.length;
287
- if (length < 9) {
288
- return false;
289
- }
290
- if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) {
291
- return false;
292
- }
293
- for (var i = length - 10; i >= 0; i--) {
294
- if (s.charCodeAt(i) !== 36) {
295
- return false;
296
- }
297
- }
298
- return true;
299
- }
300
- function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
301
- var cmp = strcmp(mappingA.source, mappingB.source);
302
- if (cmp !== 0) {
303
- return cmp;
304
- }
305
- cmp = mappingA.originalLine - mappingB.originalLine;
306
- if (cmp !== 0) {
307
- return cmp;
308
- }
309
- cmp = mappingA.originalColumn - mappingB.originalColumn;
310
- if (cmp !== 0 || onlyCompareOriginal) {
311
- return cmp;
312
- }
313
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
314
- if (cmp !== 0) {
315
- return cmp;
316
- }
317
- cmp = mappingA.generatedLine - mappingB.generatedLine;
318
- if (cmp !== 0) {
319
- return cmp;
320
- }
321
- return strcmp(mappingA.name, mappingB.name);
322
- }
323
- exports.compareByOriginalPositions = compareByOriginalPositions;
324
- function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
325
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
326
- if (cmp !== 0) {
327
- return cmp;
328
- }
329
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
330
- if (cmp !== 0 || onlyCompareGenerated) {
331
- return cmp;
332
- }
333
- cmp = strcmp(mappingA.source, mappingB.source);
334
- if (cmp !== 0) {
335
- return cmp;
336
- }
337
- cmp = mappingA.originalLine - mappingB.originalLine;
338
- if (cmp !== 0) {
339
- return cmp;
340
- }
341
- cmp = mappingA.originalColumn - mappingB.originalColumn;
342
- if (cmp !== 0) {
343
- return cmp;
344
- }
345
- return strcmp(mappingA.name, mappingB.name);
346
- }
347
- exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
348
- function strcmp(aStr1, aStr2) {
349
- if (aStr1 === aStr2) {
350
- return 0;
351
- }
352
- if (aStr1 === null) {
353
- return 1;
354
- }
355
- if (aStr2 === null) {
356
- return -1;
357
- }
358
- if (aStr1 > aStr2) {
359
- return 1;
360
- }
361
- return -1;
362
- }
363
- function compareByGeneratedPositionsInflated(mappingA, mappingB) {
364
- var cmp = mappingA.generatedLine - mappingB.generatedLine;
365
- if (cmp !== 0) {
366
- return cmp;
367
- }
368
- cmp = mappingA.generatedColumn - mappingB.generatedColumn;
369
- if (cmp !== 0) {
370
- return cmp;
371
- }
372
- cmp = strcmp(mappingA.source, mappingB.source);
373
- if (cmp !== 0) {
374
- return cmp;
375
- }
376
- cmp = mappingA.originalLine - mappingB.originalLine;
377
- if (cmp !== 0) {
378
- return cmp;
379
- }
380
- cmp = mappingA.originalColumn - mappingB.originalColumn;
381
- if (cmp !== 0) {
382
- return cmp;
383
- }
384
- return strcmp(mappingA.name, mappingB.name);
385
- }
386
- exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
387
- function parseSourceMapInput(str) {
388
- return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
389
- }
390
- exports.parseSourceMapInput = parseSourceMapInput;
391
- function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
392
- sourceURL = sourceURL || "";
393
- if (sourceRoot) {
394
- if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
395
- sourceRoot += "/";
396
- }
397
- sourceURL = sourceRoot + sourceURL;
398
- }
399
- if (sourceMapURL) {
400
- var parsed = urlParse(sourceMapURL);
401
- if (!parsed) {
402
- throw new Error("sourceMapURL could not be parsed");
403
- }
404
- if (parsed.path) {
405
- var index = parsed.path.lastIndexOf("/");
406
- if (index >= 0) {
407
- parsed.path = parsed.path.substring(0, index + 1);
408
- }
409
- }
410
- sourceURL = join2(urlGenerate(parsed), sourceURL);
411
- }
412
- return normalize(sourceURL);
413
- }
414
- exports.computeSourceURL = computeSourceURL;
415
- });
416
-
417
- // node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js
418
- var require_array_set = __commonJS((exports) => {
419
- var util = require_util();
420
- var has = Object.prototype.hasOwnProperty;
421
- var hasNativeMap = typeof Map !== "undefined";
422
- function ArraySet() {
423
- this._array = [];
424
- this._set = hasNativeMap ? new Map() : Object.create(null);
425
- }
426
- ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
427
- var set = new ArraySet();
428
- for (var i = 0, len = aArray.length; i < len; i++) {
429
- set.add(aArray[i], aAllowDuplicates);
430
- }
431
- return set;
432
- };
433
- ArraySet.prototype.size = function ArraySet_size() {
434
- return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
435
- };
436
- ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
437
- var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
438
- var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
439
- var idx = this._array.length;
440
- if (!isDuplicate || aAllowDuplicates) {
441
- this._array.push(aStr);
442
- }
443
- if (!isDuplicate) {
444
- if (hasNativeMap) {
445
- this._set.set(aStr, idx);
446
- } else {
447
- this._set[sStr] = idx;
448
- }
449
- }
450
- };
451
- ArraySet.prototype.has = function ArraySet_has(aStr) {
452
- if (hasNativeMap) {
453
- return this._set.has(aStr);
454
- } else {
455
- var sStr = util.toSetString(aStr);
456
- return has.call(this._set, sStr);
457
- }
458
- };
459
- ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
460
- if (hasNativeMap) {
461
- var idx = this._set.get(aStr);
462
- if (idx >= 0) {
463
- return idx;
464
- }
465
- } else {
466
- var sStr = util.toSetString(aStr);
467
- if (has.call(this._set, sStr)) {
468
- return this._set[sStr];
469
- }
470
- }
471
- throw new Error('"' + aStr + '" is not in the set.');
472
- };
473
- ArraySet.prototype.at = function ArraySet_at(aIdx) {
474
- if (aIdx >= 0 && aIdx < this._array.length) {
475
- return this._array[aIdx];
476
- }
477
- throw new Error("No element indexed by " + aIdx);
478
- };
479
- ArraySet.prototype.toArray = function ArraySet_toArray() {
480
- return this._array.slice();
481
- };
482
- exports.ArraySet = ArraySet;
483
- });
484
-
485
- // node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js
486
- var require_mapping_list = __commonJS((exports) => {
487
- var util = require_util();
488
- function generatedPositionAfter(mappingA, mappingB) {
489
- var lineA = mappingA.generatedLine;
490
- var lineB = mappingB.generatedLine;
491
- var columnA = mappingA.generatedColumn;
492
- var columnB = mappingB.generatedColumn;
493
- return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
494
- }
495
- function MappingList() {
496
- this._array = [];
497
- this._sorted = true;
498
- this._last = {generatedLine: -1, generatedColumn: 0};
499
- }
500
- MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
501
- this._array.forEach(aCallback, aThisArg);
502
- };
503
- MappingList.prototype.add = function MappingList_add(aMapping) {
504
- if (generatedPositionAfter(this._last, aMapping)) {
505
- this._last = aMapping;
506
- this._array.push(aMapping);
507
- } else {
508
- this._sorted = false;
509
- this._array.push(aMapping);
510
- }
511
- };
512
- MappingList.prototype.toArray = function MappingList_toArray() {
513
- if (!this._sorted) {
514
- this._array.sort(util.compareByGeneratedPositionsInflated);
515
- this._sorted = true;
516
- }
517
- return this._array;
518
- };
519
- exports.MappingList = MappingList;
520
- });
521
-
522
- // node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js
523
- var require_source_map_generator = __commonJS((exports) => {
524
- var base64VLQ = require_base64_vlq();
525
- var util = require_util();
526
- var ArraySet = require_array_set().ArraySet;
527
- var MappingList = require_mapping_list().MappingList;
528
- function SourceMapGenerator(aArgs) {
529
- if (!aArgs) {
530
- aArgs = {};
531
- }
532
- this._file = util.getArg(aArgs, "file", null);
533
- this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
534
- this._skipValidation = util.getArg(aArgs, "skipValidation", false);
535
- this._sources = new ArraySet();
536
- this._names = new ArraySet();
537
- this._mappings = new MappingList();
538
- this._sourcesContents = null;
539
- }
540
- SourceMapGenerator.prototype._version = 3;
541
- SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
542
- var sourceRoot = aSourceMapConsumer.sourceRoot;
543
- var generator = new SourceMapGenerator({
544
- file: aSourceMapConsumer.file,
545
- sourceRoot
546
- });
547
- aSourceMapConsumer.eachMapping(function(mapping) {
548
- var newMapping = {
549
- generated: {
550
- line: mapping.generatedLine,
551
- column: mapping.generatedColumn
552
- }
553
- };
554
- if (mapping.source != null) {
555
- newMapping.source = mapping.source;
556
- if (sourceRoot != null) {
557
- newMapping.source = util.relative(sourceRoot, newMapping.source);
558
- }
559
- newMapping.original = {
560
- line: mapping.originalLine,
561
- column: mapping.originalColumn
562
- };
563
- if (mapping.name != null) {
564
- newMapping.name = mapping.name;
565
- }
566
- }
567
- generator.addMapping(newMapping);
568
- });
569
- aSourceMapConsumer.sources.forEach(function(sourceFile) {
570
- var sourceRelative = sourceFile;
571
- if (sourceRoot !== null) {
572
- sourceRelative = util.relative(sourceRoot, sourceFile);
573
- }
574
- if (!generator._sources.has(sourceRelative)) {
575
- generator._sources.add(sourceRelative);
576
- }
577
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
578
- if (content != null) {
579
- generator.setSourceContent(sourceFile, content);
580
- }
581
- });
582
- return generator;
583
- };
584
- SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
585
- var generated = util.getArg(aArgs, "generated");
586
- var original = util.getArg(aArgs, "original", null);
587
- var source = util.getArg(aArgs, "source", null);
588
- var name = util.getArg(aArgs, "name", null);
589
- if (!this._skipValidation) {
590
- this._validateMapping(generated, original, source, name);
591
- }
592
- if (source != null) {
593
- source = String(source);
594
- if (!this._sources.has(source)) {
595
- this._sources.add(source);
596
- }
597
- }
598
- if (name != null) {
599
- name = String(name);
600
- if (!this._names.has(name)) {
601
- this._names.add(name);
602
- }
603
- }
604
- this._mappings.add({
605
- generatedLine: generated.line,
606
- generatedColumn: generated.column,
607
- originalLine: original != null && original.line,
608
- originalColumn: original != null && original.column,
609
- source,
610
- name
611
- });
612
- };
613
- SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
614
- var source = aSourceFile;
615
- if (this._sourceRoot != null) {
616
- source = util.relative(this._sourceRoot, source);
617
- }
618
- if (aSourceContent != null) {
619
- if (!this._sourcesContents) {
620
- this._sourcesContents = Object.create(null);
621
- }
622
- this._sourcesContents[util.toSetString(source)] = aSourceContent;
623
- } else if (this._sourcesContents) {
624
- delete this._sourcesContents[util.toSetString(source)];
625
- if (Object.keys(this._sourcesContents).length === 0) {
626
- this._sourcesContents = null;
627
- }
628
- }
629
- };
630
- SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
631
- var sourceFile = aSourceFile;
632
- if (aSourceFile == null) {
633
- if (aSourceMapConsumer.file == null) {
634
- throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);
635
- }
636
- sourceFile = aSourceMapConsumer.file;
637
- }
638
- var sourceRoot = this._sourceRoot;
639
- if (sourceRoot != null) {
640
- sourceFile = util.relative(sourceRoot, sourceFile);
641
- }
642
- var newSources = new ArraySet();
643
- var newNames = new ArraySet();
644
- this._mappings.unsortedForEach(function(mapping) {
645
- if (mapping.source === sourceFile && mapping.originalLine != null) {
646
- var original = aSourceMapConsumer.originalPositionFor({
647
- line: mapping.originalLine,
648
- column: mapping.originalColumn
649
- });
650
- if (original.source != null) {
651
- mapping.source = original.source;
652
- if (aSourceMapPath != null) {
653
- mapping.source = util.join(aSourceMapPath, mapping.source);
654
- }
655
- if (sourceRoot != null) {
656
- mapping.source = util.relative(sourceRoot, mapping.source);
657
- }
658
- mapping.originalLine = original.line;
659
- mapping.originalColumn = original.column;
660
- if (original.name != null) {
661
- mapping.name = original.name;
662
- }
663
- }
664
- }
665
- var source = mapping.source;
666
- if (source != null && !newSources.has(source)) {
667
- newSources.add(source);
668
- }
669
- var name = mapping.name;
670
- if (name != null && !newNames.has(name)) {
671
- newNames.add(name);
672
- }
673
- }, this);
674
- this._sources = newSources;
675
- this._names = newNames;
676
- aSourceMapConsumer.sources.forEach(function(sourceFile2) {
677
- var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
678
- if (content != null) {
679
- if (aSourceMapPath != null) {
680
- sourceFile2 = util.join(aSourceMapPath, sourceFile2);
681
- }
682
- if (sourceRoot != null) {
683
- sourceFile2 = util.relative(sourceRoot, sourceFile2);
684
- }
685
- this.setSourceContent(sourceFile2, content);
686
- }
687
- }, this);
688
- };
689
- SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
690
- if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
691
- throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");
692
- }
693
- if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
694
- return;
695
- } else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
696
- return;
697
- } else {
698
- throw new Error("Invalid mapping: " + JSON.stringify({
699
- generated: aGenerated,
700
- source: aSource,
701
- original: aOriginal,
702
- name: aName
703
- }));
704
- }
705
- };
706
- SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
707
- var previousGeneratedColumn = 0;
708
- var previousGeneratedLine = 1;
709
- var previousOriginalColumn = 0;
710
- var previousOriginalLine = 0;
711
- var previousName = 0;
712
- var previousSource = 0;
713
- var result = "";
714
- var next;
715
- var mapping;
716
- var nameIdx;
717
- var sourceIdx;
718
- var mappings = this._mappings.toArray();
719
- for (var i = 0, len = mappings.length; i < len; i++) {
720
- mapping = mappings[i];
721
- next = "";
722
- if (mapping.generatedLine !== previousGeneratedLine) {
723
- previousGeneratedColumn = 0;
724
- while (mapping.generatedLine !== previousGeneratedLine) {
725
- next += ";";
726
- previousGeneratedLine++;
727
- }
728
- } else {
729
- if (i > 0) {
730
- if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
731
- continue;
732
- }
733
- next += ",";
734
- }
735
- }
736
- next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
737
- previousGeneratedColumn = mapping.generatedColumn;
738
- if (mapping.source != null) {
739
- sourceIdx = this._sources.indexOf(mapping.source);
740
- next += base64VLQ.encode(sourceIdx - previousSource);
741
- previousSource = sourceIdx;
742
- next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
743
- previousOriginalLine = mapping.originalLine - 1;
744
- next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
745
- previousOriginalColumn = mapping.originalColumn;
746
- if (mapping.name != null) {
747
- nameIdx = this._names.indexOf(mapping.name);
748
- next += base64VLQ.encode(nameIdx - previousName);
749
- previousName = nameIdx;
750
- }
751
- }
752
- result += next;
753
- }
754
- return result;
755
- };
756
- SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
757
- return aSources.map(function(source) {
758
- if (!this._sourcesContents) {
759
- return null;
760
- }
761
- if (aSourceRoot != null) {
762
- source = util.relative(aSourceRoot, source);
763
- }
764
- var key = util.toSetString(source);
765
- return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
766
- }, this);
767
- };
768
- SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
769
- var map2 = {
770
- version: this._version,
771
- sources: this._sources.toArray(),
772
- names: this._names.toArray(),
773
- mappings: this._serializeMappings()
774
- };
775
- if (this._file != null) {
776
- map2.file = this._file;
777
- }
778
- if (this._sourceRoot != null) {
779
- map2.sourceRoot = this._sourceRoot;
780
- }
781
- if (this._sourcesContents) {
782
- map2.sourcesContent = this._generateSourcesContent(map2.sources, map2.sourceRoot);
783
- }
784
- return map2;
785
- };
786
- SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
787
- return JSON.stringify(this.toJSON());
788
- };
789
- exports.SourceMapGenerator = SourceMapGenerator;
790
- });
791
-
792
- // node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/binary-search.js
793
- var require_binary_search = __commonJS((exports) => {
794
- exports.GREATEST_LOWER_BOUND = 1;
795
- exports.LEAST_UPPER_BOUND = 2;
796
- function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
797
- var mid = Math.floor((aHigh - aLow) / 2) + aLow;
798
- var cmp = aCompare(aNeedle, aHaystack[mid], true);
799
- if (cmp === 0) {
800
- return mid;
801
- } else if (cmp > 0) {
802
- if (aHigh - mid > 1) {
803
- return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
804
- }
805
- if (aBias == exports.LEAST_UPPER_BOUND) {
806
- return aHigh < aHaystack.length ? aHigh : -1;
807
- } else {
808
- return mid;
809
- }
810
- } else {
811
- if (mid - aLow > 1) {
812
- return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
813
- }
814
- if (aBias == exports.LEAST_UPPER_BOUND) {
815
- return mid;
816
- } else {
817
- return aLow < 0 ? -1 : aLow;
818
- }
819
- }
820
- }
821
- exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
822
- if (aHaystack.length === 0) {
823
- return -1;
824
- }
825
- var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND);
826
- if (index < 0) {
827
- return -1;
828
- }
829
- while (index - 1 >= 0) {
830
- if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
831
- break;
832
- }
833
- --index;
834
- }
835
- return index;
836
- };
837
- });
838
-
839
- // node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js
840
- var require_quick_sort = __commonJS((exports) => {
841
- function swap(ary, x, y) {
842
- var temp = ary[x];
843
- ary[x] = ary[y];
844
- ary[y] = temp;
845
- }
846
- function randomIntInRange(low, high) {
847
- return Math.round(low + Math.random() * (high - low));
848
- }
849
- function doQuickSort(ary, comparator, p, r) {
850
- if (p < r) {
851
- var pivotIndex = randomIntInRange(p, r);
852
- var i = p - 1;
853
- swap(ary, pivotIndex, r);
854
- var pivot = ary[r];
855
- for (var j = p; j < r; j++) {
856
- if (comparator(ary[j], pivot) <= 0) {
857
- i += 1;
858
- swap(ary, i, j);
859
- }
860
- }
861
- swap(ary, i + 1, j);
862
- var q = i + 1;
863
- doQuickSort(ary, comparator, p, q - 1);
864
- doQuickSort(ary, comparator, q + 1, r);
865
- }
866
- }
867
- exports.quickSort = function(ary, comparator) {
868
- doQuickSort(ary, comparator, 0, ary.length - 1);
869
- };
870
- });
871
-
872
- // node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js
873
- var require_source_map_consumer = __commonJS((exports) => {
874
- var util = require_util();
875
- var binarySearch = require_binary_search();
876
- var ArraySet = require_array_set().ArraySet;
877
- var base64VLQ = require_base64_vlq();
878
- var quickSort = require_quick_sort().quickSort;
879
- function SourceMapConsumer(aSourceMap, aSourceMapURL) {
880
- var sourceMap = aSourceMap;
881
- if (typeof aSourceMap === "string") {
882
- sourceMap = util.parseSourceMapInput(aSourceMap);
883
- }
884
- return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
885
- }
886
- SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
887
- return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
888
- };
889
- SourceMapConsumer.prototype._version = 3;
890
- SourceMapConsumer.prototype.__generatedMappings = null;
891
- Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
892
- configurable: true,
893
- enumerable: true,
894
- get: function() {
895
- if (!this.__generatedMappings) {
896
- this._parseMappings(this._mappings, this.sourceRoot);
897
- }
898
- return this.__generatedMappings;
899
- }
900
- });
901
- SourceMapConsumer.prototype.__originalMappings = null;
902
- Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
903
- configurable: true,
904
- enumerable: true,
905
- get: function() {
906
- if (!this.__originalMappings) {
907
- this._parseMappings(this._mappings, this.sourceRoot);
908
- }
909
- return this.__originalMappings;
910
- }
911
- });
912
- SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
913
- var c = aStr.charAt(index);
914
- return c === ";" || c === ",";
915
- };
916
- SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
917
- throw new Error("Subclasses must implement _parseMappings");
918
- };
919
- SourceMapConsumer.GENERATED_ORDER = 1;
920
- SourceMapConsumer.ORIGINAL_ORDER = 2;
921
- SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
922
- SourceMapConsumer.LEAST_UPPER_BOUND = 2;
923
- SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
924
- var context = aContext || null;
925
- var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
926
- var mappings;
927
- switch (order) {
928
- case SourceMapConsumer.GENERATED_ORDER:
929
- mappings = this._generatedMappings;
930
- break;
931
- case SourceMapConsumer.ORIGINAL_ORDER:
932
- mappings = this._originalMappings;
933
- break;
934
- default:
935
- throw new Error("Unknown order of iteration.");
936
- }
937
- var sourceRoot = this.sourceRoot;
938
- mappings.map(function(mapping) {
939
- var source = mapping.source === null ? null : this._sources.at(mapping.source);
940
- source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
941
- return {
942
- source,
943
- generatedLine: mapping.generatedLine,
944
- generatedColumn: mapping.generatedColumn,
945
- originalLine: mapping.originalLine,
946
- originalColumn: mapping.originalColumn,
947
- name: mapping.name === null ? null : this._names.at(mapping.name)
948
- };
949
- }, this).forEach(aCallback, context);
950
- };
951
- SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
952
- var line = util.getArg(aArgs, "line");
953
- var needle = {
954
- source: util.getArg(aArgs, "source"),
955
- originalLine: line,
956
- originalColumn: util.getArg(aArgs, "column", 0)
957
- };
958
- needle.source = this._findSourceIndex(needle.source);
959
- if (needle.source < 0) {
960
- return [];
961
- }
962
- var mappings = [];
963
- var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND);
964
- if (index >= 0) {
965
- var mapping = this._originalMappings[index];
966
- if (aArgs.column === void 0) {
967
- var originalLine = mapping.originalLine;
968
- while (mapping && mapping.originalLine === originalLine) {
969
- mappings.push({
970
- line: util.getArg(mapping, "generatedLine", null),
971
- column: util.getArg(mapping, "generatedColumn", null),
972
- lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
973
- });
974
- mapping = this._originalMappings[++index];
975
- }
976
- } else {
977
- var originalColumn = mapping.originalColumn;
978
- while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
979
- mappings.push({
980
- line: util.getArg(mapping, "generatedLine", null),
981
- column: util.getArg(mapping, "generatedColumn", null),
982
- lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
983
- });
984
- mapping = this._originalMappings[++index];
985
- }
986
- }
987
- }
988
- return mappings;
989
- };
990
- exports.SourceMapConsumer = SourceMapConsumer;
991
- function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
992
- var sourceMap = aSourceMap;
993
- if (typeof aSourceMap === "string") {
994
- sourceMap = util.parseSourceMapInput(aSourceMap);
995
- }
996
- var version = util.getArg(sourceMap, "version");
997
- var sources = util.getArg(sourceMap, "sources");
998
- var names = util.getArg(sourceMap, "names", []);
999
- var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
1000
- var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
1001
- var mappings = util.getArg(sourceMap, "mappings");
1002
- var file = util.getArg(sourceMap, "file", null);
1003
- if (version != this._version) {
1004
- throw new Error("Unsupported version: " + version);
1005
- }
1006
- if (sourceRoot) {
1007
- sourceRoot = util.normalize(sourceRoot);
1008
- }
1009
- sources = sources.map(String).map(util.normalize).map(function(source) {
1010
- return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
1011
- });
1012
- this._names = ArraySet.fromArray(names.map(String), true);
1013
- this._sources = ArraySet.fromArray(sources, true);
1014
- this._absoluteSources = this._sources.toArray().map(function(s) {
1015
- return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
1016
- });
1017
- this.sourceRoot = sourceRoot;
1018
- this.sourcesContent = sourcesContent;
1019
- this._mappings = mappings;
1020
- this._sourceMapURL = aSourceMapURL;
1021
- this.file = file;
1022
- }
1023
- BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
1024
- BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
1025
- BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
1026
- var relativeSource = aSource;
1027
- if (this.sourceRoot != null) {
1028
- relativeSource = util.relative(this.sourceRoot, relativeSource);
1029
- }
1030
- if (this._sources.has(relativeSource)) {
1031
- return this._sources.indexOf(relativeSource);
1032
- }
1033
- var i;
1034
- for (i = 0; i < this._absoluteSources.length; ++i) {
1035
- if (this._absoluteSources[i] == aSource) {
1036
- return i;
1037
- }
1038
- }
1039
- return -1;
1040
- };
1041
- BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
1042
- var smc = Object.create(BasicSourceMapConsumer.prototype);
1043
- var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
1044
- var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
1045
- smc.sourceRoot = aSourceMap._sourceRoot;
1046
- smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot);
1047
- smc.file = aSourceMap._file;
1048
- smc._sourceMapURL = aSourceMapURL;
1049
- smc._absoluteSources = smc._sources.toArray().map(function(s) {
1050
- return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
1051
- });
1052
- var generatedMappings = aSourceMap._mappings.toArray().slice();
1053
- var destGeneratedMappings = smc.__generatedMappings = [];
1054
- var destOriginalMappings = smc.__originalMappings = [];
1055
- for (var i = 0, length = generatedMappings.length; i < length; i++) {
1056
- var srcMapping = generatedMappings[i];
1057
- var destMapping = new Mapping();
1058
- destMapping.generatedLine = srcMapping.generatedLine;
1059
- destMapping.generatedColumn = srcMapping.generatedColumn;
1060
- if (srcMapping.source) {
1061
- destMapping.source = sources.indexOf(srcMapping.source);
1062
- destMapping.originalLine = srcMapping.originalLine;
1063
- destMapping.originalColumn = srcMapping.originalColumn;
1064
- if (srcMapping.name) {
1065
- destMapping.name = names.indexOf(srcMapping.name);
1066
- }
1067
- destOriginalMappings.push(destMapping);
1068
- }
1069
- destGeneratedMappings.push(destMapping);
1070
- }
1071
- quickSort(smc.__originalMappings, util.compareByOriginalPositions);
1072
- return smc;
1073
- };
1074
- BasicSourceMapConsumer.prototype._version = 3;
1075
- Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", {
1076
- get: function() {
1077
- return this._absoluteSources.slice();
1078
- }
1079
- });
1080
- function Mapping() {
1081
- this.generatedLine = 0;
1082
- this.generatedColumn = 0;
1083
- this.source = null;
1084
- this.originalLine = null;
1085
- this.originalColumn = null;
1086
- this.name = null;
1087
- }
1088
- BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
1089
- var generatedLine = 1;
1090
- var previousGeneratedColumn = 0;
1091
- var previousOriginalLine = 0;
1092
- var previousOriginalColumn = 0;
1093
- var previousSource = 0;
1094
- var previousName = 0;
1095
- var length = aStr.length;
1096
- var index = 0;
1097
- var cachedSegments = {};
1098
- var temp = {};
1099
- var originalMappings = [];
1100
- var generatedMappings = [];
1101
- var mapping, str, segment, end, value;
1102
- while (index < length) {
1103
- if (aStr.charAt(index) === ";") {
1104
- generatedLine++;
1105
- index++;
1106
- previousGeneratedColumn = 0;
1107
- } else if (aStr.charAt(index) === ",") {
1108
- index++;
1109
- } else {
1110
- mapping = new Mapping();
1111
- mapping.generatedLine = generatedLine;
1112
- for (end = index; end < length; end++) {
1113
- if (this._charIsMappingSeparator(aStr, end)) {
1114
- break;
1115
- }
1116
- }
1117
- str = aStr.slice(index, end);
1118
- segment = cachedSegments[str];
1119
- if (segment) {
1120
- index += str.length;
1121
- } else {
1122
- segment = [];
1123
- while (index < end) {
1124
- base64VLQ.decode(aStr, index, temp);
1125
- value = temp.value;
1126
- index = temp.rest;
1127
- segment.push(value);
1128
- }
1129
- if (segment.length === 2) {
1130
- throw new Error("Found a source, but no line and column");
1131
- }
1132
- if (segment.length === 3) {
1133
- throw new Error("Found a source and line, but no column");
1134
- }
1135
- cachedSegments[str] = segment;
1136
- }
1137
- mapping.generatedColumn = previousGeneratedColumn + segment[0];
1138
- previousGeneratedColumn = mapping.generatedColumn;
1139
- if (segment.length > 1) {
1140
- mapping.source = previousSource + segment[1];
1141
- previousSource += segment[1];
1142
- mapping.originalLine = previousOriginalLine + segment[2];
1143
- previousOriginalLine = mapping.originalLine;
1144
- mapping.originalLine += 1;
1145
- mapping.originalColumn = previousOriginalColumn + segment[3];
1146
- previousOriginalColumn = mapping.originalColumn;
1147
- if (segment.length > 4) {
1148
- mapping.name = previousName + segment[4];
1149
- previousName += segment[4];
1150
- }
1151
- }
1152
- generatedMappings.push(mapping);
1153
- if (typeof mapping.originalLine === "number") {
1154
- originalMappings.push(mapping);
1155
- }
1156
- }
1157
- }
1158
- quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
1159
- this.__generatedMappings = generatedMappings;
1160
- quickSort(originalMappings, util.compareByOriginalPositions);
1161
- this.__originalMappings = originalMappings;
1162
- };
1163
- BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
1164
- if (aNeedle[aLineName] <= 0) {
1165
- throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
1166
- }
1167
- if (aNeedle[aColumnName] < 0) {
1168
- throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
1169
- }
1170
- return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
1171
- };
1172
- BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
1173
- for (var index = 0; index < this._generatedMappings.length; ++index) {
1174
- var mapping = this._generatedMappings[index];
1175
- if (index + 1 < this._generatedMappings.length) {
1176
- var nextMapping = this._generatedMappings[index + 1];
1177
- if (mapping.generatedLine === nextMapping.generatedLine) {
1178
- mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
1179
- continue;
1180
- }
1181
- }
1182
- mapping.lastGeneratedColumn = Infinity;
1183
- }
1184
- };
1185
- BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
1186
- var needle = {
1187
- generatedLine: util.getArg(aArgs, "line"),
1188
- generatedColumn: util.getArg(aArgs, "column")
1189
- };
1190
- var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND));
1191
- if (index >= 0) {
1192
- var mapping = this._generatedMappings[index];
1193
- if (mapping.generatedLine === needle.generatedLine) {
1194
- var source = util.getArg(mapping, "source", null);
1195
- if (source !== null) {
1196
- source = this._sources.at(source);
1197
- source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
1198
- }
1199
- var name = util.getArg(mapping, "name", null);
1200
- if (name !== null) {
1201
- name = this._names.at(name);
1202
- }
1203
- return {
1204
- source,
1205
- line: util.getArg(mapping, "originalLine", null),
1206
- column: util.getArg(mapping, "originalColumn", null),
1207
- name
1208
- };
1209
- }
1210
- }
1211
- return {
1212
- source: null,
1213
- line: null,
1214
- column: null,
1215
- name: null
1216
- };
1217
- };
1218
- BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
1219
- if (!this.sourcesContent) {
1220
- return false;
1221
- }
1222
- return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
1223
- return sc == null;
1224
- });
1225
- };
1226
- BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
1227
- if (!this.sourcesContent) {
1228
- return null;
1229
- }
1230
- var index = this._findSourceIndex(aSource);
1231
- if (index >= 0) {
1232
- return this.sourcesContent[index];
1233
- }
1234
- var relativeSource = aSource;
1235
- if (this.sourceRoot != null) {
1236
- relativeSource = util.relative(this.sourceRoot, relativeSource);
1237
- }
1238
- var url;
1239
- if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
1240
- var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
1241
- if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) {
1242
- return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
1243
- }
1244
- if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) {
1245
- return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
1246
- }
1247
- }
1248
- if (nullOnMissing) {
1249
- return null;
1250
- } else {
1251
- throw new Error('"' + relativeSource + '" is not in the SourceMap.');
1252
- }
1253
- };
1254
- BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
1255
- var source = util.getArg(aArgs, "source");
1256
- source = this._findSourceIndex(source);
1257
- if (source < 0) {
1258
- return {
1259
- line: null,
1260
- column: null,
1261
- lastColumn: null
1262
- };
1263
- }
1264
- var needle = {
1265
- source,
1266
- originalLine: util.getArg(aArgs, "line"),
1267
- originalColumn: util.getArg(aArgs, "column")
1268
- };
1269
- var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND));
1270
- if (index >= 0) {
1271
- var mapping = this._originalMappings[index];
1272
- if (mapping.source === needle.source) {
1273
- return {
1274
- line: util.getArg(mapping, "generatedLine", null),
1275
- column: util.getArg(mapping, "generatedColumn", null),
1276
- lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
1277
- };
1278
- }
1279
- }
1280
- return {
1281
- line: null,
1282
- column: null,
1283
- lastColumn: null
1284
- };
1285
- };
1286
- exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
1287
- function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
1288
- var sourceMap = aSourceMap;
1289
- if (typeof aSourceMap === "string") {
1290
- sourceMap = util.parseSourceMapInput(aSourceMap);
1291
- }
1292
- var version = util.getArg(sourceMap, "version");
1293
- var sections = util.getArg(sourceMap, "sections");
1294
- if (version != this._version) {
1295
- throw new Error("Unsupported version: " + version);
1296
- }
1297
- this._sources = new ArraySet();
1298
- this._names = new ArraySet();
1299
- var lastOffset = {
1300
- line: -1,
1301
- column: 0
1302
- };
1303
- this._sections = sections.map(function(s) {
1304
- if (s.url) {
1305
- throw new Error("Support for url field in sections not implemented.");
1306
- }
1307
- var offset = util.getArg(s, "offset");
1308
- var offsetLine = util.getArg(offset, "line");
1309
- var offsetColumn = util.getArg(offset, "column");
1310
- if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
1311
- throw new Error("Section offsets must be ordered and non-overlapping.");
1312
- }
1313
- lastOffset = offset;
1314
- return {
1315
- generatedOffset: {
1316
- generatedLine: offsetLine + 1,
1317
- generatedColumn: offsetColumn + 1
1318
- },
1319
- consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL)
1320
- };
1321
- });
1322
- }
1323
- IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
1324
- IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
1325
- IndexedSourceMapConsumer.prototype._version = 3;
1326
- Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", {
1327
- get: function() {
1328
- var sources = [];
1329
- for (var i = 0; i < this._sections.length; i++) {
1330
- for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
1331
- sources.push(this._sections[i].consumer.sources[j]);
1332
- }
1333
- }
1334
- return sources;
1335
- }
1336
- });
1337
- IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
1338
- var needle = {
1339
- generatedLine: util.getArg(aArgs, "line"),
1340
- generatedColumn: util.getArg(aArgs, "column")
1341
- };
1342
- var sectionIndex = binarySearch.search(needle, this._sections, function(needle2, section2) {
1343
- var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine;
1344
- if (cmp) {
1345
- return cmp;
1346
- }
1347
- return needle2.generatedColumn - section2.generatedOffset.generatedColumn;
1348
- });
1349
- var section = this._sections[sectionIndex];
1350
- if (!section) {
1351
- return {
1352
- source: null,
1353
- line: null,
1354
- column: null,
1355
- name: null
1356
- };
1357
- }
1358
- return section.consumer.originalPositionFor({
1359
- line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
1360
- column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
1361
- bias: aArgs.bias
1362
- });
1363
- };
1364
- IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
1365
- return this._sections.every(function(s) {
1366
- return s.consumer.hasContentsOfAllSources();
1367
- });
1368
- };
1369
- IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
1370
- for (var i = 0; i < this._sections.length; i++) {
1371
- var section = this._sections[i];
1372
- var content = section.consumer.sourceContentFor(aSource, true);
1373
- if (content) {
1374
- return content;
1375
- }
1376
- }
1377
- if (nullOnMissing) {
1378
- return null;
1379
- } else {
1380
- throw new Error('"' + aSource + '" is not in the SourceMap.');
1381
- }
1382
- };
1383
- IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
1384
- for (var i = 0; i < this._sections.length; i++) {
1385
- var section = this._sections[i];
1386
- if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) {
1387
- continue;
1388
- }
1389
- var generatedPosition = section.consumer.generatedPositionFor(aArgs);
1390
- if (generatedPosition) {
1391
- var ret = {
1392
- line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
1393
- column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
1394
- };
1395
- return ret;
1396
- }
1397
- }
1398
- return {
1399
- line: null,
1400
- column: null
1401
- };
1402
- };
1403
- IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
1404
- this.__generatedMappings = [];
1405
- this.__originalMappings = [];
1406
- for (var i = 0; i < this._sections.length; i++) {
1407
- var section = this._sections[i];
1408
- var sectionMappings = section.consumer._generatedMappings;
1409
- for (var j = 0; j < sectionMappings.length; j++) {
1410
- var mapping = sectionMappings[j];
1411
- var source = section.consumer._sources.at(mapping.source);
1412
- source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
1413
- this._sources.add(source);
1414
- source = this._sources.indexOf(source);
1415
- var name = null;
1416
- if (mapping.name) {
1417
- name = section.consumer._names.at(mapping.name);
1418
- this._names.add(name);
1419
- name = this._names.indexOf(name);
1420
- }
1421
- var adjustedMapping = {
1422
- source,
1423
- generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
1424
- generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
1425
- originalLine: mapping.originalLine,
1426
- originalColumn: mapping.originalColumn,
1427
- name
1428
- };
1429
- this.__generatedMappings.push(adjustedMapping);
1430
- if (typeof adjustedMapping.originalLine === "number") {
1431
- this.__originalMappings.push(adjustedMapping);
1432
- }
1433
- }
1434
- }
1435
- quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
1436
- quickSort(this.__originalMappings, util.compareByOriginalPositions);
1437
- };
1438
- exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
1439
- });
1440
-
1441
- // node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js
1442
- var require_source_node = __commonJS((exports) => {
1443
- var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
1444
- var util = require_util();
1445
- var REGEX_NEWLINE = /(\r?\n)/;
1446
- var NEWLINE_CODE = 10;
1447
- var isSourceNode = "$$$isSourceNode$$$";
1448
- function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
1449
- this.children = [];
1450
- this.sourceContents = {};
1451
- this.line = aLine == null ? null : aLine;
1452
- this.column = aColumn == null ? null : aColumn;
1453
- this.source = aSource == null ? null : aSource;
1454
- this.name = aName == null ? null : aName;
1455
- this[isSourceNode] = true;
1456
- if (aChunks != null)
1457
- this.add(aChunks);
1458
- }
1459
- SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
1460
- var node = new SourceNode();
1461
- var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
1462
- var remainingLinesIndex = 0;
1463
- var shiftNextLine = function() {
1464
- var lineContents = getNextLine();
1465
- var newLine = getNextLine() || "";
1466
- return lineContents + newLine;
1467
- function getNextLine() {
1468
- return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
1469
- }
1470
- };
1471
- var lastGeneratedLine = 1, lastGeneratedColumn = 0;
1472
- var lastMapping = null;
1473
- aSourceMapConsumer.eachMapping(function(mapping) {
1474
- if (lastMapping !== null) {
1475
- if (lastGeneratedLine < mapping.generatedLine) {
1476
- addMappingWithCode(lastMapping, shiftNextLine());
1477
- lastGeneratedLine++;
1478
- lastGeneratedColumn = 0;
1479
- } else {
1480
- var nextLine = remainingLines[remainingLinesIndex] || "";
1481
- var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
1482
- remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
1483
- lastGeneratedColumn = mapping.generatedColumn;
1484
- addMappingWithCode(lastMapping, code);
1485
- lastMapping = mapping;
1486
- return;
1487
- }
1488
- }
1489
- while (lastGeneratedLine < mapping.generatedLine) {
1490
- node.add(shiftNextLine());
1491
- lastGeneratedLine++;
1492
- }
1493
- if (lastGeneratedColumn < mapping.generatedColumn) {
1494
- var nextLine = remainingLines[remainingLinesIndex] || "";
1495
- node.add(nextLine.substr(0, mapping.generatedColumn));
1496
- remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
1497
- lastGeneratedColumn = mapping.generatedColumn;
1498
- }
1499
- lastMapping = mapping;
1500
- }, this);
1501
- if (remainingLinesIndex < remainingLines.length) {
1502
- if (lastMapping) {
1503
- addMappingWithCode(lastMapping, shiftNextLine());
1504
- }
1505
- node.add(remainingLines.splice(remainingLinesIndex).join(""));
1506
- }
1507
- aSourceMapConsumer.sources.forEach(function(sourceFile) {
1508
- var content = aSourceMapConsumer.sourceContentFor(sourceFile);
1509
- if (content != null) {
1510
- if (aRelativePath != null) {
1511
- sourceFile = util.join(aRelativePath, sourceFile);
1512
- }
1513
- node.setSourceContent(sourceFile, content);
1514
- }
1515
- });
1516
- return node;
1517
- function addMappingWithCode(mapping, code) {
1518
- if (mapping === null || mapping.source === void 0) {
1519
- node.add(code);
1520
- } else {
1521
- var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
1522
- node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name));
1523
- }
1524
- }
1525
- };
1526
- SourceNode.prototype.add = function SourceNode_add(aChunk) {
1527
- if (Array.isArray(aChunk)) {
1528
- aChunk.forEach(function(chunk) {
1529
- this.add(chunk);
1530
- }, this);
1531
- } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
1532
- if (aChunk) {
1533
- this.children.push(aChunk);
1534
- }
1535
- } else {
1536
- throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
1537
- }
1538
- return this;
1539
- };
1540
- SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
1541
- if (Array.isArray(aChunk)) {
1542
- for (var i = aChunk.length - 1; i >= 0; i--) {
1543
- this.prepend(aChunk[i]);
1544
- }
1545
- } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
1546
- this.children.unshift(aChunk);
1547
- } else {
1548
- throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
1549
- }
1550
- return this;
1551
- };
1552
- SourceNode.prototype.walk = function SourceNode_walk(aFn) {
1553
- var chunk;
1554
- for (var i = 0, len = this.children.length; i < len; i++) {
1555
- chunk = this.children[i];
1556
- if (chunk[isSourceNode]) {
1557
- chunk.walk(aFn);
1558
- } else {
1559
- if (chunk !== "") {
1560
- aFn(chunk, {
1561
- source: this.source,
1562
- line: this.line,
1563
- column: this.column,
1564
- name: this.name
1565
- });
1566
- }
1567
- }
1568
- }
1569
- };
1570
- SourceNode.prototype.join = function SourceNode_join(aSep) {
1571
- var newChildren;
1572
- var i;
1573
- var len = this.children.length;
1574
- if (len > 0) {
1575
- newChildren = [];
1576
- for (i = 0; i < len - 1; i++) {
1577
- newChildren.push(this.children[i]);
1578
- newChildren.push(aSep);
1579
- }
1580
- newChildren.push(this.children[i]);
1581
- this.children = newChildren;
1582
- }
1583
- return this;
1584
- };
1585
- SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
1586
- var lastChild = this.children[this.children.length - 1];
1587
- if (lastChild[isSourceNode]) {
1588
- lastChild.replaceRight(aPattern, aReplacement);
1589
- } else if (typeof lastChild === "string") {
1590
- this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
1591
- } else {
1592
- this.children.push("".replace(aPattern, aReplacement));
1593
- }
1594
- return this;
1595
- };
1596
- SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
1597
- this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
1598
- };
1599
- SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
1600
- for (var i = 0, len = this.children.length; i < len; i++) {
1601
- if (this.children[i][isSourceNode]) {
1602
- this.children[i].walkSourceContents(aFn);
1603
- }
1604
- }
1605
- var sources = Object.keys(this.sourceContents);
1606
- for (var i = 0, len = sources.length; i < len; i++) {
1607
- aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
1608
- }
1609
- };
1610
- SourceNode.prototype.toString = function SourceNode_toString() {
1611
- var str = "";
1612
- this.walk(function(chunk) {
1613
- str += chunk;
1614
- });
1615
- return str;
1616
- };
1617
- SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
1618
- var generated = {
1619
- code: "",
1620
- line: 1,
1621
- column: 0
1622
- };
1623
- var map2 = new SourceMapGenerator(aArgs);
1624
- var sourceMappingActive = false;
1625
- var lastOriginalSource = null;
1626
- var lastOriginalLine = null;
1627
- var lastOriginalColumn = null;
1628
- var lastOriginalName = null;
1629
- this.walk(function(chunk, original) {
1630
- generated.code += chunk;
1631
- if (original.source !== null && original.line !== null && original.column !== null) {
1632
- if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
1633
- map2.addMapping({
1634
- source: original.source,
1635
- original: {
1636
- line: original.line,
1637
- column: original.column
1638
- },
1639
- generated: {
1640
- line: generated.line,
1641
- column: generated.column
1642
- },
1643
- name: original.name
1644
- });
1645
- }
1646
- lastOriginalSource = original.source;
1647
- lastOriginalLine = original.line;
1648
- lastOriginalColumn = original.column;
1649
- lastOriginalName = original.name;
1650
- sourceMappingActive = true;
1651
- } else if (sourceMappingActive) {
1652
- map2.addMapping({
1653
- generated: {
1654
- line: generated.line,
1655
- column: generated.column
1656
- }
1657
- });
1658
- lastOriginalSource = null;
1659
- sourceMappingActive = false;
1660
- }
1661
- for (var idx = 0, length = chunk.length; idx < length; idx++) {
1662
- if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
1663
- generated.line++;
1664
- generated.column = 0;
1665
- if (idx + 1 === length) {
1666
- lastOriginalSource = null;
1667
- sourceMappingActive = false;
1668
- } else if (sourceMappingActive) {
1669
- map2.addMapping({
1670
- source: original.source,
1671
- original: {
1672
- line: original.line,
1673
- column: original.column
1674
- },
1675
- generated: {
1676
- line: generated.line,
1677
- column: generated.column
1678
- },
1679
- name: original.name
1680
- });
1681
- }
1682
- } else {
1683
- generated.column++;
1684
- }
1685
- }
1686
- });
1687
- this.walkSourceContents(function(sourceFile, sourceContent) {
1688
- map2.setSourceContent(sourceFile, sourceContent);
1689
- });
1690
- return {code: generated.code, map: map2};
1691
- };
1692
- exports.SourceNode = SourceNode;
1693
- });
1694
-
1695
- // node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/source-map.js
1696
- var require_source_map = __commonJS((exports) => {
1697
- exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
1698
- exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
1699
- exports.SourceNode = require_source_node().SourceNode;
1700
- });
1701
-
1702
- // node_modules/.pnpm/buffer-from@1.1.1/node_modules/buffer-from/index.js
1703
- var require_buffer_from = __commonJS((exports, module2) => {
1704
- var toString = Object.prototype.toString;
1705
- var isModern = typeof Buffer.alloc === "function" && typeof Buffer.allocUnsafe === "function" && typeof Buffer.from === "function";
1706
- function isArrayBuffer(input) {
1707
- return toString.call(input).slice(8, -1) === "ArrayBuffer";
1708
- }
1709
- function fromArrayBuffer(obj, byteOffset, length) {
1710
- byteOffset >>>= 0;
1711
- var maxLength = obj.byteLength - byteOffset;
1712
- if (maxLength < 0) {
1713
- throw new RangeError("'offset' is out of bounds");
1714
- }
1715
- if (length === void 0) {
1716
- length = maxLength;
1717
- } else {
1718
- length >>>= 0;
1719
- if (length > maxLength) {
1720
- throw new RangeError("'length' is out of bounds");
1721
- }
1722
- }
1723
- return isModern ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)));
1724
- }
1725
- function fromString(string, encoding) {
1726
- if (typeof encoding !== "string" || encoding === "") {
1727
- encoding = "utf8";
1728
- }
1729
- if (!Buffer.isEncoding(encoding)) {
1730
- throw new TypeError('"encoding" must be a valid string encoding');
1731
- }
1732
- return isModern ? Buffer.from(string, encoding) : new Buffer(string, encoding);
1733
- }
1734
- function bufferFrom(value, encodingOrOffset, length) {
1735
- if (typeof value === "number") {
1736
- throw new TypeError('"value" argument must not be a number');
1737
- }
1738
- if (isArrayBuffer(value)) {
1739
- return fromArrayBuffer(value, encodingOrOffset, length);
1740
- }
1741
- if (typeof value === "string") {
1742
- return fromString(value, encodingOrOffset);
1743
- }
1744
- return isModern ? Buffer.from(value) : new Buffer(value);
1745
- }
1746
- module2.exports = bufferFrom;
1747
- });
1748
-
1749
- // node_modules/.pnpm/source-map-support@0.5.19/node_modules/source-map-support/source-map-support.js
1750
- var require_source_map_support = __commonJS((exports, module2) => {
1751
- var SourceMapConsumer = require_source_map().SourceMapConsumer;
1752
- var path = require("path");
1753
- var fs3;
1754
- try {
1755
- fs3 = require("fs");
1756
- if (!fs3.existsSync || !fs3.readFileSync) {
1757
- fs3 = null;
1758
- }
1759
- } catch (err) {
1760
- }
1761
- var bufferFrom = require_buffer_from();
1762
- function dynamicRequire(mod, request) {
1763
- return mod.require(request);
1764
- }
1765
- var errorFormatterInstalled = false;
1766
- var uncaughtShimInstalled = false;
1767
- var emptyCacheBetweenOperations = false;
1768
- var environment = "auto";
1769
- var fileContentsCache = {};
1770
- var sourceMapCache = {};
1771
- var reSourceMap = /^data:application\/json[^,]+base64,/;
1772
- var retrieveFileHandlers = [];
1773
- var retrieveMapHandlers = [];
1774
- function isInBrowser() {
1775
- if (environment === "browser")
1776
- return true;
1777
- if (environment === "node")
1778
- return false;
1779
- return typeof window !== "undefined" && typeof XMLHttpRequest === "function" && !(window.require && window.module && window.process && window.process.type === "renderer");
1780
- }
1781
- function hasGlobalProcessEventEmitter() {
1782
- return typeof process === "object" && process !== null && typeof process.on === "function";
1783
- }
1784
- function handlerExec(list) {
1785
- return function(arg) {
1786
- for (var i = 0; i < list.length; i++) {
1787
- var ret = list[i](arg);
1788
- if (ret) {
1789
- return ret;
1790
- }
1791
- }
1792
- return null;
1793
- };
1794
- }
1795
- var retrieveFile = handlerExec(retrieveFileHandlers);
1796
- retrieveFileHandlers.push(function(path2) {
1797
- path2 = path2.trim();
1798
- if (/^file:/.test(path2)) {
1799
- path2 = path2.replace(/file:\/\/\/(\w:)?/, function(protocol, drive) {
1800
- return drive ? "" : "/";
1801
- });
1802
- }
1803
- if (path2 in fileContentsCache) {
1804
- return fileContentsCache[path2];
1805
- }
1806
- var contents = "";
1807
- try {
1808
- if (!fs3) {
1809
- var xhr = new XMLHttpRequest();
1810
- xhr.open("GET", path2, false);
1811
- xhr.send(null);
1812
- if (xhr.readyState === 4 && xhr.status === 200) {
1813
- contents = xhr.responseText;
1814
- }
1815
- } else if (fs3.existsSync(path2)) {
1816
- contents = fs3.readFileSync(path2, "utf8");
1817
- }
1818
- } catch (er) {
1819
- }
1820
- return fileContentsCache[path2] = contents;
1821
- });
1822
- function supportRelativeURL(file, url) {
1823
- if (!file)
1824
- return url;
1825
- var dir = path.dirname(file);
1826
- var match = /^\w+:\/\/[^\/]*/.exec(dir);
1827
- var protocol = match ? match[0] : "";
1828
- var startPath = dir.slice(protocol.length);
1829
- if (protocol && /^\/\w\:/.test(startPath)) {
1830
- protocol += "/";
1831
- return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
1832
- }
1833
- return protocol + path.resolve(dir.slice(protocol.length), url);
1834
- }
1835
- function retrieveSourceMapURL(source) {
1836
- var fileData;
1837
- if (isInBrowser()) {
1838
- try {
1839
- var xhr = new XMLHttpRequest();
1840
- xhr.open("GET", source, false);
1841
- xhr.send(null);
1842
- fileData = xhr.readyState === 4 ? xhr.responseText : null;
1843
- var sourceMapHeader = xhr.getResponseHeader("SourceMap") || xhr.getResponseHeader("X-SourceMap");
1844
- if (sourceMapHeader) {
1845
- return sourceMapHeader;
1846
- }
1847
- } catch (e) {
1848
- }
1849
- }
1850
- fileData = retrieveFile(source);
1851
- var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg;
1852
- var lastMatch, match;
1853
- while (match = re.exec(fileData))
1854
- lastMatch = match;
1855
- if (!lastMatch)
1856
- return null;
1857
- return lastMatch[1];
1858
- }
1859
- var retrieveSourceMap = handlerExec(retrieveMapHandlers);
1860
- retrieveMapHandlers.push(function(source) {
1861
- var sourceMappingURL = retrieveSourceMapURL(source);
1862
- if (!sourceMappingURL)
1863
- return null;
1864
- var sourceMapData;
1865
- if (reSourceMap.test(sourceMappingURL)) {
1866
- var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1);
1867
- sourceMapData = bufferFrom(rawData, "base64").toString();
1868
- sourceMappingURL = source;
1869
- } else {
1870
- sourceMappingURL = supportRelativeURL(source, sourceMappingURL);
1871
- sourceMapData = retrieveFile(sourceMappingURL);
1872
- }
1873
- if (!sourceMapData) {
1874
- return null;
1875
- }
1876
- return {
1877
- url: sourceMappingURL,
1878
- map: sourceMapData
1879
- };
1880
- });
1881
- function mapSourcePosition(position) {
1882
- var sourceMap = sourceMapCache[position.source];
1883
- if (!sourceMap) {
1884
- var urlAndMap = retrieveSourceMap(position.source);
1885
- if (urlAndMap) {
1886
- sourceMap = sourceMapCache[position.source] = {
1887
- url: urlAndMap.url,
1888
- map: new SourceMapConsumer(urlAndMap.map)
1889
- };
1890
- if (sourceMap.map.sourcesContent) {
1891
- sourceMap.map.sources.forEach(function(source, i) {
1892
- var contents = sourceMap.map.sourcesContent[i];
1893
- if (contents) {
1894
- var url = supportRelativeURL(sourceMap.url, source);
1895
- fileContentsCache[url] = contents;
1896
- }
1897
- });
1898
- }
1899
- } else {
1900
- sourceMap = sourceMapCache[position.source] = {
1901
- url: null,
1902
- map: null
1903
- };
1904
- }
1905
- }
1906
- if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === "function") {
1907
- var originalPosition = sourceMap.map.originalPositionFor(position);
1908
- if (originalPosition.source !== null) {
1909
- originalPosition.source = supportRelativeURL(sourceMap.url, originalPosition.source);
1910
- return originalPosition;
1911
- }
1912
- }
1913
- return position;
1914
- }
1915
- function mapEvalOrigin(origin) {
1916
- var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin);
1917
- if (match) {
1918
- var position = mapSourcePosition({
1919
- source: match[2],
1920
- line: +match[3],
1921
- column: match[4] - 1
1922
- });
1923
- return "eval at " + match[1] + " (" + position.source + ":" + position.line + ":" + (position.column + 1) + ")";
1924
- }
1925
- match = /^eval at ([^(]+) \((.+)\)$/.exec(origin);
1926
- if (match) {
1927
- return "eval at " + match[1] + " (" + mapEvalOrigin(match[2]) + ")";
1928
- }
1929
- return origin;
1930
- }
1931
- function CallSiteToString() {
1932
- var fileName;
1933
- var fileLocation = "";
1934
- if (this.isNative()) {
1935
- fileLocation = "native";
1936
- } else {
1937
- fileName = this.getScriptNameOrSourceURL();
1938
- if (!fileName && this.isEval()) {
1939
- fileLocation = this.getEvalOrigin();
1940
- fileLocation += ", ";
1941
- }
1942
- if (fileName) {
1943
- fileLocation += fileName;
1944
- } else {
1945
- fileLocation += "<anonymous>";
1946
- }
1947
- var lineNumber = this.getLineNumber();
1948
- if (lineNumber != null) {
1949
- fileLocation += ":" + lineNumber;
1950
- var columnNumber = this.getColumnNumber();
1951
- if (columnNumber) {
1952
- fileLocation += ":" + columnNumber;
1953
- }
1954
- }
1955
- }
1956
- var line = "";
1957
- var functionName = this.getFunctionName();
1958
- var addSuffix = true;
1959
- var isConstructor = this.isConstructor();
1960
- var isMethodCall = !(this.isToplevel() || isConstructor);
1961
- if (isMethodCall) {
1962
- var typeName = this.getTypeName();
1963
- if (typeName === "[object Object]") {
1964
- typeName = "null";
1965
- }
1966
- var methodName = this.getMethodName();
1967
- if (functionName) {
1968
- if (typeName && functionName.indexOf(typeName) != 0) {
1969
- line += typeName + ".";
1970
- }
1971
- line += functionName;
1972
- if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) {
1973
- line += " [as " + methodName + "]";
1974
- }
1975
- } else {
1976
- line += typeName + "." + (methodName || "<anonymous>");
1977
- }
1978
- } else if (isConstructor) {
1979
- line += "new " + (functionName || "<anonymous>");
1980
- } else if (functionName) {
1981
- line += functionName;
1982
- } else {
1983
- line += fileLocation;
1984
- addSuffix = false;
1985
- }
1986
- if (addSuffix) {
1987
- line += " (" + fileLocation + ")";
1988
- }
1989
- return line;
1990
- }
1991
- function cloneCallSite(frame) {
1992
- var object = {};
1993
- Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) {
1994
- object[name] = /^(?:is|get)/.test(name) ? function() {
1995
- return frame[name].call(frame);
1996
- } : frame[name];
1997
- });
1998
- object.toString = CallSiteToString;
1999
- return object;
2000
- }
2001
- function wrapCallSite(frame, state) {
2002
- if (state === void 0) {
2003
- state = {nextPosition: null, curPosition: null};
2004
- }
2005
- if (frame.isNative()) {
2006
- state.curPosition = null;
2007
- return frame;
2008
- }
2009
- var source = frame.getFileName() || frame.getScriptNameOrSourceURL();
2010
- if (source) {
2011
- var line = frame.getLineNumber();
2012
- var column = frame.getColumnNumber() - 1;
2013
- var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;
2014
- var headerLength = noHeader.test(process.version) ? 0 : 62;
2015
- if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) {
2016
- column -= headerLength;
2017
- }
2018
- var position = mapSourcePosition({
2019
- source,
2020
- line,
2021
- column
2022
- });
2023
- state.curPosition = position;
2024
- frame = cloneCallSite(frame);
2025
- var originalFunctionName = frame.getFunctionName;
2026
- frame.getFunctionName = function() {
2027
- if (state.nextPosition == null) {
2028
- return originalFunctionName();
2029
- }
2030
- return state.nextPosition.name || originalFunctionName();
2031
- };
2032
- frame.getFileName = function() {
2033
- return position.source;
2034
- };
2035
- frame.getLineNumber = function() {
2036
- return position.line;
2037
- };
2038
- frame.getColumnNumber = function() {
2039
- return position.column + 1;
2040
- };
2041
- frame.getScriptNameOrSourceURL = function() {
2042
- return position.source;
2043
- };
2044
- return frame;
2045
- }
2046
- var origin = frame.isEval() && frame.getEvalOrigin();
2047
- if (origin) {
2048
- origin = mapEvalOrigin(origin);
2049
- frame = cloneCallSite(frame);
2050
- frame.getEvalOrigin = function() {
2051
- return origin;
2052
- };
2053
- return frame;
2054
- }
2055
- return frame;
2056
- }
2057
- function prepareStackTrace(error, stack) {
2058
- if (emptyCacheBetweenOperations) {
2059
- fileContentsCache = {};
2060
- sourceMapCache = {};
2061
- }
2062
- var name = error.name || "Error";
2063
- var message = error.message || "";
2064
- var errorString = name + ": " + message;
2065
- var state = {nextPosition: null, curPosition: null};
2066
- var processedStack = [];
2067
- for (var i = stack.length - 1; i >= 0; i--) {
2068
- processedStack.push("\n at " + wrapCallSite(stack[i], state));
2069
- state.nextPosition = state.curPosition;
2070
- }
2071
- state.curPosition = state.nextPosition = null;
2072
- return errorString + processedStack.reverse().join("");
2073
- }
2074
- function getErrorSource(error) {
2075
- var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack);
2076
- if (match) {
2077
- var source = match[1];
2078
- var line = +match[2];
2079
- var column = +match[3];
2080
- var contents = fileContentsCache[source];
2081
- if (!contents && fs3 && fs3.existsSync(source)) {
2082
- try {
2083
- contents = fs3.readFileSync(source, "utf8");
2084
- } catch (er) {
2085
- contents = "";
2086
- }
2087
- }
2088
- if (contents) {
2089
- var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1];
2090
- if (code) {
2091
- return source + ":" + line + "\n" + code + "\n" + new Array(column).join(" ") + "^";
2092
- }
2093
- }
2094
- }
2095
- return null;
2096
- }
2097
- function printErrorAndExit(error) {
2098
- var source = getErrorSource(error);
2099
- if (process.stderr._handle && process.stderr._handle.setBlocking) {
2100
- process.stderr._handle.setBlocking(true);
2101
- }
2102
- if (source) {
2103
- console.error();
2104
- console.error(source);
2105
- }
2106
- console.error(error.stack);
2107
- process.exit(1);
2108
- }
2109
- function shimEmitUncaughtException() {
2110
- var origEmit = process.emit;
2111
- process.emit = function(type) {
2112
- if (type === "uncaughtException") {
2113
- var hasStack = arguments[1] && arguments[1].stack;
2114
- var hasListeners = this.listeners(type).length > 0;
2115
- if (hasStack && !hasListeners) {
2116
- return printErrorAndExit(arguments[1]);
2117
- }
2118
- }
2119
- return origEmit.apply(this, arguments);
2120
- };
2121
- }
2122
- var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0);
2123
- var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0);
2124
- exports.wrapCallSite = wrapCallSite;
2125
- exports.getErrorSource = getErrorSource;
2126
- exports.mapSourcePosition = mapSourcePosition;
2127
- exports.retrieveSourceMap = retrieveSourceMap;
2128
- exports.install = function(options) {
2129
- options = options || {};
2130
- if (options.environment) {
2131
- environment = options.environment;
2132
- if (["node", "browser", "auto"].indexOf(environment) === -1) {
2133
- throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}");
2134
- }
2135
- }
2136
- if (options.retrieveFile) {
2137
- if (options.overrideRetrieveFile) {
2138
- retrieveFileHandlers.length = 0;
2139
- }
2140
- retrieveFileHandlers.unshift(options.retrieveFile);
2141
- }
2142
- if (options.retrieveSourceMap) {
2143
- if (options.overrideRetrieveSourceMap) {
2144
- retrieveMapHandlers.length = 0;
2145
- }
2146
- retrieveMapHandlers.unshift(options.retrieveSourceMap);
2147
- }
2148
- if (options.hookRequire && !isInBrowser()) {
2149
- var Module = dynamicRequire(module2, "module");
2150
- var $compile = Module.prototype._compile;
2151
- if (!$compile.__sourceMapSupport) {
2152
- Module.prototype._compile = function(content, filename) {
2153
- fileContentsCache[filename] = content;
2154
- sourceMapCache[filename] = void 0;
2155
- return $compile.call(this, content, filename);
2156
- };
2157
- Module.prototype._compile.__sourceMapSupport = true;
2158
- }
2159
- }
2160
- if (!emptyCacheBetweenOperations) {
2161
- emptyCacheBetweenOperations = "emptyCacheBetweenOperations" in options ? options.emptyCacheBetweenOperations : false;
2162
- }
2163
- if (!errorFormatterInstalled) {
2164
- errorFormatterInstalled = true;
2165
- Error.prepareStackTrace = prepareStackTrace;
2166
- }
2167
- if (!uncaughtShimInstalled) {
2168
- var installHandler = "handleUncaughtExceptions" in options ? options.handleUncaughtExceptions : true;
2169
- try {
2170
- var worker_threads = dynamicRequire(module2, "worker_threads");
2171
- if (worker_threads.isMainThread === false) {
2172
- installHandler = false;
2173
- }
2174
- } catch (e) {
2175
- }
2176
- if (installHandler && hasGlobalProcessEventEmitter()) {
2177
- uncaughtShimInstalled = true;
2178
- shimEmitUncaughtException();
2179
- }
2180
- }
2181
- };
2182
- exports.resetRetrieveHandlers = function() {
2183
- retrieveFileHandlers.length = 0;
2184
- retrieveMapHandlers.length = 0;
2185
- retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
2186
- retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);
2187
- retrieveSourceMap = handlerExec(retrieveMapHandlers);
2188
- retrieveFile = handlerExec(retrieveFileHandlers);
2189
- };
2190
- });
2191
-
2192
- // node_modules/.pnpm/node-modules-regexp@1.0.0/node_modules/node-modules-regexp/index.js
2193
- var require_node_modules_regexp = __commonJS((exports, module2) => {
2194
- "use strict";
2195
- module2.exports = /^(?:.*[\\\/])?node_modules(?:[\\\/].*)?$/;
2196
- });
2197
-
2198
- // node_modules/.pnpm/pirates@4.0.1/node_modules/pirates/lib/index.js
2199
- var require_lib = __commonJS((exports, module2) => {
2200
- "use strict";
2201
- Object.defineProperty(exports, "__esModule", {
2202
- value: true
2203
- });
2204
- exports.addHook = addHook2;
2205
- var _module = _interopRequireDefault(require("module"));
2206
- var _path = _interopRequireDefault(require("path"));
2207
- var _nodeModulesRegexp = _interopRequireDefault(require_node_modules_regexp());
2208
- function _interopRequireDefault(obj) {
2209
- return obj && obj.__esModule ? obj : {default: obj};
2210
- }
2211
- var Module = module2.constructor.length > 1 ? module2.constructor : _module.default;
2212
- var HOOK_RETURNED_NOTHING_ERROR_MESSAGE = "[Pirates] A hook returned a non-string, or nothing at all! This is a violation of intergalactic law!\n--------------------\nIf you have no idea what this means or what Pirates is, let me explain: Pirates is a module that makes is easy to implement require hooks. One of the require hooks you're using uses it. One of these require hooks didn't return anything from it's handler, so we don't know what to do. You might want to debug this.";
2213
- function shouldCompile(filename, exts, matcher, ignoreNodeModules) {
2214
- if (typeof filename !== "string") {
2215
- return false;
2216
- }
2217
- if (exts.indexOf(_path.default.extname(filename)) === -1) {
2218
- return false;
2219
- }
2220
- const resolvedFilename = _path.default.resolve(filename);
2221
- if (ignoreNodeModules && _nodeModulesRegexp.default.test(resolvedFilename)) {
2222
- return false;
2223
- }
2224
- if (matcher && typeof matcher === "function") {
2225
- return !!matcher(resolvedFilename);
2226
- }
2227
- return true;
2228
- }
2229
- function addHook2(hook, opts = {}) {
2230
- let reverted = false;
2231
- const loaders = [];
2232
- const oldLoaders = [];
2233
- let exts;
2234
- const originalJSLoader = Module._extensions[".js"];
2235
- const matcher = opts.matcher || null;
2236
- const ignoreNodeModules = opts.ignoreNodeModules !== false;
2237
- exts = opts.extensions || opts.exts || opts.extension || opts.ext || [".js"];
2238
- if (!Array.isArray(exts)) {
2239
- exts = [exts];
2240
- }
2241
- exts.forEach((ext) => {
2242
- if (typeof ext !== "string") {
2243
- throw new TypeError(`Invalid Extension: ${ext}`);
2244
- }
2245
- const oldLoader = Module._extensions[ext] || originalJSLoader;
2246
- oldLoaders[ext] = oldLoader;
2247
- loaders[ext] = Module._extensions[ext] = function newLoader(mod, filename) {
2248
- let compile;
2249
- if (!reverted) {
2250
- if (shouldCompile(filename, exts, matcher, ignoreNodeModules)) {
2251
- compile = mod._compile;
2252
- mod._compile = function _compile(code) {
2253
- mod._compile = compile;
2254
- const newCode = hook(code, filename);
2255
- if (typeof newCode !== "string") {
2256
- throw new Error(HOOK_RETURNED_NOTHING_ERROR_MESSAGE);
2257
- }
2258
- return mod._compile(newCode, filename);
2259
- };
2260
- }
2261
- }
2262
- oldLoader(mod, filename);
2263
- };
2264
- });
2265
- return function revert() {
2266
- if (reverted)
2267
- return;
2268
- reverted = true;
2269
- exts.forEach((ext) => {
2270
- if (Module._extensions[ext] === loaders[ext]) {
2271
- Module._extensions[ext] = oldLoaders[ext];
2272
- }
2273
- });
2274
- };
2275
- }
2276
- });
2277
-
2278
- // node_modules/.pnpm/joycon@2.2.5/node_modules/joycon/lib/index.js
2279
- var require_lib2 = __commonJS((exports, module2) => {
2280
- "use strict";
2281
- Object.defineProperty(exports, "__esModule", {
2282
- value: true
2283
- });
2284
- exports.default = void 0;
2285
- var _fs = _interopRequireDefault(require("fs"));
2286
- var _path = _interopRequireDefault(require("path"));
2287
- function _interopRequireDefault(obj) {
2288
- return obj && obj.__esModule ? obj : {default: obj};
2289
- }
2290
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2291
- try {
2292
- var info = gen[key](arg);
2293
- var value = info.value;
2294
- } catch (error) {
2295
- reject(error);
2296
- return;
2297
- }
2298
- if (info.done) {
2299
- resolve(value);
2300
- } else {
2301
- Promise.resolve(value).then(_next, _throw);
2302
- }
2303
- }
2304
- function _asyncToGenerator(fn) {
2305
- return function() {
2306
- var self = this, args = arguments;
2307
- return new Promise(function(resolve, reject) {
2308
- var gen = fn.apply(self, args);
2309
- function _next(value) {
2310
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
2311
- }
2312
- function _throw(err) {
2313
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
2314
- }
2315
- _next(void 0);
2316
- });
2317
- };
2318
- }
2319
- var readFile = (fp) => new Promise((resolve, reject) => {
2320
- _fs.default.readFile(fp, "utf8", (err, data) => {
2321
- if (err)
2322
- return reject(err);
2323
- resolve(data);
2324
- });
2325
- });
2326
- var readFileSync = (fp) => {
2327
- return _fs.default.readFileSync(fp, "utf8");
2328
- };
2329
- var pathExists = (fp) => new Promise((resolve) => {
2330
- _fs.default.access(fp, (err) => {
2331
- resolve(!err);
2332
- });
2333
- });
2334
- var pathExistsSync = _fs.default.existsSync;
2335
- var JoyCon2 = class {
2336
- constructor({
2337
- files,
2338
- cwd = process.cwd(),
2339
- stopDir,
2340
- packageKey,
2341
- parseJSON = JSON.parse
2342
- } = {}) {
2343
- this.options = {
2344
- files,
2345
- cwd,
2346
- stopDir,
2347
- packageKey,
2348
- parseJSON
2349
- };
2350
- this.existsCache = new Map();
2351
- this.loaders = new Set();
2352
- this.packageJsonCache = new Map();
2353
- }
2354
- addLoader(loader) {
2355
- this.loaders.add(loader);
2356
- return this;
2357
- }
2358
- removeLoader(name) {
2359
- var _iteratorNormalCompletion = true;
2360
- var _didIteratorError = false;
2361
- var _iteratorError = void 0;
2362
- try {
2363
- for (var _iterator = this.loaders[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
2364
- const loader = _step.value;
2365
- if (name && loader.name === name) {
2366
- this.loaders.delete(loader);
2367
- }
2368
- }
2369
- } catch (err) {
2370
- _didIteratorError = true;
2371
- _iteratorError = err;
2372
- } finally {
2373
- try {
2374
- if (!_iteratorNormalCompletion && _iterator.return != null) {
2375
- _iterator.return();
2376
- }
2377
- } finally {
2378
- if (_didIteratorError) {
2379
- throw _iteratorError;
2380
- }
2381
- }
2382
- }
2383
- return this;
2384
- }
2385
- recusivelyResolve(options) {
2386
- var _this = this;
2387
- return _asyncToGenerator(function* () {
2388
- if (options.cwd === options.stopDir || _path.default.basename(options.cwd) === "node_modules") {
2389
- return null;
2390
- }
2391
- var _iteratorNormalCompletion4 = true;
2392
- var _didIteratorError4 = false;
2393
- var _iteratorError4 = void 0;
2394
- try {
2395
- for (var _iterator4 = options.files[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
2396
- const filename = _step4.value;
2397
- const file = _path.default.resolve(options.cwd, filename);
2398
- const exists = process.env.NODE_ENV !== "test" && _this.existsCache.has(file) ? _this.existsCache.get(file) : yield pathExists(file);
2399
- _this.existsCache.set(file, exists);
2400
- if (exists) {
2401
- if (!options.packageKey || _path.default.basename(file) !== "package.json") {
2402
- return file;
2403
- }
2404
- const data = require(file);
2405
- delete require.cache[file];
2406
- const hasPackageKey = Object.prototype.hasOwnProperty.call(data, options.packageKey);
2407
- if (hasPackageKey) {
2408
- _this.packageJsonCache.set(file, data);
2409
- return file;
2410
- }
2411
- }
2412
- continue;
2413
- }
2414
- } catch (err) {
2415
- _didIteratorError4 = true;
2416
- _iteratorError4 = err;
2417
- } finally {
2418
- try {
2419
- if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
2420
- _iterator4.return();
2421
- }
2422
- } finally {
2423
- if (_didIteratorError4) {
2424
- throw _iteratorError4;
2425
- }
2426
- }
2427
- }
2428
- return _this.recusivelyResolve(Object.assign({}, options, {
2429
- cwd: _path.default.dirname(options.cwd)
2430
- }));
2431
- })();
2432
- }
2433
- recusivelyResolveSync(options) {
2434
- if (options.cwd === options.stopDir || _path.default.basename(options.cwd) === "node_modules") {
2435
- return null;
2436
- }
2437
- var _iteratorNormalCompletion2 = true;
2438
- var _didIteratorError2 = false;
2439
- var _iteratorError2 = void 0;
2440
- try {
2441
- for (var _iterator2 = options.files[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
2442
- const filename = _step2.value;
2443
- const file = _path.default.resolve(options.cwd, filename);
2444
- const exists = process.env.NODE_ENV !== "test" && this.existsCache.has(file) ? this.existsCache.get(file) : pathExistsSync(file);
2445
- this.existsCache.set(file, exists);
2446
- if (exists) {
2447
- if (!options.packageKey || _path.default.basename(file) !== "package.json") {
2448
- return file;
2449
- }
2450
- const data = require(file);
2451
- delete require.cache[file];
2452
- const hasPackageKey = Object.prototype.hasOwnProperty.call(data, options.packageKey);
2453
- if (hasPackageKey) {
2454
- this.packageJsonCache.set(file, data);
2455
- return file;
2456
- }
2457
- }
2458
- continue;
2459
- }
2460
- } catch (err) {
2461
- _didIteratorError2 = true;
2462
- _iteratorError2 = err;
2463
- } finally {
2464
- try {
2465
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
2466
- _iterator2.return();
2467
- }
2468
- } finally {
2469
- if (_didIteratorError2) {
2470
- throw _iteratorError2;
2471
- }
2472
- }
2473
- }
2474
- return this.recusivelyResolveSync(Object.assign({}, options, {
2475
- cwd: _path.default.dirname(options.cwd)
2476
- }));
2477
- }
2478
- resolve(...args) {
2479
- var _this2 = this;
2480
- return _asyncToGenerator(function* () {
2481
- const options = _this2.normalizeOptions(args);
2482
- return _this2.recusivelyResolve(options);
2483
- })();
2484
- }
2485
- resolveSync(...args) {
2486
- const options = this.normalizeOptions(args);
2487
- return this.recusivelyResolveSync(options);
2488
- }
2489
- load(...args) {
2490
- var _this3 = this;
2491
- return _asyncToGenerator(function* () {
2492
- const options = _this3.normalizeOptions(args);
2493
- const filepath = yield _this3.recusivelyResolve(options);
2494
- if (filepath) {
2495
- const loader = _this3.findLoader(filepath);
2496
- if (loader) {
2497
- return {
2498
- path: filepath,
2499
- data: yield loader.load(filepath)
2500
- };
2501
- }
2502
- const extname2 = _path.default.extname(filepath).slice(1);
2503
- if (extname2 === "js") {
2504
- delete require.cache[filepath];
2505
- return {
2506
- path: filepath,
2507
- data: require(filepath)
2508
- };
2509
- }
2510
- if (extname2 === "json") {
2511
- if (_this3.packageJsonCache.has(filepath)) {
2512
- return {
2513
- path: filepath,
2514
- data: _this3.packageJsonCache.get(filepath)[options.packageKey]
2515
- };
2516
- }
2517
- const data = _this3.options.parseJSON(yield readFile(filepath));
2518
- return {
2519
- path: filepath,
2520
- data
2521
- };
2522
- }
2523
- return {
2524
- path: filepath,
2525
- data: yield readFile(filepath)
2526
- };
2527
- }
2528
- return {};
2529
- })();
2530
- }
2531
- loadSync(...args) {
2532
- const options = this.normalizeOptions(args);
2533
- const filepath = this.recusivelyResolveSync(options);
2534
- if (filepath) {
2535
- const loader = this.findLoader(filepath);
2536
- if (loader) {
2537
- return {
2538
- path: filepath,
2539
- data: loader.loadSync(filepath)
2540
- };
2541
- }
2542
- const extname2 = _path.default.extname(filepath).slice(1);
2543
- if (extname2 === "js") {
2544
- delete require.cache[filepath];
2545
- return {
2546
- path: filepath,
2547
- data: require(filepath)
2548
- };
2549
- }
2550
- if (extname2 === "json") {
2551
- if (this.packageJsonCache.has(filepath)) {
2552
- return {
2553
- path: filepath,
2554
- data: this.packageJsonCache.get(filepath)[options.packageKey]
2555
- };
2556
- }
2557
- const data = this.options.parseJSON(readFileSync(filepath));
2558
- return {
2559
- path: filepath,
2560
- data
2561
- };
2562
- }
2563
- return {
2564
- path: filepath,
2565
- data: readFileSync(filepath)
2566
- };
2567
- }
2568
- return {};
2569
- }
2570
- findLoader(filepath) {
2571
- var _iteratorNormalCompletion3 = true;
2572
- var _didIteratorError3 = false;
2573
- var _iteratorError3 = void 0;
2574
- try {
2575
- for (var _iterator3 = this.loaders[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
2576
- const loader = _step3.value;
2577
- if (loader.test && loader.test.test(filepath)) {
2578
- return loader;
2579
- }
2580
- }
2581
- } catch (err) {
2582
- _didIteratorError3 = true;
2583
- _iteratorError3 = err;
2584
- } finally {
2585
- try {
2586
- if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
2587
- _iterator3.return();
2588
- }
2589
- } finally {
2590
- if (_didIteratorError3) {
2591
- throw _iteratorError3;
2592
- }
2593
- }
2594
- }
2595
- return null;
2596
- }
2597
- clearCache() {
2598
- this.existsCache.clear();
2599
- this.packageJsonCache.clear();
2600
- return this;
2601
- }
2602
- normalizeOptions(args) {
2603
- const options = Object.assign({}, this.options);
2604
- if (Object.prototype.toString.call(args[0]) === "[object Object]") {
2605
- Object.assign(options, args[0]);
2606
- } else {
2607
- if (args[0]) {
2608
- options.files = args[0];
2609
- }
2610
- if (args[1]) {
2611
- options.cwd = args[1];
2612
- }
2613
- if (args[2]) {
2614
- options.stopDir = args[2];
2615
- }
2616
- }
2617
- options.cwd = _path.default.resolve(options.cwd);
2618
- options.stopDir = options.stopDir ? _path.default.resolve(options.stopDir) : _path.default.parse(options.cwd).root;
2619
- if (!options.files || options.files.length === 0) {
2620
- throw new Error("[joycon] files must be an non-empty array!");
2621
- }
2622
- options.__normalized__ = true;
2623
- return options;
2624
- }
2625
- };
2626
- exports.default = JoyCon2;
2627
- module2.exports = JoyCon2;
2628
- module2.exports.default = JoyCon2;
2629
- });
2630
-
2631
- // node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/filesystem.js
2632
- var require_filesystem = __commonJS((exports) => {
2633
- "use strict";
2634
- Object.defineProperty(exports, "__esModule", {value: true});
2635
- exports.removeExtension = exports.fileExistsAsync = exports.readJsonFromDiskAsync = exports.readJsonFromDiskSync = exports.fileExistsSync = void 0;
2636
- var fs3 = require("fs");
2637
- function fileExistsSync(path) {
2638
- if (!fs3.existsSync(path)) {
2639
- return false;
2640
- }
2641
- try {
2642
- var stats = fs3.statSync(path);
2643
- return stats.isFile();
2644
- } catch (err) {
2645
- return false;
2646
- }
2647
- }
2648
- exports.fileExistsSync = fileExistsSync;
2649
- function readJsonFromDiskSync(packageJsonPath) {
2650
- if (!fs3.existsSync(packageJsonPath)) {
2651
- return void 0;
2652
- }
2653
- return require(packageJsonPath);
2654
- }
2655
- exports.readJsonFromDiskSync = readJsonFromDiskSync;
2656
- function readJsonFromDiskAsync(path, callback) {
2657
- fs3.readFile(path, "utf8", function(err, result) {
2658
- if (err || !result) {
2659
- return callback();
2660
- }
2661
- var json = JSON.parse(result);
2662
- return callback(void 0, json);
2663
- });
2664
- }
2665
- exports.readJsonFromDiskAsync = readJsonFromDiskAsync;
2666
- function fileExistsAsync(path2, callback2) {
2667
- fs3.stat(path2, function(err, stats) {
2668
- if (err) {
2669
- return callback2(void 0, false);
2670
- }
2671
- callback2(void 0, stats ? stats.isFile() : false);
2672
- });
2673
- }
2674
- exports.fileExistsAsync = fileExistsAsync;
2675
- function removeExtension(path) {
2676
- return path.substring(0, path.lastIndexOf(".")) || path;
2677
- }
2678
- exports.removeExtension = removeExtension;
2679
- });
2680
-
2681
- // node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/mapping-entry.js
2682
- var require_mapping_entry = __commonJS((exports) => {
2683
- "use strict";
2684
- Object.defineProperty(exports, "__esModule", {value: true});
2685
- exports.getAbsoluteMappingEntries = void 0;
2686
- var path = require("path");
2687
- function getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll) {
2688
- var sortedKeys = sortByLongestPrefix(Object.keys(paths));
2689
- var absolutePaths = [];
2690
- for (var _i = 0, sortedKeys_1 = sortedKeys; _i < sortedKeys_1.length; _i++) {
2691
- var key = sortedKeys_1[_i];
2692
- absolutePaths.push({
2693
- pattern: key,
2694
- paths: paths[key].map(function(pathToResolve) {
2695
- return path.resolve(absoluteBaseUrl, pathToResolve);
2696
- })
2697
- });
2698
- }
2699
- if (!paths["*"] && addMatchAll) {
2700
- absolutePaths.push({
2701
- pattern: "*",
2702
- paths: ["".concat(absoluteBaseUrl.replace(/\/$/, ""), "/*")]
2703
- });
2704
- }
2705
- return absolutePaths;
2706
- }
2707
- exports.getAbsoluteMappingEntries = getAbsoluteMappingEntries;
2708
- function sortByLongestPrefix(arr) {
2709
- return arr.concat().sort(function(a, b) {
2710
- return getPrefixLength(b) - getPrefixLength(a);
2711
- });
2712
- }
2713
- function getPrefixLength(pattern) {
2714
- var prefixLength = pattern.indexOf("*");
2715
- return pattern.substr(0, prefixLength).length;
2716
- }
2717
- });
2718
-
2719
- // node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/try-path.js
2720
- var require_try_path = __commonJS((exports) => {
2721
- "use strict";
2722
- Object.defineProperty(exports, "__esModule", {value: true});
2723
- exports.exhaustiveTypeException = exports.getStrippedPath = exports.getPathsToTry = void 0;
2724
- var path = require("path");
2725
- var path_1 = require("path");
2726
- var filesystem_1 = require_filesystem();
2727
- function getPathsToTry(extensions, absolutePathMappings, requestedModule) {
2728
- if (!absolutePathMappings || !requestedModule || requestedModule[0] === ".") {
2729
- return void 0;
2730
- }
2731
- var pathsToTry = [];
2732
- for (var _i = 0, absolutePathMappings_1 = absolutePathMappings; _i < absolutePathMappings_1.length; _i++) {
2733
- var entry = absolutePathMappings_1[_i];
2734
- var starMatch = entry.pattern === requestedModule ? "" : matchStar(entry.pattern, requestedModule);
2735
- if (starMatch !== void 0) {
2736
- var _loop_1 = function(physicalPathPattern2) {
2737
- var physicalPath = physicalPathPattern2.replace("*", starMatch);
2738
- pathsToTry.push({type: "file", path: physicalPath});
2739
- pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
2740
- return {type: "extension", path: physicalPath + e};
2741
- }));
2742
- pathsToTry.push({
2743
- type: "package",
2744
- path: path.join(physicalPath, "/package.json")
2745
- });
2746
- var indexPath = path.join(physicalPath, "/index");
2747
- pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
2748
- return {type: "index", path: indexPath + e};
2749
- }));
2750
- };
2751
- for (var _a = 0, _b = entry.paths; _a < _b.length; _a++) {
2752
- var physicalPathPattern = _b[_a];
2753
- _loop_1(physicalPathPattern);
2754
- }
2755
- }
2756
- }
2757
- return pathsToTry.length === 0 ? void 0 : pathsToTry;
2758
- }
2759
- exports.getPathsToTry = getPathsToTry;
2760
- function getStrippedPath(tryPath) {
2761
- return tryPath.type === "index" ? (0, path_1.dirname)(tryPath.path) : tryPath.type === "file" ? tryPath.path : tryPath.type === "extension" ? (0, filesystem_1.removeExtension)(tryPath.path) : tryPath.type === "package" ? tryPath.path : exhaustiveTypeException(tryPath.type);
2762
- }
2763
- exports.getStrippedPath = getStrippedPath;
2764
- function exhaustiveTypeException(check) {
2765
- throw new Error("Unknown type ".concat(check));
2766
- }
2767
- exports.exhaustiveTypeException = exhaustiveTypeException;
2768
- function matchStar(pattern, search) {
2769
- if (search.length < pattern.length) {
2770
- return void 0;
2771
- }
2772
- if (pattern === "*") {
2773
- return search;
2774
- }
2775
- var star = pattern.indexOf("*");
2776
- if (star === -1) {
2777
- return void 0;
2778
- }
2779
- var part1 = pattern.substring(0, star);
2780
- var part2 = pattern.substring(star + 1);
2781
- if (search.substr(0, star) !== part1) {
2782
- return void 0;
2783
- }
2784
- if (search.substr(search.length - part2.length) !== part2) {
2785
- return void 0;
2786
- }
2787
- return search.substr(star, search.length - part2.length);
2788
- }
2789
- });
2790
-
2791
- // node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/match-path-sync.js
2792
- var require_match_path_sync = __commonJS((exports) => {
2793
- "use strict";
2794
- Object.defineProperty(exports, "__esModule", {value: true});
2795
- exports.matchFromAbsolutePaths = exports.createMatchPath = void 0;
2796
- var path = require("path");
2797
- var Filesystem = require_filesystem();
2798
- var MappingEntry = require_mapping_entry();
2799
- var TryPath = require_try_path();
2800
- function createMatchPath2(absoluteBaseUrl, paths, mainFields, addMatchAll) {
2801
- if (mainFields === void 0) {
2802
- mainFields = ["main"];
2803
- }
2804
- if (addMatchAll === void 0) {
2805
- addMatchAll = true;
2806
- }
2807
- var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll);
2808
- return function(requestedModule, readJson, fileExists, extensions) {
2809
- return matchFromAbsolutePaths(absolutePaths, requestedModule, readJson, fileExists, extensions, mainFields);
2810
- };
2811
- }
2812
- exports.createMatchPath = createMatchPath2;
2813
- function matchFromAbsolutePaths(absolutePathMappings, requestedModule, readJson, fileExists, extensions, mainFields) {
2814
- if (readJson === void 0) {
2815
- readJson = Filesystem.readJsonFromDiskSync;
2816
- }
2817
- if (fileExists === void 0) {
2818
- fileExists = Filesystem.fileExistsSync;
2819
- }
2820
- if (extensions === void 0) {
2821
- extensions = Object.keys(require.extensions);
2822
- }
2823
- if (mainFields === void 0) {
2824
- mainFields = ["main"];
2825
- }
2826
- var tryPaths = TryPath.getPathsToTry(extensions, absolutePathMappings, requestedModule);
2827
- if (!tryPaths) {
2828
- return void 0;
2829
- }
2830
- return findFirstExistingPath(tryPaths, readJson, fileExists, mainFields);
2831
- }
2832
- exports.matchFromAbsolutePaths = matchFromAbsolutePaths;
2833
- function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExists) {
2834
- for (var index = 0; index < mainFields.length; index++) {
2835
- var mainFieldSelector = mainFields[index];
2836
- var candidateMapping = typeof mainFieldSelector === "string" ? packageJson[mainFieldSelector] : mainFieldSelector.reduce(function(obj, key) {
2837
- return obj[key];
2838
- }, packageJson);
2839
- if (candidateMapping && typeof candidateMapping === "string") {
2840
- var candidateFilePath = path.join(path.dirname(packageJsonPath), candidateMapping);
2841
- if (fileExists(candidateFilePath)) {
2842
- return candidateFilePath;
2843
- }
2844
- }
2845
- }
2846
- return void 0;
2847
- }
2848
- function findFirstExistingPath(tryPaths, readJson, fileExists, mainFields) {
2849
- if (readJson === void 0) {
2850
- readJson = Filesystem.readJsonFromDiskSync;
2851
- }
2852
- if (mainFields === void 0) {
2853
- mainFields = ["main"];
2854
- }
2855
- for (var _i = 0, tryPaths_1 = tryPaths; _i < tryPaths_1.length; _i++) {
2856
- var tryPath = tryPaths_1[_i];
2857
- if (tryPath.type === "file" || tryPath.type === "extension" || tryPath.type === "index") {
2858
- if (fileExists(tryPath.path)) {
2859
- return TryPath.getStrippedPath(tryPath);
2860
- }
2861
- } else if (tryPath.type === "package") {
2862
- var packageJson = readJson(tryPath.path);
2863
- if (packageJson) {
2864
- var mainFieldMappedFile = findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists);
2865
- if (mainFieldMappedFile) {
2866
- return mainFieldMappedFile;
2867
- }
2868
- }
2869
- } else {
2870
- TryPath.exhaustiveTypeException(tryPath.type);
2871
- }
2872
- }
2873
- return void 0;
2874
- }
2875
- });
2876
-
2877
- // node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/match-path-async.js
2878
- var require_match_path_async = __commonJS((exports) => {
2879
- "use strict";
2880
- Object.defineProperty(exports, "__esModule", {value: true});
2881
- exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = void 0;
2882
- var path = require("path");
2883
- var TryPath = require_try_path();
2884
- var MappingEntry = require_mapping_entry();
2885
- var Filesystem = require_filesystem();
2886
- function createMatchPathAsync(absoluteBaseUrl, paths, mainFields, addMatchAll) {
2887
- if (mainFields === void 0) {
2888
- mainFields = ["main"];
2889
- }
2890
- if (addMatchAll === void 0) {
2891
- addMatchAll = true;
2892
- }
2893
- var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll);
2894
- return function(requestedModule, readJson, fileExists, extensions, callback) {
2895
- return matchFromAbsolutePathsAsync(absolutePaths, requestedModule, readJson, fileExists, extensions, callback, mainFields);
2896
- };
2897
- }
2898
- exports.createMatchPathAsync = createMatchPathAsync;
2899
- function matchFromAbsolutePathsAsync(absolutePathMappings, requestedModule, readJson, fileExists, extensions, callback, mainFields) {
2900
- if (readJson === void 0) {
2901
- readJson = Filesystem.readJsonFromDiskAsync;
2902
- }
2903
- if (fileExists === void 0) {
2904
- fileExists = Filesystem.fileExistsAsync;
2905
- }
2906
- if (extensions === void 0) {
2907
- extensions = Object.keys(require.extensions);
2908
- }
2909
- if (mainFields === void 0) {
2910
- mainFields = ["main"];
2911
- }
2912
- var tryPaths = TryPath.getPathsToTry(extensions, absolutePathMappings, requestedModule);
2913
- if (!tryPaths) {
2914
- return callback();
2915
- }
2916
- findFirstExistingPath(tryPaths, readJson, fileExists, callback, 0, mainFields);
2917
- }
2918
- exports.matchFromAbsolutePathsAsync = matchFromAbsolutePathsAsync;
2919
- function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index) {
2920
- if (index === void 0) {
2921
- index = 0;
2922
- }
2923
- if (index >= mainFields.length) {
2924
- return doneCallback(void 0, void 0);
2925
- }
2926
- var tryNext = function() {
2927
- return findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index + 1);
2928
- };
2929
- var mainFieldSelector = mainFields[index];
2930
- var mainFieldMapping = typeof mainFieldSelector === "string" ? packageJson[mainFieldSelector] : mainFieldSelector.reduce(function(obj, key) {
2931
- return obj[key];
2932
- }, packageJson);
2933
- if (typeof mainFieldMapping !== "string") {
2934
- return tryNext();
2935
- }
2936
- var mappedFilePath = path.join(path.dirname(packageJsonPath), mainFieldMapping);
2937
- fileExistsAsync(mappedFilePath, function(err, exists) {
2938
- if (err) {
2939
- return doneCallback(err);
2940
- }
2941
- if (exists) {
2942
- return doneCallback(void 0, mappedFilePath);
2943
- }
2944
- return tryNext();
2945
- });
2946
- }
2947
- function findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index, mainFields) {
2948
- if (index === void 0) {
2949
- index = 0;
2950
- }
2951
- if (mainFields === void 0) {
2952
- mainFields = ["main"];
2953
- }
2954
- var tryPath = tryPaths[index];
2955
- if (tryPath.type === "file" || tryPath.type === "extension" || tryPath.type === "index") {
2956
- fileExists(tryPath.path, function(err, exists) {
2957
- if (err) {
2958
- return doneCallback(err);
2959
- }
2960
- if (exists) {
2961
- return doneCallback(void 0, TryPath.getStrippedPath(tryPath));
2962
- }
2963
- if (index === tryPaths.length - 1) {
2964
- return doneCallback();
2965
- }
2966
- return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields);
2967
- });
2968
- } else if (tryPath.type === "package") {
2969
- readJson(tryPath.path, function(err, packageJson) {
2970
- if (err) {
2971
- return doneCallback(err);
2972
- }
2973
- if (packageJson) {
2974
- return findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists, function(mainFieldErr, mainFieldMappedFile) {
2975
- if (mainFieldErr) {
2976
- return doneCallback(mainFieldErr);
2977
- }
2978
- if (mainFieldMappedFile) {
2979
- return doneCallback(void 0, mainFieldMappedFile);
2980
- }
2981
- return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields);
2982
- });
2983
- }
2984
- return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields);
2985
- });
2986
- } else {
2987
- TryPath.exhaustiveTypeException(tryPath.type);
2988
- }
2989
- }
2990
- });
2991
-
2992
- // node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/unicode.js
2993
- var require_unicode = __commonJS((exports, module2) => {
2994
- module2.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
2995
- module2.exports.ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
2996
- module2.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
2997
- });
2998
-
2999
- // node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/util.js
3000
- var require_util2 = __commonJS((exports, module2) => {
3001
- var unicode = require_unicode();
3002
- module2.exports = {
3003
- isSpaceSeparator(c) {
3004
- return typeof c === "string" && unicode.Space_Separator.test(c);
3005
- },
3006
- isIdStartChar(c) {
3007
- return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "$" || c === "_" || unicode.ID_Start.test(c));
3008
- },
3009
- isIdContinueChar(c) {
3010
- return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "$" || c === "_" || c === "\u200C" || c === "\u200D" || unicode.ID_Continue.test(c));
3011
- },
3012
- isDigit(c) {
3013
- return typeof c === "string" && /[0-9]/.test(c);
3014
- },
3015
- isHexDigit(c) {
3016
- return typeof c === "string" && /[0-9A-Fa-f]/.test(c);
3017
- }
3018
- };
3019
- });
3020
-
3021
- // node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/parse.js
3022
- var require_parse = __commonJS((exports, module2) => {
3023
- var util = require_util2();
3024
- var source;
3025
- var parseState;
3026
- var stack;
3027
- var pos;
3028
- var line;
3029
- var column;
3030
- var token;
3031
- var key;
3032
- var root;
3033
- module2.exports = function parse(text, reviver) {
3034
- source = String(text);
3035
- parseState = "start";
3036
- stack = [];
3037
- pos = 0;
3038
- line = 1;
3039
- column = 0;
3040
- token = void 0;
3041
- key = void 0;
3042
- root = void 0;
3043
- do {
3044
- token = lex();
3045
- parseStates[parseState]();
3046
- } while (token.type !== "eof");
3047
- if (typeof reviver === "function") {
3048
- return internalize({"": root}, "", reviver);
3049
- }
3050
- return root;
3051
- };
3052
- function internalize(holder, name, reviver) {
3053
- const value = holder[name];
3054
- if (value != null && typeof value === "object") {
3055
- if (Array.isArray(value)) {
3056
- for (let i = 0; i < value.length; i++) {
3057
- const key2 = String(i);
3058
- const replacement = internalize(value, key2, reviver);
3059
- if (replacement === void 0) {
3060
- delete value[key2];
3061
- } else {
3062
- Object.defineProperty(value, key2, {
3063
- value: replacement,
3064
- writable: true,
3065
- enumerable: true,
3066
- configurable: true
3067
- });
3068
- }
3069
- }
3070
- } else {
3071
- for (const key2 in value) {
3072
- const replacement = internalize(value, key2, reviver);
3073
- if (replacement === void 0) {
3074
- delete value[key2];
3075
- } else {
3076
- Object.defineProperty(value, key2, {
3077
- value: replacement,
3078
- writable: true,
3079
- enumerable: true,
3080
- configurable: true
3081
- });
3082
- }
3083
- }
3084
- }
3085
- }
3086
- return reviver.call(holder, name, value);
3087
- }
3088
- var lexState;
3089
- var buffer;
3090
- var doubleQuote;
3091
- var sign;
3092
- var c;
3093
- function lex() {
3094
- lexState = "default";
3095
- buffer = "";
3096
- doubleQuote = false;
3097
- sign = 1;
3098
- for (; ; ) {
3099
- c = peek();
3100
- const token2 = lexStates[lexState]();
3101
- if (token2) {
3102
- return token2;
3103
- }
3104
- }
3105
- }
3106
- function peek() {
3107
- if (source[pos]) {
3108
- return String.fromCodePoint(source.codePointAt(pos));
3109
- }
3110
- }
3111
- function read() {
3112
- const c2 = peek();
3113
- if (c2 === "\n") {
3114
- line++;
3115
- column = 0;
3116
- } else if (c2) {
3117
- column += c2.length;
3118
- } else {
3119
- column++;
3120
- }
3121
- if (c2) {
3122
- pos += c2.length;
3123
- }
3124
- return c2;
3125
- }
3126
- var lexStates = {
3127
- default() {
3128
- switch (c) {
3129
- case " ":
3130
- case "\v":
3131
- case "\f":
3132
- case " ":
3133
- case "\xA0":
3134
- case "\uFEFF":
3135
- case "\n":
3136
- case "\r":
3137
- case "\u2028":
3138
- case "\u2029":
3139
- read();
3140
- return;
3141
- case "/":
3142
- read();
3143
- lexState = "comment";
3144
- return;
3145
- case void 0:
3146
- read();
3147
- return newToken("eof");
3148
- }
3149
- if (util.isSpaceSeparator(c)) {
3150
- read();
3151
- return;
3152
- }
3153
- return lexStates[parseState]();
3154
- },
3155
- comment() {
3156
- switch (c) {
3157
- case "*":
3158
- read();
3159
- lexState = "multiLineComment";
3160
- return;
3161
- case "/":
3162
- read();
3163
- lexState = "singleLineComment";
3164
- return;
3165
- }
3166
- throw invalidChar(read());
3167
- },
3168
- multiLineComment() {
3169
- switch (c) {
3170
- case "*":
3171
- read();
3172
- lexState = "multiLineCommentAsterisk";
3173
- return;
3174
- case void 0:
3175
- throw invalidChar(read());
3176
- }
3177
- read();
3178
- },
3179
- multiLineCommentAsterisk() {
3180
- switch (c) {
3181
- case "*":
3182
- read();
3183
- return;
3184
- case "/":
3185
- read();
3186
- lexState = "default";
3187
- return;
3188
- case void 0:
3189
- throw invalidChar(read());
3190
- }
3191
- read();
3192
- lexState = "multiLineComment";
3193
- },
3194
- singleLineComment() {
3195
- switch (c) {
3196
- case "\n":
3197
- case "\r":
3198
- case "\u2028":
3199
- case "\u2029":
3200
- read();
3201
- lexState = "default";
3202
- return;
3203
- case void 0:
3204
- read();
3205
- return newToken("eof");
3206
- }
3207
- read();
3208
- },
3209
- value() {
3210
- switch (c) {
3211
- case "{":
3212
- case "[":
3213
- return newToken("punctuator", read());
3214
- case "n":
3215
- read();
3216
- literal("ull");
3217
- return newToken("null", null);
3218
- case "t":
3219
- read();
3220
- literal("rue");
3221
- return newToken("boolean", true);
3222
- case "f":
3223
- read();
3224
- literal("alse");
3225
- return newToken("boolean", false);
3226
- case "-":
3227
- case "+":
3228
- if (read() === "-") {
3229
- sign = -1;
3230
- }
3231
- lexState = "sign";
3232
- return;
3233
- case ".":
3234
- buffer = read();
3235
- lexState = "decimalPointLeading";
3236
- return;
3237
- case "0":
3238
- buffer = read();
3239
- lexState = "zero";
3240
- return;
3241
- case "1":
3242
- case "2":
3243
- case "3":
3244
- case "4":
3245
- case "5":
3246
- case "6":
3247
- case "7":
3248
- case "8":
3249
- case "9":
3250
- buffer = read();
3251
- lexState = "decimalInteger";
3252
- return;
3253
- case "I":
3254
- read();
3255
- literal("nfinity");
3256
- return newToken("numeric", Infinity);
3257
- case "N":
3258
- read();
3259
- literal("aN");
3260
- return newToken("numeric", NaN);
3261
- case '"':
3262
- case "'":
3263
- doubleQuote = read() === '"';
3264
- buffer = "";
3265
- lexState = "string";
3266
- return;
3267
- }
3268
- throw invalidChar(read());
3269
- },
3270
- identifierNameStartEscape() {
3271
- if (c !== "u") {
3272
- throw invalidChar(read());
3273
- }
3274
- read();
3275
- const u = unicodeEscape();
3276
- switch (u) {
3277
- case "$":
3278
- case "_":
3279
- break;
3280
- default:
3281
- if (!util.isIdStartChar(u)) {
3282
- throw invalidIdentifier();
3283
- }
3284
- break;
3285
- }
3286
- buffer += u;
3287
- lexState = "identifierName";
3288
- },
3289
- identifierName() {
3290
- switch (c) {
3291
- case "$":
3292
- case "_":
3293
- case "\u200C":
3294
- case "\u200D":
3295
- buffer += read();
3296
- return;
3297
- case "\\":
3298
- read();
3299
- lexState = "identifierNameEscape";
3300
- return;
3301
- }
3302
- if (util.isIdContinueChar(c)) {
3303
- buffer += read();
3304
- return;
3305
- }
3306
- return newToken("identifier", buffer);
3307
- },
3308
- identifierNameEscape() {
3309
- if (c !== "u") {
3310
- throw invalidChar(read());
3311
- }
3312
- read();
3313
- const u = unicodeEscape();
3314
- switch (u) {
3315
- case "$":
3316
- case "_":
3317
- case "\u200C":
3318
- case "\u200D":
3319
- break;
3320
- default:
3321
- if (!util.isIdContinueChar(u)) {
3322
- throw invalidIdentifier();
3323
- }
3324
- break;
3325
- }
3326
- buffer += u;
3327
- lexState = "identifierName";
3328
- },
3329
- sign() {
3330
- switch (c) {
3331
- case ".":
3332
- buffer = read();
3333
- lexState = "decimalPointLeading";
3334
- return;
3335
- case "0":
3336
- buffer = read();
3337
- lexState = "zero";
3338
- return;
3339
- case "1":
3340
- case "2":
3341
- case "3":
3342
- case "4":
3343
- case "5":
3344
- case "6":
3345
- case "7":
3346
- case "8":
3347
- case "9":
3348
- buffer = read();
3349
- lexState = "decimalInteger";
3350
- return;
3351
- case "I":
3352
- read();
3353
- literal("nfinity");
3354
- return newToken("numeric", sign * Infinity);
3355
- case "N":
3356
- read();
3357
- literal("aN");
3358
- return newToken("numeric", NaN);
3359
- }
3360
- throw invalidChar(read());
3361
- },
3362
- zero() {
3363
- switch (c) {
3364
- case ".":
3365
- buffer += read();
3366
- lexState = "decimalPoint";
3367
- return;
3368
- case "e":
3369
- case "E":
3370
- buffer += read();
3371
- lexState = "decimalExponent";
3372
- return;
3373
- case "x":
3374
- case "X":
3375
- buffer += read();
3376
- lexState = "hexadecimal";
3377
- return;
3378
- }
3379
- return newToken("numeric", sign * 0);
3380
- },
3381
- decimalInteger() {
3382
- switch (c) {
3383
- case ".":
3384
- buffer += read();
3385
- lexState = "decimalPoint";
3386
- return;
3387
- case "e":
3388
- case "E":
3389
- buffer += read();
3390
- lexState = "decimalExponent";
3391
- return;
3392
- }
3393
- if (util.isDigit(c)) {
3394
- buffer += read();
3395
- return;
3396
- }
3397
- return newToken("numeric", sign * Number(buffer));
3398
- },
3399
- decimalPointLeading() {
3400
- if (util.isDigit(c)) {
3401
- buffer += read();
3402
- lexState = "decimalFraction";
3403
- return;
3404
- }
3405
- throw invalidChar(read());
3406
- },
3407
- decimalPoint() {
3408
- switch (c) {
3409
- case "e":
3410
- case "E":
3411
- buffer += read();
3412
- lexState = "decimalExponent";
3413
- return;
3414
- }
3415
- if (util.isDigit(c)) {
3416
- buffer += read();
3417
- lexState = "decimalFraction";
3418
- return;
3419
- }
3420
- return newToken("numeric", sign * Number(buffer));
3421
- },
3422
- decimalFraction() {
3423
- switch (c) {
3424
- case "e":
3425
- case "E":
3426
- buffer += read();
3427
- lexState = "decimalExponent";
3428
- return;
3429
- }
3430
- if (util.isDigit(c)) {
3431
- buffer += read();
3432
- return;
3433
- }
3434
- return newToken("numeric", sign * Number(buffer));
3435
- },
3436
- decimalExponent() {
3437
- switch (c) {
3438
- case "+":
3439
- case "-":
3440
- buffer += read();
3441
- lexState = "decimalExponentSign";
3442
- return;
3443
- }
3444
- if (util.isDigit(c)) {
3445
- buffer += read();
3446
- lexState = "decimalExponentInteger";
3447
- return;
3448
- }
3449
- throw invalidChar(read());
3450
- },
3451
- decimalExponentSign() {
3452
- if (util.isDigit(c)) {
3453
- buffer += read();
3454
- lexState = "decimalExponentInteger";
3455
- return;
3456
- }
3457
- throw invalidChar(read());
3458
- },
3459
- decimalExponentInteger() {
3460
- if (util.isDigit(c)) {
3461
- buffer += read();
3462
- return;
3463
- }
3464
- return newToken("numeric", sign * Number(buffer));
3465
- },
3466
- hexadecimal() {
3467
- if (util.isHexDigit(c)) {
3468
- buffer += read();
3469
- lexState = "hexadecimalInteger";
3470
- return;
3471
- }
3472
- throw invalidChar(read());
3473
- },
3474
- hexadecimalInteger() {
3475
- if (util.isHexDigit(c)) {
3476
- buffer += read();
3477
- return;
3478
- }
3479
- return newToken("numeric", sign * Number(buffer));
3480
- },
3481
- string() {
3482
- switch (c) {
3483
- case "\\":
3484
- read();
3485
- buffer += escape();
3486
- return;
3487
- case '"':
3488
- if (doubleQuote) {
3489
- read();
3490
- return newToken("string", buffer);
3491
- }
3492
- buffer += read();
3493
- return;
3494
- case "'":
3495
- if (!doubleQuote) {
3496
- read();
3497
- return newToken("string", buffer);
3498
- }
3499
- buffer += read();
3500
- return;
3501
- case "\n":
3502
- case "\r":
3503
- throw invalidChar(read());
3504
- case "\u2028":
3505
- case "\u2029":
3506
- separatorChar(c);
3507
- break;
3508
- case void 0:
3509
- throw invalidChar(read());
3510
- }
3511
- buffer += read();
3512
- },
3513
- start() {
3514
- switch (c) {
3515
- case "{":
3516
- case "[":
3517
- return newToken("punctuator", read());
3518
- }
3519
- lexState = "value";
3520
- },
3521
- beforePropertyName() {
3522
- switch (c) {
3523
- case "$":
3524
- case "_":
3525
- buffer = read();
3526
- lexState = "identifierName";
3527
- return;
3528
- case "\\":
3529
- read();
3530
- lexState = "identifierNameStartEscape";
3531
- return;
3532
- case "}":
3533
- return newToken("punctuator", read());
3534
- case '"':
3535
- case "'":
3536
- doubleQuote = read() === '"';
3537
- lexState = "string";
3538
- return;
3539
- }
3540
- if (util.isIdStartChar(c)) {
3541
- buffer += read();
3542
- lexState = "identifierName";
3543
- return;
3544
- }
3545
- throw invalidChar(read());
3546
- },
3547
- afterPropertyName() {
3548
- if (c === ":") {
3549
- return newToken("punctuator", read());
3550
- }
3551
- throw invalidChar(read());
3552
- },
3553
- beforePropertyValue() {
3554
- lexState = "value";
3555
- },
3556
- afterPropertyValue() {
3557
- switch (c) {
3558
- case ",":
3559
- case "}":
3560
- return newToken("punctuator", read());
3561
- }
3562
- throw invalidChar(read());
3563
- },
3564
- beforeArrayValue() {
3565
- if (c === "]") {
3566
- return newToken("punctuator", read());
3567
- }
3568
- lexState = "value";
3569
- },
3570
- afterArrayValue() {
3571
- switch (c) {
3572
- case ",":
3573
- case "]":
3574
- return newToken("punctuator", read());
3575
- }
3576
- throw invalidChar(read());
3577
- },
3578
- end() {
3579
- throw invalidChar(read());
3580
- }
3581
- };
3582
- function newToken(type, value) {
3583
- return {
3584
- type,
3585
- value,
3586
- line,
3587
- column
3588
- };
3589
- }
3590
- function literal(s) {
3591
- for (const c2 of s) {
3592
- const p = peek();
3593
- if (p !== c2) {
3594
- throw invalidChar(read());
3595
- }
3596
- read();
3597
- }
3598
- }
3599
- function escape() {
3600
- const c2 = peek();
3601
- switch (c2) {
3602
- case "b":
3603
- read();
3604
- return "\b";
3605
- case "f":
3606
- read();
3607
- return "\f";
3608
- case "n":
3609
- read();
3610
- return "\n";
3611
- case "r":
3612
- read();
3613
- return "\r";
3614
- case "t":
3615
- read();
3616
- return " ";
3617
- case "v":
3618
- read();
3619
- return "\v";
3620
- case "0":
3621
- read();
3622
- if (util.isDigit(peek())) {
3623
- throw invalidChar(read());
3624
- }
3625
- return "\0";
3626
- case "x":
3627
- read();
3628
- return hexEscape();
3629
- case "u":
3630
- read();
3631
- return unicodeEscape();
3632
- case "\n":
3633
- case "\u2028":
3634
- case "\u2029":
3635
- read();
3636
- return "";
3637
- case "\r":
3638
- read();
3639
- if (peek() === "\n") {
3640
- read();
3641
- }
3642
- return "";
3643
- case "1":
3644
- case "2":
3645
- case "3":
3646
- case "4":
3647
- case "5":
3648
- case "6":
3649
- case "7":
3650
- case "8":
3651
- case "9":
3652
- throw invalidChar(read());
3653
- case void 0:
3654
- throw invalidChar(read());
3655
- }
3656
- return read();
3657
- }
3658
- function hexEscape() {
3659
- let buffer2 = "";
3660
- let c2 = peek();
3661
- if (!util.isHexDigit(c2)) {
3662
- throw invalidChar(read());
3663
- }
3664
- buffer2 += read();
3665
- c2 = peek();
3666
- if (!util.isHexDigit(c2)) {
3667
- throw invalidChar(read());
3668
- }
3669
- buffer2 += read();
3670
- return String.fromCodePoint(parseInt(buffer2, 16));
3671
- }
3672
- function unicodeEscape() {
3673
- let buffer2 = "";
3674
- let count = 4;
3675
- while (count-- > 0) {
3676
- const c2 = peek();
3677
- if (!util.isHexDigit(c2)) {
3678
- throw invalidChar(read());
3679
- }
3680
- buffer2 += read();
3681
- }
3682
- return String.fromCodePoint(parseInt(buffer2, 16));
3683
- }
3684
- var parseStates = {
3685
- start() {
3686
- if (token.type === "eof") {
3687
- throw invalidEOF();
3688
- }
3689
- push();
3690
- },
3691
- beforePropertyName() {
3692
- switch (token.type) {
3693
- case "identifier":
3694
- case "string":
3695
- key = token.value;
3696
- parseState = "afterPropertyName";
3697
- return;
3698
- case "punctuator":
3699
- pop();
3700
- return;
3701
- case "eof":
3702
- throw invalidEOF();
3703
- }
3704
- },
3705
- afterPropertyName() {
3706
- if (token.type === "eof") {
3707
- throw invalidEOF();
3708
- }
3709
- parseState = "beforePropertyValue";
3710
- },
3711
- beforePropertyValue() {
3712
- if (token.type === "eof") {
3713
- throw invalidEOF();
3714
- }
3715
- push();
3716
- },
3717
- beforeArrayValue() {
3718
- if (token.type === "eof") {
3719
- throw invalidEOF();
3720
- }
3721
- if (token.type === "punctuator" && token.value === "]") {
3722
- pop();
3723
- return;
3724
- }
3725
- push();
3726
- },
3727
- afterPropertyValue() {
3728
- if (token.type === "eof") {
3729
- throw invalidEOF();
3730
- }
3731
- switch (token.value) {
3732
- case ",":
3733
- parseState = "beforePropertyName";
3734
- return;
3735
- case "}":
3736
- pop();
3737
- }
3738
- },
3739
- afterArrayValue() {
3740
- if (token.type === "eof") {
3741
- throw invalidEOF();
3742
- }
3743
- switch (token.value) {
3744
- case ",":
3745
- parseState = "beforeArrayValue";
3746
- return;
3747
- case "]":
3748
- pop();
3749
- }
3750
- },
3751
- end() {
3752
- }
3753
- };
3754
- function push() {
3755
- let value;
3756
- switch (token.type) {
3757
- case "punctuator":
3758
- switch (token.value) {
3759
- case "{":
3760
- value = {};
3761
- break;
3762
- case "[":
3763
- value = [];
3764
- break;
3765
- }
3766
- break;
3767
- case "null":
3768
- case "boolean":
3769
- case "numeric":
3770
- case "string":
3771
- value = token.value;
3772
- break;
3773
- }
3774
- if (root === void 0) {
3775
- root = value;
3776
- } else {
3777
- const parent = stack[stack.length - 1];
3778
- if (Array.isArray(parent)) {
3779
- parent.push(value);
3780
- } else {
3781
- Object.defineProperty(parent, key, {
3782
- value,
3783
- writable: true,
3784
- enumerable: true,
3785
- configurable: true
3786
- });
3787
- }
3788
- }
3789
- if (value !== null && typeof value === "object") {
3790
- stack.push(value);
3791
- if (Array.isArray(value)) {
3792
- parseState = "beforeArrayValue";
3793
- } else {
3794
- parseState = "beforePropertyName";
3795
- }
3796
- } else {
3797
- const current = stack[stack.length - 1];
3798
- if (current == null) {
3799
- parseState = "end";
3800
- } else if (Array.isArray(current)) {
3801
- parseState = "afterArrayValue";
3802
- } else {
3803
- parseState = "afterPropertyValue";
3804
- }
3805
- }
3806
- }
3807
- function pop() {
3808
- stack.pop();
3809
- const current = stack[stack.length - 1];
3810
- if (current == null) {
3811
- parseState = "end";
3812
- } else if (Array.isArray(current)) {
3813
- parseState = "afterArrayValue";
3814
- } else {
3815
- parseState = "afterPropertyValue";
3816
- }
3817
- }
3818
- function invalidChar(c2) {
3819
- if (c2 === void 0) {
3820
- return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
3821
- }
3822
- return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
3823
- }
3824
- function invalidEOF() {
3825
- return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
3826
- }
3827
- function invalidIdentifier() {
3828
- column -= 5;
3829
- return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`);
3830
- }
3831
- function separatorChar(c2) {
3832
- console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
3833
- }
3834
- function formatChar(c2) {
3835
- const replacements = {
3836
- "'": "\\'",
3837
- '"': '\\"',
3838
- "\\": "\\\\",
3839
- "\b": "\\b",
3840
- "\f": "\\f",
3841
- "\n": "\\n",
3842
- "\r": "\\r",
3843
- " ": "\\t",
3844
- "\v": "\\v",
3845
- "\0": "\\0",
3846
- "\u2028": "\\u2028",
3847
- "\u2029": "\\u2029"
3848
- };
3849
- if (replacements[c2]) {
3850
- return replacements[c2];
3851
- }
3852
- if (c2 < " ") {
3853
- const hexString = c2.charCodeAt(0).toString(16);
3854
- return "\\x" + ("00" + hexString).substring(hexString.length);
3855
- }
3856
- return c2;
3857
- }
3858
- function syntaxError(message) {
3859
- const err = new SyntaxError(message);
3860
- err.lineNumber = line;
3861
- err.columnNumber = column;
3862
- return err;
3863
- }
3864
- });
3865
-
3866
- // node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/stringify.js
3867
- var require_stringify = __commonJS((exports, module2) => {
3868
- var util = require_util2();
3869
- module2.exports = function stringify(value, replacer, space) {
3870
- const stack = [];
3871
- let indent = "";
3872
- let propertyList;
3873
- let replacerFunc;
3874
- let gap = "";
3875
- let quote;
3876
- if (replacer != null && typeof replacer === "object" && !Array.isArray(replacer)) {
3877
- space = replacer.space;
3878
- quote = replacer.quote;
3879
- replacer = replacer.replacer;
3880
- }
3881
- if (typeof replacer === "function") {
3882
- replacerFunc = replacer;
3883
- } else if (Array.isArray(replacer)) {
3884
- propertyList = [];
3885
- for (const v of replacer) {
3886
- let item;
3887
- if (typeof v === "string") {
3888
- item = v;
3889
- } else if (typeof v === "number" || v instanceof String || v instanceof Number) {
3890
- item = String(v);
3891
- }
3892
- if (item !== void 0 && propertyList.indexOf(item) < 0) {
3893
- propertyList.push(item);
3894
- }
3895
- }
3896
- }
3897
- if (space instanceof Number) {
3898
- space = Number(space);
3899
- } else if (space instanceof String) {
3900
- space = String(space);
3901
- }
3902
- if (typeof space === "number") {
3903
- if (space > 0) {
3904
- space = Math.min(10, Math.floor(space));
3905
- gap = " ".substr(0, space);
3906
- }
3907
- } else if (typeof space === "string") {
3908
- gap = space.substr(0, 10);
3909
- }
3910
- return serializeProperty("", {"": value});
3911
- function serializeProperty(key, holder) {
3912
- let value2 = holder[key];
3913
- if (value2 != null) {
3914
- if (typeof value2.toJSON5 === "function") {
3915
- value2 = value2.toJSON5(key);
3916
- } else if (typeof value2.toJSON === "function") {
3917
- value2 = value2.toJSON(key);
3918
- }
3919
- }
3920
- if (replacerFunc) {
3921
- value2 = replacerFunc.call(holder, key, value2);
3922
- }
3923
- if (value2 instanceof Number) {
3924
- value2 = Number(value2);
3925
- } else if (value2 instanceof String) {
3926
- value2 = String(value2);
3927
- } else if (value2 instanceof Boolean) {
3928
- value2 = value2.valueOf();
3929
- }
3930
- switch (value2) {
3931
- case null:
3932
- return "null";
3933
- case true:
3934
- return "true";
3935
- case false:
3936
- return "false";
3937
- }
3938
- if (typeof value2 === "string") {
3939
- return quoteString(value2, false);
3940
- }
3941
- if (typeof value2 === "number") {
3942
- return String(value2);
3943
- }
3944
- if (typeof value2 === "object") {
3945
- return Array.isArray(value2) ? serializeArray(value2) : serializeObject(value2);
3946
- }
3947
- return void 0;
3948
- }
3949
- function quoteString(value2) {
3950
- const quotes = {
3951
- "'": 0.1,
3952
- '"': 0.2
3953
- };
3954
- const replacements = {
3955
- "'": "\\'",
3956
- '"': '\\"',
3957
- "\\": "\\\\",
3958
- "\b": "\\b",
3959
- "\f": "\\f",
3960
- "\n": "\\n",
3961
- "\r": "\\r",
3962
- " ": "\\t",
3963
- "\v": "\\v",
3964
- "\0": "\\0",
3965
- "\u2028": "\\u2028",
3966
- "\u2029": "\\u2029"
3967
- };
3968
- let product = "";
3969
- for (let i = 0; i < value2.length; i++) {
3970
- const c = value2[i];
3971
- switch (c) {
3972
- case "'":
3973
- case '"':
3974
- quotes[c]++;
3975
- product += c;
3976
- continue;
3977
- case "\0":
3978
- if (util.isDigit(value2[i + 1])) {
3979
- product += "\\x00";
3980
- continue;
3981
- }
3982
- }
3983
- if (replacements[c]) {
3984
- product += replacements[c];
3985
- continue;
3986
- }
3987
- if (c < " ") {
3988
- let hexString = c.charCodeAt(0).toString(16);
3989
- product += "\\x" + ("00" + hexString).substring(hexString.length);
3990
- continue;
3991
- }
3992
- product += c;
3993
- }
3994
- const quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
3995
- product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]);
3996
- return quoteChar + product + quoteChar;
3997
- }
3998
- function serializeObject(value2) {
3999
- if (stack.indexOf(value2) >= 0) {
4000
- throw TypeError("Converting circular structure to JSON5");
4001
- }
4002
- stack.push(value2);
4003
- let stepback = indent;
4004
- indent = indent + gap;
4005
- let keys = propertyList || Object.keys(value2);
4006
- let partial = [];
4007
- for (const key of keys) {
4008
- const propertyString = serializeProperty(key, value2);
4009
- if (propertyString !== void 0) {
4010
- let member = serializeKey(key) + ":";
4011
- if (gap !== "") {
4012
- member += " ";
4013
- }
4014
- member += propertyString;
4015
- partial.push(member);
4016
- }
4017
- }
4018
- let final;
4019
- if (partial.length === 0) {
4020
- final = "{}";
4021
- } else {
4022
- let properties;
4023
- if (gap === "") {
4024
- properties = partial.join(",");
4025
- final = "{" + properties + "}";
4026
- } else {
4027
- let separator = ",\n" + indent;
4028
- properties = partial.join(separator);
4029
- final = "{\n" + indent + properties + ",\n" + stepback + "}";
4030
- }
4031
- }
4032
- stack.pop();
4033
- indent = stepback;
4034
- return final;
4035
- }
4036
- function serializeKey(key) {
4037
- if (key.length === 0) {
4038
- return quoteString(key, true);
4039
- }
4040
- const firstChar = String.fromCodePoint(key.codePointAt(0));
4041
- if (!util.isIdStartChar(firstChar)) {
4042
- return quoteString(key, true);
4043
- }
4044
- for (let i = firstChar.length; i < key.length; i++) {
4045
- if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
4046
- return quoteString(key, true);
4047
- }
4048
- }
4049
- return key;
4050
- }
4051
- function serializeArray(value2) {
4052
- if (stack.indexOf(value2) >= 0) {
4053
- throw TypeError("Converting circular structure to JSON5");
4054
- }
4055
- stack.push(value2);
4056
- let stepback = indent;
4057
- indent = indent + gap;
4058
- let partial = [];
4059
- for (let i = 0; i < value2.length; i++) {
4060
- const propertyString = serializeProperty(String(i), value2);
4061
- partial.push(propertyString !== void 0 ? propertyString : "null");
4062
- }
4063
- let final;
4064
- if (partial.length === 0) {
4065
- final = "[]";
4066
- } else {
4067
- if (gap === "") {
4068
- let properties = partial.join(",");
4069
- final = "[" + properties + "]";
4070
- } else {
4071
- let separator = ",\n" + indent;
4072
- let properties = partial.join(separator);
4073
- final = "[\n" + indent + properties + ",\n" + stepback + "]";
4074
- }
4075
- }
4076
- stack.pop();
4077
- indent = stepback;
4078
- return final;
4079
- }
4080
- };
4081
- });
4082
-
4083
- // node_modules/.pnpm/json5@2.2.3/node_modules/json5/lib/index.js
4084
- var require_lib3 = __commonJS((exports, module2) => {
4085
- var parse = require_parse();
4086
- var stringify = require_stringify();
4087
- var JSON5 = {
4088
- parse,
4089
- stringify
4090
- };
4091
- module2.exports = JSON5;
4092
- });
4093
-
4094
- // node_modules/.pnpm/strip-bom@3.0.0/node_modules/strip-bom/index.js
4095
- var require_strip_bom = __commonJS((exports, module2) => {
4096
- "use strict";
4097
- module2.exports = (x) => {
4098
- if (typeof x !== "string") {
4099
- throw new TypeError("Expected a string, got " + typeof x);
4100
- }
4101
- if (x.charCodeAt(0) === 65279) {
4102
- return x.slice(1);
4103
- }
4104
- return x;
4105
- };
4106
- });
4107
-
4108
- // node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/tsconfig-loader.js
4109
- var require_tsconfig_loader = __commonJS((exports) => {
4110
- "use strict";
4111
- var __assign = exports && exports.__assign || function() {
4112
- __assign = Object.assign || function(t) {
4113
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4114
- s = arguments[i];
4115
- for (var p in s)
4116
- if (Object.prototype.hasOwnProperty.call(s, p))
4117
- t[p] = s[p];
4118
- }
4119
- return t;
4120
- };
4121
- return __assign.apply(this, arguments);
4122
- };
4123
- Object.defineProperty(exports, "__esModule", {value: true});
4124
- exports.loadTsconfig = exports.walkForTsConfig = exports.tsConfigLoader = void 0;
4125
- var path = require("path");
4126
- var fs3 = require("fs");
4127
- var JSON5 = require_lib3();
4128
- var StripBom = require_strip_bom();
4129
- function tsConfigLoader(_a) {
4130
- var getEnv = _a.getEnv, cwd = _a.cwd, _b = _a.loadSync, loadSync = _b === void 0 ? loadSyncDefault : _b;
4131
- var TS_NODE_PROJECT = getEnv("TS_NODE_PROJECT");
4132
- var TS_NODE_BASEURL = getEnv("TS_NODE_BASEURL");
4133
- var loadResult = loadSync(cwd, TS_NODE_PROJECT, TS_NODE_BASEURL);
4134
- return loadResult;
4135
- }
4136
- exports.tsConfigLoader = tsConfigLoader;
4137
- function loadSyncDefault(cwd, filename, baseUrl) {
4138
- var configPath = resolveConfigPath(cwd, filename);
4139
- if (!configPath) {
4140
- return {
4141
- tsConfigPath: void 0,
4142
- baseUrl: void 0,
4143
- paths: void 0
4144
- };
4145
- }
4146
- var config = loadTsconfig(configPath);
4147
- return {
4148
- tsConfigPath: configPath,
4149
- baseUrl: baseUrl || config && config.compilerOptions && config.compilerOptions.baseUrl,
4150
- paths: config && config.compilerOptions && config.compilerOptions.paths
4151
- };
4152
- }
4153
- function resolveConfigPath(cwd, filename) {
4154
- if (filename) {
4155
- var absolutePath = fs3.lstatSync(filename).isDirectory() ? path.resolve(filename, "./tsconfig.json") : path.resolve(cwd, filename);
4156
- return absolutePath;
4157
- }
4158
- if (fs3.statSync(cwd).isFile()) {
4159
- return path.resolve(cwd);
4160
- }
4161
- var configAbsolutePath = walkForTsConfig(cwd);
4162
- return configAbsolutePath ? path.resolve(configAbsolutePath) : void 0;
4163
- }
4164
- function walkForTsConfig(directory, readdirSync) {
4165
- if (readdirSync === void 0) {
4166
- readdirSync = fs3.readdirSync;
4167
- }
4168
- var files = readdirSync(directory);
4169
- var filesToCheck = ["tsconfig.json", "jsconfig.json"];
4170
- for (var _i = 0, filesToCheck_1 = filesToCheck; _i < filesToCheck_1.length; _i++) {
4171
- var fileToCheck = filesToCheck_1[_i];
4172
- if (files.indexOf(fileToCheck) !== -1) {
4173
- return path.join(directory, fileToCheck);
4174
- }
4175
- }
4176
- var parentDirectory = path.dirname(directory);
4177
- if (directory === parentDirectory) {
4178
- return void 0;
4179
- }
4180
- return walkForTsConfig(parentDirectory, readdirSync);
4181
- }
4182
- exports.walkForTsConfig = walkForTsConfig;
4183
- function loadTsconfig(configFilePath, existsSync, readFileSync) {
4184
- if (existsSync === void 0) {
4185
- existsSync = fs3.existsSync;
4186
- }
4187
- if (readFileSync === void 0) {
4188
- readFileSync = function(filename) {
4189
- return fs3.readFileSync(filename, "utf8");
4190
- };
4191
- }
4192
- if (!existsSync(configFilePath)) {
4193
- return void 0;
4194
- }
4195
- var configString = readFileSync(configFilePath);
4196
- var cleanedJson = StripBom(configString);
4197
- var config;
4198
- try {
4199
- config = JSON5.parse(cleanedJson);
4200
- } catch (e) {
4201
- throw new Error("".concat(configFilePath, " is malformed ").concat(e.message));
4202
- }
4203
- var extendedConfig = config.extends;
4204
- if (extendedConfig) {
4205
- var base = void 0;
4206
- if (Array.isArray(extendedConfig)) {
4207
- base = extendedConfig.reduce(function(currBase, extendedConfigElement) {
4208
- return mergeTsconfigs(currBase, loadTsconfigFromExtends(configFilePath, extendedConfigElement, existsSync, readFileSync));
4209
- }, {});
4210
- } else {
4211
- base = loadTsconfigFromExtends(configFilePath, extendedConfig, existsSync, readFileSync);
4212
- }
4213
- return mergeTsconfigs(base, config);
4214
- }
4215
- return config;
4216
- }
4217
- exports.loadTsconfig = loadTsconfig;
4218
- function loadTsconfigFromExtends(configFilePath, extendedConfigValue, existsSync, readFileSync) {
4219
- var _a;
4220
- if (typeof extendedConfigValue === "string" && extendedConfigValue.indexOf(".json") === -1) {
4221
- extendedConfigValue += ".json";
4222
- }
4223
- var currentDir = path.dirname(configFilePath);
4224
- var extendedConfigPath = path.join(currentDir, extendedConfigValue);
4225
- if (extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync(extendedConfigPath)) {
4226
- extendedConfigPath = path.join(currentDir, "node_modules", extendedConfigValue);
4227
- }
4228
- var config = loadTsconfig(extendedConfigPath, existsSync, readFileSync) || {};
4229
- if ((_a = config.compilerOptions) === null || _a === void 0 ? void 0 : _a.baseUrl) {
4230
- var extendsDir = path.dirname(extendedConfigValue);
4231
- config.compilerOptions.baseUrl = path.join(extendsDir, config.compilerOptions.baseUrl);
4232
- }
4233
- return config;
4234
- }
4235
- function mergeTsconfigs(base, config) {
4236
- base = base || {};
4237
- config = config || {};
4238
- return __assign(__assign(__assign({}, base), config), {compilerOptions: __assign(__assign({}, base.compilerOptions), config.compilerOptions)});
4239
- }
4240
- });
4241
-
4242
- // node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/config-loader.js
4243
- var require_config_loader = __commonJS((exports) => {
4244
- "use strict";
4245
- Object.defineProperty(exports, "__esModule", {value: true});
4246
- exports.configLoader = exports.loadConfig = void 0;
4247
- var TsConfigLoader2 = require_tsconfig_loader();
4248
- var path = require("path");
4249
- function loadConfig2(cwd) {
4250
- if (cwd === void 0) {
4251
- cwd = process.cwd();
4252
- }
4253
- return configLoader({cwd});
4254
- }
4255
- exports.loadConfig = loadConfig2;
4256
- function configLoader(_a) {
4257
- var cwd = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
4258
- if (explicitParams) {
4259
- var absoluteBaseUrl = path.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path.join(cwd, explicitParams.baseUrl);
4260
- return {
4261
- resultType: "success",
4262
- configFileAbsolutePath: "",
4263
- baseUrl: explicitParams.baseUrl,
4264
- absoluteBaseUrl,
4265
- paths: explicitParams.paths,
4266
- mainFields: explicitParams.mainFields,
4267
- addMatchAll: explicitParams.addMatchAll
4268
- };
4269
- }
4270
- var loadResult = tsConfigLoader({
4271
- cwd,
4272
- getEnv: function(key) {
4273
- return process.env[key];
4274
- }
4275
- });
4276
- if (!loadResult.tsConfigPath) {
4277
- return {
4278
- resultType: "failed",
4279
- message: "Couldn't find tsconfig.json"
4280
- };
4281
- }
4282
- return {
4283
- resultType: "success",
4284
- configFileAbsolutePath: loadResult.tsConfigPath,
4285
- baseUrl: loadResult.baseUrl,
4286
- absoluteBaseUrl: path.resolve(path.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""),
4287
- paths: loadResult.paths || {},
4288
- addMatchAll: loadResult.baseUrl !== void 0
4289
- };
4290
- }
4291
- exports.configLoader = configLoader;
4292
- });
4293
-
4294
- // node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js
4295
- var require_minimist = __commonJS((exports, module2) => {
4296
- "use strict";
4297
- function hasKey(obj, keys) {
4298
- var o = obj;
4299
- keys.slice(0, -1).forEach(function(key2) {
4300
- o = o[key2] || {};
4301
- });
4302
- var key = keys[keys.length - 1];
4303
- return key in o;
4304
- }
4305
- function isNumber(x) {
4306
- if (typeof x === "number") {
4307
- return true;
4308
- }
4309
- if (/^0x[0-9a-f]+$/i.test(x)) {
4310
- return true;
4311
- }
4312
- return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
4313
- }
4314
- function isConstructorOrProto(obj, key) {
4315
- return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
4316
- }
4317
- module2.exports = function(args, opts) {
4318
- if (!opts) {
4319
- opts = {};
4320
- }
4321
- var flags = {
4322
- bools: {},
4323
- strings: {},
4324
- unknownFn: null
4325
- };
4326
- if (typeof opts.unknown === "function") {
4327
- flags.unknownFn = opts.unknown;
4328
- }
4329
- if (typeof opts.boolean === "boolean" && opts.boolean) {
4330
- flags.allBools = true;
4331
- } else {
4332
- [].concat(opts.boolean).filter(Boolean).forEach(function(key2) {
4333
- flags.bools[key2] = true;
4334
- });
4335
- }
4336
- var aliases = {};
4337
- function aliasIsBoolean(key2) {
4338
- return aliases[key2].some(function(x) {
4339
- return flags.bools[x];
4340
- });
4341
- }
4342
- Object.keys(opts.alias || {}).forEach(function(key2) {
4343
- aliases[key2] = [].concat(opts.alias[key2]);
4344
- aliases[key2].forEach(function(x) {
4345
- aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
4346
- return x !== y;
4347
- }));
4348
- });
4349
- });
4350
- [].concat(opts.string).filter(Boolean).forEach(function(key2) {
4351
- flags.strings[key2] = true;
4352
- if (aliases[key2]) {
4353
- [].concat(aliases[key2]).forEach(function(k) {
4354
- flags.strings[k] = true;
4355
- });
4356
- }
4357
- });
4358
- var defaults = opts.default || {};
4359
- var argv = {_: []};
4360
- function argDefined(key2, arg2) {
4361
- return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
4362
- }
4363
- function setKey(obj, keys, value2) {
4364
- var o = obj;
4365
- for (var i2 = 0; i2 < keys.length - 1; i2++) {
4366
- var key2 = keys[i2];
4367
- if (isConstructorOrProto(o, key2)) {
4368
- return;
4369
- }
4370
- if (o[key2] === void 0) {
4371
- o[key2] = {};
4372
- }
4373
- if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype) {
4374
- o[key2] = {};
4375
- }
4376
- if (o[key2] === Array.prototype) {
4377
- o[key2] = [];
4378
- }
4379
- o = o[key2];
4380
- }
4381
- var lastKey = keys[keys.length - 1];
4382
- if (isConstructorOrProto(o, lastKey)) {
4383
- return;
4384
- }
4385
- if (o === Object.prototype || o === Number.prototype || o === String.prototype) {
4386
- o = {};
4387
- }
4388
- if (o === Array.prototype) {
4389
- o = [];
4390
- }
4391
- if (o[lastKey] === void 0 || flags.bools[lastKey] || typeof o[lastKey] === "boolean") {
4392
- o[lastKey] = value2;
4393
- } else if (Array.isArray(o[lastKey])) {
4394
- o[lastKey].push(value2);
4395
- } else {
4396
- o[lastKey] = [o[lastKey], value2];
4397
- }
4398
- }
4399
- function setArg(key2, val, arg2) {
4400
- if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
4401
- if (flags.unknownFn(arg2) === false) {
4402
- return;
4403
- }
4404
- }
4405
- var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
4406
- setKey(argv, key2.split("."), value2);
4407
- (aliases[key2] || []).forEach(function(x) {
4408
- setKey(argv, x.split("."), value2);
4409
- });
4410
- }
4411
- Object.keys(flags.bools).forEach(function(key2) {
4412
- setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);
4413
- });
4414
- var notFlags = [];
4415
- if (args.indexOf("--") !== -1) {
4416
- notFlags = args.slice(args.indexOf("--") + 1);
4417
- args = args.slice(0, args.indexOf("--"));
4418
- }
4419
- for (var i = 0; i < args.length; i++) {
4420
- var arg = args[i];
4421
- var key;
4422
- var next;
4423
- if (/^--.+=/.test(arg)) {
4424
- var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
4425
- key = m[1];
4426
- var value = m[2];
4427
- if (flags.bools[key]) {
4428
- value = value !== "false";
4429
- }
4430
- setArg(key, value, arg);
4431
- } else if (/^--no-.+/.test(arg)) {
4432
- key = arg.match(/^--no-(.+)/)[1];
4433
- setArg(key, false, arg);
4434
- } else if (/^--.+/.test(arg)) {
4435
- key = arg.match(/^--(.+)/)[1];
4436
- next = args[i + 1];
4437
- if (next !== void 0 && !/^(-|--)[^-]/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
4438
- setArg(key, next, arg);
4439
- i += 1;
4440
- } else if (/^(true|false)$/.test(next)) {
4441
- setArg(key, next === "true", arg);
4442
- i += 1;
4443
- } else {
4444
- setArg(key, flags.strings[key] ? "" : true, arg);
4445
- }
4446
- } else if (/^-[^-]+/.test(arg)) {
4447
- var letters = arg.slice(1, -1).split("");
4448
- var broken = false;
4449
- for (var j = 0; j < letters.length; j++) {
4450
- next = arg.slice(j + 2);
4451
- if (next === "-") {
4452
- setArg(letters[j], next, arg);
4453
- continue;
4454
- }
4455
- if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {
4456
- setArg(letters[j], next.slice(1), arg);
4457
- broken = true;
4458
- break;
4459
- }
4460
- if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
4461
- setArg(letters[j], next, arg);
4462
- broken = true;
4463
- break;
4464
- }
4465
- if (letters[j + 1] && letters[j + 1].match(/\W/)) {
4466
- setArg(letters[j], arg.slice(j + 2), arg);
4467
- broken = true;
4468
- break;
4469
- } else {
4470
- setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
4471
- }
4472
- }
4473
- key = arg.slice(-1)[0];
4474
- if (!broken && key !== "-") {
4475
- if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
4476
- setArg(key, args[i + 1], arg);
4477
- i += 1;
4478
- } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
4479
- setArg(key, args[i + 1] === "true", arg);
4480
- i += 1;
4481
- } else {
4482
- setArg(key, flags.strings[key] ? "" : true, arg);
4483
- }
4484
- }
4485
- } else {
4486
- if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
4487
- argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg));
4488
- }
4489
- if (opts.stopEarly) {
4490
- argv._.push.apply(argv._, args.slice(i + 1));
4491
- break;
4492
- }
4493
- }
4494
- }
4495
- Object.keys(defaults).forEach(function(k) {
4496
- if (!hasKey(argv, k.split("."))) {
4497
- setKey(argv, k.split("."), defaults[k]);
4498
- (aliases[k] || []).forEach(function(x) {
4499
- setKey(argv, x.split("."), defaults[k]);
4500
- });
4501
- }
4502
- });
4503
- if (opts["--"]) {
4504
- argv["--"] = notFlags.slice();
4505
- } else {
4506
- notFlags.forEach(function(k) {
4507
- argv._.push(k);
4508
- });
4509
- }
4510
- return argv;
4511
- };
4512
- });
4513
-
4514
- // node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/register.js
4515
- var require_register = __commonJS((exports) => {
4516
- "use strict";
4517
- var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) {
4518
- if (pack || arguments.length === 2)
4519
- for (var i = 0, l = from.length, ar; i < l; i++) {
4520
- if (ar || !(i in from)) {
4521
- if (!ar)
4522
- ar = Array.prototype.slice.call(from, 0, i);
4523
- ar[i] = from[i];
4524
- }
4525
- }
4526
- return to.concat(ar || Array.prototype.slice.call(from));
4527
- };
4528
- Object.defineProperty(exports, "__esModule", {value: true});
4529
- exports.register = void 0;
4530
- var match_path_sync_1 = require_match_path_sync();
4531
- var config_loader_1 = require_config_loader();
4532
- var noOp2 = function() {
4533
- return void 0;
4534
- };
4535
- function getCoreModules(builtinModules2) {
4536
- builtinModules2 = builtinModules2 || [
4537
- "assert",
4538
- "buffer",
4539
- "child_process",
4540
- "cluster",
4541
- "crypto",
4542
- "dgram",
4543
- "dns",
4544
- "domain",
4545
- "events",
4546
- "fs",
4547
- "http",
4548
- "https",
4549
- "net",
4550
- "os",
4551
- "path",
4552
- "punycode",
4553
- "querystring",
4554
- "readline",
4555
- "stream",
4556
- "string_decoder",
4557
- "tls",
4558
- "tty",
4559
- "url",
4560
- "util",
4561
- "v8",
4562
- "vm",
4563
- "zlib"
4564
- ];
4565
- var coreModules = {};
4566
- for (var _i = 0, builtinModules_1 = builtinModules2; _i < builtinModules_1.length; _i++) {
4567
- var module_1 = builtinModules_1[_i];
4568
- coreModules[module_1] = true;
4569
- }
4570
- return coreModules;
4571
- }
4572
- function register2(params) {
4573
- var cwd;
4574
- var explicitParams;
4575
- if (params) {
4576
- cwd = params.cwd;
4577
- if (params.baseUrl || params.paths) {
4578
- explicitParams = params;
4579
- }
4580
- } else {
4581
- var minimist = require_minimist();
4582
- var argv = minimist(process.argv.slice(2), {
4583
- string: ["project"],
4584
- alias: {
4585
- project: ["P"]
4586
- }
4587
- });
4588
- cwd = argv.project;
4589
- }
4590
- var configLoaderResult = (0, config_loader_1.configLoader)({
4591
- cwd: cwd !== null && cwd !== void 0 ? cwd : process.cwd(),
4592
- explicitParams
4593
- });
4594
- if (configLoaderResult.resultType === "failed") {
4595
- console.warn("".concat(configLoaderResult.message, ". tsconfig-paths will be skipped"));
4596
- return noOp2;
4597
- }
4598
- var matchPath = (0, match_path_sync_1.createMatchPath)(configLoaderResult.absoluteBaseUrl, configLoaderResult.paths, configLoaderResult.mainFields, configLoaderResult.addMatchAll);
4599
- var Module = require("module");
4600
- var originalResolveFilename = Module._resolveFilename;
4601
- var coreModules = getCoreModules(Module.builtinModules);
4602
- Module._resolveFilename = function(request, _parent) {
4603
- var isCoreModule = coreModules.hasOwnProperty(request);
4604
- if (!isCoreModule) {
4605
- var found = matchPath(request);
4606
- if (found) {
4607
- var modifiedArguments = __spreadArray([found], [].slice.call(arguments, 1), true);
4608
- return originalResolveFilename.apply(this, modifiedArguments);
4609
- }
4610
- }
4611
- return originalResolveFilename.apply(this, arguments);
4612
- };
4613
- return function() {
4614
- Module._resolveFilename = originalResolveFilename;
4615
- };
4616
- }
4617
- exports.register = register2;
4618
- });
4619
-
4620
- // node_modules/.pnpm/tsconfig-paths@4.2.0/node_modules/tsconfig-paths/lib/index.js
4621
- var require_lib4 = __commonJS((exports) => {
4622
- "use strict";
4623
- Object.defineProperty(exports, "__esModule", {value: true});
4624
- exports.loadConfig = exports.register = exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = exports.matchFromAbsolutePaths = exports.createMatchPath = void 0;
4625
- var match_path_sync_1 = require_match_path_sync();
4626
- Object.defineProperty(exports, "createMatchPath", {enumerable: true, get: function() {
4627
- return match_path_sync_1.createMatchPath;
4628
- }});
4629
- Object.defineProperty(exports, "matchFromAbsolutePaths", {enumerable: true, get: function() {
4630
- return match_path_sync_1.matchFromAbsolutePaths;
4631
- }});
4632
- var match_path_async_1 = require_match_path_async();
4633
- Object.defineProperty(exports, "createMatchPathAsync", {enumerable: true, get: function() {
4634
- return match_path_async_1.createMatchPathAsync;
4635
- }});
4636
- Object.defineProperty(exports, "matchFromAbsolutePathsAsync", {enumerable: true, get: function() {
4637
- return match_path_async_1.matchFromAbsolutePathsAsync;
4638
- }});
4639
- var register_1 = require_register();
4640
- Object.defineProperty(exports, "register", {enumerable: true, get: function() {
4641
- return register_1.register;
4642
- }});
4643
- var config_loader_1 = require_config_loader();
4644
- Object.defineProperty(exports, "loadConfig", {enumerable: true, get: function() {
4645
- return config_loader_1.loadConfig;
4646
- }});
4647
- });
4648
-
4649
- // src/node.ts
4650
- var import_source_map_support = __toModule(require_source_map_support());
4651
- var import_pirates = __toModule(require_lib());
4652
- var _path2 = require('path');
4653
- var _esbuild = require('esbuild');
4654
- var _fs2 = require('fs'); var _fs3 = _interopRequireDefault2(_fs2);
4655
- var _module2 = require('module'); var _module3 = _interopRequireDefault2(_module2);
4656
- var _process = require('process'); var _process2 = _interopRequireDefault2(_process);
4657
-
4658
- // src/options.ts
4659
- var import_joycon = __toModule(require_lib2());
4660
-
4661
-
4662
- // node_modules/.pnpm/strip-json-comments@4.0.0/node_modules/strip-json-comments/index.js
4663
- var singleComment = Symbol("singleComment");
4664
- var multiComment = Symbol("multiComment");
4665
- var stripWithoutWhitespace = () => "";
4666
- var stripWithWhitespace = (string, start, end) => string.slice(start, end).replace(/\S/g, " ");
4667
- var isEscaped = (jsonString, quotePosition) => {
4668
- let index = quotePosition - 1;
4669
- let backslashCount = 0;
4670
- while (jsonString[index] === "\\") {
4671
- index -= 1;
4672
- backslashCount += 1;
4673
- }
4674
- return Boolean(backslashCount % 2);
4675
- };
4676
- function stripJsonComments(jsonString, {whitespace = true} = {}) {
4677
- if (typeof jsonString !== "string") {
4678
- throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``);
4679
- }
4680
- const strip = whitespace ? stripWithWhitespace : stripWithoutWhitespace;
4681
- let isInsideString = false;
4682
- let isInsideComment = false;
4683
- let offset = 0;
4684
- let result = "";
4685
- for (let index = 0; index < jsonString.length; index++) {
4686
- const currentCharacter = jsonString[index];
4687
- const nextCharacter = jsonString[index + 1];
4688
- if (!isInsideComment && currentCharacter === '"') {
4689
- const escaped = isEscaped(jsonString, index);
4690
- if (!escaped) {
4691
- isInsideString = !isInsideString;
4692
- }
4693
- }
4694
- if (isInsideString) {
4695
- continue;
4696
- }
4697
- if (!isInsideComment && currentCharacter + nextCharacter === "//") {
4698
- result += jsonString.slice(offset, index);
4699
- offset = index;
4700
- isInsideComment = singleComment;
4701
- index++;
4702
- } else if (isInsideComment === singleComment && currentCharacter + nextCharacter === "\r\n") {
4703
- index++;
4704
- isInsideComment = false;
4705
- result += strip(jsonString, offset, index);
4706
- offset = index;
4707
- continue;
4708
- } else if (isInsideComment === singleComment && currentCharacter === "\n") {
4709
- isInsideComment = false;
4710
- result += strip(jsonString, offset, index);
4711
- offset = index;
4712
- } else if (!isInsideComment && currentCharacter + nextCharacter === "/*") {
4713
- result += jsonString.slice(offset, index);
4714
- offset = index;
4715
- isInsideComment = multiComment;
4716
- index++;
4717
- continue;
4718
- } else if (isInsideComment === multiComment && currentCharacter + nextCharacter === "*/") {
4719
- index++;
4720
- isInsideComment = false;
4721
- result += strip(jsonString, offset, index + 1);
4722
- offset = index + 1;
4723
- continue;
4724
- }
4725
- }
4726
- return result + (isInsideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset));
4727
- }
4728
-
4729
- // src/utils.ts
4730
- var nodeVersion = (process.versions.node.match(/^(\d+)\.(\d+)/) || []).slice(1).map(Number);
4731
- function removeNodePrefix(code) {
4732
- if (nodeVersion[0] <= 14 && nodeVersion[1] < 18) {
4733
- return code.replace(/([\b\(])require\("node:([^"]+)"\)([\b\)])/g, '$1require("$2")$3');
4734
- }
4735
- return code;
4736
- }
4737
- function jsoncParse(data) {
4738
- try {
4739
- return new Function("return " + stripJsonComments(data).trim())();
4740
- } catch (_) {
4741
- return {};
4742
- }
4743
- }
4744
-
4745
- // src/options.ts
4746
- var joycon = new import_joycon.default();
4747
- joycon.addLoader({
4748
- test: /\.json$/,
4749
- loadSync: (file) => {
4750
- const content = _fs3.default.readFileSync(file, "utf8");
4751
- return jsoncParse(content);
4752
- }
4753
- });
4754
- var getOptions = (cwd) => {
4755
- var _a, _b, _c, _d;
4756
- const {data, path} = joycon.loadSync(["tsconfig.json", "jsconfig.json"], cwd);
4757
- if (path && data) {
4758
- return {
4759
- jsxFactory: (_a = data.compilerOptions) == null ? void 0 : _a.jsxFactory,
4760
- jsxFragment: (_b = data.compilerOptions) == null ? void 0 : _b.jsxFragmentFactory,
4761
- target: (_d = (_c = data.compilerOptions) == null ? void 0 : _c.target) == null ? void 0 : _d.toLowerCase()
4762
- };
4763
- }
4764
- return {};
4765
- };
4766
- var inferPackageFormat = (cwd, filename) => {
4767
- if (filename.endsWith(".mjs")) {
4768
- return "esm";
4769
- }
4770
- if (filename.endsWith(".cjs")) {
4771
- return "cjs";
4772
- }
4773
- const {data} = joycon.loadSync(["package.json"], cwd);
4774
- return data && data.type === "module" && /\.m?js$/.test(filename) ? "esm" : "cjs";
4775
- };
4776
-
4777
- // src/tsconfig-paths.ts
4778
- var import_tsconfig_paths = __toModule(require_lib4());
4779
-
4780
- var noOp = () => {
4781
- };
4782
- function registerTsconfigPaths() {
4783
- const configLoaderResult = (0, import_tsconfig_paths.loadConfig)(process.cwd());
4784
- if (configLoaderResult.resultType === "failed") {
4785
- return noOp;
4786
- }
4787
- const matchPath = (0, import_tsconfig_paths.createMatchPath)(configLoaderResult.absoluteBaseUrl, configLoaderResult.paths, configLoaderResult.mainFields, configLoaderResult.addMatchAll);
4788
- const Module = require("module");
4789
- const originalResolveFilename = Module._resolveFilename;
4790
- Module._resolveFilename = function(request, _parent) {
4791
- const isCoreModule = _module2.builtinModules.includes(request);
4792
- if (!isCoreModule) {
4793
- const found = matchPath(request);
4794
- if (found) {
4795
- const modifiedArguments = [found, ...[].slice.call(arguments, 1)];
4796
- return originalResolveFilename.apply(this, modifiedArguments);
4797
- }
4798
- }
4799
- return originalResolveFilename.apply(this, arguments);
4800
- };
4801
- return () => {
4802
- Module._resolveFilename = originalResolveFilename;
4803
- };
4804
- }
4805
-
4806
- // src/debug.ts
4807
- var _debug = require('debug'); var _debug2 = _interopRequireDefault2(_debug);
4808
- var debug = _debug2.default.call(void 0, "esbuild-register");
4809
-
4810
- // src/node.ts
4811
- var IMPORT_META_URL_VARIABLE_NAME = "__esbuild_register_import_meta_url__";
4812
- var map = {};
4813
- function installSourceMapSupport() {
4814
- if (_process2.default.setSourceMapsEnabled) {
4815
- ;
4816
- _process2.default.setSourceMapsEnabled(true);
4817
- } else {
4818
- import_source_map_support.default.install({
4819
- handleUncaughtExceptions: false,
4820
- environment: "node",
4821
- retrieveSourceMap(file) {
4822
- if (map[file]) {
4823
- return {
4824
- url: file,
4825
- map: map[file]
4826
- };
4827
- }
4828
- return null;
4829
- }
4830
- });
4831
- }
4832
- }
4833
- function patchCommonJsLoader(compile) {
4834
- const extensions = _module3.default.Module._extensions;
4835
- const jsHandler = extensions[".js"];
4836
- extensions[".js"] = function(module2, filename) {
4837
- try {
4838
- return jsHandler.call(this, module2, filename);
4839
- } catch (error) {
4840
- if (error.code !== "ERR_REQUIRE_ESM") {
4841
- throw error;
4842
- }
4843
- let content = _fs3.default.readFileSync(filename, "utf8");
4844
- content = compile(content, filename, "cjs");
4845
- module2._compile(content, filename);
4846
- }
4847
- };
4848
- return () => {
4849
- extensions[".js"] = jsHandler;
4850
- };
4851
- }
4852
- var FILE_LOADERS = {
4853
- ".js": "js",
4854
- ".jsx": "jsx",
4855
- ".ts": "ts",
4856
- ".tsx": "tsx",
4857
- ".mjs": "js",
4858
- ".mts": "ts",
4859
- ".cts": "ts"
4860
- };
4861
- var DEFAULT_EXTENSIONS = Object.keys(FILE_LOADERS);
4862
- var getLoader = (filename) => FILE_LOADERS[_path2.extname.call(void 0, filename)];
4863
- function register(esbuildOptions = {}) {
4864
- const {
4865
- extensions = DEFAULT_EXTENSIONS,
4866
- hookIgnoreNodeModules = true,
4867
- hookMatcher,
4868
- ...overrides
4869
- } = esbuildOptions;
4870
- const compile = function compile2(code, filename, format) {
4871
- const define = {
4872
- "import.meta.url": IMPORT_META_URL_VARIABLE_NAME,
4873
- ...overrides.define
4874
- };
4875
- const banner = `const ${IMPORT_META_URL_VARIABLE_NAME} = require('url').pathToFileURL(__filename).href;${overrides.banner || ""}`;
4876
- if (code.includes(banner)) {
4877
- return code;
4878
- }
4879
- const dir = _path2.dirname.call(void 0, filename);
4880
- const options = getOptions(dir);
4881
- format = format != null ? format : inferPackageFormat(dir, filename);
4882
- const result = _esbuild.transformSync.call(void 0, code, {
4883
- sourcefile: filename,
4884
- loader: getLoader(filename),
4885
- sourcemap: "both",
4886
- target: options.target,
4887
- jsxFactory: options.jsxFactory,
4888
- jsxFragment: options.jsxFragment,
4889
- format,
4890
- define,
4891
- banner,
4892
- ...overrides
4893
- });
4894
- const js = result.code;
4895
- debug("compiled %s", filename);
4896
- debug("%s", js);
4897
- const warnings = result.warnings;
4898
- if (warnings && warnings.length > 0) {
4899
- for (const warning of warnings) {
4900
- console.log(warning.location);
4901
- console.log(warning.text);
4902
- }
4903
- }
4904
- if (format === "esm")
4905
- return js;
4906
- return removeNodePrefix(js);
4907
- };
4908
- const revert = (0, import_pirates.addHook)(compile, {
4909
- exts: extensions,
4910
- ignoreNodeModules: hookIgnoreNodeModules,
4911
- matcher: hookMatcher
4912
- });
4913
- installSourceMapSupport();
4914
- const unpatchCommonJsLoader = patchCommonJsLoader(compile);
4915
- const unregisterTsconfigPaths = registerTsconfigPaths();
4916
- return {
4917
- unregister() {
4918
- revert();
4919
- unpatchCommonJsLoader();
4920
- unregisterTsconfigPaths();
4921
- }
4922
- };
4923
- }
4924
-
4925
-
4926
- exports.register = register;