@nice-code/action 0.13.0 → 0.15.0

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.
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_rolldown_runtime = require("../../rolldown-runtime-emK7D4bc.cjs");
2
3
  const require_ActionDevtoolsCore = require("../../ActionDevtoolsCore-DtgXwPBZ.cjs");
3
4
  let _nice_code_util = require("@nice-code/util");
4
5
  let react = require("react");
@@ -6,7 +7,6 @@ let react_jsx_runtime = require("react/jsx-runtime");
6
7
  let react_dom = require("react-dom");
7
8
  let _tanstack_react_virtual = require("@tanstack/react-virtual");
8
9
  let lucide_react = require("lucide-react");
9
- let source_map_js = require("source-map-js");
10
10
  //#region ../nice-devtools-shared/src/colors.ts
11
11
  const DEVTOOL_COLOR_SEMANTIC_ERROR = "#FF5C5C";
12
12
  const DEVTOOL_COLOR_SEMANTIC_SUCCESS = "#A3E635";
@@ -1274,7 +1274,2104 @@ const devtools_storage = (0, _nice_code_util.createTypedWebLocalStorage)({
1274
1274
  });
1275
1275
  devtools_storage.updateJsonWithDef("runtimeToProjectFilePath", {}, (prev) => prev);
1276
1276
  //#endregion
1277
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/base64.js
1278
+ var require_base64 = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
1279
+ var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
1280
+ /**
1281
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
1282
+ */
1283
+ exports.encode = function(number) {
1284
+ if (0 <= number && number < intToCharMap.length) return intToCharMap[number];
1285
+ throw new TypeError("Must be between 0 and 63: " + number);
1286
+ };
1287
+ /**
1288
+ * Decode a single base 64 character code digit to an integer. Returns -1 on
1289
+ * failure.
1290
+ */
1291
+ exports.decode = function(charCode) {
1292
+ var bigA = 65;
1293
+ var bigZ = 90;
1294
+ var littleA = 97;
1295
+ var littleZ = 122;
1296
+ var zero = 48;
1297
+ var nine = 57;
1298
+ var plus = 43;
1299
+ var slash = 47;
1300
+ var littleOffset = 26;
1301
+ var numberOffset = 52;
1302
+ if (bigA <= charCode && charCode <= bigZ) return charCode - bigA;
1303
+ if (littleA <= charCode && charCode <= littleZ) return charCode - littleA + littleOffset;
1304
+ if (zero <= charCode && charCode <= nine) return charCode - zero + numberOffset;
1305
+ if (charCode == plus) return 62;
1306
+ if (charCode == slash) return 63;
1307
+ return -1;
1308
+ };
1309
+ }));
1310
+ //#endregion
1311
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/base64-vlq.js
1312
+ var require_base64_vlq = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
1313
+ var base64 = require_base64();
1314
+ var VLQ_BASE_SHIFT = 5;
1315
+ var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
1316
+ var VLQ_BASE_MASK = VLQ_BASE - 1;
1317
+ var VLQ_CONTINUATION_BIT = VLQ_BASE;
1318
+ /**
1319
+ * Converts from a two-complement value to a value where the sign bit is
1320
+ * placed in the least significant bit. For example, as decimals:
1321
+ * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
1322
+ * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
1323
+ */
1324
+ function toVLQSigned(aValue) {
1325
+ return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
1326
+ }
1327
+ /**
1328
+ * Converts to a two-complement value from a value where the sign bit is
1329
+ * placed in the least significant bit. For example, as decimals:
1330
+ * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
1331
+ * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
1332
+ */
1333
+ function fromVLQSigned(aValue) {
1334
+ var isNegative = (aValue & 1) === 1;
1335
+ var shifted = aValue >> 1;
1336
+ return isNegative ? -shifted : shifted;
1337
+ }
1338
+ /**
1339
+ * Returns the base 64 VLQ encoded value.
1340
+ */
1341
+ exports.encode = function base64VLQ_encode(aValue) {
1342
+ var encoded = "";
1343
+ var digit;
1344
+ var vlq = toVLQSigned(aValue);
1345
+ do {
1346
+ digit = vlq & VLQ_BASE_MASK;
1347
+ vlq >>>= VLQ_BASE_SHIFT;
1348
+ if (vlq > 0) digit |= VLQ_CONTINUATION_BIT;
1349
+ encoded += base64.encode(digit);
1350
+ } while (vlq > 0);
1351
+ return encoded;
1352
+ };
1353
+ /**
1354
+ * Decodes the next base 64 VLQ value from the given string and returns the
1355
+ * value and the rest of the string via the out parameter.
1356
+ */
1357
+ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
1358
+ var strLen = aStr.length;
1359
+ var result = 0;
1360
+ var shift = 0;
1361
+ var continuation, digit;
1362
+ do {
1363
+ if (aIndex >= strLen) throw new Error("Expected more digits in base 64 VLQ value.");
1364
+ digit = base64.decode(aStr.charCodeAt(aIndex++));
1365
+ if (digit === -1) throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
1366
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
1367
+ digit &= VLQ_BASE_MASK;
1368
+ result = result + (digit << shift);
1369
+ shift += VLQ_BASE_SHIFT;
1370
+ } while (continuation);
1371
+ aOutParam.value = fromVLQSigned(result);
1372
+ aOutParam.rest = aIndex;
1373
+ };
1374
+ }));
1375
+ //#endregion
1376
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/util.js
1377
+ var require_util = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
1378
+ /**
1379
+ * This is a helper function for getting values from parameter/options
1380
+ * objects.
1381
+ *
1382
+ * @param args The object we are extracting values from
1383
+ * @param name The name of the property we are getting.
1384
+ * @param defaultValue An optional value to return if the property is missing
1385
+ * from the object. If this is not specified and the property is missing, an
1386
+ * error will be thrown.
1387
+ */
1388
+ function getArg(aArgs, aName, aDefaultValue) {
1389
+ if (aName in aArgs) return aArgs[aName];
1390
+ else if (arguments.length === 3) return aDefaultValue;
1391
+ else throw new Error("\"" + aName + "\" is a required argument.");
1392
+ }
1393
+ exports.getArg = getArg;
1394
+ var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
1395
+ var dataUrlRegexp = /^data:.+\,.+$/;
1396
+ function urlParse(aUrl) {
1397
+ var match = aUrl.match(urlRegexp);
1398
+ if (!match) return null;
1399
+ return {
1400
+ scheme: match[1],
1401
+ auth: match[2],
1402
+ host: match[3],
1403
+ port: match[4],
1404
+ path: match[5]
1405
+ };
1406
+ }
1407
+ exports.urlParse = urlParse;
1408
+ function urlGenerate(aParsedUrl) {
1409
+ var url = "";
1410
+ if (aParsedUrl.scheme) url += aParsedUrl.scheme + ":";
1411
+ url += "//";
1412
+ if (aParsedUrl.auth) url += aParsedUrl.auth + "@";
1413
+ if (aParsedUrl.host) url += aParsedUrl.host;
1414
+ if (aParsedUrl.port) url += ":" + aParsedUrl.port;
1415
+ if (aParsedUrl.path) url += aParsedUrl.path;
1416
+ return url;
1417
+ }
1418
+ exports.urlGenerate = urlGenerate;
1419
+ var MAX_CACHED_INPUTS = 32;
1420
+ /**
1421
+ * Takes some function `f(input) -> result` and returns a memoized version of
1422
+ * `f`.
1423
+ *
1424
+ * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The
1425
+ * memoization is a dumb-simple, linear least-recently-used cache.
1426
+ */
1427
+ function lruMemoize(f) {
1428
+ var cache = [];
1429
+ return function(input) {
1430
+ for (var i = 0; i < cache.length; i++) if (cache[i].input === input) {
1431
+ var temp = cache[0];
1432
+ cache[0] = cache[i];
1433
+ cache[i] = temp;
1434
+ return cache[0].result;
1435
+ }
1436
+ var result = f(input);
1437
+ cache.unshift({
1438
+ input,
1439
+ result
1440
+ });
1441
+ if (cache.length > MAX_CACHED_INPUTS) cache.pop();
1442
+ return result;
1443
+ };
1444
+ }
1445
+ /**
1446
+ * Normalizes a path, or the path portion of a URL:
1447
+ *
1448
+ * - Replaces consecutive slashes with one slash.
1449
+ * - Removes unnecessary '.' parts.
1450
+ * - Removes unnecessary '<dir>/..' parts.
1451
+ *
1452
+ * Based on code in the Node.js 'path' core module.
1453
+ *
1454
+ * @param aPath The path or url to normalize.
1455
+ */
1456
+ var normalize = lruMemoize(function normalize(aPath) {
1457
+ var path = aPath;
1458
+ var url = urlParse(aPath);
1459
+ if (url) {
1460
+ if (!url.path) return aPath;
1461
+ path = url.path;
1462
+ }
1463
+ var isAbsolute = exports.isAbsolute(path);
1464
+ var parts = [];
1465
+ var start = 0;
1466
+ var i = 0;
1467
+ while (true) {
1468
+ start = i;
1469
+ i = path.indexOf("/", start);
1470
+ if (i === -1) {
1471
+ parts.push(path.slice(start));
1472
+ break;
1473
+ } else {
1474
+ parts.push(path.slice(start, i));
1475
+ while (i < path.length && path[i] === "/") i++;
1476
+ }
1477
+ }
1478
+ for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
1479
+ part = parts[i];
1480
+ if (part === ".") parts.splice(i, 1);
1481
+ else if (part === "..") up++;
1482
+ else if (up > 0) if (part === "") {
1483
+ parts.splice(i + 1, up);
1484
+ up = 0;
1485
+ } else {
1486
+ parts.splice(i, 2);
1487
+ up--;
1488
+ }
1489
+ }
1490
+ path = parts.join("/");
1491
+ if (path === "") path = isAbsolute ? "/" : ".";
1492
+ if (url) {
1493
+ url.path = path;
1494
+ return urlGenerate(url);
1495
+ }
1496
+ return path;
1497
+ });
1498
+ exports.normalize = normalize;
1499
+ /**
1500
+ * Joins two paths/URLs.
1501
+ *
1502
+ * @param aRoot The root path or URL.
1503
+ * @param aPath The path or URL to be joined with the root.
1504
+ *
1505
+ * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
1506
+ * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
1507
+ * first.
1508
+ * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
1509
+ * is updated with the result and aRoot is returned. Otherwise the result
1510
+ * is returned.
1511
+ * - If aPath is absolute, the result is aPath.
1512
+ * - Otherwise the two paths are joined with a slash.
1513
+ * - Joining for example 'http://' and 'www.example.com' is also supported.
1514
+ */
1515
+ function join(aRoot, aPath) {
1516
+ if (aRoot === "") aRoot = ".";
1517
+ if (aPath === "") aPath = ".";
1518
+ var aPathUrl = urlParse(aPath);
1519
+ var aRootUrl = urlParse(aRoot);
1520
+ if (aRootUrl) aRoot = aRootUrl.path || "/";
1521
+ if (aPathUrl && !aPathUrl.scheme) {
1522
+ if (aRootUrl) aPathUrl.scheme = aRootUrl.scheme;
1523
+ return urlGenerate(aPathUrl);
1524
+ }
1525
+ if (aPathUrl || aPath.match(dataUrlRegexp)) return aPath;
1526
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
1527
+ aRootUrl.host = aPath;
1528
+ return urlGenerate(aRootUrl);
1529
+ }
1530
+ var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
1531
+ if (aRootUrl) {
1532
+ aRootUrl.path = joined;
1533
+ return urlGenerate(aRootUrl);
1534
+ }
1535
+ return joined;
1536
+ }
1537
+ exports.join = join;
1538
+ exports.isAbsolute = function(aPath) {
1539
+ return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
1540
+ };
1541
+ /**
1542
+ * Make a path relative to a URL or another path.
1543
+ *
1544
+ * @param aRoot The root path or URL.
1545
+ * @param aPath The path or URL to be made relative to aRoot.
1546
+ */
1547
+ function relative(aRoot, aPath) {
1548
+ if (aRoot === "") aRoot = ".";
1549
+ aRoot = aRoot.replace(/\/$/, "");
1550
+ var level = 0;
1551
+ while (aPath.indexOf(aRoot + "/") !== 0) {
1552
+ var index = aRoot.lastIndexOf("/");
1553
+ if (index < 0) return aPath;
1554
+ aRoot = aRoot.slice(0, index);
1555
+ if (aRoot.match(/^([^\/]+:\/)?\/*$/)) return aPath;
1556
+ ++level;
1557
+ }
1558
+ return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
1559
+ }
1560
+ exports.relative = relative;
1561
+ var supportsNullProto = function() {
1562
+ return !("__proto__" in Object.create(null));
1563
+ }();
1564
+ function identity(s) {
1565
+ return s;
1566
+ }
1567
+ /**
1568
+ * Because behavior goes wacky when you set `__proto__` on objects, we
1569
+ * have to prefix all the strings in our set with an arbitrary character.
1570
+ *
1571
+ * See https://github.com/mozilla/source-map/pull/31 and
1572
+ * https://github.com/mozilla/source-map/issues/30
1573
+ *
1574
+ * @param String aStr
1575
+ */
1576
+ function toSetString(aStr) {
1577
+ if (isProtoString(aStr)) return "$" + aStr;
1578
+ return aStr;
1579
+ }
1580
+ exports.toSetString = supportsNullProto ? identity : toSetString;
1581
+ function fromSetString(aStr) {
1582
+ if (isProtoString(aStr)) return aStr.slice(1);
1583
+ return aStr;
1584
+ }
1585
+ exports.fromSetString = supportsNullProto ? identity : fromSetString;
1586
+ function isProtoString(s) {
1587
+ if (!s) return false;
1588
+ var length = s.length;
1589
+ if (length < 9) return false;
1590
+ 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) return false;
1591
+ for (var i = length - 10; i >= 0; i--) if (s.charCodeAt(i) !== 36) return false;
1592
+ return true;
1593
+ }
1594
+ /**
1595
+ * Comparator between two mappings where the original positions are compared.
1596
+ *
1597
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
1598
+ * mappings with the same original source/line/column, but different generated
1599
+ * line and column the same. Useful when searching for a mapping with a
1600
+ * stubbed out mapping.
1601
+ */
1602
+ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
1603
+ var cmp = strcmp(mappingA.source, mappingB.source);
1604
+ if (cmp !== 0) return cmp;
1605
+ cmp = mappingA.originalLine - mappingB.originalLine;
1606
+ if (cmp !== 0) return cmp;
1607
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
1608
+ if (cmp !== 0 || onlyCompareOriginal) return cmp;
1609
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
1610
+ if (cmp !== 0) return cmp;
1611
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
1612
+ if (cmp !== 0) return cmp;
1613
+ return strcmp(mappingA.name, mappingB.name);
1614
+ }
1615
+ exports.compareByOriginalPositions = compareByOriginalPositions;
1616
+ function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {
1617
+ var cmp = mappingA.originalLine - mappingB.originalLine;
1618
+ if (cmp !== 0) return cmp;
1619
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
1620
+ if (cmp !== 0 || onlyCompareOriginal) return cmp;
1621
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
1622
+ if (cmp !== 0) return cmp;
1623
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
1624
+ if (cmp !== 0) return cmp;
1625
+ return strcmp(mappingA.name, mappingB.name);
1626
+ }
1627
+ exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;
1628
+ /**
1629
+ * Comparator between two mappings with deflated source and name indices where
1630
+ * the generated positions are compared.
1631
+ *
1632
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
1633
+ * mappings with the same generated line and column, but different
1634
+ * source/name/original line and column the same. Useful when searching for a
1635
+ * mapping with a stubbed out mapping.
1636
+ */
1637
+ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
1638
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
1639
+ if (cmp !== 0) return cmp;
1640
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
1641
+ if (cmp !== 0 || onlyCompareGenerated) return cmp;
1642
+ cmp = strcmp(mappingA.source, mappingB.source);
1643
+ if (cmp !== 0) return cmp;
1644
+ cmp = mappingA.originalLine - mappingB.originalLine;
1645
+ if (cmp !== 0) return cmp;
1646
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
1647
+ if (cmp !== 0) return cmp;
1648
+ return strcmp(mappingA.name, mappingB.name);
1649
+ }
1650
+ exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
1651
+ function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {
1652
+ var cmp = mappingA.generatedColumn - mappingB.generatedColumn;
1653
+ if (cmp !== 0 || onlyCompareGenerated) return cmp;
1654
+ cmp = strcmp(mappingA.source, mappingB.source);
1655
+ if (cmp !== 0) return cmp;
1656
+ cmp = mappingA.originalLine - mappingB.originalLine;
1657
+ if (cmp !== 0) return cmp;
1658
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
1659
+ if (cmp !== 0) return cmp;
1660
+ return strcmp(mappingA.name, mappingB.name);
1661
+ }
1662
+ exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;
1663
+ function strcmp(aStr1, aStr2) {
1664
+ if (aStr1 === aStr2) return 0;
1665
+ if (aStr1 === null) return 1;
1666
+ if (aStr2 === null) return -1;
1667
+ if (aStr1 > aStr2) return 1;
1668
+ return -1;
1669
+ }
1670
+ /**
1671
+ * Comparator between two mappings with inflated source and name strings where
1672
+ * the generated positions are compared.
1673
+ */
1674
+ function compareByGeneratedPositionsInflated(mappingA, mappingB) {
1675
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
1676
+ if (cmp !== 0) return cmp;
1677
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
1678
+ if (cmp !== 0) return cmp;
1679
+ cmp = strcmp(mappingA.source, mappingB.source);
1680
+ if (cmp !== 0) return cmp;
1681
+ cmp = mappingA.originalLine - mappingB.originalLine;
1682
+ if (cmp !== 0) return cmp;
1683
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
1684
+ if (cmp !== 0) return cmp;
1685
+ return strcmp(mappingA.name, mappingB.name);
1686
+ }
1687
+ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
1688
+ /**
1689
+ * Strip any JSON XSSI avoidance prefix from the string (as documented
1690
+ * in the source maps specification), and then parse the string as
1691
+ * JSON.
1692
+ */
1693
+ function parseSourceMapInput(str) {
1694
+ return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
1695
+ }
1696
+ exports.parseSourceMapInput = parseSourceMapInput;
1697
+ /**
1698
+ * Compute the URL of a source given the the source root, the source's
1699
+ * URL, and the source map's URL.
1700
+ */
1701
+ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
1702
+ sourceURL = sourceURL || "";
1703
+ if (sourceRoot) {
1704
+ if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") sourceRoot += "/";
1705
+ sourceURL = sourceRoot + sourceURL;
1706
+ }
1707
+ if (sourceMapURL) {
1708
+ var parsed = urlParse(sourceMapURL);
1709
+ if (!parsed) throw new Error("sourceMapURL could not be parsed");
1710
+ if (parsed.path) {
1711
+ var index = parsed.path.lastIndexOf("/");
1712
+ if (index >= 0) parsed.path = parsed.path.substring(0, index + 1);
1713
+ }
1714
+ sourceURL = join(urlGenerate(parsed), sourceURL);
1715
+ }
1716
+ return normalize(sourceURL);
1717
+ }
1718
+ exports.computeSourceURL = computeSourceURL;
1719
+ }));
1720
+ //#endregion
1721
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/array-set.js
1722
+ var require_array_set = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
1723
+ var util = require_util();
1724
+ var has = Object.prototype.hasOwnProperty;
1725
+ var hasNativeMap = typeof Map !== "undefined";
1726
+ /**
1727
+ * A data structure which is a combination of an array and a set. Adding a new
1728
+ * member is O(1), testing for membership is O(1), and finding the index of an
1729
+ * element is O(1). Removing elements from the set is not supported. Only
1730
+ * strings are supported for membership.
1731
+ */
1732
+ function ArraySet() {
1733
+ this._array = [];
1734
+ this._set = hasNativeMap ? /* @__PURE__ */ new Map() : Object.create(null);
1735
+ }
1736
+ /**
1737
+ * Static method for creating ArraySet instances from an existing array.
1738
+ */
1739
+ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
1740
+ var set = new ArraySet();
1741
+ for (var i = 0, len = aArray.length; i < len; i++) set.add(aArray[i], aAllowDuplicates);
1742
+ return set;
1743
+ };
1744
+ /**
1745
+ * Return how many unique items are in this ArraySet. If duplicates have been
1746
+ * added, than those do not count towards the size.
1747
+ *
1748
+ * @returns Number
1749
+ */
1750
+ ArraySet.prototype.size = function ArraySet_size() {
1751
+ return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
1752
+ };
1753
+ /**
1754
+ * Add the given string to this set.
1755
+ *
1756
+ * @param String aStr
1757
+ */
1758
+ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
1759
+ var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
1760
+ var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
1761
+ var idx = this._array.length;
1762
+ if (!isDuplicate || aAllowDuplicates) this._array.push(aStr);
1763
+ if (!isDuplicate) if (hasNativeMap) this._set.set(aStr, idx);
1764
+ else this._set[sStr] = idx;
1765
+ };
1766
+ /**
1767
+ * Is the given string a member of this set?
1768
+ *
1769
+ * @param String aStr
1770
+ */
1771
+ ArraySet.prototype.has = function ArraySet_has(aStr) {
1772
+ if (hasNativeMap) return this._set.has(aStr);
1773
+ else {
1774
+ var sStr = util.toSetString(aStr);
1775
+ return has.call(this._set, sStr);
1776
+ }
1777
+ };
1778
+ /**
1779
+ * What is the index of the given string in the array?
1780
+ *
1781
+ * @param String aStr
1782
+ */
1783
+ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
1784
+ if (hasNativeMap) {
1785
+ var idx = this._set.get(aStr);
1786
+ if (idx >= 0) return idx;
1787
+ } else {
1788
+ var sStr = util.toSetString(aStr);
1789
+ if (has.call(this._set, sStr)) return this._set[sStr];
1790
+ }
1791
+ throw new Error("\"" + aStr + "\" is not in the set.");
1792
+ };
1793
+ /**
1794
+ * What is the element at the given index?
1795
+ *
1796
+ * @param Number aIdx
1797
+ */
1798
+ ArraySet.prototype.at = function ArraySet_at(aIdx) {
1799
+ if (aIdx >= 0 && aIdx < this._array.length) return this._array[aIdx];
1800
+ throw new Error("No element indexed by " + aIdx);
1801
+ };
1802
+ /**
1803
+ * Returns the array representation of this set (which has the proper indices
1804
+ * indicated by indexOf). Note that this is a copy of the internal array used
1805
+ * for storing the members so that no one can mess with internal state.
1806
+ */
1807
+ ArraySet.prototype.toArray = function ArraySet_toArray() {
1808
+ return this._array.slice();
1809
+ };
1810
+ exports.ArraySet = ArraySet;
1811
+ }));
1812
+ //#endregion
1813
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/mapping-list.js
1814
+ var require_mapping_list = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
1815
+ var util = require_util();
1816
+ /**
1817
+ * Determine whether mappingB is after mappingA with respect to generated
1818
+ * position.
1819
+ */
1820
+ function generatedPositionAfter(mappingA, mappingB) {
1821
+ var lineA = mappingA.generatedLine;
1822
+ var lineB = mappingB.generatedLine;
1823
+ var columnA = mappingA.generatedColumn;
1824
+ var columnB = mappingB.generatedColumn;
1825
+ return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
1826
+ }
1827
+ /**
1828
+ * A data structure to provide a sorted view of accumulated mappings in a
1829
+ * performance conscious manner. It trades a neglibable overhead in general
1830
+ * case for a large speedup in case of mappings being added in order.
1831
+ */
1832
+ function MappingList() {
1833
+ this._array = [];
1834
+ this._sorted = true;
1835
+ this._last = {
1836
+ generatedLine: -1,
1837
+ generatedColumn: 0
1838
+ };
1839
+ }
1840
+ /**
1841
+ * Iterate through internal items. This method takes the same arguments that
1842
+ * `Array.prototype.forEach` takes.
1843
+ *
1844
+ * NOTE: The order of the mappings is NOT guaranteed.
1845
+ */
1846
+ MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
1847
+ this._array.forEach(aCallback, aThisArg);
1848
+ };
1849
+ /**
1850
+ * Add the given source mapping.
1851
+ *
1852
+ * @param Object aMapping
1853
+ */
1854
+ MappingList.prototype.add = function MappingList_add(aMapping) {
1855
+ if (generatedPositionAfter(this._last, aMapping)) {
1856
+ this._last = aMapping;
1857
+ this._array.push(aMapping);
1858
+ } else {
1859
+ this._sorted = false;
1860
+ this._array.push(aMapping);
1861
+ }
1862
+ };
1863
+ /**
1864
+ * Returns the flat, sorted array of mappings. The mappings are sorted by
1865
+ * generated position.
1866
+ *
1867
+ * WARNING: This method returns internal data without copying, for
1868
+ * performance. The return value must NOT be mutated, and should be treated as
1869
+ * an immutable borrow. If you want to take ownership, you must make your own
1870
+ * copy.
1871
+ */
1872
+ MappingList.prototype.toArray = function MappingList_toArray() {
1873
+ if (!this._sorted) {
1874
+ this._array.sort(util.compareByGeneratedPositionsInflated);
1875
+ this._sorted = true;
1876
+ }
1877
+ return this._array;
1878
+ };
1879
+ exports.MappingList = MappingList;
1880
+ }));
1881
+ //#endregion
1882
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-generator.js
1883
+ var require_source_map_generator = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
1884
+ var base64VLQ = require_base64_vlq();
1885
+ var util = require_util();
1886
+ var ArraySet = require_array_set().ArraySet;
1887
+ var MappingList = require_mapping_list().MappingList;
1888
+ /**
1889
+ * An instance of the SourceMapGenerator represents a source map which is
1890
+ * being built incrementally. You may pass an object with the following
1891
+ * properties:
1892
+ *
1893
+ * - file: The filename of the generated source.
1894
+ * - sourceRoot: A root for all relative URLs in this source map.
1895
+ */
1896
+ function SourceMapGenerator(aArgs) {
1897
+ if (!aArgs) aArgs = {};
1898
+ this._file = util.getArg(aArgs, "file", null);
1899
+ this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
1900
+ this._skipValidation = util.getArg(aArgs, "skipValidation", false);
1901
+ this._ignoreInvalidMapping = util.getArg(aArgs, "ignoreInvalidMapping", false);
1902
+ this._sources = new ArraySet();
1903
+ this._names = new ArraySet();
1904
+ this._mappings = new MappingList();
1905
+ this._sourcesContents = null;
1906
+ }
1907
+ SourceMapGenerator.prototype._version = 3;
1908
+ /**
1909
+ * Creates a new SourceMapGenerator based on a SourceMapConsumer
1910
+ *
1911
+ * @param aSourceMapConsumer The SourceMap.
1912
+ */
1913
+ SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) {
1914
+ var sourceRoot = aSourceMapConsumer.sourceRoot;
1915
+ var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, {
1916
+ file: aSourceMapConsumer.file,
1917
+ sourceRoot
1918
+ }));
1919
+ aSourceMapConsumer.eachMapping(function(mapping) {
1920
+ var newMapping = { generated: {
1921
+ line: mapping.generatedLine,
1922
+ column: mapping.generatedColumn
1923
+ } };
1924
+ if (mapping.source != null) {
1925
+ newMapping.source = mapping.source;
1926
+ if (sourceRoot != null) newMapping.source = util.relative(sourceRoot, newMapping.source);
1927
+ newMapping.original = {
1928
+ line: mapping.originalLine,
1929
+ column: mapping.originalColumn
1930
+ };
1931
+ if (mapping.name != null) newMapping.name = mapping.name;
1932
+ }
1933
+ generator.addMapping(newMapping);
1934
+ });
1935
+ aSourceMapConsumer.sources.forEach(function(sourceFile) {
1936
+ var sourceRelative = sourceFile;
1937
+ if (sourceRoot !== null) sourceRelative = util.relative(sourceRoot, sourceFile);
1938
+ if (!generator._sources.has(sourceRelative)) generator._sources.add(sourceRelative);
1939
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
1940
+ if (content != null) generator.setSourceContent(sourceFile, content);
1941
+ });
1942
+ return generator;
1943
+ };
1944
+ /**
1945
+ * Add a single mapping from original source line and column to the generated
1946
+ * source's line and column for this source map being created. The mapping
1947
+ * object should have the following properties:
1948
+ *
1949
+ * - generated: An object with the generated line and column positions.
1950
+ * - original: An object with the original line and column positions.
1951
+ * - source: The original source file (relative to the sourceRoot).
1952
+ * - name: An optional original token name for this mapping.
1953
+ */
1954
+ SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
1955
+ var generated = util.getArg(aArgs, "generated");
1956
+ var original = util.getArg(aArgs, "original", null);
1957
+ var source = util.getArg(aArgs, "source", null);
1958
+ var name = util.getArg(aArgs, "name", null);
1959
+ if (!this._skipValidation) {
1960
+ if (this._validateMapping(generated, original, source, name) === false) return;
1961
+ }
1962
+ if (source != null) {
1963
+ source = String(source);
1964
+ if (!this._sources.has(source)) this._sources.add(source);
1965
+ }
1966
+ if (name != null) {
1967
+ name = String(name);
1968
+ if (!this._names.has(name)) this._names.add(name);
1969
+ }
1970
+ this._mappings.add({
1971
+ generatedLine: generated.line,
1972
+ generatedColumn: generated.column,
1973
+ originalLine: original != null && original.line,
1974
+ originalColumn: original != null && original.column,
1975
+ source,
1976
+ name
1977
+ });
1978
+ };
1979
+ /**
1980
+ * Set the source content for a source file.
1981
+ */
1982
+ SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
1983
+ var source = aSourceFile;
1984
+ if (this._sourceRoot != null) source = util.relative(this._sourceRoot, source);
1985
+ if (aSourceContent != null) {
1986
+ if (!this._sourcesContents) this._sourcesContents = Object.create(null);
1987
+ this._sourcesContents[util.toSetString(source)] = aSourceContent;
1988
+ } else if (this._sourcesContents) {
1989
+ delete this._sourcesContents[util.toSetString(source)];
1990
+ if (Object.keys(this._sourcesContents).length === 0) this._sourcesContents = null;
1991
+ }
1992
+ };
1993
+ /**
1994
+ * Applies the mappings of a sub-source-map for a specific source file to the
1995
+ * source map being generated. Each mapping to the supplied source file is
1996
+ * rewritten using the supplied source map. Note: The resolution for the
1997
+ * resulting mappings is the minimium of this map and the supplied map.
1998
+ *
1999
+ * @param aSourceMapConsumer The source map to be applied.
2000
+ * @param aSourceFile Optional. The filename of the source file.
2001
+ * If omitted, SourceMapConsumer's file property will be used.
2002
+ * @param aSourceMapPath Optional. The dirname of the path to the source map
2003
+ * to be applied. If relative, it is relative to the SourceMapConsumer.
2004
+ * This parameter is needed when the two source maps aren't in the same
2005
+ * directory, and the source map to be applied contains relative source
2006
+ * paths. If so, those relative source paths need to be rewritten
2007
+ * relative to the SourceMapGenerator.
2008
+ */
2009
+ SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
2010
+ var sourceFile = aSourceFile;
2011
+ if (aSourceFile == null) {
2012
+ if (aSourceMapConsumer.file == null) throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's \"file\" property. Both were omitted.");
2013
+ sourceFile = aSourceMapConsumer.file;
2014
+ }
2015
+ var sourceRoot = this._sourceRoot;
2016
+ if (sourceRoot != null) sourceFile = util.relative(sourceRoot, sourceFile);
2017
+ var newSources = new ArraySet();
2018
+ var newNames = new ArraySet();
2019
+ this._mappings.unsortedForEach(function(mapping) {
2020
+ if (mapping.source === sourceFile && mapping.originalLine != null) {
2021
+ var original = aSourceMapConsumer.originalPositionFor({
2022
+ line: mapping.originalLine,
2023
+ column: mapping.originalColumn
2024
+ });
2025
+ if (original.source != null) {
2026
+ mapping.source = original.source;
2027
+ if (aSourceMapPath != null) mapping.source = util.join(aSourceMapPath, mapping.source);
2028
+ if (sourceRoot != null) mapping.source = util.relative(sourceRoot, mapping.source);
2029
+ mapping.originalLine = original.line;
2030
+ mapping.originalColumn = original.column;
2031
+ if (original.name != null) mapping.name = original.name;
2032
+ }
2033
+ }
2034
+ var source = mapping.source;
2035
+ if (source != null && !newSources.has(source)) newSources.add(source);
2036
+ var name = mapping.name;
2037
+ if (name != null && !newNames.has(name)) newNames.add(name);
2038
+ }, this);
2039
+ this._sources = newSources;
2040
+ this._names = newNames;
2041
+ aSourceMapConsumer.sources.forEach(function(sourceFile) {
2042
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
2043
+ if (content != null) {
2044
+ if (aSourceMapPath != null) sourceFile = util.join(aSourceMapPath, sourceFile);
2045
+ if (sourceRoot != null) sourceFile = util.relative(sourceRoot, sourceFile);
2046
+ this.setSourceContent(sourceFile, content);
2047
+ }
2048
+ }, this);
2049
+ };
2050
+ /**
2051
+ * A mapping can have one of the three levels of data:
2052
+ *
2053
+ * 1. Just the generated position.
2054
+ * 2. The Generated position, original position, and original source.
2055
+ * 3. Generated and original position, original source, as well as a name
2056
+ * token.
2057
+ *
2058
+ * To maintain consistency, we validate that any new mapping being added falls
2059
+ * in to one of these categories.
2060
+ */
2061
+ SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
2062
+ if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
2063
+ 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.";
2064
+ if (this._ignoreInvalidMapping) {
2065
+ if (typeof console !== "undefined" && console.warn) console.warn(message);
2066
+ return false;
2067
+ } else throw new Error(message);
2068
+ }
2069
+ if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) return;
2070
+ 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) return;
2071
+ else {
2072
+ var message = "Invalid mapping: " + JSON.stringify({
2073
+ generated: aGenerated,
2074
+ source: aSource,
2075
+ original: aOriginal,
2076
+ name: aName
2077
+ });
2078
+ if (this._ignoreInvalidMapping) {
2079
+ if (typeof console !== "undefined" && console.warn) console.warn(message);
2080
+ return false;
2081
+ } else throw new Error(message);
2082
+ }
2083
+ };
2084
+ /**
2085
+ * Serialize the accumulated mappings in to the stream of base 64 VLQs
2086
+ * specified by the source map format.
2087
+ */
2088
+ SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
2089
+ var previousGeneratedColumn = 0;
2090
+ var previousGeneratedLine = 1;
2091
+ var previousOriginalColumn = 0;
2092
+ var previousOriginalLine = 0;
2093
+ var previousName = 0;
2094
+ var previousSource = 0;
2095
+ var result = "";
2096
+ var next;
2097
+ var mapping;
2098
+ var nameIdx;
2099
+ var sourceIdx;
2100
+ var mappings = this._mappings.toArray();
2101
+ for (var i = 0, len = mappings.length; i < len; i++) {
2102
+ mapping = mappings[i];
2103
+ next = "";
2104
+ if (mapping.generatedLine !== previousGeneratedLine) {
2105
+ previousGeneratedColumn = 0;
2106
+ while (mapping.generatedLine !== previousGeneratedLine) {
2107
+ next += ";";
2108
+ previousGeneratedLine++;
2109
+ }
2110
+ } else if (i > 0) {
2111
+ if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) continue;
2112
+ next += ",";
2113
+ }
2114
+ next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
2115
+ previousGeneratedColumn = mapping.generatedColumn;
2116
+ if (mapping.source != null) {
2117
+ sourceIdx = this._sources.indexOf(mapping.source);
2118
+ next += base64VLQ.encode(sourceIdx - previousSource);
2119
+ previousSource = sourceIdx;
2120
+ next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
2121
+ previousOriginalLine = mapping.originalLine - 1;
2122
+ next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
2123
+ previousOriginalColumn = mapping.originalColumn;
2124
+ if (mapping.name != null) {
2125
+ nameIdx = this._names.indexOf(mapping.name);
2126
+ next += base64VLQ.encode(nameIdx - previousName);
2127
+ previousName = nameIdx;
2128
+ }
2129
+ }
2130
+ result += next;
2131
+ }
2132
+ return result;
2133
+ };
2134
+ SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
2135
+ return aSources.map(function(source) {
2136
+ if (!this._sourcesContents) return null;
2137
+ if (aSourceRoot != null) source = util.relative(aSourceRoot, source);
2138
+ var key = util.toSetString(source);
2139
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
2140
+ }, this);
2141
+ };
2142
+ /**
2143
+ * Externalize the source map.
2144
+ */
2145
+ SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
2146
+ var map = {
2147
+ version: this._version,
2148
+ sources: this._sources.toArray(),
2149
+ names: this._names.toArray(),
2150
+ mappings: this._serializeMappings()
2151
+ };
2152
+ if (this._file != null) map.file = this._file;
2153
+ if (this._sourceRoot != null) map.sourceRoot = this._sourceRoot;
2154
+ if (this._sourcesContents) map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
2155
+ return map;
2156
+ };
2157
+ /**
2158
+ * Render the source map being generated to a string.
2159
+ */
2160
+ SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
2161
+ return JSON.stringify(this.toJSON());
2162
+ };
2163
+ exports.SourceMapGenerator = SourceMapGenerator;
2164
+ }));
2165
+ //#endregion
2166
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/binary-search.js
2167
+ var require_binary_search = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
2168
+ exports.GREATEST_LOWER_BOUND = 1;
2169
+ exports.LEAST_UPPER_BOUND = 2;
2170
+ /**
2171
+ * Recursive implementation of binary search.
2172
+ *
2173
+ * @param aLow Indices here and lower do not contain the needle.
2174
+ * @param aHigh Indices here and higher do not contain the needle.
2175
+ * @param aNeedle The element being searched for.
2176
+ * @param aHaystack The non-empty array being searched.
2177
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
2178
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
2179
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
2180
+ * closest element that is smaller than or greater than the one we are
2181
+ * searching for, respectively, if the exact element cannot be found.
2182
+ */
2183
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
2184
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
2185
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
2186
+ if (cmp === 0) return mid;
2187
+ else if (cmp > 0) {
2188
+ if (aHigh - mid > 1) return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
2189
+ if (aBias == exports.LEAST_UPPER_BOUND) return aHigh < aHaystack.length ? aHigh : -1;
2190
+ else return mid;
2191
+ } else {
2192
+ if (mid - aLow > 1) return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
2193
+ if (aBias == exports.LEAST_UPPER_BOUND) return mid;
2194
+ else return aLow < 0 ? -1 : aLow;
2195
+ }
2196
+ }
2197
+ /**
2198
+ * This is an implementation of binary search which will always try and return
2199
+ * the index of the closest element if there is no exact hit. This is because
2200
+ * mappings between original and generated line/col pairs are single points,
2201
+ * and there is an implicit region between each of them, so a miss just means
2202
+ * that you aren't on the very start of a region.
2203
+ *
2204
+ * @param aNeedle The element you are looking for.
2205
+ * @param aHaystack The array that is being searched.
2206
+ * @param aCompare A function which takes the needle and an element in the
2207
+ * array and returns -1, 0, or 1 depending on whether the needle is less
2208
+ * than, equal to, or greater than the element, respectively.
2209
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
2210
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
2211
+ * closest element that is smaller than or greater than the one we are
2212
+ * searching for, respectively, if the exact element cannot be found.
2213
+ * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
2214
+ */
2215
+ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
2216
+ if (aHaystack.length === 0) return -1;
2217
+ var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND);
2218
+ if (index < 0) return -1;
2219
+ while (index - 1 >= 0) {
2220
+ if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) break;
2221
+ --index;
2222
+ }
2223
+ return index;
2224
+ };
2225
+ }));
2226
+ //#endregion
2227
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/quick-sort.js
2228
+ var require_quick_sort = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
2229
+ function SortTemplate(comparator) {
2230
+ /**
2231
+ * Swap the elements indexed by `x` and `y` in the array `ary`.
2232
+ *
2233
+ * @param {Array} ary
2234
+ * The array.
2235
+ * @param {Number} x
2236
+ * The index of the first item.
2237
+ * @param {Number} y
2238
+ * The index of the second item.
2239
+ */
2240
+ function swap(ary, x, y) {
2241
+ var temp = ary[x];
2242
+ ary[x] = ary[y];
2243
+ ary[y] = temp;
2244
+ }
2245
+ /**
2246
+ * Returns a random integer within the range `low .. high` inclusive.
2247
+ *
2248
+ * @param {Number} low
2249
+ * The lower bound on the range.
2250
+ * @param {Number} high
2251
+ * The upper bound on the range.
2252
+ */
2253
+ function randomIntInRange(low, high) {
2254
+ return Math.round(low + Math.random() * (high - low));
2255
+ }
2256
+ /**
2257
+ * The Quick Sort algorithm.
2258
+ *
2259
+ * @param {Array} ary
2260
+ * An array to sort.
2261
+ * @param {function} comparator
2262
+ * Function to use to compare two items.
2263
+ * @param {Number} p
2264
+ * Start index of the array
2265
+ * @param {Number} r
2266
+ * End index of the array
2267
+ */
2268
+ function doQuickSort(ary, comparator, p, r) {
2269
+ if (p < r) {
2270
+ var pivotIndex = randomIntInRange(p, r);
2271
+ var i = p - 1;
2272
+ swap(ary, pivotIndex, r);
2273
+ var pivot = ary[r];
2274
+ for (var j = p; j < r; j++) if (comparator(ary[j], pivot, false) <= 0) {
2275
+ i += 1;
2276
+ swap(ary, i, j);
2277
+ }
2278
+ swap(ary, i + 1, j);
2279
+ var q = i + 1;
2280
+ doQuickSort(ary, comparator, p, q - 1);
2281
+ doQuickSort(ary, comparator, q + 1, r);
2282
+ }
2283
+ }
2284
+ return doQuickSort;
2285
+ }
2286
+ function cloneSort(comparator) {
2287
+ let template = SortTemplate.toString();
2288
+ return new Function(`return ${template}`)()(comparator);
2289
+ }
2290
+ /**
2291
+ * Sort the given array in-place with the given comparator function.
2292
+ *
2293
+ * @param {Array} ary
2294
+ * An array to sort.
2295
+ * @param {function} comparator
2296
+ * Function to use to compare two items.
2297
+ */
2298
+ let sortCache = /* @__PURE__ */ new WeakMap();
2299
+ exports.quickSort = function(ary, comparator, start = 0) {
2300
+ let doQuickSort = sortCache.get(comparator);
2301
+ if (doQuickSort === void 0) {
2302
+ doQuickSort = cloneSort(comparator);
2303
+ sortCache.set(comparator, doQuickSort);
2304
+ }
2305
+ doQuickSort(ary, comparator, start, ary.length - 1);
2306
+ };
2307
+ }));
2308
+ //#endregion
2309
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-map-consumer.js
2310
+ var require_source_map_consumer = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
2311
+ var util = require_util();
2312
+ var binarySearch = require_binary_search();
2313
+ var ArraySet = require_array_set().ArraySet;
2314
+ var base64VLQ = require_base64_vlq();
2315
+ var quickSort = require_quick_sort().quickSort;
2316
+ function SourceMapConsumer(aSourceMap, aSourceMapURL) {
2317
+ var sourceMap = aSourceMap;
2318
+ if (typeof aSourceMap === "string") sourceMap = util.parseSourceMapInput(aSourceMap);
2319
+ return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
2320
+ }
2321
+ SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
2322
+ return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
2323
+ };
2324
+ /**
2325
+ * The version of the source mapping spec that we are consuming.
2326
+ */
2327
+ SourceMapConsumer.prototype._version = 3;
2328
+ SourceMapConsumer.prototype.__generatedMappings = null;
2329
+ Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
2330
+ configurable: true,
2331
+ enumerable: true,
2332
+ get: function() {
2333
+ if (!this.__generatedMappings) this._parseMappings(this._mappings, this.sourceRoot);
2334
+ return this.__generatedMappings;
2335
+ }
2336
+ });
2337
+ SourceMapConsumer.prototype.__originalMappings = null;
2338
+ Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
2339
+ configurable: true,
2340
+ enumerable: true,
2341
+ get: function() {
2342
+ if (!this.__originalMappings) this._parseMappings(this._mappings, this.sourceRoot);
2343
+ return this.__originalMappings;
2344
+ }
2345
+ });
2346
+ SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
2347
+ var c = aStr.charAt(index);
2348
+ return c === ";" || c === ",";
2349
+ };
2350
+ /**
2351
+ * Parse the mappings in a string in to a data structure which we can easily
2352
+ * query (the ordered arrays in the `this.__generatedMappings` and
2353
+ * `this.__originalMappings` properties).
2354
+ */
2355
+ SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
2356
+ throw new Error("Subclasses must implement _parseMappings");
2357
+ };
2358
+ SourceMapConsumer.GENERATED_ORDER = 1;
2359
+ SourceMapConsumer.ORIGINAL_ORDER = 2;
2360
+ SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
2361
+ SourceMapConsumer.LEAST_UPPER_BOUND = 2;
2362
+ /**
2363
+ * Iterate over each mapping between an original source/line/column and a
2364
+ * generated line/column in this source map.
2365
+ *
2366
+ * @param Function aCallback
2367
+ * The function that is called with each mapping.
2368
+ * @param Object aContext
2369
+ * Optional. If specified, this object will be the value of `this` every
2370
+ * time that `aCallback` is called.
2371
+ * @param aOrder
2372
+ * Either `SourceMapConsumer.GENERATED_ORDER` or
2373
+ * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
2374
+ * iterate over the mappings sorted by the generated file's line/column
2375
+ * order or the original's source/line/column order, respectively. Defaults to
2376
+ * `SourceMapConsumer.GENERATED_ORDER`.
2377
+ */
2378
+ SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
2379
+ var context = aContext || null;
2380
+ var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
2381
+ var mappings;
2382
+ switch (order) {
2383
+ case SourceMapConsumer.GENERATED_ORDER:
2384
+ mappings = this._generatedMappings;
2385
+ break;
2386
+ case SourceMapConsumer.ORIGINAL_ORDER:
2387
+ mappings = this._originalMappings;
2388
+ break;
2389
+ default: throw new Error("Unknown order of iteration.");
2390
+ }
2391
+ var sourceRoot = this.sourceRoot;
2392
+ var boundCallback = aCallback.bind(context);
2393
+ var names = this._names;
2394
+ var sources = this._sources;
2395
+ var sourceMapURL = this._sourceMapURL;
2396
+ for (var i = 0, n = mappings.length; i < n; i++) {
2397
+ var mapping = mappings[i];
2398
+ var source = mapping.source === null ? null : sources.at(mapping.source);
2399
+ if (source !== null) source = util.computeSourceURL(sourceRoot, source, sourceMapURL);
2400
+ boundCallback({
2401
+ source,
2402
+ generatedLine: mapping.generatedLine,
2403
+ generatedColumn: mapping.generatedColumn,
2404
+ originalLine: mapping.originalLine,
2405
+ originalColumn: mapping.originalColumn,
2406
+ name: mapping.name === null ? null : names.at(mapping.name)
2407
+ });
2408
+ }
2409
+ };
2410
+ /**
2411
+ * Returns all generated line and column information for the original source,
2412
+ * line, and column provided. If no column is provided, returns all mappings
2413
+ * corresponding to a either the line we are searching for or the next
2414
+ * closest line that has any mappings. Otherwise, returns all mappings
2415
+ * corresponding to the given line and either the column we are searching for
2416
+ * or the next closest column that has any offsets.
2417
+ *
2418
+ * The only argument is an object with the following properties:
2419
+ *
2420
+ * - source: The filename of the original source.
2421
+ * - line: The line number in the original source. The line number is 1-based.
2422
+ * - column: Optional. the column number in the original source.
2423
+ * The column number is 0-based.
2424
+ *
2425
+ * and an array of objects is returned, each with the following properties:
2426
+ *
2427
+ * - line: The line number in the generated source, or null. The
2428
+ * line number is 1-based.
2429
+ * - column: The column number in the generated source, or null.
2430
+ * The column number is 0-based.
2431
+ */
2432
+ SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
2433
+ var line = util.getArg(aArgs, "line");
2434
+ var needle = {
2435
+ source: util.getArg(aArgs, "source"),
2436
+ originalLine: line,
2437
+ originalColumn: util.getArg(aArgs, "column", 0)
2438
+ };
2439
+ needle.source = this._findSourceIndex(needle.source);
2440
+ if (needle.source < 0) return [];
2441
+ var mappings = [];
2442
+ var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND);
2443
+ if (index >= 0) {
2444
+ var mapping = this._originalMappings[index];
2445
+ if (aArgs.column === void 0) {
2446
+ var originalLine = mapping.originalLine;
2447
+ while (mapping && mapping.originalLine === originalLine) {
2448
+ mappings.push({
2449
+ line: util.getArg(mapping, "generatedLine", null),
2450
+ column: util.getArg(mapping, "generatedColumn", null),
2451
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
2452
+ });
2453
+ mapping = this._originalMappings[++index];
2454
+ }
2455
+ } else {
2456
+ var originalColumn = mapping.originalColumn;
2457
+ while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
2458
+ mappings.push({
2459
+ line: util.getArg(mapping, "generatedLine", null),
2460
+ column: util.getArg(mapping, "generatedColumn", null),
2461
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
2462
+ });
2463
+ mapping = this._originalMappings[++index];
2464
+ }
2465
+ }
2466
+ }
2467
+ return mappings;
2468
+ };
2469
+ exports.SourceMapConsumer = SourceMapConsumer;
2470
+ /**
2471
+ * A BasicSourceMapConsumer instance represents a parsed source map which we can
2472
+ * query for information about the original file positions by giving it a file
2473
+ * position in the generated source.
2474
+ *
2475
+ * The first parameter is the raw source map (either as a JSON string, or
2476
+ * already parsed to an object). According to the spec, source maps have the
2477
+ * following attributes:
2478
+ *
2479
+ * - version: Which version of the source map spec this map is following.
2480
+ * - sources: An array of URLs to the original source files.
2481
+ * - names: An array of identifiers which can be referrenced by individual mappings.
2482
+ * - sourceRoot: Optional. The URL root from which all sources are relative.
2483
+ * - sourcesContent: Optional. An array of contents of the original source files.
2484
+ * - mappings: A string of base64 VLQs which contain the actual mappings.
2485
+ * - file: Optional. The generated file this source map is associated with.
2486
+ *
2487
+ * Here is an example source map, taken from the source map spec[0]:
2488
+ *
2489
+ * {
2490
+ * version : 3,
2491
+ * file: "out.js",
2492
+ * sourceRoot : "",
2493
+ * sources: ["foo.js", "bar.js"],
2494
+ * names: ["src", "maps", "are", "fun"],
2495
+ * mappings: "AA,AB;;ABCDE;"
2496
+ * }
2497
+ *
2498
+ * The second parameter, if given, is a string whose value is the URL
2499
+ * at which the source map was found. This URL is used to compute the
2500
+ * sources array.
2501
+ *
2502
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
2503
+ */
2504
+ function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
2505
+ var sourceMap = aSourceMap;
2506
+ if (typeof aSourceMap === "string") sourceMap = util.parseSourceMapInput(aSourceMap);
2507
+ var version = util.getArg(sourceMap, "version");
2508
+ var sources = util.getArg(sourceMap, "sources");
2509
+ var names = util.getArg(sourceMap, "names", []);
2510
+ var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
2511
+ var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
2512
+ var mappings = util.getArg(sourceMap, "mappings");
2513
+ var file = util.getArg(sourceMap, "file", null);
2514
+ if (version != this._version) throw new Error("Unsupported version: " + version);
2515
+ if (sourceRoot) sourceRoot = util.normalize(sourceRoot);
2516
+ sources = sources.map(String).map(util.normalize).map(function(source) {
2517
+ return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
2518
+ });
2519
+ this._names = ArraySet.fromArray(names.map(String), true);
2520
+ this._sources = ArraySet.fromArray(sources, true);
2521
+ this._absoluteSources = this._sources.toArray().map(function(s) {
2522
+ return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
2523
+ });
2524
+ this.sourceRoot = sourceRoot;
2525
+ this.sourcesContent = sourcesContent;
2526
+ this._mappings = mappings;
2527
+ this._sourceMapURL = aSourceMapURL;
2528
+ this.file = file;
2529
+ }
2530
+ BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
2531
+ BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
2532
+ /**
2533
+ * Utility function to find the index of a source. Returns -1 if not
2534
+ * found.
2535
+ */
2536
+ BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
2537
+ var relativeSource = aSource;
2538
+ if (this.sourceRoot != null) relativeSource = util.relative(this.sourceRoot, relativeSource);
2539
+ if (this._sources.has(relativeSource)) return this._sources.indexOf(relativeSource);
2540
+ var i;
2541
+ for (i = 0; i < this._absoluteSources.length; ++i) if (this._absoluteSources[i] == aSource) return i;
2542
+ return -1;
2543
+ };
2544
+ /**
2545
+ * Create a BasicSourceMapConsumer from a SourceMapGenerator.
2546
+ *
2547
+ * @param SourceMapGenerator aSourceMap
2548
+ * The source map that will be consumed.
2549
+ * @param String aSourceMapURL
2550
+ * The URL at which the source map can be found (optional)
2551
+ * @returns BasicSourceMapConsumer
2552
+ */
2553
+ BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
2554
+ var smc = Object.create(BasicSourceMapConsumer.prototype);
2555
+ var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
2556
+ var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
2557
+ smc.sourceRoot = aSourceMap._sourceRoot;
2558
+ smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot);
2559
+ smc.file = aSourceMap._file;
2560
+ smc._sourceMapURL = aSourceMapURL;
2561
+ smc._absoluteSources = smc._sources.toArray().map(function(s) {
2562
+ return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
2563
+ });
2564
+ var generatedMappings = aSourceMap._mappings.toArray().slice();
2565
+ var destGeneratedMappings = smc.__generatedMappings = [];
2566
+ var destOriginalMappings = smc.__originalMappings = [];
2567
+ for (var i = 0, length = generatedMappings.length; i < length; i++) {
2568
+ var srcMapping = generatedMappings[i];
2569
+ var destMapping = new Mapping();
2570
+ destMapping.generatedLine = srcMapping.generatedLine;
2571
+ destMapping.generatedColumn = srcMapping.generatedColumn;
2572
+ if (srcMapping.source) {
2573
+ destMapping.source = sources.indexOf(srcMapping.source);
2574
+ destMapping.originalLine = srcMapping.originalLine;
2575
+ destMapping.originalColumn = srcMapping.originalColumn;
2576
+ if (srcMapping.name) destMapping.name = names.indexOf(srcMapping.name);
2577
+ destOriginalMappings.push(destMapping);
2578
+ }
2579
+ destGeneratedMappings.push(destMapping);
2580
+ }
2581
+ quickSort(smc.__originalMappings, util.compareByOriginalPositions);
2582
+ return smc;
2583
+ };
2584
+ /**
2585
+ * The version of the source mapping spec that we are consuming.
2586
+ */
2587
+ BasicSourceMapConsumer.prototype._version = 3;
2588
+ /**
2589
+ * The list of original sources.
2590
+ */
2591
+ Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", { get: function() {
2592
+ return this._absoluteSources.slice();
2593
+ } });
2594
+ /**
2595
+ * Provide the JIT with a nice shape / hidden class.
2596
+ */
2597
+ function Mapping() {
2598
+ this.generatedLine = 0;
2599
+ this.generatedColumn = 0;
2600
+ this.source = null;
2601
+ this.originalLine = null;
2602
+ this.originalColumn = null;
2603
+ this.name = null;
2604
+ }
2605
+ /**
2606
+ * Parse the mappings in a string in to a data structure which we can easily
2607
+ * query (the ordered arrays in the `this.__generatedMappings` and
2608
+ * `this.__originalMappings` properties).
2609
+ */
2610
+ const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine;
2611
+ function sortGenerated(array, start) {
2612
+ let l = array.length;
2613
+ let n = array.length - start;
2614
+ if (n <= 1) return;
2615
+ else if (n == 2) {
2616
+ let a = array[start];
2617
+ let b = array[start + 1];
2618
+ if (compareGenerated(a, b) > 0) {
2619
+ array[start] = b;
2620
+ array[start + 1] = a;
2621
+ }
2622
+ } else if (n < 20) for (let i = start; i < l; i++) for (let j = i; j > start; j--) {
2623
+ let a = array[j - 1];
2624
+ let b = array[j];
2625
+ if (compareGenerated(a, b) <= 0) break;
2626
+ array[j - 1] = b;
2627
+ array[j] = a;
2628
+ }
2629
+ else quickSort(array, compareGenerated, start);
2630
+ }
2631
+ BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
2632
+ var generatedLine = 1;
2633
+ var previousGeneratedColumn = 0;
2634
+ var previousOriginalLine = 0;
2635
+ var previousOriginalColumn = 0;
2636
+ var previousSource = 0;
2637
+ var previousName = 0;
2638
+ var length = aStr.length;
2639
+ var index = 0;
2640
+ var temp = {};
2641
+ var originalMappings = [];
2642
+ var generatedMappings = [], mapping, segment, end, value;
2643
+ let subarrayStart = 0;
2644
+ while (index < length) if (aStr.charAt(index) === ";") {
2645
+ generatedLine++;
2646
+ index++;
2647
+ previousGeneratedColumn = 0;
2648
+ sortGenerated(generatedMappings, subarrayStart);
2649
+ subarrayStart = generatedMappings.length;
2650
+ } else if (aStr.charAt(index) === ",") index++;
2651
+ else {
2652
+ mapping = new Mapping();
2653
+ mapping.generatedLine = generatedLine;
2654
+ for (end = index; end < length; end++) if (this._charIsMappingSeparator(aStr, end)) break;
2655
+ aStr.slice(index, end);
2656
+ segment = [];
2657
+ while (index < end) {
2658
+ base64VLQ.decode(aStr, index, temp);
2659
+ value = temp.value;
2660
+ index = temp.rest;
2661
+ segment.push(value);
2662
+ }
2663
+ if (segment.length === 2) throw new Error("Found a source, but no line and column");
2664
+ if (segment.length === 3) throw new Error("Found a source and line, but no column");
2665
+ mapping.generatedColumn = previousGeneratedColumn + segment[0];
2666
+ previousGeneratedColumn = mapping.generatedColumn;
2667
+ if (segment.length > 1) {
2668
+ mapping.source = previousSource + segment[1];
2669
+ previousSource += segment[1];
2670
+ mapping.originalLine = previousOriginalLine + segment[2];
2671
+ previousOriginalLine = mapping.originalLine;
2672
+ mapping.originalLine += 1;
2673
+ mapping.originalColumn = previousOriginalColumn + segment[3];
2674
+ previousOriginalColumn = mapping.originalColumn;
2675
+ if (segment.length > 4) {
2676
+ mapping.name = previousName + segment[4];
2677
+ previousName += segment[4];
2678
+ }
2679
+ }
2680
+ generatedMappings.push(mapping);
2681
+ if (typeof mapping.originalLine === "number") {
2682
+ let currentSource = mapping.source;
2683
+ while (originalMappings.length <= currentSource) originalMappings.push(null);
2684
+ if (originalMappings[currentSource] === null) originalMappings[currentSource] = [];
2685
+ originalMappings[currentSource].push(mapping);
2686
+ }
2687
+ }
2688
+ sortGenerated(generatedMappings, subarrayStart);
2689
+ this.__generatedMappings = generatedMappings;
2690
+ for (var i = 0; i < originalMappings.length; i++) if (originalMappings[i] != null) quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource);
2691
+ this.__originalMappings = [].concat(...originalMappings);
2692
+ };
2693
+ /**
2694
+ * Find the mapping that best matches the hypothetical "needle" mapping that
2695
+ * we are searching for in the given "haystack" of mappings.
2696
+ */
2697
+ BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
2698
+ if (aNeedle[aLineName] <= 0) throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
2699
+ if (aNeedle[aColumnName] < 0) throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
2700
+ return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
2701
+ };
2702
+ /**
2703
+ * Compute the last column for each generated mapping. The last column is
2704
+ * inclusive.
2705
+ */
2706
+ BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
2707
+ for (var index = 0; index < this._generatedMappings.length; ++index) {
2708
+ var mapping = this._generatedMappings[index];
2709
+ if (index + 1 < this._generatedMappings.length) {
2710
+ var nextMapping = this._generatedMappings[index + 1];
2711
+ if (mapping.generatedLine === nextMapping.generatedLine) {
2712
+ mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
2713
+ continue;
2714
+ }
2715
+ }
2716
+ mapping.lastGeneratedColumn = Infinity;
2717
+ }
2718
+ };
2719
+ /**
2720
+ * Returns the original source, line, and column information for the generated
2721
+ * source's line and column positions provided. The only argument is an object
2722
+ * with the following properties:
2723
+ *
2724
+ * - line: The line number in the generated source. The line number
2725
+ * is 1-based.
2726
+ * - column: The column number in the generated source. The column
2727
+ * number is 0-based.
2728
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
2729
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
2730
+ * closest element that is smaller than or greater than the one we are
2731
+ * searching for, respectively, if the exact element cannot be found.
2732
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
2733
+ *
2734
+ * and an object is returned with the following properties:
2735
+ *
2736
+ * - source: The original source file, or null.
2737
+ * - line: The line number in the original source, or null. The
2738
+ * line number is 1-based.
2739
+ * - column: The column number in the original source, or null. The
2740
+ * column number is 0-based.
2741
+ * - name: The original identifier, or null.
2742
+ */
2743
+ BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
2744
+ var needle = {
2745
+ generatedLine: util.getArg(aArgs, "line"),
2746
+ generatedColumn: util.getArg(aArgs, "column")
2747
+ };
2748
+ var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND));
2749
+ if (index >= 0) {
2750
+ var mapping = this._generatedMappings[index];
2751
+ if (mapping.generatedLine === needle.generatedLine) {
2752
+ var source = util.getArg(mapping, "source", null);
2753
+ if (source !== null) {
2754
+ source = this._sources.at(source);
2755
+ source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
2756
+ }
2757
+ var name = util.getArg(mapping, "name", null);
2758
+ if (name !== null) name = this._names.at(name);
2759
+ return {
2760
+ source,
2761
+ line: util.getArg(mapping, "originalLine", null),
2762
+ column: util.getArg(mapping, "originalColumn", null),
2763
+ name
2764
+ };
2765
+ }
2766
+ }
2767
+ return {
2768
+ source: null,
2769
+ line: null,
2770
+ column: null,
2771
+ name: null
2772
+ };
2773
+ };
2774
+ /**
2775
+ * Return true if we have the source content for every source in the source
2776
+ * map, false otherwise.
2777
+ */
2778
+ BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
2779
+ if (!this.sourcesContent) return false;
2780
+ return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
2781
+ return sc == null;
2782
+ });
2783
+ };
2784
+ /**
2785
+ * Returns the original source content. The only argument is the url of the
2786
+ * original source file. Returns null if no original source content is
2787
+ * available.
2788
+ */
2789
+ BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
2790
+ if (!this.sourcesContent) return null;
2791
+ var index = this._findSourceIndex(aSource);
2792
+ if (index >= 0) return this.sourcesContent[index];
2793
+ var relativeSource = aSource;
2794
+ if (this.sourceRoot != null) relativeSource = util.relative(this.sourceRoot, relativeSource);
2795
+ var url;
2796
+ if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
2797
+ var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
2798
+ if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
2799
+ if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
2800
+ }
2801
+ if (nullOnMissing) return null;
2802
+ else throw new Error("\"" + relativeSource + "\" is not in the SourceMap.");
2803
+ };
2804
+ /**
2805
+ * Returns the generated line and column information for the original source,
2806
+ * line, and column positions provided. The only argument is an object with
2807
+ * the following properties:
2808
+ *
2809
+ * - source: The filename of the original source.
2810
+ * - line: The line number in the original source. The line number
2811
+ * is 1-based.
2812
+ * - column: The column number in the original source. The column
2813
+ * number is 0-based.
2814
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
2815
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
2816
+ * closest element that is smaller than or greater than the one we are
2817
+ * searching for, respectively, if the exact element cannot be found.
2818
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
2819
+ *
2820
+ * and an object is returned with the following properties:
2821
+ *
2822
+ * - line: The line number in the generated source, or null. The
2823
+ * line number is 1-based.
2824
+ * - column: The column number in the generated source, or null.
2825
+ * The column number is 0-based.
2826
+ */
2827
+ BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
2828
+ var source = util.getArg(aArgs, "source");
2829
+ source = this._findSourceIndex(source);
2830
+ if (source < 0) return {
2831
+ line: null,
2832
+ column: null,
2833
+ lastColumn: null
2834
+ };
2835
+ var needle = {
2836
+ source,
2837
+ originalLine: util.getArg(aArgs, "line"),
2838
+ originalColumn: util.getArg(aArgs, "column")
2839
+ };
2840
+ var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND));
2841
+ if (index >= 0) {
2842
+ var mapping = this._originalMappings[index];
2843
+ if (mapping.source === needle.source) return {
2844
+ line: util.getArg(mapping, "generatedLine", null),
2845
+ column: util.getArg(mapping, "generatedColumn", null),
2846
+ lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
2847
+ };
2848
+ }
2849
+ return {
2850
+ line: null,
2851
+ column: null,
2852
+ lastColumn: null
2853
+ };
2854
+ };
2855
+ exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
2856
+ /**
2857
+ * An IndexedSourceMapConsumer instance represents a parsed source map which
2858
+ * we can query for information. It differs from BasicSourceMapConsumer in
2859
+ * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
2860
+ * input.
2861
+ *
2862
+ * The first parameter is a raw source map (either as a JSON string, or already
2863
+ * parsed to an object). According to the spec for indexed source maps, they
2864
+ * have the following attributes:
2865
+ *
2866
+ * - version: Which version of the source map spec this map is following.
2867
+ * - file: Optional. The generated file this source map is associated with.
2868
+ * - sections: A list of section definitions.
2869
+ *
2870
+ * Each value under the "sections" field has two fields:
2871
+ * - offset: The offset into the original specified at which this section
2872
+ * begins to apply, defined as an object with a "line" and "column"
2873
+ * field.
2874
+ * - map: A source map definition. This source map could also be indexed,
2875
+ * but doesn't have to be.
2876
+ *
2877
+ * Instead of the "map" field, it's also possible to have a "url" field
2878
+ * specifying a URL to retrieve a source map from, but that's currently
2879
+ * unsupported.
2880
+ *
2881
+ * Here's an example source map, taken from the source map spec[0], but
2882
+ * modified to omit a section which uses the "url" field.
2883
+ *
2884
+ * {
2885
+ * version : 3,
2886
+ * file: "app.js",
2887
+ * sections: [{
2888
+ * offset: {line:100, column:10},
2889
+ * map: {
2890
+ * version : 3,
2891
+ * file: "section.js",
2892
+ * sources: ["foo.js", "bar.js"],
2893
+ * names: ["src", "maps", "are", "fun"],
2894
+ * mappings: "AAAA,E;;ABCDE;"
2895
+ * }
2896
+ * }],
2897
+ * }
2898
+ *
2899
+ * The second parameter, if given, is a string whose value is the URL
2900
+ * at which the source map was found. This URL is used to compute the
2901
+ * sources array.
2902
+ *
2903
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
2904
+ */
2905
+ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
2906
+ var sourceMap = aSourceMap;
2907
+ if (typeof aSourceMap === "string") sourceMap = util.parseSourceMapInput(aSourceMap);
2908
+ var version = util.getArg(sourceMap, "version");
2909
+ var sections = util.getArg(sourceMap, "sections");
2910
+ if (version != this._version) throw new Error("Unsupported version: " + version);
2911
+ this._sources = new ArraySet();
2912
+ this._names = new ArraySet();
2913
+ var lastOffset = {
2914
+ line: -1,
2915
+ column: 0
2916
+ };
2917
+ this._sections = sections.map(function(s) {
2918
+ if (s.url) throw new Error("Support for url field in sections not implemented.");
2919
+ var offset = util.getArg(s, "offset");
2920
+ var offsetLine = util.getArg(offset, "line");
2921
+ var offsetColumn = util.getArg(offset, "column");
2922
+ if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) throw new Error("Section offsets must be ordered and non-overlapping.");
2923
+ lastOffset = offset;
2924
+ return {
2925
+ generatedOffset: {
2926
+ generatedLine: offsetLine + 1,
2927
+ generatedColumn: offsetColumn + 1
2928
+ },
2929
+ consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL)
2930
+ };
2931
+ });
2932
+ }
2933
+ IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
2934
+ IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
2935
+ /**
2936
+ * The version of the source mapping spec that we are consuming.
2937
+ */
2938
+ IndexedSourceMapConsumer.prototype._version = 3;
2939
+ /**
2940
+ * The list of original sources.
2941
+ */
2942
+ Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", { get: function() {
2943
+ var sources = [];
2944
+ for (var i = 0; i < this._sections.length; i++) for (var j = 0; j < this._sections[i].consumer.sources.length; j++) sources.push(this._sections[i].consumer.sources[j]);
2945
+ return sources;
2946
+ } });
2947
+ /**
2948
+ * Returns the original source, line, and column information for the generated
2949
+ * source's line and column positions provided. The only argument is an object
2950
+ * with the following properties:
2951
+ *
2952
+ * - line: The line number in the generated source. The line number
2953
+ * is 1-based.
2954
+ * - column: The column number in the generated source. The column
2955
+ * number is 0-based.
2956
+ *
2957
+ * and an object is returned with the following properties:
2958
+ *
2959
+ * - source: The original source file, or null.
2960
+ * - line: The line number in the original source, or null. The
2961
+ * line number is 1-based.
2962
+ * - column: The column number in the original source, or null. The
2963
+ * column number is 0-based.
2964
+ * - name: The original identifier, or null.
2965
+ */
2966
+ IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
2967
+ var needle = {
2968
+ generatedLine: util.getArg(aArgs, "line"),
2969
+ generatedColumn: util.getArg(aArgs, "column")
2970
+ };
2971
+ var sectionIndex = binarySearch.search(needle, this._sections, function(needle, section) {
2972
+ var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
2973
+ if (cmp) return cmp;
2974
+ return needle.generatedColumn - section.generatedOffset.generatedColumn;
2975
+ });
2976
+ var section = this._sections[sectionIndex];
2977
+ if (!section) return {
2978
+ source: null,
2979
+ line: null,
2980
+ column: null,
2981
+ name: null
2982
+ };
2983
+ return section.consumer.originalPositionFor({
2984
+ line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
2985
+ column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
2986
+ bias: aArgs.bias
2987
+ });
2988
+ };
2989
+ /**
2990
+ * Return true if we have the source content for every source in the source
2991
+ * map, false otherwise.
2992
+ */
2993
+ IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
2994
+ return this._sections.every(function(s) {
2995
+ return s.consumer.hasContentsOfAllSources();
2996
+ });
2997
+ };
2998
+ /**
2999
+ * Returns the original source content. The only argument is the url of the
3000
+ * original source file. Returns null if no original source content is
3001
+ * available.
3002
+ */
3003
+ IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
3004
+ for (var i = 0; i < this._sections.length; i++) {
3005
+ var content = this._sections[i].consumer.sourceContentFor(aSource, true);
3006
+ if (content || content === "") return content;
3007
+ }
3008
+ if (nullOnMissing) return null;
3009
+ else throw new Error("\"" + aSource + "\" is not in the SourceMap.");
3010
+ };
3011
+ /**
3012
+ * Returns the generated line and column information for the original source,
3013
+ * line, and column positions provided. The only argument is an object with
3014
+ * the following properties:
3015
+ *
3016
+ * - source: The filename of the original source.
3017
+ * - line: The line number in the original source. The line number
3018
+ * is 1-based.
3019
+ * - column: The column number in the original source. The column
3020
+ * number is 0-based.
3021
+ *
3022
+ * and an object is returned with the following properties:
3023
+ *
3024
+ * - line: The line number in the generated source, or null. The
3025
+ * line number is 1-based.
3026
+ * - column: The column number in the generated source, or null.
3027
+ * The column number is 0-based.
3028
+ */
3029
+ IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
3030
+ for (var i = 0; i < this._sections.length; i++) {
3031
+ var section = this._sections[i];
3032
+ if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) continue;
3033
+ var generatedPosition = section.consumer.generatedPositionFor(aArgs);
3034
+ if (generatedPosition) return {
3035
+ line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
3036
+ column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
3037
+ };
3038
+ }
3039
+ return {
3040
+ line: null,
3041
+ column: null
3042
+ };
3043
+ };
3044
+ /**
3045
+ * Parse the mappings in a string in to a data structure which we can easily
3046
+ * query (the ordered arrays in the `this.__generatedMappings` and
3047
+ * `this.__originalMappings` properties).
3048
+ */
3049
+ IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
3050
+ this.__generatedMappings = [];
3051
+ this.__originalMappings = [];
3052
+ for (var i = 0; i < this._sections.length; i++) {
3053
+ var section = this._sections[i];
3054
+ var sectionMappings = section.consumer._generatedMappings;
3055
+ for (var j = 0; j < sectionMappings.length; j++) {
3056
+ var mapping = sectionMappings[j];
3057
+ var source = section.consumer._sources.at(mapping.source);
3058
+ if (source !== null) source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
3059
+ this._sources.add(source);
3060
+ source = this._sources.indexOf(source);
3061
+ var name = null;
3062
+ if (mapping.name) {
3063
+ name = section.consumer._names.at(mapping.name);
3064
+ this._names.add(name);
3065
+ name = this._names.indexOf(name);
3066
+ }
3067
+ var adjustedMapping = {
3068
+ source,
3069
+ generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
3070
+ generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
3071
+ originalLine: mapping.originalLine,
3072
+ originalColumn: mapping.originalColumn,
3073
+ name
3074
+ };
3075
+ this.__generatedMappings.push(adjustedMapping);
3076
+ if (typeof adjustedMapping.originalLine === "number") this.__originalMappings.push(adjustedMapping);
3077
+ }
3078
+ }
3079
+ quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
3080
+ quickSort(this.__originalMappings, util.compareByOriginalPositions);
3081
+ };
3082
+ exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
3083
+ }));
3084
+ //#endregion
3085
+ //#region ../../node_modules/.bun/source-map-js@1.2.1/node_modules/source-map-js/lib/source-node.js
3086
+ var require_source_node = /* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
3087
+ var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
3088
+ var util = require_util();
3089
+ var REGEX_NEWLINE = /(\r?\n)/;
3090
+ var NEWLINE_CODE = 10;
3091
+ var isSourceNode = "$$$isSourceNode$$$";
3092
+ /**
3093
+ * SourceNodes provide a way to abstract over interpolating/concatenating
3094
+ * snippets of generated JavaScript source code while maintaining the line and
3095
+ * column information associated with the original source code.
3096
+ *
3097
+ * @param aLine The original line number.
3098
+ * @param aColumn The original column number.
3099
+ * @param aSource The original source's filename.
3100
+ * @param aChunks Optional. An array of strings which are snippets of
3101
+ * generated JS, or other SourceNodes.
3102
+ * @param aName The original identifier.
3103
+ */
3104
+ function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
3105
+ this.children = [];
3106
+ this.sourceContents = {};
3107
+ this.line = aLine == null ? null : aLine;
3108
+ this.column = aColumn == null ? null : aColumn;
3109
+ this.source = aSource == null ? null : aSource;
3110
+ this.name = aName == null ? null : aName;
3111
+ this[isSourceNode] = true;
3112
+ if (aChunks != null) this.add(aChunks);
3113
+ }
3114
+ /**
3115
+ * Creates a SourceNode from generated code and a SourceMapConsumer.
3116
+ *
3117
+ * @param aGeneratedCode The generated code
3118
+ * @param aSourceMapConsumer The SourceMap for the generated code
3119
+ * @param aRelativePath Optional. The path that relative sources in the
3120
+ * SourceMapConsumer should be relative to.
3121
+ */
3122
+ SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
3123
+ var node = new SourceNode();
3124
+ var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
3125
+ var remainingLinesIndex = 0;
3126
+ var shiftNextLine = function() {
3127
+ return getNextLine() + (getNextLine() || "");
3128
+ function getNextLine() {
3129
+ return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
3130
+ }
3131
+ };
3132
+ var lastGeneratedLine = 1, lastGeneratedColumn = 0;
3133
+ var lastMapping = null;
3134
+ aSourceMapConsumer.eachMapping(function(mapping) {
3135
+ if (lastMapping !== null) if (lastGeneratedLine < mapping.generatedLine) {
3136
+ addMappingWithCode(lastMapping, shiftNextLine());
3137
+ lastGeneratedLine++;
3138
+ lastGeneratedColumn = 0;
3139
+ } else {
3140
+ var nextLine = remainingLines[remainingLinesIndex] || "";
3141
+ var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
3142
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
3143
+ lastGeneratedColumn = mapping.generatedColumn;
3144
+ addMappingWithCode(lastMapping, code);
3145
+ lastMapping = mapping;
3146
+ return;
3147
+ }
3148
+ while (lastGeneratedLine < mapping.generatedLine) {
3149
+ node.add(shiftNextLine());
3150
+ lastGeneratedLine++;
3151
+ }
3152
+ if (lastGeneratedColumn < mapping.generatedColumn) {
3153
+ var nextLine = remainingLines[remainingLinesIndex] || "";
3154
+ node.add(nextLine.substr(0, mapping.generatedColumn));
3155
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
3156
+ lastGeneratedColumn = mapping.generatedColumn;
3157
+ }
3158
+ lastMapping = mapping;
3159
+ }, this);
3160
+ if (remainingLinesIndex < remainingLines.length) {
3161
+ if (lastMapping) addMappingWithCode(lastMapping, shiftNextLine());
3162
+ node.add(remainingLines.splice(remainingLinesIndex).join(""));
3163
+ }
3164
+ aSourceMapConsumer.sources.forEach(function(sourceFile) {
3165
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
3166
+ if (content != null) {
3167
+ if (aRelativePath != null) sourceFile = util.join(aRelativePath, sourceFile);
3168
+ node.setSourceContent(sourceFile, content);
3169
+ }
3170
+ });
3171
+ return node;
3172
+ function addMappingWithCode(mapping, code) {
3173
+ if (mapping === null || mapping.source === void 0) node.add(code);
3174
+ else {
3175
+ var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
3176
+ node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name));
3177
+ }
3178
+ }
3179
+ };
3180
+ /**
3181
+ * Add a chunk of generated JS to this source node.
3182
+ *
3183
+ * @param aChunk A string snippet of generated JS code, another instance of
3184
+ * SourceNode, or an array where each member is one of those things.
3185
+ */
3186
+ SourceNode.prototype.add = function SourceNode_add(aChunk) {
3187
+ if (Array.isArray(aChunk)) aChunk.forEach(function(chunk) {
3188
+ this.add(chunk);
3189
+ }, this);
3190
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") {
3191
+ if (aChunk) this.children.push(aChunk);
3192
+ } else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
3193
+ return this;
3194
+ };
3195
+ /**
3196
+ * Add a chunk of generated JS to the beginning of this source node.
3197
+ *
3198
+ * @param aChunk A string snippet of generated JS code, another instance of
3199
+ * SourceNode, or an array where each member is one of those things.
3200
+ */
3201
+ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
3202
+ if (Array.isArray(aChunk)) for (var i = aChunk.length - 1; i >= 0; i--) this.prepend(aChunk[i]);
3203
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") this.children.unshift(aChunk);
3204
+ else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
3205
+ return this;
3206
+ };
3207
+ /**
3208
+ * Walk over the tree of JS snippets in this node and its children. The
3209
+ * walking function is called once for each snippet of JS and is passed that
3210
+ * snippet and the its original associated source's line/column location.
3211
+ *
3212
+ * @param aFn The traversal function.
3213
+ */
3214
+ SourceNode.prototype.walk = function SourceNode_walk(aFn) {
3215
+ var chunk;
3216
+ for (var i = 0, len = this.children.length; i < len; i++) {
3217
+ chunk = this.children[i];
3218
+ if (chunk[isSourceNode]) chunk.walk(aFn);
3219
+ else if (chunk !== "") aFn(chunk, {
3220
+ source: this.source,
3221
+ line: this.line,
3222
+ column: this.column,
3223
+ name: this.name
3224
+ });
3225
+ }
3226
+ };
3227
+ /**
3228
+ * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
3229
+ * each of `this.children`.
3230
+ *
3231
+ * @param aSep The separator.
3232
+ */
3233
+ SourceNode.prototype.join = function SourceNode_join(aSep) {
3234
+ var newChildren;
3235
+ var i;
3236
+ var len = this.children.length;
3237
+ if (len > 0) {
3238
+ newChildren = [];
3239
+ for (i = 0; i < len - 1; i++) {
3240
+ newChildren.push(this.children[i]);
3241
+ newChildren.push(aSep);
3242
+ }
3243
+ newChildren.push(this.children[i]);
3244
+ this.children = newChildren;
3245
+ }
3246
+ return this;
3247
+ };
3248
+ /**
3249
+ * Call String.prototype.replace on the very right-most source snippet. Useful
3250
+ * for trimming whitespace from the end of a source node, etc.
3251
+ *
3252
+ * @param aPattern The pattern to replace.
3253
+ * @param aReplacement The thing to replace the pattern with.
3254
+ */
3255
+ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
3256
+ var lastChild = this.children[this.children.length - 1];
3257
+ if (lastChild[isSourceNode]) lastChild.replaceRight(aPattern, aReplacement);
3258
+ else if (typeof lastChild === "string") this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
3259
+ else this.children.push("".replace(aPattern, aReplacement));
3260
+ return this;
3261
+ };
3262
+ /**
3263
+ * Set the source content for a source file. This will be added to the SourceMapGenerator
3264
+ * in the sourcesContent field.
3265
+ *
3266
+ * @param aSourceFile The filename of the source file
3267
+ * @param aSourceContent The content of the source file
3268
+ */
3269
+ SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
3270
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
3271
+ };
3272
+ /**
3273
+ * Walk over the tree of SourceNodes. The walking function is called for each
3274
+ * source file content and is passed the filename and source content.
3275
+ *
3276
+ * @param aFn The traversal function.
3277
+ */
3278
+ SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
3279
+ for (var i = 0, len = this.children.length; i < len; i++) if (this.children[i][isSourceNode]) this.children[i].walkSourceContents(aFn);
3280
+ var sources = Object.keys(this.sourceContents);
3281
+ for (var i = 0, len = sources.length; i < len; i++) aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
3282
+ };
3283
+ /**
3284
+ * Return the string representation of this source node. Walks over the tree
3285
+ * and concatenates all the various snippets together to one string.
3286
+ */
3287
+ SourceNode.prototype.toString = function SourceNode_toString() {
3288
+ var str = "";
3289
+ this.walk(function(chunk) {
3290
+ str += chunk;
3291
+ });
3292
+ return str;
3293
+ };
3294
+ /**
3295
+ * Returns the string representation of this source node along with a source
3296
+ * map.
3297
+ */
3298
+ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
3299
+ var generated = {
3300
+ code: "",
3301
+ line: 1,
3302
+ column: 0
3303
+ };
3304
+ var map = new SourceMapGenerator(aArgs);
3305
+ var sourceMappingActive = false;
3306
+ var lastOriginalSource = null;
3307
+ var lastOriginalLine = null;
3308
+ var lastOriginalColumn = null;
3309
+ var lastOriginalName = null;
3310
+ this.walk(function(chunk, original) {
3311
+ generated.code += chunk;
3312
+ if (original.source !== null && original.line !== null && original.column !== null) {
3313
+ if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) map.addMapping({
3314
+ source: original.source,
3315
+ original: {
3316
+ line: original.line,
3317
+ column: original.column
3318
+ },
3319
+ generated: {
3320
+ line: generated.line,
3321
+ column: generated.column
3322
+ },
3323
+ name: original.name
3324
+ });
3325
+ lastOriginalSource = original.source;
3326
+ lastOriginalLine = original.line;
3327
+ lastOriginalColumn = original.column;
3328
+ lastOriginalName = original.name;
3329
+ sourceMappingActive = true;
3330
+ } else if (sourceMappingActive) {
3331
+ map.addMapping({ generated: {
3332
+ line: generated.line,
3333
+ column: generated.column
3334
+ } });
3335
+ lastOriginalSource = null;
3336
+ sourceMappingActive = false;
3337
+ }
3338
+ for (var idx = 0, length = chunk.length; idx < length; idx++) if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
3339
+ generated.line++;
3340
+ generated.column = 0;
3341
+ if (idx + 1 === length) {
3342
+ lastOriginalSource = null;
3343
+ sourceMappingActive = false;
3344
+ } else if (sourceMappingActive) map.addMapping({
3345
+ source: original.source,
3346
+ original: {
3347
+ line: original.line,
3348
+ column: original.column
3349
+ },
3350
+ generated: {
3351
+ line: generated.line,
3352
+ column: generated.column
3353
+ },
3354
+ name: original.name
3355
+ });
3356
+ } else generated.column++;
3357
+ });
3358
+ this.walkSourceContents(function(sourceFile, sourceContent) {
3359
+ map.setSourceContent(sourceFile, sourceContent);
3360
+ });
3361
+ return {
3362
+ code: generated.code,
3363
+ map
3364
+ };
3365
+ };
3366
+ exports.SourceNode = SourceNode;
3367
+ }));
3368
+ //#endregion
1277
3369
  //#region src/devtools/browser/components/sourceMapResolver.ts
3370
+ var import_source_map = (/* @__PURE__ */ require_rolldown_runtime.__commonJSMin(((exports) => {
3371
+ exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
3372
+ exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
3373
+ exports.SourceNode = require_source_node().SourceNode;
3374
+ })))();
1278
3375
  const consumerCache = /* @__PURE__ */ new Map();
1279
3376
  async function loadConsumer(fileUrl) {
1280
3377
  try {
@@ -1297,7 +3394,7 @@ async function loadConsumer(fileUrl) {
1297
3394
  if (!mapResp.ok) return null;
1298
3395
  mapJson = await mapResp.text();
1299
3396
  }
1300
- return new source_map_js.SourceMapConsumer(JSON.parse(mapJson));
3397
+ return new import_source_map.SourceMapConsumer(JSON.parse(mapJson));
1301
3398
  } catch {
1302
3399
  return null;
1303
3400
  }