bippy 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +24 -0
  2. package/dist/chunk-AMVCK6H6.js +2240 -0
  3. package/dist/chunk-AQ674A4M.cjs +38 -0
  4. package/dist/{chunk-2R5SJTFQ.js → chunk-E67XFKKG.js} +2 -7
  5. package/dist/chunk-EPG3GO3H.js +35 -0
  6. package/dist/{chunk-POWCTW3F.cjs → chunk-J2F3EJOS.cjs} +2 -7
  7. package/dist/chunk-LMTDJIAV.cjs +2246 -0
  8. package/dist/{chunk-R357CEJU.cjs → chunk-OZZZ2ACU.cjs} +57 -40
  9. package/dist/{chunk-NK43KTPL.js → chunk-SI6Y374H.js} +55 -39
  10. package/dist/core.cjs +80 -67
  11. package/dist/core.d.cts +13 -3
  12. package/dist/core.d.ts +13 -3
  13. package/dist/core.js +2 -1
  14. package/dist/experiments/inspect.cjs +25 -15
  15. package/dist/experiments/inspect.js +13 -3
  16. package/dist/experiments/shrinkwrap.cjs +7 -6
  17. package/dist/experiments/shrinkwrap.js +3 -2
  18. package/dist/index.cjs +81 -68
  19. package/dist/index.d.cts +3 -2
  20. package/dist/index.d.ts +3 -2
  21. package/dist/index.global.js +1 -1
  22. package/dist/index.js +3 -2
  23. package/dist/jsx-dev-runtime.cjs +47 -0
  24. package/dist/jsx-dev-runtime.d.cts +8 -0
  25. package/dist/jsx-dev-runtime.d.ts +8 -0
  26. package/dist/jsx-dev-runtime.js +37 -0
  27. package/dist/{types-bP3PNEQt.d.cts → jsx-runtime-LhDmw-G0.d.cts} +1 -0
  28. package/dist/{types-bP3PNEQt.d.ts → jsx-runtime-LhDmw-G0.d.ts} +1 -0
  29. package/dist/jsx-runtime.cjs +15 -0
  30. package/dist/jsx-runtime.d.cts +3 -0
  31. package/dist/jsx-runtime.d.ts +3 -0
  32. package/dist/jsx-runtime.js +4 -0
  33. package/dist/shrinkwrap.global.js +1 -1
  34. package/dist/source.cjs +274 -2216
  35. package/dist/source.d.cts +7 -3
  36. package/dist/source.d.ts +7 -3
  37. package/dist/source.global.js +14 -1
  38. package/dist/source.js +4 -2229
  39. package/package.json +21 -1
@@ -0,0 +1,2240 @@
1
+ import { getRDTHook, isHostFiber, getType, traverseFiber, isCompositeFiber, ClassComponentTag, getDisplayName } from './chunk-SI6Y374H.js';
2
+ import { __commonJS, __toESM } from './chunk-EPG3GO3H.js';
3
+ import React from 'react';
4
+
5
+ /**
6
+ * @license bippy
7
+ *
8
+ * Copyright (c) Aiden Bai, Million Software, Inc.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+
14
+ // ../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.js
15
+ var require_base64 = __commonJS({
16
+ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.js"(exports) {
17
+ var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
18
+ exports.encode = function(number) {
19
+ if (0 <= number && number < intToCharMap.length) {
20
+ return intToCharMap[number];
21
+ }
22
+ throw new TypeError("Must be between 0 and 63: " + number);
23
+ };
24
+ exports.decode = function(charCode) {
25
+ var bigA = 65;
26
+ var bigZ = 90;
27
+ var littleA = 97;
28
+ var littleZ = 122;
29
+ var zero = 48;
30
+ var nine = 57;
31
+ var plus = 43;
32
+ var slash = 47;
33
+ var littleOffset = 26;
34
+ var numberOffset = 52;
35
+ if (bigA <= charCode && charCode <= bigZ) {
36
+ return charCode - bigA;
37
+ }
38
+ if (littleA <= charCode && charCode <= littleZ) {
39
+ return charCode - littleA + littleOffset;
40
+ }
41
+ if (zero <= charCode && charCode <= nine) {
42
+ return charCode - zero + numberOffset;
43
+ }
44
+ if (charCode == plus) {
45
+ return 62;
46
+ }
47
+ if (charCode == slash) {
48
+ return 63;
49
+ }
50
+ return -1;
51
+ };
52
+ }
53
+ });
54
+
55
+ // ../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.js
56
+ var require_base64_vlq = __commonJS({
57
+ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.js"(exports) {
58
+ var base64 = require_base64();
59
+ var VLQ_BASE_SHIFT = 5;
60
+ var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
61
+ var VLQ_BASE_MASK = VLQ_BASE - 1;
62
+ var VLQ_CONTINUATION_BIT = VLQ_BASE;
63
+ function toVLQSigned(aValue) {
64
+ return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
65
+ }
66
+ function fromVLQSigned(aValue) {
67
+ var isNegative = (aValue & 1) === 1;
68
+ var shifted = aValue >> 1;
69
+ return isNegative ? -shifted : shifted;
70
+ }
71
+ exports.encode = function base64VLQ_encode(aValue) {
72
+ var encoded = "";
73
+ var digit;
74
+ var vlq = toVLQSigned(aValue);
75
+ do {
76
+ digit = vlq & VLQ_BASE_MASK;
77
+ vlq >>>= VLQ_BASE_SHIFT;
78
+ if (vlq > 0) {
79
+ digit |= VLQ_CONTINUATION_BIT;
80
+ }
81
+ encoded += base64.encode(digit);
82
+ } while (vlq > 0);
83
+ return encoded;
84
+ };
85
+ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
86
+ var strLen = aStr.length;
87
+ var result = 0;
88
+ var shift = 0;
89
+ var continuation, digit;
90
+ do {
91
+ if (aIndex >= strLen) {
92
+ throw new Error("Expected more digits in base 64 VLQ value.");
93
+ }
94
+ digit = base64.decode(aStr.charCodeAt(aIndex++));
95
+ if (digit === -1) {
96
+ throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
97
+ }
98
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
99
+ digit &= VLQ_BASE_MASK;
100
+ result = result + (digit << shift);
101
+ shift += VLQ_BASE_SHIFT;
102
+ } while (continuation);
103
+ aOutParam.value = fromVLQSigned(result);
104
+ aOutParam.rest = aIndex;
105
+ };
106
+ }
107
+ });
108
+
109
+ // ../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/util.js
110
+ var require_util = __commonJS({
111
+ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/util.js"(exports) {
112
+ function getArg(aArgs, aName, aDefaultValue) {
113
+ if (aName in aArgs) {
114
+ return aArgs[aName];
115
+ } else if (arguments.length === 3) {
116
+ return aDefaultValue;
117
+ } else {
118
+ throw new Error('"' + aName + '" is a required argument.');
119
+ }
120
+ }
121
+ exports.getArg = getArg;
122
+ var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
123
+ var dataUrlRegexp = /^data:.+\,.+$/;
124
+ function urlParse(aUrl) {
125
+ var match = aUrl.match(urlRegexp);
126
+ if (!match) {
127
+ return null;
128
+ }
129
+ return {
130
+ scheme: match[1],
131
+ auth: match[2],
132
+ host: match[3],
133
+ port: match[4],
134
+ path: match[5]
135
+ };
136
+ }
137
+ exports.urlParse = urlParse;
138
+ function urlGenerate(aParsedUrl) {
139
+ var url = "";
140
+ if (aParsedUrl.scheme) {
141
+ url += aParsedUrl.scheme + ":";
142
+ }
143
+ url += "//";
144
+ if (aParsedUrl.auth) {
145
+ url += aParsedUrl.auth + "@";
146
+ }
147
+ if (aParsedUrl.host) {
148
+ url += aParsedUrl.host;
149
+ }
150
+ if (aParsedUrl.port) {
151
+ url += ":" + aParsedUrl.port;
152
+ }
153
+ if (aParsedUrl.path) {
154
+ url += aParsedUrl.path;
155
+ }
156
+ return url;
157
+ }
158
+ exports.urlGenerate = urlGenerate;
159
+ var MAX_CACHED_INPUTS = 32;
160
+ function lruMemoize(f) {
161
+ var cache = [];
162
+ return function(input) {
163
+ for (var i = 0; i < cache.length; i++) {
164
+ if (cache[i].input === input) {
165
+ var temp = cache[0];
166
+ cache[0] = cache[i];
167
+ cache[i] = temp;
168
+ return cache[0].result;
169
+ }
170
+ }
171
+ var result = f(input);
172
+ cache.unshift({
173
+ input,
174
+ result
175
+ });
176
+ if (cache.length > MAX_CACHED_INPUTS) {
177
+ cache.pop();
178
+ }
179
+ return result;
180
+ };
181
+ }
182
+ var normalize = lruMemoize(function normalize2(aPath) {
183
+ var path = aPath;
184
+ var url = urlParse(aPath);
185
+ if (url) {
186
+ if (!url.path) {
187
+ return aPath;
188
+ }
189
+ path = url.path;
190
+ }
191
+ var isAbsolute = exports.isAbsolute(path);
192
+ var parts = [];
193
+ var start = 0;
194
+ var i = 0;
195
+ while (true) {
196
+ start = i;
197
+ i = path.indexOf("/", start);
198
+ if (i === -1) {
199
+ parts.push(path.slice(start));
200
+ break;
201
+ } else {
202
+ parts.push(path.slice(start, i));
203
+ while (i < path.length && path[i] === "/") {
204
+ i++;
205
+ }
206
+ }
207
+ }
208
+ for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
209
+ part = parts[i];
210
+ if (part === ".") {
211
+ parts.splice(i, 1);
212
+ } else if (part === "..") {
213
+ up++;
214
+ } else if (up > 0) {
215
+ if (part === "") {
216
+ parts.splice(i + 1, up);
217
+ up = 0;
218
+ } else {
219
+ parts.splice(i, 2);
220
+ up--;
221
+ }
222
+ }
223
+ }
224
+ path = parts.join("/");
225
+ if (path === "") {
226
+ path = isAbsolute ? "/" : ".";
227
+ }
228
+ if (url) {
229
+ url.path = path;
230
+ return urlGenerate(url);
231
+ }
232
+ return path;
233
+ });
234
+ exports.normalize = normalize;
235
+ function join(aRoot, aPath) {
236
+ if (aRoot === "") {
237
+ aRoot = ".";
238
+ }
239
+ if (aPath === "") {
240
+ aPath = ".";
241
+ }
242
+ var aPathUrl = urlParse(aPath);
243
+ var aRootUrl = urlParse(aRoot);
244
+ if (aRootUrl) {
245
+ aRoot = aRootUrl.path || "/";
246
+ }
247
+ if (aPathUrl && !aPathUrl.scheme) {
248
+ if (aRootUrl) {
249
+ aPathUrl.scheme = aRootUrl.scheme;
250
+ }
251
+ return urlGenerate(aPathUrl);
252
+ }
253
+ if (aPathUrl || aPath.match(dataUrlRegexp)) {
254
+ return aPath;
255
+ }
256
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
257
+ aRootUrl.host = aPath;
258
+ return urlGenerate(aRootUrl);
259
+ }
260
+ var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
261
+ if (aRootUrl) {
262
+ aRootUrl.path = joined;
263
+ return urlGenerate(aRootUrl);
264
+ }
265
+ return joined;
266
+ }
267
+ exports.join = join;
268
+ exports.isAbsolute = function(aPath) {
269
+ return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
270
+ };
271
+ function relative(aRoot, aPath) {
272
+ if (aRoot === "") {
273
+ aRoot = ".";
274
+ }
275
+ aRoot = aRoot.replace(/\/$/, "");
276
+ var level = 0;
277
+ while (aPath.indexOf(aRoot + "/") !== 0) {
278
+ var index = aRoot.lastIndexOf("/");
279
+ if (index < 0) {
280
+ return aPath;
281
+ }
282
+ aRoot = aRoot.slice(0, index);
283
+ if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
284
+ return aPath;
285
+ }
286
+ ++level;
287
+ }
288
+ return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
289
+ }
290
+ exports.relative = relative;
291
+ var supportsNullProto = function() {
292
+ var obj = /* @__PURE__ */ Object.create(null);
293
+ return !("__proto__" in obj);
294
+ }();
295
+ function identity(s) {
296
+ return s;
297
+ }
298
+ function toSetString(aStr) {
299
+ if (isProtoString(aStr)) {
300
+ return "$" + aStr;
301
+ }
302
+ return aStr;
303
+ }
304
+ exports.toSetString = supportsNullProto ? identity : toSetString;
305
+ function fromSetString(aStr) {
306
+ if (isProtoString(aStr)) {
307
+ return aStr.slice(1);
308
+ }
309
+ return aStr;
310
+ }
311
+ exports.fromSetString = supportsNullProto ? identity : fromSetString;
312
+ function isProtoString(s) {
313
+ if (!s) {
314
+ return false;
315
+ }
316
+ var length = s.length;
317
+ if (length < 9) {
318
+ return false;
319
+ }
320
+ 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) {
321
+ return false;
322
+ }
323
+ for (var i = length - 10; i >= 0; i--) {
324
+ if (s.charCodeAt(i) !== 36) {
325
+ return false;
326
+ }
327
+ }
328
+ return true;
329
+ }
330
+ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
331
+ var cmp = strcmp(mappingA.source, mappingB.source);
332
+ if (cmp !== 0) {
333
+ return cmp;
334
+ }
335
+ cmp = mappingA.originalLine - mappingB.originalLine;
336
+ if (cmp !== 0) {
337
+ return cmp;
338
+ }
339
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
340
+ if (cmp !== 0 || onlyCompareOriginal) {
341
+ return cmp;
342
+ }
343
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
344
+ if (cmp !== 0) {
345
+ return cmp;
346
+ }
347
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
348
+ if (cmp !== 0) {
349
+ return cmp;
350
+ }
351
+ return strcmp(mappingA.name, mappingB.name);
352
+ }
353
+ exports.compareByOriginalPositions = compareByOriginalPositions;
354
+ function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {
355
+ var cmp;
356
+ cmp = mappingA.originalLine - mappingB.originalLine;
357
+ if (cmp !== 0) {
358
+ return cmp;
359
+ }
360
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
361
+ if (cmp !== 0 || onlyCompareOriginal) {
362
+ return cmp;
363
+ }
364
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
365
+ if (cmp !== 0) {
366
+ return cmp;
367
+ }
368
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
369
+ if (cmp !== 0) {
370
+ return cmp;
371
+ }
372
+ return strcmp(mappingA.name, mappingB.name);
373
+ }
374
+ exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;
375
+ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
376
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
377
+ if (cmp !== 0) {
378
+ return cmp;
379
+ }
380
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
381
+ if (cmp !== 0 || onlyCompareGenerated) {
382
+ return cmp;
383
+ }
384
+ cmp = strcmp(mappingA.source, mappingB.source);
385
+ if (cmp !== 0) {
386
+ return cmp;
387
+ }
388
+ cmp = mappingA.originalLine - mappingB.originalLine;
389
+ if (cmp !== 0) {
390
+ return cmp;
391
+ }
392
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
393
+ if (cmp !== 0) {
394
+ return cmp;
395
+ }
396
+ return strcmp(mappingA.name, mappingB.name);
397
+ }
398
+ exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
399
+ function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {
400
+ var cmp = mappingA.generatedColumn - mappingB.generatedColumn;
401
+ if (cmp !== 0 || onlyCompareGenerated) {
402
+ return cmp;
403
+ }
404
+ cmp = strcmp(mappingA.source, mappingB.source);
405
+ if (cmp !== 0) {
406
+ return cmp;
407
+ }
408
+ cmp = mappingA.originalLine - mappingB.originalLine;
409
+ if (cmp !== 0) {
410
+ return cmp;
411
+ }
412
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
413
+ if (cmp !== 0) {
414
+ return cmp;
415
+ }
416
+ return strcmp(mappingA.name, mappingB.name);
417
+ }
418
+ exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;
419
+ function strcmp(aStr1, aStr2) {
420
+ if (aStr1 === aStr2) {
421
+ return 0;
422
+ }
423
+ if (aStr1 === null) {
424
+ return 1;
425
+ }
426
+ if (aStr2 === null) {
427
+ return -1;
428
+ }
429
+ if (aStr1 > aStr2) {
430
+ return 1;
431
+ }
432
+ return -1;
433
+ }
434
+ function compareByGeneratedPositionsInflated(mappingA, mappingB) {
435
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
436
+ if (cmp !== 0) {
437
+ return cmp;
438
+ }
439
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
440
+ if (cmp !== 0) {
441
+ return cmp;
442
+ }
443
+ cmp = strcmp(mappingA.source, mappingB.source);
444
+ if (cmp !== 0) {
445
+ return cmp;
446
+ }
447
+ cmp = mappingA.originalLine - mappingB.originalLine;
448
+ if (cmp !== 0) {
449
+ return cmp;
450
+ }
451
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
452
+ if (cmp !== 0) {
453
+ return cmp;
454
+ }
455
+ return strcmp(mappingA.name, mappingB.name);
456
+ }
457
+ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
458
+ function parseSourceMapInput(str) {
459
+ return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
460
+ }
461
+ exports.parseSourceMapInput = parseSourceMapInput;
462
+ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
463
+ sourceURL = sourceURL || "";
464
+ if (sourceRoot) {
465
+ if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
466
+ sourceRoot += "/";
467
+ }
468
+ sourceURL = sourceRoot + sourceURL;
469
+ }
470
+ if (sourceMapURL) {
471
+ var parsed = urlParse(sourceMapURL);
472
+ if (!parsed) {
473
+ throw new Error("sourceMapURL could not be parsed");
474
+ }
475
+ if (parsed.path) {
476
+ var index = parsed.path.lastIndexOf("/");
477
+ if (index >= 0) {
478
+ parsed.path = parsed.path.substring(0, index + 1);
479
+ }
480
+ }
481
+ sourceURL = join(urlGenerate(parsed), sourceURL);
482
+ }
483
+ return normalize(sourceURL);
484
+ }
485
+ exports.computeSourceURL = computeSourceURL;
486
+ }
487
+ });
488
+
489
+ // ../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.js
490
+ var require_array_set = __commonJS({
491
+ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.js"(exports) {
492
+ var util = require_util();
493
+ var has = Object.prototype.hasOwnProperty;
494
+ var hasNativeMap = typeof Map !== "undefined";
495
+ function ArraySet() {
496
+ this._array = [];
497
+ this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
498
+ }
499
+ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
500
+ var set = new ArraySet();
501
+ for (var i = 0, len = aArray.length; i < len; i++) {
502
+ set.add(aArray[i], aAllowDuplicates);
503
+ }
504
+ return set;
505
+ };
506
+ ArraySet.prototype.size = function ArraySet_size() {
507
+ return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
508
+ };
509
+ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
510
+ var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
511
+ var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
512
+ var idx = this._array.length;
513
+ if (!isDuplicate || aAllowDuplicates) {
514
+ this._array.push(aStr);
515
+ }
516
+ if (!isDuplicate) {
517
+ if (hasNativeMap) {
518
+ this._set.set(aStr, idx);
519
+ } else {
520
+ this._set[sStr] = idx;
521
+ }
522
+ }
523
+ };
524
+ ArraySet.prototype.has = function ArraySet_has(aStr) {
525
+ if (hasNativeMap) {
526
+ return this._set.has(aStr);
527
+ } else {
528
+ var sStr = util.toSetString(aStr);
529
+ return has.call(this._set, sStr);
530
+ }
531
+ };
532
+ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
533
+ if (hasNativeMap) {
534
+ var idx = this._set.get(aStr);
535
+ if (idx >= 0) {
536
+ return idx;
537
+ }
538
+ } else {
539
+ var sStr = util.toSetString(aStr);
540
+ if (has.call(this._set, sStr)) {
541
+ return this._set[sStr];
542
+ }
543
+ }
544
+ throw new Error('"' + aStr + '" is not in the set.');
545
+ };
546
+ ArraySet.prototype.at = function ArraySet_at(aIdx) {
547
+ if (aIdx >= 0 && aIdx < this._array.length) {
548
+ return this._array[aIdx];
549
+ }
550
+ throw new Error("No element indexed by " + aIdx);
551
+ };
552
+ ArraySet.prototype.toArray = function ArraySet_toArray() {
553
+ return this._array.slice();
554
+ };
555
+ exports.ArraySet = ArraySet;
556
+ }
557
+ });
558
+
559
+ // ../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.js
560
+ var require_mapping_list = __commonJS({
561
+ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.js"(exports) {
562
+ var util = require_util();
563
+ function generatedPositionAfter(mappingA, mappingB) {
564
+ var lineA = mappingA.generatedLine;
565
+ var lineB = mappingB.generatedLine;
566
+ var columnA = mappingA.generatedColumn;
567
+ var columnB = mappingB.generatedColumn;
568
+ return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
569
+ }
570
+ function MappingList() {
571
+ this._array = [];
572
+ this._sorted = true;
573
+ this._last = { generatedLine: -1, generatedColumn: 0 };
574
+ }
575
+ MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
576
+ this._array.forEach(aCallback, aThisArg);
577
+ };
578
+ MappingList.prototype.add = function MappingList_add(aMapping) {
579
+ if (generatedPositionAfter(this._last, aMapping)) {
580
+ this._last = aMapping;
581
+ this._array.push(aMapping);
582
+ } else {
583
+ this._sorted = false;
584
+ this._array.push(aMapping);
585
+ }
586
+ };
587
+ MappingList.prototype.toArray = function MappingList_toArray() {
588
+ if (!this._sorted) {
589
+ this._array.sort(util.compareByGeneratedPositionsInflated);
590
+ this._sorted = true;
591
+ }
592
+ return this._array;
593
+ };
594
+ exports.MappingList = MappingList;
595
+ }
596
+ });
597
+
598
+ // ../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.js
599
+ var require_source_map_generator = __commonJS({
600
+ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.js"(exports) {
601
+ var base64VLQ = require_base64_vlq();
602
+ var util = require_util();
603
+ var ArraySet = require_array_set().ArraySet;
604
+ var MappingList = require_mapping_list().MappingList;
605
+ function SourceMapGenerator(aArgs) {
606
+ if (!aArgs) {
607
+ aArgs = {};
608
+ }
609
+ this._file = util.getArg(aArgs, "file", null);
610
+ this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
611
+ this._skipValidation = util.getArg(aArgs, "skipValidation", false);
612
+ this._ignoreInvalidMapping = util.getArg(aArgs, "ignoreInvalidMapping", false);
613
+ this._sources = new ArraySet();
614
+ this._names = new ArraySet();
615
+ this._mappings = new MappingList();
616
+ this._sourcesContents = null;
617
+ }
618
+ SourceMapGenerator.prototype._version = 3;
619
+ SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) {
620
+ var sourceRoot = aSourceMapConsumer.sourceRoot;
621
+ var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, {
622
+ file: aSourceMapConsumer.file,
623
+ sourceRoot
624
+ }));
625
+ aSourceMapConsumer.eachMapping(function(mapping) {
626
+ var newMapping = {
627
+ generated: {
628
+ line: mapping.generatedLine,
629
+ column: mapping.generatedColumn
630
+ }
631
+ };
632
+ if (mapping.source != null) {
633
+ newMapping.source = mapping.source;
634
+ if (sourceRoot != null) {
635
+ newMapping.source = util.relative(sourceRoot, newMapping.source);
636
+ }
637
+ newMapping.original = {
638
+ line: mapping.originalLine,
639
+ column: mapping.originalColumn
640
+ };
641
+ if (mapping.name != null) {
642
+ newMapping.name = mapping.name;
643
+ }
644
+ }
645
+ generator.addMapping(newMapping);
646
+ });
647
+ aSourceMapConsumer.sources.forEach(function(sourceFile) {
648
+ var sourceRelative = sourceFile;
649
+ if (sourceRoot !== null) {
650
+ sourceRelative = util.relative(sourceRoot, sourceFile);
651
+ }
652
+ if (!generator._sources.has(sourceRelative)) {
653
+ generator._sources.add(sourceRelative);
654
+ }
655
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
656
+ if (content != null) {
657
+ generator.setSourceContent(sourceFile, content);
658
+ }
659
+ });
660
+ return generator;
661
+ };
662
+ SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
663
+ var generated = util.getArg(aArgs, "generated");
664
+ var original = util.getArg(aArgs, "original", null);
665
+ var source = util.getArg(aArgs, "source", null);
666
+ var name = util.getArg(aArgs, "name", null);
667
+ if (!this._skipValidation) {
668
+ if (this._validateMapping(generated, original, source, name) === false) {
669
+ return;
670
+ }
671
+ }
672
+ if (source != null) {
673
+ source = String(source);
674
+ if (!this._sources.has(source)) {
675
+ this._sources.add(source);
676
+ }
677
+ }
678
+ if (name != null) {
679
+ name = String(name);
680
+ if (!this._names.has(name)) {
681
+ this._names.add(name);
682
+ }
683
+ }
684
+ this._mappings.add({
685
+ generatedLine: generated.line,
686
+ generatedColumn: generated.column,
687
+ originalLine: original != null && original.line,
688
+ originalColumn: original != null && original.column,
689
+ source,
690
+ name
691
+ });
692
+ };
693
+ SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
694
+ var source = aSourceFile;
695
+ if (this._sourceRoot != null) {
696
+ source = util.relative(this._sourceRoot, source);
697
+ }
698
+ if (aSourceContent != null) {
699
+ if (!this._sourcesContents) {
700
+ this._sourcesContents = /* @__PURE__ */ Object.create(null);
701
+ }
702
+ this._sourcesContents[util.toSetString(source)] = aSourceContent;
703
+ } else if (this._sourcesContents) {
704
+ delete this._sourcesContents[util.toSetString(source)];
705
+ if (Object.keys(this._sourcesContents).length === 0) {
706
+ this._sourcesContents = null;
707
+ }
708
+ }
709
+ };
710
+ SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
711
+ var sourceFile = aSourceFile;
712
+ if (aSourceFile == null) {
713
+ if (aSourceMapConsumer.file == null) {
714
+ throw new Error(
715
+ `SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`
716
+ );
717
+ }
718
+ sourceFile = aSourceMapConsumer.file;
719
+ }
720
+ var sourceRoot = this._sourceRoot;
721
+ if (sourceRoot != null) {
722
+ sourceFile = util.relative(sourceRoot, sourceFile);
723
+ }
724
+ var newSources = new ArraySet();
725
+ var newNames = new ArraySet();
726
+ this._mappings.unsortedForEach(function(mapping) {
727
+ if (mapping.source === sourceFile && mapping.originalLine != null) {
728
+ var original = aSourceMapConsumer.originalPositionFor({
729
+ line: mapping.originalLine,
730
+ column: mapping.originalColumn
731
+ });
732
+ if (original.source != null) {
733
+ mapping.source = original.source;
734
+ if (aSourceMapPath != null) {
735
+ mapping.source = util.join(aSourceMapPath, mapping.source);
736
+ }
737
+ if (sourceRoot != null) {
738
+ mapping.source = util.relative(sourceRoot, mapping.source);
739
+ }
740
+ mapping.originalLine = original.line;
741
+ mapping.originalColumn = original.column;
742
+ if (original.name != null) {
743
+ mapping.name = original.name;
744
+ }
745
+ }
746
+ }
747
+ var source = mapping.source;
748
+ if (source != null && !newSources.has(source)) {
749
+ newSources.add(source);
750
+ }
751
+ var name = mapping.name;
752
+ if (name != null && !newNames.has(name)) {
753
+ newNames.add(name);
754
+ }
755
+ }, this);
756
+ this._sources = newSources;
757
+ this._names = newNames;
758
+ aSourceMapConsumer.sources.forEach(function(sourceFile2) {
759
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
760
+ if (content != null) {
761
+ if (aSourceMapPath != null) {
762
+ sourceFile2 = util.join(aSourceMapPath, sourceFile2);
763
+ }
764
+ if (sourceRoot != null) {
765
+ sourceFile2 = util.relative(sourceRoot, sourceFile2);
766
+ }
767
+ this.setSourceContent(sourceFile2, content);
768
+ }
769
+ }, this);
770
+ };
771
+ SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
772
+ if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
773
+ var message = "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.";
774
+ if (this._ignoreInvalidMapping) {
775
+ if (typeof console !== "undefined" && console.warn) {
776
+ console.warn(message);
777
+ }
778
+ return false;
779
+ } else {
780
+ throw new Error(message);
781
+ }
782
+ }
783
+ if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
784
+ return;
785
+ } 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) {
786
+ return;
787
+ } else {
788
+ var message = "Invalid mapping: " + JSON.stringify({
789
+ generated: aGenerated,
790
+ source: aSource,
791
+ original: aOriginal,
792
+ name: aName
793
+ });
794
+ if (this._ignoreInvalidMapping) {
795
+ if (typeof console !== "undefined" && console.warn) {
796
+ console.warn(message);
797
+ }
798
+ return false;
799
+ } else {
800
+ throw new Error(message);
801
+ }
802
+ }
803
+ };
804
+ SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
805
+ var previousGeneratedColumn = 0;
806
+ var previousGeneratedLine = 1;
807
+ var previousOriginalColumn = 0;
808
+ var previousOriginalLine = 0;
809
+ var previousName = 0;
810
+ var previousSource = 0;
811
+ var result = "";
812
+ var next;
813
+ var mapping;
814
+ var nameIdx;
815
+ var sourceIdx;
816
+ var mappings = this._mappings.toArray();
817
+ for (var i = 0, len = mappings.length; i < len; i++) {
818
+ mapping = mappings[i];
819
+ next = "";
820
+ if (mapping.generatedLine !== previousGeneratedLine) {
821
+ previousGeneratedColumn = 0;
822
+ while (mapping.generatedLine !== previousGeneratedLine) {
823
+ next += ";";
824
+ previousGeneratedLine++;
825
+ }
826
+ } else {
827
+ if (i > 0) {
828
+ if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
829
+ continue;
830
+ }
831
+ next += ",";
832
+ }
833
+ }
834
+ next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
835
+ previousGeneratedColumn = mapping.generatedColumn;
836
+ if (mapping.source != null) {
837
+ sourceIdx = this._sources.indexOf(mapping.source);
838
+ next += base64VLQ.encode(sourceIdx - previousSource);
839
+ previousSource = sourceIdx;
840
+ next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
841
+ previousOriginalLine = mapping.originalLine - 1;
842
+ next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
843
+ previousOriginalColumn = mapping.originalColumn;
844
+ if (mapping.name != null) {
845
+ nameIdx = this._names.indexOf(mapping.name);
846
+ next += base64VLQ.encode(nameIdx - previousName);
847
+ previousName = nameIdx;
848
+ }
849
+ }
850
+ result += next;
851
+ }
852
+ return result;
853
+ };
854
+ SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
855
+ return aSources.map(function(source) {
856
+ if (!this._sourcesContents) {
857
+ return null;
858
+ }
859
+ if (aSourceRoot != null) {
860
+ source = util.relative(aSourceRoot, source);
861
+ }
862
+ var key = util.toSetString(source);
863
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
864
+ }, this);
865
+ };
866
+ SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
867
+ var map = {
868
+ version: this._version,
869
+ sources: this._sources.toArray(),
870
+ names: this._names.toArray(),
871
+ mappings: this._serializeMappings()
872
+ };
873
+ if (this._file != null) {
874
+ map.file = this._file;
875
+ }
876
+ if (this._sourceRoot != null) {
877
+ map.sourceRoot = this._sourceRoot;
878
+ }
879
+ if (this._sourcesContents) {
880
+ map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
881
+ }
882
+ return map;
883
+ };
884
+ SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
885
+ return JSON.stringify(this.toJSON());
886
+ };
887
+ exports.SourceMapGenerator = SourceMapGenerator;
888
+ }
889
+ });
890
+
891
+ // ../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.js
892
+ var require_binary_search = __commonJS({
893
+ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.js"(exports) {
894
+ exports.GREATEST_LOWER_BOUND = 1;
895
+ exports.LEAST_UPPER_BOUND = 2;
896
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
897
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
898
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
899
+ if (cmp === 0) {
900
+ return mid;
901
+ } else if (cmp > 0) {
902
+ if (aHigh - mid > 1) {
903
+ return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
904
+ }
905
+ if (aBias == exports.LEAST_UPPER_BOUND) {
906
+ return aHigh < aHaystack.length ? aHigh : -1;
907
+ } else {
908
+ return mid;
909
+ }
910
+ } else {
911
+ if (mid - aLow > 1) {
912
+ return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
913
+ }
914
+ if (aBias == exports.LEAST_UPPER_BOUND) {
915
+ return mid;
916
+ } else {
917
+ return aLow < 0 ? -1 : aLow;
918
+ }
919
+ }
920
+ }
921
+ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
922
+ if (aHaystack.length === 0) {
923
+ return -1;
924
+ }
925
+ var index = recursiveSearch(
926
+ -1,
927
+ aHaystack.length,
928
+ aNeedle,
929
+ aHaystack,
930
+ aCompare,
931
+ aBias || exports.GREATEST_LOWER_BOUND
932
+ );
933
+ if (index < 0) {
934
+ return -1;
935
+ }
936
+ while (index - 1 >= 0) {
937
+ if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
938
+ break;
939
+ }
940
+ --index;
941
+ }
942
+ return index;
943
+ };
944
+ }
945
+ });
946
+
947
+ // ../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.js
948
+ var require_quick_sort = __commonJS({
949
+ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.js"(exports) {
950
+ function SortTemplate(comparator) {
951
+ function swap(ary, x, y) {
952
+ var temp = ary[x];
953
+ ary[x] = ary[y];
954
+ ary[y] = temp;
955
+ }
956
+ function randomIntInRange(low, high) {
957
+ return Math.round(low + Math.random() * (high - low));
958
+ }
959
+ function doQuickSort(ary, comparator2, p, r) {
960
+ if (p < r) {
961
+ var pivotIndex = randomIntInRange(p, r);
962
+ var i = p - 1;
963
+ swap(ary, pivotIndex, r);
964
+ var pivot = ary[r];
965
+ for (var j = p; j < r; j++) {
966
+ if (comparator2(ary[j], pivot, false) <= 0) {
967
+ i += 1;
968
+ swap(ary, i, j);
969
+ }
970
+ }
971
+ swap(ary, i + 1, j);
972
+ var q = i + 1;
973
+ doQuickSort(ary, comparator2, p, q - 1);
974
+ doQuickSort(ary, comparator2, q + 1, r);
975
+ }
976
+ }
977
+ return doQuickSort;
978
+ }
979
+ function cloneSort(comparator) {
980
+ let template = SortTemplate.toString();
981
+ let templateFn = new Function(`return ${template}`)();
982
+ return templateFn(comparator);
983
+ }
984
+ var sortCache = /* @__PURE__ */ new WeakMap();
985
+ exports.quickSort = function(ary, comparator, start = 0) {
986
+ let doQuickSort = sortCache.get(comparator);
987
+ if (doQuickSort === void 0) {
988
+ doQuickSort = cloneSort(comparator);
989
+ sortCache.set(comparator, doQuickSort);
990
+ }
991
+ doQuickSort(ary, comparator, start, ary.length - 1);
992
+ };
993
+ }
994
+ });
995
+
996
+ // ../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.js
997
+ var require_source_map_consumer = __commonJS({
998
+ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.js"(exports) {
999
+ var util = require_util();
1000
+ var binarySearch = require_binary_search();
1001
+ var ArraySet = require_array_set().ArraySet;
1002
+ var base64VLQ = require_base64_vlq();
1003
+ var quickSort = require_quick_sort().quickSort;
1004
+ function SourceMapConsumer2(aSourceMap, aSourceMapURL) {
1005
+ var sourceMap = aSourceMap;
1006
+ if (typeof aSourceMap === "string") {
1007
+ sourceMap = util.parseSourceMapInput(aSourceMap);
1008
+ }
1009
+ return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
1010
+ }
1011
+ SourceMapConsumer2.fromSourceMap = function(aSourceMap, aSourceMapURL) {
1012
+ return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
1013
+ };
1014
+ SourceMapConsumer2.prototype._version = 3;
1015
+ SourceMapConsumer2.prototype.__generatedMappings = null;
1016
+ Object.defineProperty(SourceMapConsumer2.prototype, "_generatedMappings", {
1017
+ configurable: true,
1018
+ enumerable: true,
1019
+ get: function() {
1020
+ if (!this.__generatedMappings) {
1021
+ this._parseMappings(this._mappings, this.sourceRoot);
1022
+ }
1023
+ return this.__generatedMappings;
1024
+ }
1025
+ });
1026
+ SourceMapConsumer2.prototype.__originalMappings = null;
1027
+ Object.defineProperty(SourceMapConsumer2.prototype, "_originalMappings", {
1028
+ configurable: true,
1029
+ enumerable: true,
1030
+ get: function() {
1031
+ if (!this.__originalMappings) {
1032
+ this._parseMappings(this._mappings, this.sourceRoot);
1033
+ }
1034
+ return this.__originalMappings;
1035
+ }
1036
+ });
1037
+ SourceMapConsumer2.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
1038
+ var c = aStr.charAt(index);
1039
+ return c === ";" || c === ",";
1040
+ };
1041
+ SourceMapConsumer2.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
1042
+ throw new Error("Subclasses must implement _parseMappings");
1043
+ };
1044
+ SourceMapConsumer2.GENERATED_ORDER = 1;
1045
+ SourceMapConsumer2.ORIGINAL_ORDER = 2;
1046
+ SourceMapConsumer2.GREATEST_LOWER_BOUND = 1;
1047
+ SourceMapConsumer2.LEAST_UPPER_BOUND = 2;
1048
+ SourceMapConsumer2.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
1049
+ var context = aContext || null;
1050
+ var order = aOrder || SourceMapConsumer2.GENERATED_ORDER;
1051
+ var mappings;
1052
+ switch (order) {
1053
+ case SourceMapConsumer2.GENERATED_ORDER:
1054
+ mappings = this._generatedMappings;
1055
+ break;
1056
+ case SourceMapConsumer2.ORIGINAL_ORDER:
1057
+ mappings = this._originalMappings;
1058
+ break;
1059
+ default:
1060
+ throw new Error("Unknown order of iteration.");
1061
+ }
1062
+ var sourceRoot = this.sourceRoot;
1063
+ var boundCallback = aCallback.bind(context);
1064
+ var names = this._names;
1065
+ var sources = this._sources;
1066
+ var sourceMapURL = this._sourceMapURL;
1067
+ for (var i = 0, n = mappings.length; i < n; i++) {
1068
+ var mapping = mappings[i];
1069
+ var source = mapping.source === null ? null : sources.at(mapping.source);
1070
+ if (source !== null) {
1071
+ source = util.computeSourceURL(sourceRoot, source, sourceMapURL);
1072
+ }
1073
+ boundCallback({
1074
+ source,
1075
+ generatedLine: mapping.generatedLine,
1076
+ generatedColumn: mapping.generatedColumn,
1077
+ originalLine: mapping.originalLine,
1078
+ originalColumn: mapping.originalColumn,
1079
+ name: mapping.name === null ? null : names.at(mapping.name)
1080
+ });
1081
+ }
1082
+ };
1083
+ SourceMapConsumer2.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
1084
+ var line = util.getArg(aArgs, "line");
1085
+ var needle = {
1086
+ source: util.getArg(aArgs, "source"),
1087
+ originalLine: line,
1088
+ originalColumn: util.getArg(aArgs, "column", 0)
1089
+ };
1090
+ needle.source = this._findSourceIndex(needle.source);
1091
+ if (needle.source < 0) {
1092
+ return [];
1093
+ }
1094
+ var mappings = [];
1095
+ var index = this._findMapping(
1096
+ needle,
1097
+ this._originalMappings,
1098
+ "originalLine",
1099
+ "originalColumn",
1100
+ util.compareByOriginalPositions,
1101
+ binarySearch.LEAST_UPPER_BOUND
1102
+ );
1103
+ if (index >= 0) {
1104
+ var mapping = this._originalMappings[index];
1105
+ if (aArgs.column === void 0) {
1106
+ var originalLine = mapping.originalLine;
1107
+ while (mapping && mapping.originalLine === originalLine) {
1108
+ mappings.push({
1109
+ line: util.getArg(mapping, "generatedLine", null),
1110
+ column: util.getArg(mapping, "generatedColumn", null),
1111
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
1112
+ });
1113
+ mapping = this._originalMappings[++index];
1114
+ }
1115
+ } else {
1116
+ var originalColumn = mapping.originalColumn;
1117
+ while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
1118
+ mappings.push({
1119
+ line: util.getArg(mapping, "generatedLine", null),
1120
+ column: util.getArg(mapping, "generatedColumn", null),
1121
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
1122
+ });
1123
+ mapping = this._originalMappings[++index];
1124
+ }
1125
+ }
1126
+ }
1127
+ return mappings;
1128
+ };
1129
+ exports.SourceMapConsumer = SourceMapConsumer2;
1130
+ function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
1131
+ var sourceMap = aSourceMap;
1132
+ if (typeof aSourceMap === "string") {
1133
+ sourceMap = util.parseSourceMapInput(aSourceMap);
1134
+ }
1135
+ var version = util.getArg(sourceMap, "version");
1136
+ var sources = util.getArg(sourceMap, "sources");
1137
+ var names = util.getArg(sourceMap, "names", []);
1138
+ var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
1139
+ var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
1140
+ var mappings = util.getArg(sourceMap, "mappings");
1141
+ var file = util.getArg(sourceMap, "file", null);
1142
+ if (version != this._version) {
1143
+ throw new Error("Unsupported version: " + version);
1144
+ }
1145
+ if (sourceRoot) {
1146
+ sourceRoot = util.normalize(sourceRoot);
1147
+ }
1148
+ sources = sources.map(String).map(util.normalize).map(function(source) {
1149
+ return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
1150
+ });
1151
+ this._names = ArraySet.fromArray(names.map(String), true);
1152
+ this._sources = ArraySet.fromArray(sources, true);
1153
+ this._absoluteSources = this._sources.toArray().map(function(s) {
1154
+ return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
1155
+ });
1156
+ this.sourceRoot = sourceRoot;
1157
+ this.sourcesContent = sourcesContent;
1158
+ this._mappings = mappings;
1159
+ this._sourceMapURL = aSourceMapURL;
1160
+ this.file = file;
1161
+ }
1162
+ BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer2.prototype);
1163
+ BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer2;
1164
+ BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
1165
+ var relativeSource = aSource;
1166
+ if (this.sourceRoot != null) {
1167
+ relativeSource = util.relative(this.sourceRoot, relativeSource);
1168
+ }
1169
+ if (this._sources.has(relativeSource)) {
1170
+ return this._sources.indexOf(relativeSource);
1171
+ }
1172
+ var i;
1173
+ for (i = 0; i < this._absoluteSources.length; ++i) {
1174
+ if (this._absoluteSources[i] == aSource) {
1175
+ return i;
1176
+ }
1177
+ }
1178
+ return -1;
1179
+ };
1180
+ BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
1181
+ var smc = Object.create(BasicSourceMapConsumer.prototype);
1182
+ var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
1183
+ var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
1184
+ smc.sourceRoot = aSourceMap._sourceRoot;
1185
+ smc.sourcesContent = aSourceMap._generateSourcesContent(
1186
+ smc._sources.toArray(),
1187
+ smc.sourceRoot
1188
+ );
1189
+ smc.file = aSourceMap._file;
1190
+ smc._sourceMapURL = aSourceMapURL;
1191
+ smc._absoluteSources = smc._sources.toArray().map(function(s) {
1192
+ return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
1193
+ });
1194
+ var generatedMappings = aSourceMap._mappings.toArray().slice();
1195
+ var destGeneratedMappings = smc.__generatedMappings = [];
1196
+ var destOriginalMappings = smc.__originalMappings = [];
1197
+ for (var i = 0, length = generatedMappings.length; i < length; i++) {
1198
+ var srcMapping = generatedMappings[i];
1199
+ var destMapping = new Mapping();
1200
+ destMapping.generatedLine = srcMapping.generatedLine;
1201
+ destMapping.generatedColumn = srcMapping.generatedColumn;
1202
+ if (srcMapping.source) {
1203
+ destMapping.source = sources.indexOf(srcMapping.source);
1204
+ destMapping.originalLine = srcMapping.originalLine;
1205
+ destMapping.originalColumn = srcMapping.originalColumn;
1206
+ if (srcMapping.name) {
1207
+ destMapping.name = names.indexOf(srcMapping.name);
1208
+ }
1209
+ destOriginalMappings.push(destMapping);
1210
+ }
1211
+ destGeneratedMappings.push(destMapping);
1212
+ }
1213
+ quickSort(smc.__originalMappings, util.compareByOriginalPositions);
1214
+ return smc;
1215
+ };
1216
+ BasicSourceMapConsumer.prototype._version = 3;
1217
+ Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", {
1218
+ get: function() {
1219
+ return this._absoluteSources.slice();
1220
+ }
1221
+ });
1222
+ function Mapping() {
1223
+ this.generatedLine = 0;
1224
+ this.generatedColumn = 0;
1225
+ this.source = null;
1226
+ this.originalLine = null;
1227
+ this.originalColumn = null;
1228
+ this.name = null;
1229
+ }
1230
+ var compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine;
1231
+ function sortGenerated(array, start) {
1232
+ let l = array.length;
1233
+ let n = array.length - start;
1234
+ if (n <= 1) {
1235
+ return;
1236
+ } else if (n == 2) {
1237
+ let a = array[start];
1238
+ let b = array[start + 1];
1239
+ if (compareGenerated(a, b) > 0) {
1240
+ array[start] = b;
1241
+ array[start + 1] = a;
1242
+ }
1243
+ } else if (n < 20) {
1244
+ for (let i = start; i < l; i++) {
1245
+ for (let j = i; j > start; j--) {
1246
+ let a = array[j - 1];
1247
+ let b = array[j];
1248
+ if (compareGenerated(a, b) <= 0) {
1249
+ break;
1250
+ }
1251
+ array[j - 1] = b;
1252
+ array[j] = a;
1253
+ }
1254
+ }
1255
+ } else {
1256
+ quickSort(array, compareGenerated, start);
1257
+ }
1258
+ }
1259
+ BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
1260
+ var generatedLine = 1;
1261
+ var previousGeneratedColumn = 0;
1262
+ var previousOriginalLine = 0;
1263
+ var previousOriginalColumn = 0;
1264
+ var previousSource = 0;
1265
+ var previousName = 0;
1266
+ var length = aStr.length;
1267
+ var index = 0;
1268
+ var temp = {};
1269
+ var originalMappings = [];
1270
+ var generatedMappings = [];
1271
+ var mapping, segment, end, value;
1272
+ let subarrayStart = 0;
1273
+ while (index < length) {
1274
+ if (aStr.charAt(index) === ";") {
1275
+ generatedLine++;
1276
+ index++;
1277
+ previousGeneratedColumn = 0;
1278
+ sortGenerated(generatedMappings, subarrayStart);
1279
+ subarrayStart = generatedMappings.length;
1280
+ } else if (aStr.charAt(index) === ",") {
1281
+ index++;
1282
+ } else {
1283
+ mapping = new Mapping();
1284
+ mapping.generatedLine = generatedLine;
1285
+ for (end = index; end < length; end++) {
1286
+ if (this._charIsMappingSeparator(aStr, end)) {
1287
+ break;
1288
+ }
1289
+ }
1290
+ aStr.slice(index, end);
1291
+ segment = [];
1292
+ while (index < end) {
1293
+ base64VLQ.decode(aStr, index, temp);
1294
+ value = temp.value;
1295
+ index = temp.rest;
1296
+ segment.push(value);
1297
+ }
1298
+ if (segment.length === 2) {
1299
+ throw new Error("Found a source, but no line and column");
1300
+ }
1301
+ if (segment.length === 3) {
1302
+ throw new Error("Found a source and line, but no column");
1303
+ }
1304
+ mapping.generatedColumn = previousGeneratedColumn + segment[0];
1305
+ previousGeneratedColumn = mapping.generatedColumn;
1306
+ if (segment.length > 1) {
1307
+ mapping.source = previousSource + segment[1];
1308
+ previousSource += segment[1];
1309
+ mapping.originalLine = previousOriginalLine + segment[2];
1310
+ previousOriginalLine = mapping.originalLine;
1311
+ mapping.originalLine += 1;
1312
+ mapping.originalColumn = previousOriginalColumn + segment[3];
1313
+ previousOriginalColumn = mapping.originalColumn;
1314
+ if (segment.length > 4) {
1315
+ mapping.name = previousName + segment[4];
1316
+ previousName += segment[4];
1317
+ }
1318
+ }
1319
+ generatedMappings.push(mapping);
1320
+ if (typeof mapping.originalLine === "number") {
1321
+ let currentSource = mapping.source;
1322
+ while (originalMappings.length <= currentSource) {
1323
+ originalMappings.push(null);
1324
+ }
1325
+ if (originalMappings[currentSource] === null) {
1326
+ originalMappings[currentSource] = [];
1327
+ }
1328
+ originalMappings[currentSource].push(mapping);
1329
+ }
1330
+ }
1331
+ }
1332
+ sortGenerated(generatedMappings, subarrayStart);
1333
+ this.__generatedMappings = generatedMappings;
1334
+ for (var i = 0; i < originalMappings.length; i++) {
1335
+ if (originalMappings[i] != null) {
1336
+ quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource);
1337
+ }
1338
+ }
1339
+ this.__originalMappings = [].concat(...originalMappings);
1340
+ };
1341
+ BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
1342
+ if (aNeedle[aLineName] <= 0) {
1343
+ throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
1344
+ }
1345
+ if (aNeedle[aColumnName] < 0) {
1346
+ throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
1347
+ }
1348
+ return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
1349
+ };
1350
+ BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
1351
+ for (var index = 0; index < this._generatedMappings.length; ++index) {
1352
+ var mapping = this._generatedMappings[index];
1353
+ if (index + 1 < this._generatedMappings.length) {
1354
+ var nextMapping = this._generatedMappings[index + 1];
1355
+ if (mapping.generatedLine === nextMapping.generatedLine) {
1356
+ mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
1357
+ continue;
1358
+ }
1359
+ }
1360
+ mapping.lastGeneratedColumn = Infinity;
1361
+ }
1362
+ };
1363
+ BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
1364
+ var needle = {
1365
+ generatedLine: util.getArg(aArgs, "line"),
1366
+ generatedColumn: util.getArg(aArgs, "column")
1367
+ };
1368
+ var index = this._findMapping(
1369
+ needle,
1370
+ this._generatedMappings,
1371
+ "generatedLine",
1372
+ "generatedColumn",
1373
+ util.compareByGeneratedPositionsDeflated,
1374
+ util.getArg(aArgs, "bias", SourceMapConsumer2.GREATEST_LOWER_BOUND)
1375
+ );
1376
+ if (index >= 0) {
1377
+ var mapping = this._generatedMappings[index];
1378
+ if (mapping.generatedLine === needle.generatedLine) {
1379
+ var source = util.getArg(mapping, "source", null);
1380
+ if (source !== null) {
1381
+ source = this._sources.at(source);
1382
+ source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
1383
+ }
1384
+ var name = util.getArg(mapping, "name", null);
1385
+ if (name !== null) {
1386
+ name = this._names.at(name);
1387
+ }
1388
+ return {
1389
+ source,
1390
+ line: util.getArg(mapping, "originalLine", null),
1391
+ column: util.getArg(mapping, "originalColumn", null),
1392
+ name
1393
+ };
1394
+ }
1395
+ }
1396
+ return {
1397
+ source: null,
1398
+ line: null,
1399
+ column: null,
1400
+ name: null
1401
+ };
1402
+ };
1403
+ BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
1404
+ if (!this.sourcesContent) {
1405
+ return false;
1406
+ }
1407
+ return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
1408
+ return sc == null;
1409
+ });
1410
+ };
1411
+ BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
1412
+ if (!this.sourcesContent) {
1413
+ return null;
1414
+ }
1415
+ var index = this._findSourceIndex(aSource);
1416
+ if (index >= 0) {
1417
+ return this.sourcesContent[index];
1418
+ }
1419
+ var relativeSource = aSource;
1420
+ if (this.sourceRoot != null) {
1421
+ relativeSource = util.relative(this.sourceRoot, relativeSource);
1422
+ }
1423
+ var url;
1424
+ if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
1425
+ var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
1426
+ if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) {
1427
+ return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
1428
+ }
1429
+ if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) {
1430
+ return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
1431
+ }
1432
+ }
1433
+ if (nullOnMissing) {
1434
+ return null;
1435
+ } else {
1436
+ throw new Error('"' + relativeSource + '" is not in the SourceMap.');
1437
+ }
1438
+ };
1439
+ BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
1440
+ var source = util.getArg(aArgs, "source");
1441
+ source = this._findSourceIndex(source);
1442
+ if (source < 0) {
1443
+ return {
1444
+ line: null,
1445
+ column: null,
1446
+ lastColumn: null
1447
+ };
1448
+ }
1449
+ var needle = {
1450
+ source,
1451
+ originalLine: util.getArg(aArgs, "line"),
1452
+ originalColumn: util.getArg(aArgs, "column")
1453
+ };
1454
+ var index = this._findMapping(
1455
+ needle,
1456
+ this._originalMappings,
1457
+ "originalLine",
1458
+ "originalColumn",
1459
+ util.compareByOriginalPositions,
1460
+ util.getArg(aArgs, "bias", SourceMapConsumer2.GREATEST_LOWER_BOUND)
1461
+ );
1462
+ if (index >= 0) {
1463
+ var mapping = this._originalMappings[index];
1464
+ if (mapping.source === needle.source) {
1465
+ return {
1466
+ line: util.getArg(mapping, "generatedLine", null),
1467
+ column: util.getArg(mapping, "generatedColumn", null),
1468
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
1469
+ };
1470
+ }
1471
+ }
1472
+ return {
1473
+ line: null,
1474
+ column: null,
1475
+ lastColumn: null
1476
+ };
1477
+ };
1478
+ exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
1479
+ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
1480
+ var sourceMap = aSourceMap;
1481
+ if (typeof aSourceMap === "string") {
1482
+ sourceMap = util.parseSourceMapInput(aSourceMap);
1483
+ }
1484
+ var version = util.getArg(sourceMap, "version");
1485
+ var sections = util.getArg(sourceMap, "sections");
1486
+ if (version != this._version) {
1487
+ throw new Error("Unsupported version: " + version);
1488
+ }
1489
+ this._sources = new ArraySet();
1490
+ this._names = new ArraySet();
1491
+ var lastOffset = {
1492
+ line: -1,
1493
+ column: 0
1494
+ };
1495
+ this._sections = sections.map(function(s) {
1496
+ if (s.url) {
1497
+ throw new Error("Support for url field in sections not implemented.");
1498
+ }
1499
+ var offset = util.getArg(s, "offset");
1500
+ var offsetLine = util.getArg(offset, "line");
1501
+ var offsetColumn = util.getArg(offset, "column");
1502
+ if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
1503
+ throw new Error("Section offsets must be ordered and non-overlapping.");
1504
+ }
1505
+ lastOffset = offset;
1506
+ return {
1507
+ generatedOffset: {
1508
+ // The offset fields are 0-based, but we use 1-based indices when
1509
+ // encoding/decoding from VLQ.
1510
+ generatedLine: offsetLine + 1,
1511
+ generatedColumn: offsetColumn + 1
1512
+ },
1513
+ consumer: new SourceMapConsumer2(util.getArg(s, "map"), aSourceMapURL)
1514
+ };
1515
+ });
1516
+ }
1517
+ IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer2.prototype);
1518
+ IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer2;
1519
+ IndexedSourceMapConsumer.prototype._version = 3;
1520
+ Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", {
1521
+ get: function() {
1522
+ var sources = [];
1523
+ for (var i = 0; i < this._sections.length; i++) {
1524
+ for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
1525
+ sources.push(this._sections[i].consumer.sources[j]);
1526
+ }
1527
+ }
1528
+ return sources;
1529
+ }
1530
+ });
1531
+ IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
1532
+ var needle = {
1533
+ generatedLine: util.getArg(aArgs, "line"),
1534
+ generatedColumn: util.getArg(aArgs, "column")
1535
+ };
1536
+ var sectionIndex = binarySearch.search(
1537
+ needle,
1538
+ this._sections,
1539
+ function(needle2, section2) {
1540
+ var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine;
1541
+ if (cmp) {
1542
+ return cmp;
1543
+ }
1544
+ return needle2.generatedColumn - section2.generatedOffset.generatedColumn;
1545
+ }
1546
+ );
1547
+ var section = this._sections[sectionIndex];
1548
+ if (!section) {
1549
+ return {
1550
+ source: null,
1551
+ line: null,
1552
+ column: null,
1553
+ name: null
1554
+ };
1555
+ }
1556
+ return section.consumer.originalPositionFor({
1557
+ line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
1558
+ column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
1559
+ bias: aArgs.bias
1560
+ });
1561
+ };
1562
+ IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
1563
+ return this._sections.every(function(s) {
1564
+ return s.consumer.hasContentsOfAllSources();
1565
+ });
1566
+ };
1567
+ IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
1568
+ for (var i = 0; i < this._sections.length; i++) {
1569
+ var section = this._sections[i];
1570
+ var content = section.consumer.sourceContentFor(aSource, true);
1571
+ if (content || content === "") {
1572
+ return content;
1573
+ }
1574
+ }
1575
+ if (nullOnMissing) {
1576
+ return null;
1577
+ } else {
1578
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
1579
+ }
1580
+ };
1581
+ IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
1582
+ for (var i = 0; i < this._sections.length; i++) {
1583
+ var section = this._sections[i];
1584
+ if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) {
1585
+ continue;
1586
+ }
1587
+ var generatedPosition = section.consumer.generatedPositionFor(aArgs);
1588
+ if (generatedPosition) {
1589
+ var ret = {
1590
+ line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
1591
+ column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
1592
+ };
1593
+ return ret;
1594
+ }
1595
+ }
1596
+ return {
1597
+ line: null,
1598
+ column: null
1599
+ };
1600
+ };
1601
+ IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
1602
+ this.__generatedMappings = [];
1603
+ this.__originalMappings = [];
1604
+ for (var i = 0; i < this._sections.length; i++) {
1605
+ var section = this._sections[i];
1606
+ var sectionMappings = section.consumer._generatedMappings;
1607
+ for (var j = 0; j < sectionMappings.length; j++) {
1608
+ var mapping = sectionMappings[j];
1609
+ var source = section.consumer._sources.at(mapping.source);
1610
+ if (source !== null) {
1611
+ source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
1612
+ }
1613
+ this._sources.add(source);
1614
+ source = this._sources.indexOf(source);
1615
+ var name = null;
1616
+ if (mapping.name) {
1617
+ name = section.consumer._names.at(mapping.name);
1618
+ this._names.add(name);
1619
+ name = this._names.indexOf(name);
1620
+ }
1621
+ var adjustedMapping = {
1622
+ source,
1623
+ generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
1624
+ generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
1625
+ originalLine: mapping.originalLine,
1626
+ originalColumn: mapping.originalColumn,
1627
+ name
1628
+ };
1629
+ this.__generatedMappings.push(adjustedMapping);
1630
+ if (typeof adjustedMapping.originalLine === "number") {
1631
+ this.__originalMappings.push(adjustedMapping);
1632
+ }
1633
+ }
1634
+ }
1635
+ quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
1636
+ quickSort(this.__originalMappings, util.compareByOriginalPositions);
1637
+ };
1638
+ exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
1639
+ }
1640
+ });
1641
+
1642
+ // ../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.js
1643
+ var require_source_node = __commonJS({
1644
+ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.js"(exports) {
1645
+ var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
1646
+ var util = require_util();
1647
+ var REGEX_NEWLINE = /(\r?\n)/;
1648
+ var NEWLINE_CODE = 10;
1649
+ var isSourceNode = "$$$isSourceNode$$$";
1650
+ function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
1651
+ this.children = [];
1652
+ this.sourceContents = {};
1653
+ this.line = aLine == null ? null : aLine;
1654
+ this.column = aColumn == null ? null : aColumn;
1655
+ this.source = aSource == null ? null : aSource;
1656
+ this.name = aName == null ? null : aName;
1657
+ this[isSourceNode] = true;
1658
+ if (aChunks != null) this.add(aChunks);
1659
+ }
1660
+ SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
1661
+ var node = new SourceNode();
1662
+ var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
1663
+ var remainingLinesIndex = 0;
1664
+ var shiftNextLine = function() {
1665
+ var lineContents = getNextLine();
1666
+ var newLine = getNextLine() || "";
1667
+ return lineContents + newLine;
1668
+ function getNextLine() {
1669
+ return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
1670
+ }
1671
+ };
1672
+ var lastGeneratedLine = 1, lastGeneratedColumn = 0;
1673
+ var lastMapping = null;
1674
+ aSourceMapConsumer.eachMapping(function(mapping) {
1675
+ if (lastMapping !== null) {
1676
+ if (lastGeneratedLine < mapping.generatedLine) {
1677
+ addMappingWithCode(lastMapping, shiftNextLine());
1678
+ lastGeneratedLine++;
1679
+ lastGeneratedColumn = 0;
1680
+ } else {
1681
+ var nextLine = remainingLines[remainingLinesIndex] || "";
1682
+ var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
1683
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
1684
+ lastGeneratedColumn = mapping.generatedColumn;
1685
+ addMappingWithCode(lastMapping, code);
1686
+ lastMapping = mapping;
1687
+ return;
1688
+ }
1689
+ }
1690
+ while (lastGeneratedLine < mapping.generatedLine) {
1691
+ node.add(shiftNextLine());
1692
+ lastGeneratedLine++;
1693
+ }
1694
+ if (lastGeneratedColumn < mapping.generatedColumn) {
1695
+ var nextLine = remainingLines[remainingLinesIndex] || "";
1696
+ node.add(nextLine.substr(0, mapping.generatedColumn));
1697
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
1698
+ lastGeneratedColumn = mapping.generatedColumn;
1699
+ }
1700
+ lastMapping = mapping;
1701
+ }, this);
1702
+ if (remainingLinesIndex < remainingLines.length) {
1703
+ if (lastMapping) {
1704
+ addMappingWithCode(lastMapping, shiftNextLine());
1705
+ }
1706
+ node.add(remainingLines.splice(remainingLinesIndex).join(""));
1707
+ }
1708
+ aSourceMapConsumer.sources.forEach(function(sourceFile) {
1709
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
1710
+ if (content != null) {
1711
+ if (aRelativePath != null) {
1712
+ sourceFile = util.join(aRelativePath, sourceFile);
1713
+ }
1714
+ node.setSourceContent(sourceFile, content);
1715
+ }
1716
+ });
1717
+ return node;
1718
+ function addMappingWithCode(mapping, code) {
1719
+ if (mapping === null || mapping.source === void 0) {
1720
+ node.add(code);
1721
+ } else {
1722
+ var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
1723
+ node.add(new SourceNode(
1724
+ mapping.originalLine,
1725
+ mapping.originalColumn,
1726
+ source,
1727
+ code,
1728
+ mapping.name
1729
+ ));
1730
+ }
1731
+ }
1732
+ };
1733
+ SourceNode.prototype.add = function SourceNode_add(aChunk) {
1734
+ if (Array.isArray(aChunk)) {
1735
+ aChunk.forEach(function(chunk) {
1736
+ this.add(chunk);
1737
+ }, this);
1738
+ } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
1739
+ if (aChunk) {
1740
+ this.children.push(aChunk);
1741
+ }
1742
+ } else {
1743
+ throw new TypeError(
1744
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
1745
+ );
1746
+ }
1747
+ return this;
1748
+ };
1749
+ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
1750
+ if (Array.isArray(aChunk)) {
1751
+ for (var i = aChunk.length - 1; i >= 0; i--) {
1752
+ this.prepend(aChunk[i]);
1753
+ }
1754
+ } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
1755
+ this.children.unshift(aChunk);
1756
+ } else {
1757
+ throw new TypeError(
1758
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
1759
+ );
1760
+ }
1761
+ return this;
1762
+ };
1763
+ SourceNode.prototype.walk = function SourceNode_walk(aFn) {
1764
+ var chunk;
1765
+ for (var i = 0, len = this.children.length; i < len; i++) {
1766
+ chunk = this.children[i];
1767
+ if (chunk[isSourceNode]) {
1768
+ chunk.walk(aFn);
1769
+ } else {
1770
+ if (chunk !== "") {
1771
+ aFn(chunk, {
1772
+ source: this.source,
1773
+ line: this.line,
1774
+ column: this.column,
1775
+ name: this.name
1776
+ });
1777
+ }
1778
+ }
1779
+ }
1780
+ };
1781
+ SourceNode.prototype.join = function SourceNode_join(aSep) {
1782
+ var newChildren;
1783
+ var i;
1784
+ var len = this.children.length;
1785
+ if (len > 0) {
1786
+ newChildren = [];
1787
+ for (i = 0; i < len - 1; i++) {
1788
+ newChildren.push(this.children[i]);
1789
+ newChildren.push(aSep);
1790
+ }
1791
+ newChildren.push(this.children[i]);
1792
+ this.children = newChildren;
1793
+ }
1794
+ return this;
1795
+ };
1796
+ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
1797
+ var lastChild = this.children[this.children.length - 1];
1798
+ if (lastChild[isSourceNode]) {
1799
+ lastChild.replaceRight(aPattern, aReplacement);
1800
+ } else if (typeof lastChild === "string") {
1801
+ this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
1802
+ } else {
1803
+ this.children.push("".replace(aPattern, aReplacement));
1804
+ }
1805
+ return this;
1806
+ };
1807
+ SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
1808
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
1809
+ };
1810
+ SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
1811
+ for (var i = 0, len = this.children.length; i < len; i++) {
1812
+ if (this.children[i][isSourceNode]) {
1813
+ this.children[i].walkSourceContents(aFn);
1814
+ }
1815
+ }
1816
+ var sources = Object.keys(this.sourceContents);
1817
+ for (var i = 0, len = sources.length; i < len; i++) {
1818
+ aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
1819
+ }
1820
+ };
1821
+ SourceNode.prototype.toString = function SourceNode_toString() {
1822
+ var str = "";
1823
+ this.walk(function(chunk) {
1824
+ str += chunk;
1825
+ });
1826
+ return str;
1827
+ };
1828
+ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
1829
+ var generated = {
1830
+ code: "",
1831
+ line: 1,
1832
+ column: 0
1833
+ };
1834
+ var map = new SourceMapGenerator(aArgs);
1835
+ var sourceMappingActive = false;
1836
+ var lastOriginalSource = null;
1837
+ var lastOriginalLine = null;
1838
+ var lastOriginalColumn = null;
1839
+ var lastOriginalName = null;
1840
+ this.walk(function(chunk, original) {
1841
+ generated.code += chunk;
1842
+ if (original.source !== null && original.line !== null && original.column !== null) {
1843
+ if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
1844
+ map.addMapping({
1845
+ source: original.source,
1846
+ original: {
1847
+ line: original.line,
1848
+ column: original.column
1849
+ },
1850
+ generated: {
1851
+ line: generated.line,
1852
+ column: generated.column
1853
+ },
1854
+ name: original.name
1855
+ });
1856
+ }
1857
+ lastOriginalSource = original.source;
1858
+ lastOriginalLine = original.line;
1859
+ lastOriginalColumn = original.column;
1860
+ lastOriginalName = original.name;
1861
+ sourceMappingActive = true;
1862
+ } else if (sourceMappingActive) {
1863
+ map.addMapping({
1864
+ generated: {
1865
+ line: generated.line,
1866
+ column: generated.column
1867
+ }
1868
+ });
1869
+ lastOriginalSource = null;
1870
+ sourceMappingActive = false;
1871
+ }
1872
+ for (var idx = 0, length = chunk.length; idx < length; idx++) {
1873
+ if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
1874
+ generated.line++;
1875
+ generated.column = 0;
1876
+ if (idx + 1 === length) {
1877
+ lastOriginalSource = null;
1878
+ sourceMappingActive = false;
1879
+ } else if (sourceMappingActive) {
1880
+ map.addMapping({
1881
+ source: original.source,
1882
+ original: {
1883
+ line: original.line,
1884
+ column: original.column
1885
+ },
1886
+ generated: {
1887
+ line: generated.line,
1888
+ column: generated.column
1889
+ },
1890
+ name: original.name
1891
+ });
1892
+ }
1893
+ } else {
1894
+ generated.column++;
1895
+ }
1896
+ }
1897
+ });
1898
+ this.walkSourceContents(function(sourceFile, sourceContent) {
1899
+ map.setSourceContent(sourceFile, sourceContent);
1900
+ });
1901
+ return { code: generated.code, map };
1902
+ };
1903
+ exports.SourceNode = SourceNode;
1904
+ }
1905
+ });
1906
+
1907
+ // ../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/source-map.js
1908
+ var require_source_map = __commonJS({
1909
+ "../../node_modules/.pnpm/source-map-js@1.2.1/node_modules/source-map-js/source-map.js"(exports) {
1910
+ exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
1911
+ exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
1912
+ exports.SourceNode = require_source_node().SourceNode;
1913
+ }
1914
+ });
1915
+
1916
+ // ../../node_modules/.pnpm/error-stack-parser-es@1.0.5/node_modules/error-stack-parser-es/dist/lite.mjs
1917
+ var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
1918
+ var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code\])?$/;
1919
+ function parseStack(stackString, options) {
1920
+ if (stackString.match(CHROME_IE_STACK_REGEXP))
1921
+ return parseV8OrIeString(stackString);
1922
+ else
1923
+ return parseFFOrSafariString(stackString);
1924
+ }
1925
+ function extractLocation(urlLike) {
1926
+ if (!urlLike.includes(":"))
1927
+ return [urlLike, void 0, void 0];
1928
+ const regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
1929
+ const parts = regExp.exec(urlLike.replace(/[()]/g, ""));
1930
+ return [parts[1], parts[2] || void 0, parts[3] || void 0];
1931
+ }
1932
+ function applySlice(lines, options) {
1933
+ return lines;
1934
+ }
1935
+ function parseV8OrIeString(stack, options) {
1936
+ const filtered = applySlice(
1937
+ stack.split("\n").filter((line) => {
1938
+ return !!line.match(CHROME_IE_STACK_REGEXP);
1939
+ }));
1940
+ return filtered.map((line) => {
1941
+ if (line.includes("(eval ")) {
1942
+ line = line.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, "");
1943
+ }
1944
+ let sanitizedLine = line.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, "");
1945
+ const location = sanitizedLine.match(/ (\(.+\)$)/);
1946
+ sanitizedLine = location ? sanitizedLine.replace(location[0], "") : sanitizedLine;
1947
+ const locationParts = extractLocation(location ? location[1] : sanitizedLine);
1948
+ const functionName = location && sanitizedLine || void 0;
1949
+ const fileName = ["eval", "<anonymous>"].includes(locationParts[0]) ? void 0 : locationParts[0];
1950
+ return {
1951
+ function: functionName,
1952
+ file: fileName,
1953
+ line: locationParts[1] ? +locationParts[1] : void 0,
1954
+ col: locationParts[2] ? +locationParts[2] : void 0,
1955
+ raw: line
1956
+ };
1957
+ });
1958
+ }
1959
+ function parseFFOrSafariString(stack, options) {
1960
+ const filtered = applySlice(
1961
+ stack.split("\n").filter((line) => {
1962
+ return !line.match(SAFARI_NATIVE_CODE_REGEXP);
1963
+ }));
1964
+ return filtered.map((line) => {
1965
+ if (line.includes(" > eval"))
1966
+ line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1");
1967
+ if (!line.includes("@") && !line.includes(":")) {
1968
+ return {
1969
+ function: line
1970
+ };
1971
+ } else {
1972
+ const functionNameRegex = /(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/;
1973
+ const matches = line.match(functionNameRegex);
1974
+ const functionName = matches && matches[1] ? matches[1] : void 0;
1975
+ const locationParts = extractLocation(line.replace(functionNameRegex, ""));
1976
+ return {
1977
+ function: functionName,
1978
+ file: locationParts[0],
1979
+ line: locationParts[1] ? +locationParts[1] : void 0,
1980
+ col: locationParts[2] ? +locationParts[2] : void 0,
1981
+ raw: line
1982
+ };
1983
+ }
1984
+ });
1985
+ }
1986
+
1987
+ // src/source.ts
1988
+ var import_source_map_js = __toESM(require_source_map(), 1);
1989
+ var reentry = false;
1990
+ var describeBuiltInComponentFrame = (name) => {
1991
+ return `
1992
+ in ${name}`;
1993
+ };
1994
+ var disableLogs = () => {
1995
+ const prev = {
1996
+ error: console.error,
1997
+ warn: console.warn
1998
+ };
1999
+ console.error = () => {
2000
+ };
2001
+ console.warn = () => {
2002
+ };
2003
+ return prev;
2004
+ };
2005
+ var reenableLogs = (prev) => {
2006
+ console.error = prev.error;
2007
+ console.warn = prev.warn;
2008
+ };
2009
+ var INLINE_SOURCEMAP_REGEX = /^data:application\/json[^,]+base64,/;
2010
+ var SOURCEMAP_REGEX = /(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/;
2011
+ var getSourceMap = async (url, content) => {
2012
+ const lines = content.split("\n");
2013
+ let sourceMapUrl;
2014
+ for (let i = lines.length - 1; i >= 0 && !sourceMapUrl; i--) {
2015
+ const result = lines[i].match(SOURCEMAP_REGEX);
2016
+ if (result) {
2017
+ sourceMapUrl = result[1];
2018
+ }
2019
+ }
2020
+ if (!sourceMapUrl) {
2021
+ return null;
2022
+ }
2023
+ if (!(INLINE_SOURCEMAP_REGEX.test(sourceMapUrl) || sourceMapUrl.startsWith("/"))) {
2024
+ const parsedURL = url.split("/");
2025
+ parsedURL[parsedURL.length - 1] = sourceMapUrl;
2026
+ sourceMapUrl = parsedURL.join("/");
2027
+ }
2028
+ const response = await fetch(sourceMapUrl);
2029
+ const rawSourceMap = await response.json();
2030
+ return new import_source_map_js.SourceMapConsumer(rawSourceMap);
2031
+ };
2032
+ var getActualFileSource = (path) => {
2033
+ if (path.startsWith("file://")) {
2034
+ return `/_build/@fs${path.substring("file://".length)}`;
2035
+ }
2036
+ return path;
2037
+ };
2038
+ var parseStackFrame = async (frame) => {
2039
+ const source = parseStack(frame);
2040
+ if (!source.length) {
2041
+ return null;
2042
+ }
2043
+ const { file, line, col } = source[0];
2044
+ if (!file || !line) {
2045
+ return null;
2046
+ }
2047
+ const fileName = file || "";
2048
+ const lineNumber = line || 0;
2049
+ const columnNumber = col || 0;
2050
+ const response = await fetch(getActualFileSource(fileName));
2051
+ if (response.ok) {
2052
+ const content = await response.text();
2053
+ const sourcemap = await getSourceMap(fileName, content);
2054
+ if (sourcemap) {
2055
+ const result = sourcemap.originalPositionFor({
2056
+ line: lineNumber,
2057
+ column: columnNumber
2058
+ });
2059
+ return {
2060
+ fileName: sourcemap.file || "",
2061
+ lineNumber: result.line || 0,
2062
+ columnNumber: result.column || 0
2063
+ };
2064
+ }
2065
+ }
2066
+ return {
2067
+ fileName,
2068
+ lineNumber,
2069
+ columnNumber
2070
+ };
2071
+ };
2072
+ var describeNativeComponentFrame = (fn, construct, currentDispatcherRef) => {
2073
+ if (!fn || reentry) {
2074
+ return "";
2075
+ }
2076
+ const previousPrepareStackTrace = Error.prepareStackTrace;
2077
+ Error.prepareStackTrace = void 0;
2078
+ reentry = true;
2079
+ const previousDispatcher = currentDispatcherRef.current;
2080
+ currentDispatcherRef.current = null;
2081
+ const prevLogs = disableLogs();
2082
+ const RunInRootFrame = {
2083
+ DetermineComponentFrameRoot() {
2084
+ let control;
2085
+ try {
2086
+ if (construct) {
2087
+ const Fake = () => {
2088
+ throw Error();
2089
+ };
2090
+ Object.defineProperty(Fake.prototype, "props", {
2091
+ set: () => {
2092
+ throw Error();
2093
+ }
2094
+ });
2095
+ if (typeof Reflect === "object" && Reflect.construct) {
2096
+ try {
2097
+ Reflect.construct(Fake, []);
2098
+ } catch (x) {
2099
+ control = x;
2100
+ }
2101
+ Reflect.construct(fn, [], Fake);
2102
+ } else {
2103
+ try {
2104
+ Fake.call(null);
2105
+ } catch (x) {
2106
+ control = x;
2107
+ }
2108
+ fn.call(Fake.prototype);
2109
+ }
2110
+ } else {
2111
+ try {
2112
+ throw Error();
2113
+ } catch (x) {
2114
+ control = x;
2115
+ }
2116
+ const maybePromise = fn();
2117
+ if (maybePromise && typeof maybePromise === "object" && "catch" in maybePromise && typeof maybePromise.catch === "function") {
2118
+ maybePromise.catch(() => {
2119
+ });
2120
+ }
2121
+ }
2122
+ } catch (sample) {
2123
+ if (sample instanceof Error && control && control.stack && sample.stack) {
2124
+ return [sample.stack, control.stack];
2125
+ }
2126
+ }
2127
+ return [null, null];
2128
+ }
2129
+ };
2130
+ RunInRootFrame.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
2131
+ const namePropDescriptor = Object.getOwnPropertyDescriptor(
2132
+ RunInRootFrame.DetermineComponentFrameRoot,
2133
+ "name"
2134
+ );
2135
+ if (namePropDescriptor?.configurable) {
2136
+ Object.defineProperty(RunInRootFrame.DetermineComponentFrameRoot, "name", {
2137
+ value: "DetermineComponentFrameRoot"
2138
+ });
2139
+ }
2140
+ try {
2141
+ const [sampleStack, controlStack] = RunInRootFrame.DetermineComponentFrameRoot();
2142
+ if (sampleStack && controlStack) {
2143
+ const sampleLines = sampleStack.split("\n");
2144
+ const controlLines = controlStack.split("\n");
2145
+ let s = 0;
2146
+ let c = 0;
2147
+ while (s < sampleLines.length && !sampleLines[s].includes("DetermineComponentFrameRoot")) {
2148
+ s++;
2149
+ }
2150
+ while (c < controlLines.length && !controlLines[c].includes("DetermineComponentFrameRoot")) {
2151
+ c++;
2152
+ }
2153
+ if (s === sampleLines.length || c === controlLines.length) {
2154
+ s = sampleLines.length - 1;
2155
+ c = controlLines.length - 1;
2156
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
2157
+ c--;
2158
+ }
2159
+ }
2160
+ for (; s >= 1 && c >= 0; s--, c--) {
2161
+ if (sampleLines[s] !== controlLines[c]) {
2162
+ if (s !== 1 || c !== 1) {
2163
+ do {
2164
+ s--;
2165
+ c--;
2166
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
2167
+ let frame = `
2168
+ ${sampleLines[s].replace(" at new ", " at ")}`;
2169
+ const displayName = getDisplayName(fn);
2170
+ if (displayName && frame.includes("<anonymous>")) {
2171
+ frame = frame.replace("<anonymous>", displayName);
2172
+ }
2173
+ return frame;
2174
+ }
2175
+ } while (s >= 1 && c >= 0);
2176
+ }
2177
+ break;
2178
+ }
2179
+ }
2180
+ }
2181
+ } finally {
2182
+ reentry = false;
2183
+ Error.prepareStackTrace = previousPrepareStackTrace;
2184
+ currentDispatcherRef.current = previousDispatcher;
2185
+ reenableLogs(prevLogs);
2186
+ }
2187
+ const name = fn ? getDisplayName(fn) : "";
2188
+ const syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
2189
+ return syntheticFrame;
2190
+ };
2191
+ var ReactSharedInternals = (
2192
+ // biome-ignore lint/suspicious/noExplicitAny: OK
2193
+ React?.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE || // biome-ignore lint/suspicious/noExplicitAny: OK
2194
+ React?.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
2195
+ );
2196
+ var getFiberSource = async (fiber) => {
2197
+ const debugSource = fiber._debugSource;
2198
+ if (debugSource) {
2199
+ const { fileName, lineNumber } = debugSource;
2200
+ return {
2201
+ fileName,
2202
+ lineNumber,
2203
+ columnNumber: "columnNumber" in debugSource && typeof debugSource.columnNumber === "number" ? debugSource.columnNumber : 0
2204
+ };
2205
+ }
2206
+ if (fiber.memoizedProps?.__source) {
2207
+ return fiber.memoizedProps.__source;
2208
+ }
2209
+ const rdtHook = getRDTHook();
2210
+ let currentDispatcherRef = ReactSharedInternals?.ReactCurrentDispatcher || ReactSharedInternals?.H;
2211
+ for (const renderer of rdtHook.renderers.values()) {
2212
+ currentDispatcherRef = renderer.currentDispatcherRef;
2213
+ if (currentDispatcherRef) {
2214
+ break;
2215
+ }
2216
+ }
2217
+ if (!currentDispatcherRef) {
2218
+ return null;
2219
+ }
2220
+ const componentFunction = isHostFiber(fiber) ? getType(
2221
+ traverseFiber(
2222
+ fiber,
2223
+ (f) => {
2224
+ if (isCompositeFiber(f)) return true;
2225
+ },
2226
+ true
2227
+ )
2228
+ ) : getType(fiber.type);
2229
+ if (!componentFunction || reentry) {
2230
+ return null;
2231
+ }
2232
+ const frame = describeNativeComponentFrame(
2233
+ componentFunction,
2234
+ fiber.tag === ClassComponentTag,
2235
+ ReactSharedInternals
2236
+ );
2237
+ return parseStackFrame(frame);
2238
+ };
2239
+
2240
+ export { getFiberSource };